:root {
  color-scheme: dark;
  --bg: #07111d;
  --bg-2: #0c1726;
  --panel: rgba(12, 22, 34, 0.76);
  --panel-strong: rgba(18, 32, 48, 0.9);
  --panel-soft: rgba(255, 255, 255, 0.075);
  --ink: #f7fbff;
  --muted: #9fb3c8;
  --muted-2: #d6e3ef;
  --cyan: #29f0d1;
  --blue: #2f7dff;
  --violet: #8d5cff;
  --pink: #ff4fac;
  --amber: #ffd166;
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.24);
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
  --glass: blur(24px) saturate(1.35);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, rgba(41, 240, 209, 0.2), transparent 32rem),
    radial-gradient(circle at 92% 6%, rgba(255, 79, 172, 0.2), transparent 28rem),
    radial-gradient(circle at 70% 86%, rgba(47, 125, 255, 0.24), transparent 30rem),
    linear-gradient(135deg, var(--bg), var(--bg-2) 54%, #090b1c);
  font-family: ui-rounded, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 18%, black, transparent 76%);
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.42;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: calc(0.75rem + env(safe-area-inset-top)) clamp(0.9rem, 3vw, 3rem) 0.75rem;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 17, 29, 0.74);
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
}

.brand {
  display: inline-flex;
  min-width: max-content;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 17px;
  color: #06121d;
  background:
    linear-gradient(135deg, var(--cyan), var(--blue) 54%, var(--pink)),
    #ffffff;
  box-shadow:
    0 12px 30px rgba(41, 240, 209, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  font-weight: 950;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 0.98rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 760;
}

.tabs,
.actions,
.equipment-row,
.tag-list,
.wizard-actions,
.carousel-controls,
.score-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.tabs {
  justify-content: flex-end;
}

.tab,
.button,
.text-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  font-size: 0.84rem;
  font-weight: 850;
}

.tab,
.button {
  padding: 0.72rem 1rem;
}

.compact {
  min-height: 38px;
  padding: 0.62rem 0.85rem;
}

.text-button {
  min-height: 34px;
  padding: 0.5rem 0.7rem;
  color: var(--cyan);
}

.tab.is-active,
.primary {
  border-color: rgba(41, 240, 209, 0.55);
  color: #06121d;
  background: linear-gradient(135deg, var(--cyan), #69b7ff 52%, var(--pink));
  box-shadow: 0 14px 36px rgba(41, 240, 209, 0.2);
}

.secondary {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.1);
}

main,
.footer {
  width: min(1220px, calc(100% - 1.5rem));
  margin: 0 auto;
}

.screen {
  display: none;
  margin-top: 1rem;
  padding: clamp(1rem, 3vw, 1.45rem);
  border: 1px solid var(--line);
  border-radius: 32px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.055)),
    rgba(7, 17, 29, 0.52);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
}

.screen.is-active {
  display: block;
}

.home-screen {
  background:
    radial-gradient(circle at 16% 12%, rgba(41, 240, 209, 0.18), transparent 20rem),
    radial-gradient(circle at 82% 30%, rgba(255, 79, 172, 0.16), transparent 22rem),
    rgba(7, 17, 29, 0.58);
}

.hero {
  padding: clamp(1.5rem, 6vw, 4.4rem) 0 clamp(1.2rem, 3vw, 2rem);
}

.eyebrow {
  margin: 0 0 0.68rem;
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
h5 {
  margin: 0;
}

h1 {
  max-width: 960px;
  font-size: clamp(2.85rem, 8vw, 7.6rem);
  line-height: 0.9;
  letter-spacing: -0.08em;
}

h2 {
  font-size: clamp(2rem, 4.8vw, 4.6rem);
  line-height: 0.92;
  letter-spacing: -0.065em;
}

h3 {
  font-size: clamp(1.7rem, 3.8vw, 3rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

h4 {
  color: var(--muted-2);
  font-size: 0.82rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h5 {
  font-size: 1rem;
  font-weight: 920;
}

.lead {
  max-width: 820px;
  color: var(--muted-2);
  font-size: clamp(1.08rem, 2vw, 1.45rem);
  line-height: 1.34;
}

.equipment-row span,
.tag,
.recipe-card-meta span,
.recipe-card-meta em,
.difficulty-label {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.08);
  padding: 0.48rem 0.68rem;
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 850;
}

.notice,
.master-panel,
.detail-panel,
.day-card,
.shopping-card,
.pantry,
.proposal-card,
.home-card,
.detail-card,
.ingredient-filter {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--panel);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.24);
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
}

.notice {
  margin-top: 1rem;
  padding: 1rem 1.15rem;
  color: var(--muted-2);
  line-height: 1.55;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.home-card {
  min-height: 168px;
  padding: 1.1rem;
  color: var(--ink);
  text-align: left;
}

.home-card strong,
.home-card span {
  display: block;
}

.home-card strong {
  margin-bottom: 0.6rem;
  font-size: 1.25rem;
  font-weight: 920;
  letter-spacing: -0.04em;
}

.home-card span {
  color: var(--muted);
  line-height: 1.45;
}

.screen-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.recipe-browser {
  display: grid;
  gap: 1rem;
}

.master-panel,
.detail-panel,
.day-card,
.shopping-card,
.pantry,
.proposal-card,
.detail-card,
.ingredient-filter {
  padding: 1rem;
}

.search-box,
.ingredient-form {
  display: grid;
  gap: 0.55rem;
}

.search-box label,
.ingredient-form label,
fieldset legend,
.mini-title strong {
  color: var(--muted-2);
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

input[type="search"],
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  padding: 0.92rem 1rem;
  outline: none;
}

input[type="search"]:focus,
textarea:focus {
  border-color: rgba(41, 240, 209, 0.62);
  box-shadow: 0 0 0 4px rgba(41, 240, 209, 0.12);
}

.ingredient-filter {
  margin-top: 0.85rem;
}

.mini-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.card-note,
.empty,
.recipe-row small,
.detail-header p,
.detail-card li,
.detail-card p,
.day-card dd,
.sources li,
.proposal-card p {
  color: var(--muted);
  line-height: 1.45;
}

.ingredient-filter-grid,
.ingredient-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.48rem;
  margin-top: 0.75rem;
}

.ingredient-pill,
.ingredient-check,
fieldset label {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.07);
  padding: 0.55rem 0.72rem;
  font-size: 0.82rem;
  font-weight: 780;
}

.ingredient-pill.is-owned,
.ingredient-check.is-owned {
  border-color: rgba(41, 240, 209, 0.6);
  color: #06121d;
  background: linear-gradient(135deg, var(--cyan), #b6fff4);
}

.carousel-controls {
  justify-content: space-between;
  margin: 0.85rem 0;
}

.recipe-list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 30%);
  gap: 0.85rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding: 0.15rem 0 0.55rem;
}

.recipe-row {
  min-height: 430px;
  border: 1px solid var(--line);
  border-radius: 30px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.055)),
    rgba(255, 255, 255, 0.06);
  padding: 0.75rem;
  scroll-snap-align: center;
  text-align: left;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.recipe-row.is-selected {
  border-color: rgba(41, 240, 209, 0.65);
  background:
    linear-gradient(160deg, rgba(41, 240, 209, 0.18), rgba(47, 125, 255, 0.12), rgba(255, 79, 172, 0.12)),
    rgba(255, 255, 255, 0.08);
}

.recipe-row:hover {
  transform: translateY(-2px);
}

.recipe-thumb {
  width: 100%;
  height: 170px;
  object-fit: cover;
  border-radius: 24px;
  background: var(--panel-soft);
}

.recipe-card-body {
  display: grid;
  gap: 0.62rem;
  padding: 0.8rem 0.2rem 0.15rem;
}

.recipe-card-body strong {
  font-size: 1.12rem;
  font-weight: 920;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.recipe-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.stars {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.12rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.star {
  min-width: 0;
  border: 0;
  color: rgba(255, 255, 255, 0.22);
  background: transparent;
  padding: 0.04rem;
  font-size: 1.08rem;
  line-height: 1;
}

.star.is-on {
  color: var(--amber);
  text-shadow: 0 0 16px rgba(255, 209, 102, 0.35);
}

.difficulty {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.48rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.difficulty-bars {
  display: inline-flex;
  gap: 0.18rem;
}

.difficulty-bars i {
  display: block;
  width: 18px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.difficulty-bars i.is-on {
  background: linear-gradient(90deg, var(--cyan), var(--blue));
}

.detail-figure {
  margin: 0 0 1rem;
}

.detail-visual {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 28px;
  background: var(--panel-soft);
}

.detail-figure figcaption {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 720;
}

.detail-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.detail-card-wide {
  grid-column: 1 / -1;
}

.detail-card ul,
.detail-card ol,
.sources ul {
  margin: 0.8rem 0 0;
  padding-left: 1.1rem;
}

.wizard {
  margin-top: 1rem;
  border: 1px solid rgba(41, 240, 209, 0.36);
  border-radius: 30px;
  color: var(--ink);
  background:
    radial-gradient(circle at 0% 0%, rgba(41, 240, 209, 0.2), transparent 18rem),
    radial-gradient(circle at 100% 0%, rgba(255, 79, 172, 0.16), transparent 18rem),
    rgba(255, 255, 255, 0.09);
  padding: 1rem;
}

.wizard-step {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.wizard-illustration {
  display: grid;
  width: 84px;
  height: 84px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 26px;
  color: #06121d;
  background: linear-gradient(135deg, var(--cyan), var(--blue), var(--pink));
  font-size: 1.55rem;
  font-weight: 950;
}

.wizard-actions {
  justify-content: space-between;
  margin-top: 1rem;
}

.operation-list {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.9rem;
}

.operation-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.85rem;
}

.step-index {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 16px;
  color: #06121d;
  background: linear-gradient(135deg, var(--cyan), #ffffff);
  font-weight: 950;
}

.operation-grid {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 0.48rem 0.75rem;
  margin: 0.72rem 0 0;
}

.operation-grid dt {
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.operation-grid dd {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
  margin: 0;
  color: var(--muted-2);
  line-height: 1.38;
}

.operation-tags span {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  padding: 0.26rem 0.48rem;
}

.week-plan,
.shopping-grid,
.pantry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.day-card strong {
  display: block;
  margin-bottom: 0.6rem;
  font-size: 1rem;
  font-weight: 920;
}

.day-card dl {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 0.45rem 0.8rem;
  margin: 0;
}

.day-card dt {
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.day-card dd {
  margin: 0;
}

.check-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted-2);
  font-size: 0.94rem;
  font-weight: 760;
}

.ingredients-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.75fr);
  gap: 1rem;
}

fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 1rem;
}

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

.pantry-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.85rem;
}

.pantry-card ul {
  margin: 0.55rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.proposal {
  margin-top: 1rem;
}

.sources {
  margin-bottom: 1rem;
}

.sources a {
  color: var(--cyan);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem 0 3rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 820;
}

@media (max-width: 980px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .tabs {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.2rem;
  }

  .home-grid,
  .detail-grid,
  .ingredients-layout,
  .week-plan,
  .shopping-grid {
    grid-template-columns: 1fr;
  }

  .recipe-list {
    grid-auto-columns: minmax(250px, 82%);
  }

  .screen-title,
  .detail-header {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .wizard-step,
  .operation-card,
  .operation-grid {
    grid-template-columns: 1fr;
  }

  .wizard-illustration,
  .step-index {
    width: 54px;
    height: 54px;
    border-radius: 18px;
  }

  .footer {
    flex-direction: column;
  }
}
