:root {
  --ink: #18251f;
  --muted: #61706a;
  --line: #d8e5de;
  --paper: #fbfffd;
  --soft: #eef7f2;
  --accent: #126b59;
  --accent-2: #c54e37;
  --gold: #b8872d;
  --shadow: 0 18px 45px rgba(28, 56, 45, .12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #f3faf6 0%, #fffefd 48%, #f3f7fb 100%);
  color: var(--ink);
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 28px 0 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 420px);
  gap: 18px;
}

.tool-panel,
.result-panel,
.memo-panel section {
  background: rgba(251, 255, 253, .96);
  border: 1px solid rgba(18, 107, 89, .18);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.tool-panel {
  padding: clamp(20px, 4vw, 36px);
}

.tool-head {
  margin: 0 0 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  letter-spacing: 0;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.08;
}

h2 {
  margin: 0 0 12px;
  font-size: 19px;
  line-height: 1.35;
}

.lead {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.planner-form {
  display: grid;
  gap: 16px;
}

.season-box {
  display: grid;
  gap: 9px;
  border: 1px solid rgba(18, 107, 89, .16);
  border-radius: 8px;
  background: #f6fcf9;
  padding: 13px;
}

.season-box > span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.season-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.season-row button {
  border: 1px solid rgba(18, 107, 89, .22);
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  padding: 9px 12px;
  font-weight: 800;
  cursor: pointer;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  font-size: 13px;
  font-weight: 800;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(18, 107, 89, .12);
}

.quick-row,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quick-row button,
.secondary {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 9px 12px;
  cursor: pointer;
}

.primary {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  padding: 12px 22px;
  font-weight: 800;
  cursor: pointer;
}

.secondary {
  min-height: 48px;
  padding: 12px 18px;
}

.result-panel {
  padding: 24px;
  min-height: 420px;
}

.result-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  padding: 18px;
  line-height: 1.8;
}

.results {
  display: grid;
  gap: 14px;
}

.recipe-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.recipe-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.45;
}

.recipe-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.recipe-meta span {
  border-radius: 999px;
  background: #eef6f2;
  color: var(--accent);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
}

.recipe-card p,
.recipe-card li,
.memo-panel p,
.history-list {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.recipe-card ul {
  margin: 10px 0 0;
  padding-left: 1.2em;
}

.shopping-panel {
  margin-top: 14px;
  border: 1px solid rgba(197, 78, 55, .18);
  border-radius: 8px;
  background: #fff8f4;
  padding: 13px;
}

.shopping-panel.is-loading {
  opacity: .82;
}

.shopping-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.shopping-head strong {
  font-size: 14px;
  line-height: 1.4;
}

.shopping-head span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #fff;
  color: var(--accent-2);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
}

.shopping-note {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.shopping-list {
  display: grid;
  gap: 8px;
}

.shopping-item,
.related-link {
  display: grid;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(197, 78, 55, .16);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px;
  text-decoration: none;
}

.shopping-item {
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.35fr) auto;
}

.shopping-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.shopping-check input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

.shopping-keyword {
  font-weight: 800;
}

.shopping-reason {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.shopping-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent-2);
  color: #fff;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  text-decoration: none;
}

.product-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 11px;
  border: 1px solid rgba(197, 78, 55, .16);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px;
  text-decoration: none;
}

.product-image {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  background: #f4fbf8;
  object-fit: cover;
}

.product-image-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
}

.product-body,
.product-name,
.product-meta {
  min-width: 0;
}

.product-body {
  display: grid;
  gap: 5px;
}

.product-name {
  display: -webkit-box;
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.product-cta {
  justify-self: start;
  border-radius: 999px;
  background: var(--accent-2);
  color: #fff;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 800;
}

.rakuten-recipe-panel {
  margin-top: 16px;
  border: 1px solid rgba(18, 107, 89, .18);
  border-radius: 8px;
  background: #f7fcf9;
  padding: 15px;
}

.recipe-api-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.recipe-api-head h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.45;
}

.recipe-api-head span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
}

.recipe-api-note,
.recipe-api-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.recipe-api-note {
  margin: 0 0 10px;
}

.recipe-api-list {
  display: grid;
  gap: 9px;
}

.recipe-api-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 11px;
  border: 1px solid rgba(18, 107, 89, .16);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px;
  text-decoration: none;
}

.recipe-api-image {
  width: 76px;
  height: 76px;
  border-radius: 8px;
  background: #eef7f2;
  object-fit: cover;
}

.recipe-api-image-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
}

.recipe-api-body,
.recipe-api-title,
.recipe-api-meta,
.recipe-api-materials {
  min-width: 0;
}

.recipe-api-body {
  display: grid;
  gap: 5px;
}

.recipe-api-title {
  display: -webkit-box;
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.recipe-api-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.recipe-api-materials {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.card-actions button {
  border: 1px solid rgba(18, 107, 89, .22);
  border-radius: 999px;
  background: #f4fbf8;
  color: var(--accent);
  padding: 8px 11px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.related-panel {
  margin-top: 14px;
  border: 1px solid rgba(18, 107, 89, .18);
  border-radius: 8px;
  background: #f7fcf9;
  padding: 13px;
}

.related-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.related-head strong {
  font-size: 14px;
  line-height: 1.4;
}

.related-head span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
}

.related-list {
  display: grid;
  gap: 8px;
}

.related-link {
  grid-template-columns: 1fr;
  border-color: rgba(18, 107, 89, .16);
  color: var(--ink);
}

.related-link span {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.related-link small,
.history-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.memo-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.memo-panel section {
  padding: 18px;
}

.history-item {
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.history-item button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  border: 1px solid rgba(18, 107, 89, .22);
  border-radius: 999px;
  background: #f4fbf8;
  color: var(--accent);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.history-item:first-child {
  border-top: 0;
  padding-top: 0;
}

@media (max-width: 900px) {
  .app-shell,
  .memo-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100%, calc(100vw - 20px));
    padding-top: 14px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .quick-row button,
  .season-row button,
  .primary,
  .secondary {
    width: 100%;
  }

  .shopping-item {
    grid-template-columns: 1fr;
  }

  .shopping-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .shopping-cta {
    justify-self: start;
  }

  .product-card {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .product-image {
    width: 64px;
    height: 64px;
  }

  .recipe-api-head {
    flex-direction: column;
  }

  .recipe-api-card {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .recipe-api-image {
    width: 64px;
    height: 64px;
  }

  .result-panel,
  .tool-panel,
  .memo-panel section {
    padding: 18px;
  }
}
