@layer tokens, base, layout, components, app;

/* docs/css/tokens.css */
@layer tokens {
  @layer tokens, base, layout, components, app;
  @layer tokens {
    :root {
      --color-bg: #fbf7f1;
      --color-bg-elevated: #ffffff;
      --color-bg-sunken: #f1ebe0;
      --color-fg: #2a1f17;
      --color-fg-muted: #6b5a4a;
      --color-fg-subtle: #9b8a78;
      --color-border: #e8dfd0;
      --color-border-strong: #d2c4ac;
      --color-accent: #b34a1c;
      --color-accent-fg: #ffffff;
      --color-accent-soft: #f4dcc8;
      --color-success: #5e7a3a;
      --color-warning: #b8861a;
      --color-danger: #9a2a2a;
      --color-focus-ring: #9a4a1a;
      --font-display:
        "Source Serif 4",
        "Lora",
        "Iowan Old Style",
        Georgia,
        serif;
      --font-body:
        ui-sans-serif,
        system-ui,
        -apple-system,
        "Segoe UI",
        Roboto,
        "Helvetica Neue",
        Arial,
        sans-serif;
      --text-xs: 0.75rem;
      --text-sm: 0.875rem;
      --text-md: 1rem;
      --text-lg: 1.125rem;
      --text-xl: 1.375rem;
      --text-2xl: 1.75rem;
      --text-3xl: 2.25rem;
      --leading-tight: 1.15;
      --leading-snug: 1.3;
      --leading-normal: 1.5;
      --leading-relaxed: 1.7;
      --tracking-tight: -0.01em;
      --tracking-wide: 0.04em;
      --space-1: 0.25rem;
      --space-2: 0.5rem;
      --space-3: 0.75rem;
      --space-4: 1rem;
      --space-6: 1.5rem;
      --space-8: 2rem;
      --space-10: 2.5rem;
      --space-12: 3rem;
      --space-16: 4rem;
      --radius-sm: 4px;
      --radius-md: 8px;
      --radius-lg: 14px;
      --radius-pill: 999px;
      --shadow-sm: 0 1px 2px rgba(42, 31, 23, 0.06);
      --shadow-lg: 0 12px 32px rgba(42, 31, 23, 0.12);
      --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
      --dur-fast: 120ms;
      --dur-base: 200ms;
      --container-narrow: 40rem;
      --container-base: 60rem;
      --container-wide: 80rem;
      --z-toast: 50;
    }
    @media (prefers-color-scheme: dark) {
      :root {
        --color-bg: #1a140e;
        --color-bg-elevated: #221a13;
        --color-bg-sunken: #15100a;
        --color-fg: #f4ecdf;
        --color-fg-muted: #b8a48c;
        --color-fg-subtle: #7a6856;
        --color-border: #2f2519;
        --color-border-strong: #4a3a28;
        --color-accent: #e07a4a;
        --color-accent-fg: #1a140e;
        --color-accent-soft: #3a2418;
        --color-success: #a8c47a;
        --color-warning: #d4a642;
        --color-danger: #d66060;
        --color-focus-ring: #c87a4a;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.32);
        --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.52);
      }
    }
    :root[data-theme=dark] {
      --color-bg: #1a140e;
      --color-bg-elevated: #221a13;
      --color-bg-sunken: #15100a;
      --color-fg: #f4ecdf;
      --color-fg-muted: #b8a48c;
      --color-fg-subtle: #7a6856;
      --color-border: #2f2519;
      --color-border-strong: #4a3a28;
      --color-accent: #e07a4a;
      --color-accent-fg: #1a140e;
      --color-accent-soft: #3a2418;
      --color-success: #a8c47a;
      --color-warning: #d4a642;
      --color-danger: #d66060;
      --color-focus-ring: #c87a4a;
      --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.32);
      --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.52);
    }
    :root[data-theme=light] {
      --color-bg: #fbf7f1;
      --color-bg-elevated: #ffffff;
      --color-bg-sunken: #f1ebe0;
      --color-fg: #2a1f17;
      --color-fg-muted: #6b5a4a;
      --color-fg-subtle: #9b8a78;
      --color-border: #e8dfd0;
      --color-border-strong: #d2c4ac;
      --color-accent: #b34a1c;
      --color-accent-fg: #ffffff;
      --color-accent-soft: #f4dcc8;
      --color-success: #5e7a3a;
      --color-warning: #b8861a;
      --color-danger: #9a2a2a;
      --color-focus-ring: #9a4a1a;
      --shadow-sm: 0 1px 2px rgba(42, 31, 23, 0.06);
      --shadow-lg: 0 12px 32px rgba(42, 31, 23, 0.12);
    }
    @media (prefers-reduced-motion: reduce) {
      :root {
        --dur-fast: 0ms;
        --dur-base: 0ms;
      }
    }
    @media (min-width: 64rem) {
      :root {
        --text-md: 1.0625rem;
        --text-lg: 1.25rem;
        --text-xl: 1.5rem;
        --text-2xl: 2rem;
        --text-3xl: 2.75rem;
      }
    }
  }
}

/* docs/css/base.css */
@layer base {
  @layer base {
    *,
    *::before,
    *::after {
      box-sizing: border-box;
    }
    *,
    *::before,
    *::after {
      margin: 0;
      padding: 0;
    }
    html {
      -webkit-text-size-adjust: 100%;
    }
    body {
      font-family: var(--font-body);
      font-size: var(--text-md);
      line-height: var(--leading-normal);
      color: var(--color-fg);
      background: var(--color-bg);
      min-height: 100vh;
      min-height: 100dvh;
      -webkit-font-smoothing: antialiased;
      text-rendering: optimizeLegibility;
    }
    h1,
    h2,
    h3,
    h4 {
      font-family: var(--font-display);
      font-weight: 600;
      line-height: var(--leading-tight);
      letter-spacing: var(--tracking-tight);
      color: var(--color-fg);
    }
    h1 {
      font-size: var(--text-3xl);
    }
    h2 {
      font-size: var(--text-2xl);
    }
    h3 {
      font-size: var(--text-xl);
    }
    h4 {
      font-size: var(--text-lg);
    }
    :where(a, button, input, select, textarea, [tabindex]):focus-visible {
      outline: 2px solid var(--color-focus-ring);
      outline-offset: 2px;
      border-radius: var(--radius-sm);
    }
    ::selection {
      background: var(--color-accent-soft);
      color: var(--color-fg);
    }
    @media (prefers-reduced-motion: reduce) {
      *,
      *::before,
      *::after {
        transition: none !important;
        animation: none !important;
      }
    }
  }
}

/* docs/css/layout.css */
@layer layout {
  @layer layout {
    .stack-0 {
      display: flex;
      flex-direction: column;
      gap: 0;
    }
    .stack-1 {
      display: flex;
      flex-direction: column;
      gap: var(--space-1);
    }
    .stack-2 {
      display: flex;
      flex-direction: column;
      gap: var(--space-2);
    }
    .stack-3 {
      display: flex;
      flex-direction: column;
      gap: var(--space-3);
    }
    .stack-4 {
      display: flex;
      flex-direction: column;
      gap: var(--space-4);
    }
    .stack-6 {
      display: flex;
      flex-direction: column;
      gap: var(--space-6);
    }
    .stack-8 {
      display: flex;
      flex-direction: column;
      gap: var(--space-8);
    }
    .stack-10 {
      display: flex;
      flex-direction: column;
      gap: var(--space-10);
    }
    .stack-12 {
      display: flex;
      flex-direction: column;
      gap: var(--space-12);
    }
    .stack-16 {
      display: flex;
      flex-direction: column;
      gap: var(--space-16);
    }
    .cluster-1 {
      display: flex;
      flex-wrap: wrap;
      gap: var(--space-1);
      align-items: center;
    }
    .cluster-2 {
      display: flex;
      flex-wrap: wrap;
      gap: var(--space-2);
      align-items: center;
    }
    .cluster-3 {
      display: flex;
      flex-wrap: wrap;
      gap: var(--space-3);
      align-items: center;
    }
    .cluster-4 {
      display: flex;
      flex-wrap: wrap;
      gap: var(--space-4);
      align-items: center;
    }
    .cluster-6 {
      display: flex;
      flex-wrap: wrap;
      gap: var(--space-6);
      align-items: center;
    }
    .grid-cards {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
      gap: var(--space-6);
    }
    .container-narrow {
      max-width: var(--container-narrow);
      margin-inline: auto;
      padding-inline: var(--space-4);
    }
    .container-base {
      max-width: var(--container-base);
      margin-inline: auto;
      padding-inline: var(--space-4);
    }
    .container-wide {
      max-width: var(--container-wide);
      margin-inline: auto;
      padding-inline: var(--space-4);
    }
    .divider {
      border: 0;
      border-top: 1px solid var(--color-border);
      margin-block: var(--space-4);
    }
  }
}

/* docs/css/components.css */
@layer components {
  @layer components {
    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: var(--space-2);
      min-height: 44px;
      padding-inline: var(--space-4);
      border: 1px solid transparent;
      border-radius: var(--radius-md);
      font-family: var(--font-body);
      font-size: var(--text-md);
      font-weight: 500;
      line-height: 1;
      cursor: pointer;
      transition:
        background var(--dur-fast) var(--ease-out),
        border-color var(--dur-fast) var(--ease-out),
        color var(--dur-fast) var(--ease-out);
      user-select: none;
    }
    .btn[disabled],
    .btn[aria-disabled=true] {
      opacity: 0.55;
      cursor: not-allowed;
    }
    .btn-primary {
      background: var(--color-accent);
      color: var(--color-accent-fg);
    }
    .btn-primary:hover {
      background: var(--color-focus-ring);
    }
    .btn-secondary {
      background: var(--color-bg-elevated);
      color: var(--color-fg);
      border-color: var(--color-border-strong);
    }
    .btn-secondary:hover {
      border-color: var(--color-accent);
    }
    .btn-ghost {
      background: transparent;
      color: var(--color-fg);
    }
    .btn-ghost:hover {
      background: var(--color-accent-soft);
    }
    .btn-sm {
      min-height: 32px;
      padding-inline: var(--space-3);
      font-size: var(--text-sm);
    }
    .btn-md {
      min-height: 44px;
    }
    .btn-lg {
      min-height: 52px;
      padding-inline: var(--space-6);
      font-size: var(--text-lg);
    }
    .icon-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 44px;
      height: 44px;
      border: 1px solid transparent;
      background: transparent;
      color: var(--color-fg-muted);
      border-radius: var(--radius-md);
      cursor: pointer;
      transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
    }
    .icon-btn:hover {
      background: var(--color-accent-soft);
      color: var(--color-fg);
    }
    .icon-btn.danger {
      color: var(--color-danger);
    }
    .icon-btn.danger:hover {
      background: var(--color-accent-soft);
    }
    .icon-btn-sm {
      width: 32px;
      height: 32px;
      border-radius: var(--radius-sm);
    }
    .input,
    .select,
    textarea.input {
      display: block;
      width: 100%;
      min-height: 44px;
      padding: var(--space-2) var(--space-3);
      background: var(--color-bg-elevated);
      color: var(--color-fg);
      font: inherit;
      font-size: var(--text-md);
      border: 1px solid var(--color-border-strong);
      border-radius: var(--radius-md);
      transition: border-color var(--dur-fast) var(--ease-out);
    }
    textarea.input {
      min-height: 6rem;
      resize: vertical;
      line-height: var(--leading-snug);
    }
    .input::placeholder,
    .select::placeholder {
      color: var(--color-fg-subtle);
    }
    .input:focus-visible,
    .select:focus-visible,
    textarea.input:focus-visible {
      border-color: var(--color-accent);
      outline-color: var(--color-focus-ring);
    }
    .input[aria-invalid=true],
    .select[aria-invalid=true],
    textarea.input[aria-invalid=true] {
      border-color: var(--color-danger);
    }
    .label {
      display: block;
      font-size: var(--text-sm);
      font-weight: 500;
      color: var(--color-fg-muted);
      margin-block-end: var(--space-1);
    }
    .checkbox {
      appearance: none;
      width: 20px;
      height: 20px;
      border: 1.5px solid var(--color-border-strong);
      border-radius: var(--radius-sm);
      background: var(--color-bg-elevated);
      display: inline-grid;
      place-content: center;
      cursor: pointer;
      transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
    }
    .checkbox:checked {
      background: var(--color-accent);
      border-color: var(--color-accent);
    }
    .checkbox:checked::after {
      content: "";
      width: 12px;
      height: 6px;
      border-left: 2px solid var(--color-accent-fg);
      border-bottom: 2px solid var(--color-accent-fg);
      transform: rotate(-45deg) translate(1px, -1px);
    }
    .checkbox:focus-visible {
      outline: 2px solid var(--color-focus-ring);
      outline-offset: 2px;
    }
    .badge {
      display: inline-flex;
      align-items: center;
      gap: var(--space-1);
      padding: var(--space-1) var(--space-2);
      border-radius: var(--radius-pill);
      font-size: var(--text-xs);
      font-weight: 600;
      letter-spacing: var(--tracking-wide);
      text-transform: uppercase;
      background: var(--color-bg-sunken);
      color: var(--color-fg-muted);
      border: 1px solid var(--color-border);
    }
    .badge-accent {
      background: var(--color-accent-soft);
      color: var(--color-accent);
      border-color: transparent;
    }
    .badge-success {
      background: color-mix(in oklab, var(--color-success) 12%, transparent);
      color: var(--color-success);
      border-color: transparent;
    }
    .badge-warning {
      background: color-mix(in oklab, var(--color-warning) 12%, transparent);
      color: var(--color-warning);
      border-color: transparent;
    }
    .badge-danger {
      background: color-mix(in oklab, var(--color-danger) 12%, transparent);
      color: var(--color-danger);
      border-color: transparent;
    }
    .card {
      background: var(--color-bg-elevated);
      border: 1px solid var(--color-border);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-sm);
      overflow: hidden;
    }
    .card-pad-sm {
      padding: var(--space-3);
    }
    .card-pad-md {
      padding: var(--space-4);
    }
    .card-pad-lg {
      padding: var(--space-6);
    }
    .icon {
      display: inline-block;
      width: 1em;
      height: 1em;
      vertical-align: -0.125em;
      fill: none;
      stroke: currentColor;
      stroke-width: 2;
      stroke-linecap: round;
      stroke-linejoin: round;
    }
    .toast {
      position: fixed;
      inset: auto 0 var(--space-6) 0;
      margin-inline: auto;
      width: max-content;
      max-width: 90vw;
      padding: var(--space-3) var(--space-6);
      background: var(--color-fg);
      color: var(--color-bg);
      border-radius: var(--radius-pill);
      font-size: var(--text-sm);
      font-weight: 500;
      box-shadow: var(--shadow-lg);
      opacity: 0;
      transform: translateY(8px);
      transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
      z-index: var(--z-toast);
      pointer-events: none;
    }
    .toast.show {
      opacity: 1;
      transform: translateY(0);
    }
    .toast-error {
      background: var(--color-danger);
      color: var(--color-accent-fg);
    }
    .aria-live {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }
    .recipe-card {
      background: var(--color-bg-elevated);
      border: 1px solid var(--color-border);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-sm);
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }
    .recipe-card .card-stripe {
      height: 4px;
      background: var(--color-accent);
    }
    .recipe-card.complete .card-stripe {
      background: var(--color-success);
    }
    .recipe-card .card-body {
      padding: var(--space-4);
      display: flex;
      flex-direction: column;
      gap: var(--space-3);
      flex: 1;
    }
    .recipe-card .card-category {
      font-size: var(--text-xs);
      letter-spacing: var(--tracking-wide);
      text-transform: uppercase;
      color: var(--color-fg-muted);
      font-weight: 600;
    }
    .recipe-card .card-title {
      font-family: var(--font-display);
      font-size: var(--text-xl);
      line-height: var(--leading-tight);
      color: var(--color-fg);
    }
    .recipe-card .card-meta {
      display: flex;
      flex-wrap: wrap;
      gap: var(--space-2);
      color: var(--color-fg-muted);
      font-size: var(--text-sm);
    }
    .recipe-card .meta-pill {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 2px var(--space-2);
      border-radius: var(--radius-pill);
      background: var(--color-bg-sunken);
    }
    .recipe-card .card-ingredients {
      display: flex;
      flex-direction: column;
      gap: var(--space-2);
    }
    .recipe-card .ingredients-label {
      font-size: var(--text-xs);
      text-transform: uppercase;
      letter-spacing: var(--tracking-wide);
      color: var(--color-fg-subtle);
    }
    .recipe-card .ingredient-tags {
      display: flex;
      flex-wrap: wrap;
      gap: var(--space-1);
    }
    .recipe-card .ing-tag {
      padding: 2px var(--space-2);
      border-radius: var(--radius-pill);
      background: var(--color-bg-sunken);
      color: var(--color-fg-muted);
      font-size: var(--text-xs);
    }
    .recipe-card .ing-tag.have {
      background: color-mix(in oklab, var(--color-success) 18%, transparent);
      color: var(--color-success);
    }
    .recipe-card .ing-tag.missing {
      background: color-mix(in oklab, var(--color-danger) 12%, transparent);
      color: var(--color-danger);
    }
    .recipe-card .card-footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: var(--space-3) var(--space-4);
      border-top: 1px solid var(--color-border);
      background: var(--color-bg-sunken);
    }
    .recipe-card .card-status {
      font-size: var(--text-sm);
      color: var(--color-fg-muted);
      display: inline-flex;
      align-items: center;
      gap: var(--space-2);
    }
    .recipe-card .status-dot {
      width: 8px;
      height: 8px;
      border-radius: var(--radius-pill);
      background: var(--color-fg-subtle);
    }
    .recipe-card.complete .status-dot {
      background: var(--color-success);
    }
    .recipe-card .card-actions {
      display: flex;
      gap: var(--space-1);
    }
    .empty-state {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: var(--space-2);
      padding: var(--space-12) var(--space-4);
      color: var(--color-fg-muted);
      text-align: center;
    }
    .empty-state strong {
      font-family: var(--font-display);
      font-size: var(--text-lg);
      color: var(--color-fg);
    }
    .detail-meta {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
      gap: var(--space-3);
      padding: var(--space-4);
      background: var(--color-bg-sunken);
      border-radius: var(--radius-md);
      margin-block: var(--space-4);
    }
    .detail-meta-item {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .detail-meta-item .k {
      font-size: var(--text-xs);
      text-transform: uppercase;
      letter-spacing: var(--tracking-wide);
      color: var(--color-fg-subtle);
    }
    .detail-meta-item .v {
      font-size: var(--text-md);
      color: var(--color-fg);
      font-weight: 500;
    }
    .recipe-detail {
      padding: var(--space-6);
      display: flex;
      flex-direction: column;
      gap: var(--space-6);
    }
    .recipe-detail h2 {
      font-family: var(--font-display);
    }
    .recipe-detail-body {
      display: grid;
      gap: var(--space-8);
      grid-template-columns: 1fr;
    }
    @media (min-width: 64rem) {
      .recipe-detail-body {
        grid-template-columns: minmax(0, 18rem) 1fr;
      }
    }
    .detail-ing-list {
      list-style: none;
      display: flex;
      flex-direction: column;
      gap: var(--space-2);
    }
    .detail-ing-item {
      display: flex;
      align-items: center;
      gap: var(--space-2);
      padding: var(--space-2) var(--space-3);
      border-radius: var(--radius-md);
      cursor: pointer;
      transition: background var(--dur-fast) var(--ease-out);
    }
    .detail-ing-item:hover {
      background: var(--color-bg-sunken);
    }
    .detail-ing-item.missing-item {
      color: var(--color-fg-muted);
    }
    .detail-ing-check {
      width: 20px;
      height: 20px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: var(--radius-pill);
      border: 1.5px solid var(--color-border-strong);
      color: var(--color-accent);
    }
    .detail-ing-check.have {
      background: var(--color-accent);
      color: var(--color-accent-fg);
      border-color: var(--color-accent);
    }
    .detail-step {
      display: grid;
      grid-template-columns: 2rem 1fr;
      gap: var(--space-3);
      padding-block: var(--space-2);
    }
    .detail-step .step-num {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 2rem;
      height: 2rem;
      border-radius: var(--radius-pill);
      background: var(--color-accent-soft);
      color: var(--color-accent);
      font-weight: 600;
    }
    .detail-step .step-text {
      font-size: var(--text-md);
      line-height: var(--leading-relaxed);
      color: var(--color-fg);
    }
    .detail-nutrition {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
      gap: var(--space-3);
    }
    .nutrition-cell {
      background: var(--color-bg-sunken);
      padding: var(--space-3);
      border-radius: var(--radius-md);
    }
    .nutrition-cell .k {
      font-size: var(--text-xs);
      text-transform: uppercase;
      letter-spacing: var(--tracking-wide);
      color: var(--color-fg-subtle);
    }
    .nutrition-cell .v {
      font-size: var(--text-md);
      color: var(--color-fg);
      font-weight: 500;
    }
    .recipe-form {
      display: flex;
      flex-direction: column;
      gap: var(--space-4);
      padding: var(--space-6);
    }
    .recipe-form .form-row {
      display: grid;
      gap: var(--space-3);
      grid-template-columns: 1fr;
    }
    @media (min-width: 40rem) {
      .recipe-form .form-row-2 {
        grid-template-columns: 1fr 1fr;
      }
    }
    .recipe-form .form-error {
      color: var(--color-danger);
      font-size: var(--text-sm);
      margin-block-start: var(--space-1);
    }
    .ing-row,
    .step-row {
      display: flex;
      align-items: center;
      gap: var(--space-2);
    }
    .step-row .step-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 28px;
      height: 28px;
      border-radius: var(--radius-pill);
      background: var(--color-accent-soft);
      color: var(--color-accent);
      font-weight: 600;
      font-size: var(--text-sm);
      flex-shrink: 0;
    }
    .cart-empty {
      padding: var(--space-6);
      text-align: center;
      color: var(--color-fg-muted);
    }
    .cart-row {
      padding: var(--space-3) var(--space-4);
      border-bottom: 1px solid var(--color-border);
      display: flex;
      flex-wrap: wrap;
      gap: var(--space-2);
      align-items: baseline;
    }
    .cart-row:last-child {
      border-bottom: 0;
    }
    .cart-name {
      font-weight: 600;
      color: var(--color-fg);
    }
    .cart-total {
      font-size: var(--text-sm);
      color: var(--color-fg-muted);
    }
    .cart-contrib {
      cursor: pointer;
      padding: 2px var(--space-2);
      border-radius: var(--radius-pill);
      background: var(--color-bg-sunken);
      color: var(--color-fg-muted);
      font-size: var(--text-sm);
      transition: background var(--dur-fast) var(--ease-out);
    }
    .cart-contrib:hover {
      background: var(--color-accent-soft);
      color: var(--color-fg);
    }
  }
}

/* docs/css/app.css */
@layer app {
  @layer app {
    .sidebar {
      width: 240px;
      background: var(--color-fg);
      color: var(--color-bg-elevated);
      display: flex;
      flex-direction: column;
      flex-shrink: 0;
      position: fixed;
      top: 0;
      left: 0;
      bottom: 0;
      z-index: 50;
      padding: 32px 0 24px;
    }
    .sidebar-brand {
      padding: 0 24px 28px;
      border-bottom: 1px solid color-mix(in oklab, var(--color-bg-elevated) 10%, transparent);
    }
    .sidebar-brand h1 {
      font-family: var(--font-display);
      font-size: var(--text-2xl);
      font-weight: 700;
      color: var(--color-accent-fg);
      line-height: var(--leading-tight);
    }
    .sidebar-brand p {
      font-size: var(--text-xs);
      font-weight: 500;
      letter-spacing: var(--tracking-wide);
      text-transform: uppercase;
      color: var(--color-fg-subtle);
      margin-top: 5px;
    }
    .sidebar-nav {
      padding: 22px 12px;
      flex: 1;
    }
    .nav-item {
      display: flex;
      align-items: center;
      gap: 11px;
      padding: 11px 12px;
      border-radius: var(--radius-md);
      cursor: pointer;
      font-size: var(--text-sm);
      font-weight: 400;
      color: var(--color-fg-subtle);
      transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
      margin-bottom: 2px;
      border: none;
      background: none;
      width: 100%;
      text-align: left;
      font-family: inherit;
    }
    .nav-item svg {
      opacity: 0.6;
      flex-shrink: 0;
    }
    .nav-item:hover {
      background: color-mix(in oklab, var(--color-bg-elevated) 7%, transparent);
      color: var(--color-accent-fg);
    }
    .nav-item:hover svg {
      opacity: 1;
    }
    .nav-item.active {
      background: var(--color-accent);
      color: var(--color-accent-fg);
      font-weight: 500;
    }
    .nav-item.active svg {
      opacity: 1;
    }
    .nav-sep {
      height: 1px;
      background: color-mix(in oklab, var(--color-bg-elevated) 10%, transparent);
      margin: 14px 12px;
    }
    .nav-tab-label {
      display: inline;
    }
    .sidebar-footer {
      padding: 0 24px;
      font-size: var(--text-xs);
      color: var(--color-fg-subtle);
      line-height: var(--leading-normal);
    }
    .sidebar-footer a {
      color: var(--color-fg-subtle);
    }
    .main {
      margin-left: 240px;
      flex: 1;
      min-width: 0;
      min-height: 100vh;
      min-height: 100dvh;
      display: flex;
      flex-direction: column;
    }
    .topbar {
      background: var(--color-bg-elevated);
      border-bottom: 1px solid var(--color-border);
      padding: 14px 28px;
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
      position: sticky;
      top: 0;
      z-index: 40;
    }
    body:not([data-panel=recipes]) .topbar {
      display: none;
    }
    .search-wrap {
      display: flex;
      align-items: center;
      flex: 0 1 360px;
      min-width: 0;
      border: 1px solid var(--color-border-strong);
      background: var(--color-bg-elevated);
      border-radius: var(--radius-md);
      min-height: 44px;
      transition: border-color var(--dur-fast) var(--ease-out);
    }
    .search-wrap:focus-within {
      border-color: var(--color-accent);
    }
    .search-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 36px;
      height: 36px;
      color: var(--color-fg-subtle);
      flex-shrink: 0;
    }
    .search-clear {
      flex-shrink: 0;
      width: 36px;
      height: 36px;
      display: none;
      align-items: center;
      justify-content: center;
      color: var(--color-fg-subtle);
      background: none;
      border: none;
      cursor: pointer;
      border-radius: var(--radius-pill);
      padding: 0;
    }
    .search-clear.show {
      display: inline-flex;
    }
    .search-clear:hover {
      color: var(--color-fg);
    }
    .search-wrap > .input {
      flex: 1;
      min-width: 0;
      width: 100%;
      background: transparent;
      border: none;
      border-radius: 0;
      min-height: 0;
      padding: var(--space-2) var(--space-2) var(--space-2) 0;
    }
    .search-wrap > .input:focus-visible {
      outline: none;
    }
    .chips-scroll {
      display: flex;
      gap: 8px;
      overflow-x: auto;
      scrollbar-width: none;
      -webkit-overflow-scrolling: touch;
      flex: 1 1 100%;
      padding-bottom: 2px;
      mask-image:
        linear-gradient(
          to right,
          black calc(100% - 24px),
          transparent);
      -webkit-mask-image:
        linear-gradient(
          to right,
          black calc(100% - 24px),
          transparent);
    }
    .chips-scroll::-webkit-scrollbar {
      display: none;
    }
    .chip {
      flex-shrink: 0;
      padding: 7px 14px;
      border-radius: var(--radius-pill);
      font-size: var(--text-xs);
      font-weight: 500;
      cursor: pointer;
      border: 1px solid var(--color-border);
      background: var(--color-bg-elevated);
      color: var(--color-fg-muted);
      transition:
        border-color var(--dur-fast) var(--ease-out),
        color var(--dur-fast) var(--ease-out),
        background var(--dur-fast) var(--ease-out);
      white-space: nowrap;
      font-family: inherit;
      min-height: 32px;
    }
    .chip:hover {
      border-color: var(--color-accent);
      color: var(--color-accent);
    }
    .chip.is-active {
      background: var(--color-accent);
      border-color: var(--color-accent);
      color: var(--color-accent-fg);
    }
    .ready-toggle {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      cursor: pointer;
      font-size: var(--text-sm);
      color: var(--color-fg-muted);
      white-space: nowrap;
      user-select: none;
      align-self: center;
    }
    .ready-toggle input {
      width: auto;
      accent-color: var(--color-accent);
    }
    .panel {
      display: none;
      padding: 28px;
      flex: 1;
    }
    .panel.active,
    .panel.is-active {
      display: block;
    }
    .panel-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 24px;
      gap: 16px;
    }
    .panel-header h2 {
      font-family: var(--font-display);
      font-size: var(--text-2xl);
      font-weight: 600;
    }
    .panel-header p {
      font-size: var(--text-sm);
      color: var(--color-fg-muted);
      margin-top: 4px;
    }
    .recipe-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
      gap: 20px;
    }
    .empty-state svg {
      margin: 0 auto 16px;
      display: block;
      opacity: 0.4;
    }
    .empty-state strong {
      font-family: var(--font-display);
      font-size: var(--text-lg);
      color: var(--color-fg-muted);
      display: block;
      margin-bottom: 6px;
    }
    .empty-state p {
      font-size: var(--text-sm);
    }
    .recipe-card {
      cursor: pointer;
      transition: box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
      position: relative;
    }
    @media (hover: hover) {
      .recipe-card:hover {
        box-shadow: var(--shadow-lg);
        transform: translateY(-2px);
      }
    }
    .recipe-card:active {
      transform: scale(0.99);
    }
    .recipe-card::before {
      content: "";
      position: absolute;
      top: 0;
      right: 0;
      width: 0;
      height: 0;
      border-style: solid;
      border-width: 0 42px 42px 0;
      border-color: transparent var(--color-bg) transparent transparent;
      z-index: 2;
    }
    .recipe-card::after {
      content: "";
      position: absolute;
      top: 0;
      right: 0;
      width: 42px;
      height: 42px;
      z-index: 1;
      background: var(--color-fg-subtle);
    }
    .card-fold-complete::after {
      background: var(--color-success);
    }
    .card-fold-partial::after {
      background: var(--color-warning);
    }
    .card-fold-none::after {
      background: var(--color-danger);
    }
    .card-fold-complete .card-stripe {
      background: var(--color-success);
    }
    .card-fold-partial .card-stripe {
      background: var(--color-warning);
    }
    .card-fold-none .card-stripe {
      background: var(--color-danger);
    }
    .card-body {
      user-select: none;
      padding: 18px 22px 16px;
    }
    .card-category {
      font-size: var(--text-xs);
      font-weight: 600;
      letter-spacing: var(--tracking-wide);
      text-transform: uppercase;
      color: var(--color-fg-subtle);
      margin-bottom: 6px;
    }
    .card-title {
      font-family: var(--font-display);
      font-size: var(--text-lg);
      font-weight: 600;
      line-height: var(--leading-snug);
      margin-bottom: 10px;
      padding-right: 28px;
    }
    .card-meta {
      display: flex;
      gap: 16px;
      flex-wrap: wrap;
      margin-bottom: 14px;
    }
    .meta-pill {
      display: flex;
      align-items: center;
      gap: 4px;
      font-size: var(--text-xs);
      color: var(--color-fg-muted);
    }
    .meta-pill svg {
      color: var(--color-fg-subtle);
      flex-shrink: 0;
    }
    .card-ingredients {
      border-top: 1px solid var(--color-border);
      padding-top: 12px;
      margin-bottom: 14px;
    }
    .ingredients-label {
      font-size: var(--text-xs);
      font-weight: 600;
      letter-spacing: var(--tracking-wide);
      text-transform: uppercase;
      color: var(--color-fg-subtle);
      margin-bottom: 8px;
    }
    .ingredient-tags {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }
    .ing-tag {
      font-size: var(--text-xs);
      padding: 4px 11px;
      border-radius: var(--radius-pill);
      border: 1px solid var(--color-border);
      color: var(--color-fg-muted);
      line-height: var(--leading-snug);
    }
    .ing-tag.have {
      background: color-mix(in oklab, var(--color-success) 22%, transparent);
      border-color: color-mix(in oklab, var(--color-success) 65%, transparent);
      color: var(--color-success);
      font-weight: 500;
    }
    .ing-tag.have::before {
      content: "\2713";
      opacity: 0.9;
      margin-right: 5px;
      font-weight: 700;
    }
    .ing-tag.missing {
      background: color-mix(in oklab, var(--color-danger) 14%, transparent);
      border-color: color-mix(in oklab, var(--color-danger) 60%, transparent);
      color: var(--color-danger);
      opacity: 0.82;
    }
    .ing-tag.missing::before {
      content: "+";
      opacity: 0.9;
      margin-right: 5px;
      font-weight: 700;
      text-decoration: none;
    }
    .card-footer {
      border-top: 1px solid var(--color-border);
      padding: 9px 12px 9px 18px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: var(--color-bg-sunken);
    }
    .card-status {
      font-size: var(--text-xs);
      font-weight: 500;
      display: flex;
      align-items: center;
      gap: 6px;
      color: var(--color-fg-muted);
    }
    .status-dot {
      width: 7px;
      height: 7px;
      border-radius: var(--radius-pill);
      flex-shrink: 0;
      background: var(--color-fg-subtle);
    }
    .card-fold-complete .status-dot {
      background: var(--color-success);
    }
    .card-fold-partial .status-dot {
      background: var(--color-warning);
    }
    .card-fold-none .status-dot {
      background: var(--color-danger);
    }
    .card-actions {
      display: flex;
      gap: 4px;
    }
    .overlay {
      position: fixed;
      inset: 0;
      background: color-mix(in oklab, var(--color-fg) 45%, transparent);
      opacity: 0;
      pointer-events: none;
      transition: opacity var(--dur-base) var(--ease-out);
    }
    .overlay.open {
      opacity: 1;
      pointer-events: all;
    }
    #detail-overlay {
      z-index: 149;
    }
    #drawer-overlay {
      z-index: 159;
    }
    .detail-modal {
      position: fixed;
      left: 240px;
      right: 0;
      top: 0;
      bottom: 0;
      background: var(--color-bg-elevated);
      z-index: 150;
      display: flex;
      flex-direction: column;
      transform: translateY(100%);
      transition: transform var(--dur-base) var(--ease-out);
    }
    .detail-modal.open {
      transform: translateY(0);
    }
    .detail-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
      padding: 26px 32px 18px;
      padding-top: max(26px, env(safe-area-inset-top, 0px));
      border-bottom: 1px solid var(--color-border);
      flex-shrink: 0;
    }
    .detail-header-left {
      flex: 1;
      min-width: 0;
    }
    .detail-eyebrow {
      font-size: var(--text-xs);
      font-weight: 600;
      letter-spacing: var(--tracking-wide);
      text-transform: uppercase;
      color: var(--color-fg-subtle);
      margin-bottom: 6px;
    }
    .detail-title {
      font-family: var(--font-display);
      font-size: var(--text-2xl);
      font-weight: 700;
      line-height: var(--leading-tight);
    }
    .detail-meta-row {
      display: flex;
      gap: 14px 32px;
      flex-wrap: wrap;
      align-items: baseline;
      margin-top: 18px;
      flex: 1 1 auto;
    }
    .detail-meta-item {
      display: flex;
      flex-direction: row;
      align-items: baseline;
      gap: 8px;
      flex: 0 0 auto;
    }
    .detail-meta-item .k {
      font-size: var(--text-xs);
      font-weight: 600;
      letter-spacing: var(--tracking-wide);
      text-transform: uppercase;
      color: var(--color-fg-subtle);
    }
    .detail-meta-item .v {
      font-size: var(--text-md);
      font-weight: 600;
      color: var(--color-fg);
    }
    .detail-close {
      flex-shrink: 0;
      background: var(--color-bg-sunken);
      border: 1px solid var(--color-border);
      border-radius: var(--radius-md);
      padding: 0 14px;
      cursor: pointer;
      font-size: var(--text-sm);
      font-weight: 500;
      color: var(--color-fg-muted);
      display: flex;
      align-items: center;
      gap: 6px;
      transition: background var(--dur-fast) var(--ease-out);
      min-height: 44px;
      font-family: inherit;
    }
    .detail-close:hover {
      background: var(--color-bg-sunken);
    }
    .detail-body {
      flex: 1;
      overflow-y: auto;
      display: grid;
      grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
      -webkit-overflow-scrolling: touch;
    }
    .section-label {
      font-size: var(--text-xs);
      font-weight: 700;
      letter-spacing: var(--tracking-wide);
      text-transform: uppercase;
      color: var(--color-fg-subtle);
      margin-bottom: 14px;
      padding-bottom: 8px;
      border-bottom: 1px solid var(--color-border);
    }
    .section-label-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 14px;
    }
    .section-label-row .section-label {
      flex: 1;
      min-width: 0;
      margin-bottom: 0;
    }
    .section-label .sub {
      font-weight: 400;
      text-transform: none;
      letter-spacing: 0;
      color: var(--color-fg-subtle);
      font-size: var(--text-xs);
    }
    .detail-ingredients {
      border-right: 1px solid var(--color-border);
      padding: 26px 26px 40px;
      background: var(--color-bg);
    }
    .detail-ing-list {
      list-style: none;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .detail-ing-item {
      display: flex;
      align-items: center;
      gap: 11px;
      padding: 9px 10px;
      border-radius: 5px;
      font-size: var(--text-sm);
      line-height: var(--leading-snug);
      cursor: pointer;
      transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
    }
    .detail-ing-item:hover {
      background: var(--color-bg-sunken);
    }
    .detail-ing-item.missing-item .detail-ing-text {
      color: var(--color-fg-subtle);
    }
    .detail-ing-check {
      flex-shrink: 0;
      width: 20px;
      height: 20px;
      border-radius: var(--radius-pill);
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
    }
    .detail-ing-check.have {
      background: color-mix(in oklab, var(--color-success) 18%, transparent);
      border: 1.5px solid color-mix(in oklab, var(--color-success) 60%, transparent);
      color: var(--color-success);
    }
    .detail-ing-check.missing {
      background: var(--color-bg-sunken);
      border: 1.5px dashed var(--color-border);
    }
    .detail-pantry-note {
      margin-top: 18px;
      padding: 11px 13px;
      background: var(--color-bg-elevated);
      border: 1px solid var(--color-border);
      border-radius: var(--radius-md);
      font-size: var(--text-xs);
      color: var(--color-fg-muted);
      line-height: var(--leading-normal);
    }
    .detail-pantry-note strong {
      color: var(--color-fg);
    }
    .detail-steps {
      padding: 26px 32px 48px;
    }
    .detail-step {
      display: flex;
      gap: 15px;
      margin-bottom: 24px;
      align-items: flex-start;
    }
    .detail-step:last-child {
      margin-bottom: 0;
    }
    .step-num {
      flex-shrink: 0;
      width: 30px;
      height: 30px;
      border-radius: var(--radius-pill);
      background: var(--color-accent);
      color: var(--color-accent-fg);
      font-size: var(--text-sm);
      font-weight: 600;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-top: 1px;
    }
    .step-text {
      font-size: var(--text-md);
      line-height: var(--leading-relaxed);
      color: var(--color-fg-muted);
      padding-top: 4px;
    }
    .detail-nutrition {
      display: block;
      margin-top: 30px;
      padding-top: 22px;
      border-top: 1px solid var(--color-border);
    }
    .detail-nutrition .section-label {
      margin-bottom: 14px;
    }
    .nutrition-grid {
      display: grid;
      gap: 12px;
      grid-template-columns: repeat(4, 1fr);
    }
    .nutrition-cell {
      background: var(--color-bg-elevated);
      border: 1px solid var(--color-border);
      border-radius: var(--radius-md);
      padding: 12px 14px;
      min-width: 0;
      text-align: center;
    }
    .nutrition-cell .k {
      display: block;
      font-size: var(--text-xs);
      font-weight: 600;
      letter-spacing: var(--tracking-wide);
      text-transform: uppercase;
      color: var(--color-fg-subtle);
      margin-bottom: 4px;
    }
    .nutrition-cell .v {
      font-size: var(--text-sm);
      font-weight: 600;
      color: var(--color-fg);
    }
    .detail-footer {
      flex-shrink: 0;
      border-top: 1px solid var(--color-border);
      padding: 12px 32px;
      padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
      display: flex;
      gap: 10px;
      justify-content: flex-end;
      background: var(--color-bg);
    }
    .drawer {
      position: fixed;
      top: 0;
      right: 0;
      bottom: 0;
      width: 460px;
      max-width: 100vw;
      background: var(--color-bg-elevated);
      z-index: 160;
      transform: translateX(100%);
      transition: transform var(--dur-base) var(--ease-out);
      display: flex;
      flex-direction: column;
      box-shadow: -8px 0 32px color-mix(in oklab, var(--color-fg) 12%, transparent);
    }
    .drawer.open {
      transform: translateX(0);
    }
    .drawer-header {
      padding: 22px 26px 18px;
      padding-top: max(22px, env(safe-area-inset-top, 0px));
      border-bottom: 1px solid var(--color-border);
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-shrink: 0;
    }
    .drawer-header h3 {
      font-family: var(--font-display);
      font-size: var(--text-xl);
    }
    .drawer-close {
      background: none;
      border: none;
      cursor: pointer;
      color: var(--color-fg-muted);
      padding: 10px;
      border-radius: 6px;
      display: flex;
      min-width: 44px;
      min-height: 44px;
      align-items: center;
      justify-content: center;
    }
    .drawer-close:hover {
      color: var(--color-fg);
      background: var(--color-bg);
    }
    .drawer-body {
      flex: 1;
      overflow-y: auto;
      padding: 22px 26px;
      -webkit-overflow-scrolling: touch;
    }
    .drawer-footer {
      border-top: 1px solid var(--color-border);
      padding: 14px 26px;
      padding-bottom: max(14px, env(safe-area-inset-bottom, 0px));
      display: flex;
      gap: 10px;
      justify-content: flex-end;
      flex-shrink: 0;
      flex-wrap: wrap;
    }
    .form-group {
      margin-bottom: 16px;
    }
    .form-row {
      display: flex;
      gap: 12px;
      margin-bottom: 16px;
    }
    .form-col {
      flex: 1;
      min-width: 0;
    }
    .recipe-form label,
    form label {
      display: block;
      font-size: var(--text-sm);
      font-weight: 500;
      color: var(--color-fg-muted);
      margin-bottom: 6px;
    }
    label .req {
      color: var(--color-accent);
    }
    .form-hint {
      font-size: var(--text-xs);
      color: var(--color-fg-subtle);
      margin-top: 4px;
    }
    .form-section-label {
      font-size: var(--text-xs);
      font-weight: 600;
      letter-spacing: var(--tracking-wide);
      text-transform: uppercase;
      color: var(--color-fg-subtle);
      margin: 22px 0 12px;
      padding-bottom: 8px;
      border-bottom: 1px solid var(--color-border);
    }
    .form-section-label:first-child {
      margin-top: 0;
    }
    .ing-editor,
    .steps-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .ing-row {
      display: flex;
      gap: 8px;
      align-items: center;
    }
    .ing-row input {
      flex: 1;
    }
    .row-remove {
      flex-shrink: 0;
      background: none;
      border: 1px solid var(--color-border);
      border-radius: 6px;
      cursor: pointer;
      color: var(--color-danger);
      display: flex;
      align-items: center;
      justify-content: center;
      min-width: 44px;
      min-height: 44px;
      transition: background var(--dur-fast) var(--ease-out);
    }
    .row-remove:hover {
      background: color-mix(in oklab, var(--color-danger) 12%, transparent);
    }
    .add-row {
      display: flex;
      gap: 8px;
      margin-top: 8px;
    }
    .add-row input {
      flex: 1;
    }
    .step-row {
      display: flex;
      gap: 9px;
      align-items: flex-start;
    }
    .step-badge {
      flex-shrink: 0;
      width: 28px;
      height: 28px;
      border-radius: var(--radius-pill);
      background: var(--color-accent-soft);
      color: var(--color-accent);
      font-size: var(--text-sm);
      font-weight: 600;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-top: 9px;
    }
    .step-row textarea {
      min-height: 64px;
    }
    .pantry-add {
      display: flex;
      gap: 8px;
      max-width: 520px;
    }
    .pantry-add input {
      flex: 1;
    }
    .pantry-hint {
      font-size: var(--text-xs);
      color: var(--color-fg-subtle);
      margin-top: 8px;
      max-width: 520px;
      line-height: var(--leading-normal);
    }
    .pantry-grid {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 20px;
    }
    .pantry-tag {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 8px 8px 8px 14px;
      border-radius: var(--radius-pill);
      background: var(--color-bg-elevated);
      font-size: var(--text-sm);
      color: var(--color-fg);
      border: 1px solid var(--color-border);
      box-shadow: var(--shadow-sm);
    }
    .pantry-remove {
      background: var(--color-bg-sunken);
      border: none;
      cursor: pointer;
      color: var(--color-fg-muted);
      display: flex;
      align-items: center;
      justify-content: center;
      width: 24px;
      height: 24px;
      border-radius: var(--radius-pill);
      transition: all var(--dur-fast) var(--ease-out);
      flex-shrink: 0;
    }
    .pantry-remove:hover {
      background: color-mix(in oklab, var(--color-danger) 12%, transparent);
      color: var(--color-danger);
    }
    .schema-overlay {
      position: fixed;
      inset: 0;
      background: color-mix(in oklab, var(--color-fg) 50%, transparent);
      z-index: 200;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 20px;
    }
    .schema-overlay.open {
      display: flex;
    }
    .schema-modal {
      background: var(--color-fg);
      border-radius: 10px;
      max-width: 640px;
      width: 100%;
      max-height: 82vh;
      display: flex;
      flex-direction: column;
    }
    .schema-modal-header {
      padding: 16px 20px;
      border-bottom: 1px solid color-mix(in oklab, var(--color-bg-elevated) 10%, transparent);
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-shrink: 0;
    }
    .schema-modal-header h4 {
      font-family: var(--font-display);
      color: var(--color-accent-fg);
      font-size: var(--text-md);
    }
    .schema-modal-header button {
      background: none;
      border: none;
      color: var(--color-fg-subtle);
      cursor: pointer;
      display: flex;
      padding: 6px;
    }
    .schema-actions {
      display: flex;
      gap: 8px;
    }
    .schema-copy {
      background: color-mix(in oklab, var(--color-bg-elevated) 10%, transparent);
      border: none;
      color: var(--color-bg-elevated);
      cursor: pointer;
      font-size: var(--text-xs);
      font-weight: 500;
      padding: 6px 12px;
      border-radius: 5px;
      font-family: inherit;
    }
    .schema-copy:hover {
      background: color-mix(in oklab, var(--color-bg-elevated) 18%, transparent);
    }
    .schema-modal pre {
      flex: 1;
      overflow: auto;
      padding: 20px;
      font-size: var(--text-xs);
      line-height: 1.6;
      color: var(--color-fg-subtle);
      font-family:
        ui-monospace,
        "SF Mono",
        Menlo,
        monospace;
      white-space: pre;
    }
    .fab {
      display: none;
    }
    .fab-stack {
      position: fixed;
      right: 16px;
      bottom: 24px;
      z-index: 60;
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 8px;
    }
    .fab-stack .fab {
      display: flex;
    }
    .fab-dropdown {
      background: var(--color-bg-elevated);
      border: 1px solid var(--color-border);
      border-radius: var(--radius-md);
      box-shadow: var(--shadow-md);
      padding: 4px;
      display: flex;
      flex-direction: column;
      gap: 2px;
      min-width: 180px;
    }
    .fab-dropdown[hidden] {
      display: none;
    }
    .fab-dropdown-item {
      background: none;
      border: none;
      cursor: pointer;
      text-align: left;
      padding: 10px 14px;
      border-radius: var(--radius-sm);
      font-size: var(--text-sm);
      color: var(--color-fg);
      min-height: 44px;
      font-family: inherit;
    }
    .fab-dropdown-divider {
      height: 1px;
      background: var(--color-border);
      margin: 4px 6px;
    }
    .fab-dropdown-item:hover {
      background: var(--color-bg-sunken);
    }
    .fab-dropdown-item:focus-visible {
      outline: 2px solid var(--color-focus-ring);
      outline-offset: 2px;
    }
    .auth-signed-in {
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
      font-size: var(--text-sm);
      color: var(--color-fg-muted);
    }
    .auth-email {
      color: var(--color-fg);
    }
    .auth-signout {
      background: none;
      border: 1px solid var(--color-border);
      cursor: pointer;
      padding: 8px 14px;
      border-radius: var(--radius-md);
      font-size: var(--text-sm);
      color: var(--color-fg);
      font-family: inherit;
      min-height: 36px;
    }
    .auth-signout:hover {
      background: var(--color-bg-sunken);
    }
    .settings-section {
      margin-bottom: 32px;
    }
    .settings-section-label {
      font-size: var(--text-xs);
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--color-fg-muted);
      font-weight: 600;
      margin-bottom: 12px;
    }
    .settings-row {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
    }
    .settings-hint {
      font-size: var(--text-xs);
      color: var(--color-fg-subtle);
    }
    #settings-auth-zone {
      display: flex;
      align-items: center;
      min-height: 44px;
    }
    @media (max-width: 760px) {
      .sidebar {
        flex-direction: row;
        width: 100%;
        height: auto;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 6px 4px;
        padding-bottom: max(6px, env(safe-area-inset-bottom, 0px));
        border-top: 1px solid color-mix(in oklab, var(--color-bg-elevated) 12%, transparent);
        justify-content: space-around;
      }
      .sidebar-brand,
      .sidebar-footer {
        display: none;
      }
      .sidebar-nav {
        display: flex;
        padding: 0;
        flex: 1;
        justify-content: space-around;
        gap: 2px;
      }
      .nav-item {
        flex-direction: column;
        gap: 3px;
        padding: 7px 4px;
        width: auto;
        flex: 1;
        align-items: center;
        font-size: var(--text-xs);
        border-radius: 10px;
        max-width: 90px;
      }
      .nav-item svg {
        width: 20px;
        height: 20px;
        opacity: 0.7;
      }
      .nav-item.active {
        background: transparent;
        color: var(--color-accent);
      }
      .nav-item.active svg {
        color: var(--color-accent);
      }
      .nav-tab-label {
        display: block;
        font-size: var(--text-xs);
      }
      .main {
        margin-left: 0;
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
      }
      .topbar {
        padding: 10px 14px;
        padding-top: max(10px, env(safe-area-inset-top, 0px));
      }
      .search-wrap {
        flex: 1 1 auto;
      }
      .panel {
        padding: 18px 14px;
      }
      .panel-header h2 {
        font-size: var(--text-xl);
      }
      .recipe-grid {
        grid-template-columns: 1fr;
        gap: 14px;
      }
      .detail-modal {
        left: 0;
      }
      .detail-body {
        grid-template-columns: 1fr;
      }
      .detail-nutrition-inner {
        grid-template-columns: 1fr;
        gap: 14px;
      }
      .nutrition-grid {
        grid-template-columns: repeat(2, 1fr);
      }
      .detail-ingredients {
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        padding: 22px 18px 28px;
      }
      .detail-header {
        padding: 18px;
        padding-top: max(18px, env(safe-area-inset-top, 0px));
      }
      .detail-title {
        font-size: var(--text-xl);
      }
      .detail-meta-row {
        gap: 16px;
      }
      .detail-steps {
        padding: 22px 18px 32px;
      }
      .detail-footer {
        padding: 12px 18px;
        padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
      }
      .drawer {
        width: 100vw;
      }
      .fab-stack {
        right: 16px;
        bottom: calc(72px + env(safe-area-inset-bottom, 0px));
      }
      .fab-stack .fab {
        width: 56px;
        height: 56px;
        border-radius: var(--radius-pill);
        background: var(--color-accent);
        color: var(--color-accent-fg);
        border: none;
        cursor: pointer;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 16px color-mix(in oklab, var(--color-accent) 45%, transparent);
      }
      .fab-stack .fab:active {
        transform: scale(0.94);
      }
      #toast {
        bottom: calc(80px + env(safe-area-inset-bottom, 0px));
      }
    }
    @media (max-width: 380px) {
      .card-actions .icon-btn:first-child {
        display: none;
      }
    }
    .author-badge {
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      font-size: 0.8rem;
      color: var(--ink-light, #a8a29e);
    }
    .author-avatar {
      width: 22px;
      height: 22px;
      border-radius: 50%;
      object-fit: cover;
      flex: 0 0 auto;
    }
    .author-avatar.author-initial {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: var(--surface-2, #2f2a25);
      color: var(--ink, #e7e5e4);
      font-size: 0.7rem;
      font-weight: 600;
    }
    .author-name {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .load-more-wrap {
      display: flex;
      justify-content: center;
      padding: 1rem;
    }
    .btn-danger {
      background: var(--color-danger);
      color: var(--color-accent-fg);
      border: 1px solid var(--color-danger);
    }
    .btn-danger:hover {
      background: color-mix(in oklab, var(--color-danger) 88%, black);
    }
  }
}

/* scripts/.css-entry.css */
