/* Life With AI · "Ink & Persimmon" design system.
   Bootstrap 5.3 stays for grid, forms, modals and offcanvas; this file owns tokens and components.
   Navigation is translucent; content surfaces stay opaque. */

:root {
  --lw-page: #F6F5F1;
  --lw-card: #FFFFFF;
  --lw-tile: #EFEDE6;
  --lw-field: #FAF9F6;
  --lw-ink: #0E2236;
  --lw-sub: #4E5A6B;
  --lw-line: #E3E1DA;
  --lw-accent: #C43D12;
  --lw-accent-hover: #A8340F;
  --lw-on-accent: #FFFFFF;
  --lw-accent-soft: #FBE9E1;
  --lw-accent-ink: #9A2F0C;
  --lw-accent-text: #B5380F;
  --lw-danger: #B42318;
  --lw-glass: rgba(246, 245, 241, 0.74);
  --lw-ad: #EEECE6;
  --lw-shadow: 0 18px 50px -24px rgba(14, 34, 54, 0.35);
  --lw-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --lw-display: "Bricolage Grotesque", var(--lw-font);
  --lw-r-card: 28px;
  --lw-r-tile: 16px;
  --lw-r-row: 20px;
  --lw-r-field: 14px;
  --lw-tabbar-space: 0px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --lw-page: #0B1622;
    --lw-card: #13212F;
    --lw-tile: #1B2B3B;
    --lw-field: #0F1B27;
    --lw-ink: #F3F1EA;
    --lw-sub: #A9B4C2;
    --lw-line: #263646;
    --lw-accent: #FF8A5C;
    --lw-accent-hover: #FFA07B;
    --lw-on-accent: #0E2236;
    --lw-accent-soft: #3A2219;
    --lw-accent-ink: #FFB08F;
    --lw-accent-text: #FF8A5C;
    --lw-danger: #FF8B80;
    --lw-glass: rgba(11, 22, 34, 0.74);
    --lw-ad: #16242F;
    --lw-shadow: 0 18px 50px -24px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}

/* Bootstrap bridges: components read our tokens in both appearances. */
:root, [data-bs-theme] {
  --bs-body-bg: var(--lw-page);
  --bs-body-color: var(--lw-ink);
  --bs-body-font-family: var(--lw-font);
  --bs-body-font-size: 1.0625rem;
  --bs-body-line-height: 1.5;
  --bs-secondary-color: var(--lw-sub);
  --bs-tertiary-bg: var(--lw-tile);
  --bs-border-color: var(--lw-line);
  --bs-emphasis-color: var(--lw-ink);
  --bs-link-color: var(--lw-accent-text);
  --bs-link-color-rgb: 181, 56, 15;
  --bs-link-hover-color: var(--lw-accent-hover);
  --bs-focus-ring-color: rgba(196, 61, 18, 0.35);
  --bs-form-invalid-color: var(--lw-danger);
  --bs-form-invalid-border-color: var(--lw-danger);
  --bs-border-radius: var(--lw-r-field);
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--lw-page);
  color: var(--lw-ink);
  font-family: var(--lw-font);
  font-size: 1.0625rem;
  line-height: 1.5;
  padding-bottom: var(--lw-tabbar-space);
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { color: var(--lw-ink); }
a { color: var(--lw-accent-text); }
a:hover { color: var(--lw-accent-hover); }
img { max-width: 100%; }

:focus-visible {
  outline: 3px solid var(--lw-accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.lw-skip {
  position: absolute; left: 16px; top: -100px; z-index: 50;
  background: var(--lw-card); color: var(--lw-ink); padding: 12px 16px; border-radius: 12px;
}
.lw-skip:focus { top: 12px; }

/* ---------- Header and navigation (glass) ---------- */
.lw-header {
  position: sticky; top: 0; z-index: 1020;
  background: var(--lw-glass);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--lw-line);
}
.lw-header__inner {
  max-width: 1160px; margin: 0 auto; padding: 8px 20px;
  display: flex; align-items: center; gap: 12px;
}
.lw-brand {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  color: var(--lw-ink); text-decoration: none;
}
.lw-brand:hover { color: var(--lw-ink); }
.lw-brand img { width: 36px; height: 36px; border-radius: 50%; }
.lw-brand span {
  font-family: var(--lw-display); font-weight: 800; font-size: 1.3rem; letter-spacing: -0.01em;
}
.lw-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.lw-navlink {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px;
  color: var(--lw-ink); text-decoration: none; font-weight: 600; font-size: 0.9375rem;
}
.lw-navlink:hover { color: var(--lw-ink); background: var(--lw-tile); }
.lw-navlink[aria-current="page"] { background: var(--lw-accent-soft); color: var(--lw-accent-ink); }
.lw-pillbtn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--lw-line); background: var(--lw-card); color: var(--lw-ink);
  font: inherit; font-size: 0.9375rem; font-weight: 600; text-decoration: none; cursor: pointer;
}
.lw-pillbtn:hover { color: var(--lw-ink); background: var(--lw-tile); }
.lw-iconbtn {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--lw-line);
  background: var(--lw-card); color: var(--lw-ink);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.lw-iconbtn:hover { background: var(--lw-tile); }
.lw-icon { width: 1.25em; height: 1.25em; flex: none; }

.lw-header .dropdown-menu, .dropdown-menu {
  --bs-dropdown-bg: var(--lw-card);
  --bs-dropdown-color: var(--lw-ink);
  --bs-dropdown-border-color: var(--lw-line);
  --bs-dropdown-link-color: var(--lw-ink);
  --bs-dropdown-link-hover-bg: var(--lw-tile);
  --bs-dropdown-link-hover-color: var(--lw-ink);
  --bs-dropdown-link-active-bg: var(--lw-accent-soft);
  --bs-dropdown-link-active-color: var(--lw-accent-ink);
  border-radius: 18px; padding: 6px; box-shadow: var(--lw-shadow);
}
.dropdown-item { border-radius: 12px; min-height: 44px; display: flex; align-items: center; }

.lw-desktop-only { display: none !important; }
@media (min-width: 768px) {
  .lw-desktop-only { display: inline-flex !important; }
  .lw-phone-only { display: none !important; }
}

/* Bottom tab bar on phones (floating glass capsule). */
.lw-tabbar { display: none; }
@media (max-width: 767.98px) {
  :root { --lw-tabbar-space: calc(96px + env(safe-area-inset-bottom)); }
  .lw-tabbar {
    position: fixed; z-index: 1030; left: 12px; right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 6px;
    border-radius: 999px; border: 1px solid var(--lw-line);
    background: var(--lw-glass);
    -webkit-backdrop-filter: saturate(160%) blur(18px);
    backdrop-filter: saturate(160%) blur(18px);
    box-shadow: 0 10px 30px -12px rgba(14, 34, 54, 0.4);
  }
}
.lw-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 52px; border-radius: 999px; border: none; background: transparent;
  color: var(--lw-ink); font: inherit; font-size: 0.75rem; font-weight: 600; text-decoration: none; cursor: pointer;
}
.lw-tab:hover { color: var(--lw-ink); }
.lw-tab[aria-current="page"] { background: var(--lw-accent-soft); color: var(--lw-accent-ink); }
.lw-tab .lw-icon { width: 22px; height: 22px; }

/* Offcanvas "More" sheet */
.offcanvas {
  --bs-offcanvas-bg: var(--lw-page);
  --bs-offcanvas-color: var(--lw-ink);
  --bs-offcanvas-border-color: var(--lw-line);
}
.offcanvas-title { font-family: var(--lw-display); font-weight: 800; }

/* ---------- Page layout ---------- */
.lw-shell {
  max-width: 1160px; margin: 0 auto; padding: 24px 20px 56px;
  display: flex; gap: 32px; align-items: flex-start;
}
.lw-main { flex: 1 1 auto; min-width: 0; }
.lw-rail { display: none; }
@media (min-width: 1200px) {
  .lw-rail { display: block; flex: 0 0 300px; }
}
.lw-stack { display: flex; flex-direction: column; gap: 20px; }

.lw-page-head { display: flex; flex-direction: column; gap: 10px; padding: 16px 0 24px; max-width: 46rem; }
.lw-eyebrow {
  align-self: flex-start; margin: 0; padding: 5px 12px; border-radius: 999px;
  background: var(--lw-accent-soft); color: var(--lw-accent-ink); font-size: 0.875rem; font-weight: 600;
}
.lw-title, .lw-page-head h1 {
  margin: 0; font-family: var(--lw-display); font-weight: 800; letter-spacing: -0.02em;
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); line-height: 1.08;
}
.lw-lead { margin: 0; color: var(--lw-sub); font-size: 1.125rem; }
.lw-h2 { margin: 0; font-family: var(--lw-display); font-weight: 800; letter-spacing: -0.02em; font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem); }
.lw-h3 { margin: 0; font-weight: 700; font-size: 1.25rem; }
.lw-sub { color: var(--lw-sub); }
.lw-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }

.lw-panel {
  background: var(--lw-card); border: 1px solid var(--lw-line); border-radius: var(--lw-r-card);
  padding: 22px; color: var(--lw-ink);
}
@media (min-width: 768px) { .lw-panel { padding: 28px; } }
.lw-panel--tile { background: var(--lw-tile); border-color: transparent; }

/* ---------- Buttons ---------- */
.lw-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: 1rem; text-decoration: none; cursor: pointer;
  transition: background-color 120ms ease, transform 120ms ease;
}
.lw-btn:active { transform: scale(0.98); }
.lw-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.lw-btn--primary, .btn-mine { background: var(--lw-accent); color: var(--lw-on-accent); border-color: var(--lw-accent); }
.lw-btn--primary:hover, .btn-mine:hover { background: var(--lw-accent-hover); color: var(--lw-on-accent); }
.lw-btn--secondary { background: var(--lw-card); color: var(--lw-ink); border-color: var(--lw-line); }
.lw-btn--secondary:hover { background: var(--lw-tile); color: var(--lw-ink); }
.lw-btn--ghost { background: transparent; color: var(--lw-accent-text); min-height: 44px; padding: 0 12px; }
.lw-btn--ghost:hover { background: var(--lw-accent-soft); color: var(--lw-accent-ink); }
.lw-btn--danger { background: transparent; color: var(--lw-danger); border-color: var(--lw-line); }
.lw-btn--danger:hover { background: var(--lw-tile); color: var(--lw-danger); }
.lw-btn--block { width: 100%; min-height: 54px; font-size: 1.0625rem; }
.btn-mine { border-radius: 999px; font-weight: 700; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; padding: 0 22px; }
.btn-mine.text-black { color: var(--lw-on-accent) !important; }

.lw-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 768px) { .lw-actions { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); } }
.lw-actions .lw-btn { border-radius: 18px; min-height: 52px; padding: 0 14px; font-size: 0.9375rem; }

/* ---------- Forms ---------- */
.lw-form .form-label, .lw-label { font-weight: 700; font-size: 0.9375rem; margin-bottom: 6px; color: var(--lw-ink); }
.lw-optional { font-weight: 500; color: var(--lw-sub); font-size: 0.875rem; }
.lw-count { font-weight: 500; color: var(--lw-sub); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.form-control, .form-select {
  min-height: 48px; border-radius: var(--lw-r-field); border: 1px solid var(--lw-line);
  background-color: var(--lw-field); color: var(--lw-ink); font-size: 1.0625rem;
}
.form-control::placeholder { color: var(--lw-sub); opacity: 1; }
.form-control:focus, .form-select:focus {
  background-color: var(--lw-field); color: var(--lw-ink); border-color: var(--lw-accent);
  box-shadow: 0 0 0 4px rgba(196, 61, 18, 0.18);
}
textarea.form-control { min-height: 112px; }
.input-group-text { background: var(--lw-tile); border-color: var(--lw-line); color: var(--lw-sub); border-radius: var(--lw-r-field); }
.form-control.text-center { text-align: left !important; }
.lw-form .row { --bs-gutter-y: 1.25rem; }
.lw-form-foot { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.lw-form-foot__secondary { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.lw-hint { margin: 0; color: var(--lw-sub); font-size: 0.875rem; text-align: center; }
.was-validated .form-control:invalid, .was-validated .form-select:invalid { border-color: var(--lw-danger); }

/* Segmented choices (built from short <select> lists by lwai-forms.js) */
.lw-seg {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 24px;
  background: var(--lw-field); border: 1px solid var(--lw-line);
}
.lw-seg button {
  flex: 1 1 auto; min-height: 44px; padding: 0 14px; border: none; border-radius: 999px;
  background: transparent; color: var(--lw-sub); font: inherit; font-size: 0.9375rem; font-weight: 600; cursor: pointer;
}
.lw-seg button:hover { color: var(--lw-ink); }
.lw-seg button[aria-checked="true"] { background: var(--lw-card); color: var(--lw-ink); box-shadow: 0 1px 3px rgba(14, 34, 54, 0.18); }

/* Choice chips for longer lists (6+ options): all visible, one tap, wraps on phones. */
.lw-choice { display: flex; flex-wrap: wrap; gap: 8px; }
.lw-choice button {
  min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--lw-line);
  background: var(--lw-field); color: var(--lw-ink); font: inherit; font-size: 0.9375rem; font-weight: 600; cursor: pointer;
}
.lw-choice button:hover { background: var(--lw-tile); }
.lw-choice button[aria-checked="true"] {
  background: var(--lw-accent-soft); color: var(--lw-accent-ink); border-color: var(--lw-accent);
}
.lw-choice button[aria-checked="true"]::before { content: "✓ "; }

/* Steppers */
.lw-stepper { flex-wrap: nowrap; }
.lw-stepper .form-control { text-align: center; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.lw-stepper .form-control::-webkit-inner-spin-button, .lw-stepper .form-control::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.lw-stepper__btn {
  flex: none; width: 48px; border: 1px solid var(--lw-line); background: var(--lw-card); color: var(--lw-ink);
  font-size: 1.375rem; font-weight: 600; line-height: 1; cursor: pointer;
}
.lw-stepper__btn:first-child { border-radius: var(--lw-r-field) 0 0 var(--lw-r-field) !important; }
.lw-stepper__btn:hover { background: var(--lw-tile); }

/* Token entry */
.lw-tokens { display: flex; flex-direction: column; gap: 10px; }
.lw-tokens__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lw-tokens__list:empty { display: none; }
.lw-token {
  display: inline-flex; align-items: center; gap: 2px; padding-left: 14px; border-radius: 999px;
  background: var(--lw-accent-soft); color: var(--lw-accent-ink); font-weight: 600; font-size: 0.9375rem;
}
.lw-token button {
  width: 36px; height: 36px; border: none; border-radius: 50%; background: transparent; color: inherit;
  font-size: 1.25rem; line-height: 1; cursor: pointer;
}
.lw-token button:hover { background: rgba(0, 0, 0, 0.06); }
.lw-tokens__row { display: flex; gap: 8px; }
.lw-tokens__row .form-control { flex: 1 1 auto; }

/* Collapsible field groups */
.lw-group { border: 1px solid var(--lw-line); border-radius: 22px; background: var(--lw-page); }
.lw-group > summary {
  list-style: none; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 16px;
  font-weight: 700; cursor: pointer; border-radius: 22px;
}
.lw-group > summary::-webkit-details-marker { display: none; }
.lw-group > summary::after {
  content: ""; margin-left: auto; width: 10px; height: 10px; flex: none;
  border-right: 2px solid var(--lw-sub); border-bottom: 2px solid var(--lw-sub); transform: rotate(45deg) translateY(-3px);
}
.lw-group[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.lw-group__note { font-weight: 500; color: var(--lw-sub); font-size: 0.875rem; }
.lw-group__body { padding: 4px 16px 18px; }
.lw-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 0.9375rem; }
.lw-check input { width: 22px; height: 22px; accent-color: var(--lw-accent); flex: none; }
.invalid-feedback { color: var(--lw-danger); font-size: 0.875rem; font-weight: 600; }

/* Refinement chips */
.lw-refine { margin: 16px 0 0; }
.lw-refine .lw-chips { margin-top: 10px; }
.lw-chip:disabled { opacity: 0.5; cursor: progress; }

/* Guide below the tool */
.lw-tips { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.lw-tips li { background: var(--lw-page); border: 1px solid var(--lw-line); border-radius: 20px; padding: 16px; display: flex; gap: 12px; align-items: flex-start; }
.lw-tips__n {
  flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--lw-accent-soft); color: var(--lw-accent-ink);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.875rem;
}
.lw-faq details { border-top: 1px solid var(--lw-line); }
.lw-faq details:last-child { border-bottom: 1px solid var(--lw-line); }
.lw-faq summary { list-style: none; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 0; font-weight: 700; cursor: pointer; }
.lw-faq summary::-webkit-details-marker { display: none; }
.lw-faq summary::after { content: "+"; margin-left: auto; font-size: 1.5rem; font-weight: 400; color: var(--lw-sub); }
.lw-faq details[open] summary::after { content: "−"; }
.lw-faq details p { margin: 0 0 16px; color: var(--lw-sub); }

/* Legacy collapsing animation from the generator scripts keeps working. */
.needs-validation { overflow: hidden; }

/* ---------- Tool cards and lists ---------- */
.lw-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.lw-card {
  display: flex; flex-direction: column; gap: 12px; padding: 22px; min-height: 180px;
  border-radius: var(--lw-r-card); background: var(--lw-card); border: 1px solid var(--lw-line);
  color: var(--lw-ink); text-decoration: none; transition: transform 160ms ease, box-shadow 160ms ease;
}
.lw-card:hover { color: var(--lw-ink); transform: translateY(-2px); box-shadow: var(--lw-shadow); }
.lw-card__icon {
  width: 52px; height: 52px; border-radius: var(--lw-r-tile); background: var(--lw-tile); color: var(--lw-ink);
  display: flex; align-items: center; justify-content: center;
}
.lw-card__icon .lw-icon { width: 26px; height: 26px; }
.lw-card__title { font-weight: 700; font-size: 1.25rem; line-height: 1.25; }
.lw-card__text { color: var(--lw-sub); font-size: 1rem; flex-grow: 1; }
.lw-card__more { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 0.9375rem; color: var(--lw-accent-text); }

.lw-list { background: var(--lw-card); border: 1px solid var(--lw-line); border-radius: 24px; overflow: hidden; margin: 0; padding: 0; list-style: none; }
.lw-list > li + li { border-top: 1px solid var(--lw-line); }
.lw-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; min-height: 72px;
  color: var(--lw-ink); text-decoration: none;
}
.lw-row:hover { color: var(--lw-ink); background: var(--lw-tile); }
.lw-row__icon {
  flex: none; width: 44px; height: 44px; border-radius: 13px; background: var(--lw-tile);
  display: flex; align-items: center; justify-content: center;
}
.lw-row__body { display: flex; flex-direction: column; min-width: 0; flex-grow: 1; }
.lw-row__title { font-weight: 700; }
.lw-row__text { font-size: 0.9375rem; color: var(--lw-sub); }
.lw-row__chev { color: var(--lw-sub); width: 18px; height: 18px; flex: none; }

/* ---------- Home ---------- */
.lw-hero { display: flex; flex-wrap: wrap; gap: 40px; align-items: center; padding: 24px 0 48px; }
.lw-hero__copy { flex: 999 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.lw-hero__title {
  margin: 0; font-family: var(--lw-display); font-weight: 800; letter-spacing: -0.025em; line-height: 1.04;
  font-size: clamp(2.5rem, 1.6rem + 3.8vw, 4rem);
}
.lw-hero__lead { margin: 0; font-size: 1.25rem; color: var(--lw-sub); max-width: 34em; }
.lw-hero__ctas { display: flex; gap: 12px; flex-wrap: wrap; padding-top: 6px; }
.lw-example {
  flex: 1 1 320px; min-width: 0; margin: 0; background: var(--lw-card); border: 1px solid var(--lw-line);
  border-radius: var(--lw-r-card); padding: 22px; box-shadow: var(--lw-shadow);
}
.lw-example__head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--lw-line); }
.lw-example__badge {
  width: 44px; height: 44px; border-radius: 14px; background: var(--lw-accent-soft); color: var(--lw-accent-ink);
  display: flex; align-items: center; justify-content: center;
}
.lw-caps { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--lw-sub); }
.lw-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 16px; }
.lw-steps li { background: var(--lw-card); border: 1px solid var(--lw-line); border-radius: 24px; padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.lw-steps__n {
  width: 36px; height: 36px; border-radius: 50%; background: var(--lw-ink); color: var(--lw-page);
  display: flex; align-items: center; justify-content: center; font-weight: 800;
}
.lw-section { padding: 0 0 48px; }

/* ---------- Archive cards ---------- */
.lw-read {
  display: flex; flex-direction: column; border-radius: 24px; overflow: hidden; height: 100%;
  background: var(--lw-card); border: 1px solid var(--lw-line); color: var(--lw-ink); text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.lw-read:hover { color: var(--lw-ink); transform: translateY(-2px); box-shadow: var(--lw-shadow); }
.lw-read__img { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; background: var(--lw-tile); }
.lw-read__body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.lw-read__title { font-weight: 700; font-size: 1.1875rem; line-height: 1.3; margin: 0; }
.lw-read__text { color: var(--lw-sub); font-size: 0.9375rem; margin: 0; }

.lw-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.lw-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--lw-line); background: var(--lw-card); color: var(--lw-ink);
  font-size: 0.9375rem; font-weight: 600; cursor: pointer; user-select: none;
}
.btn-check:checked + .lw-chip { background: var(--lw-accent-soft); color: var(--lw-accent-ink); border-color: transparent; }
.btn-check:focus-visible + .lw-chip { outline: 3px solid var(--lw-accent); outline-offset: 2px; }
.lw-tag { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px; background: var(--lw-tile); font-size: 0.875rem; font-weight: 600; color: var(--lw-ink); text-decoration: none; }
.lw-tag--accent { background: var(--lw-accent-soft); color: var(--lw-accent-ink); }

.pagination {
  --bs-pagination-color: var(--lw-ink);
  --bs-pagination-bg: var(--lw-card);
  --bs-pagination-border-color: var(--lw-line);
  --bs-pagination-hover-color: var(--lw-ink);
  --bs-pagination-hover-bg: var(--lw-tile);
  --bs-pagination-active-bg: var(--lw-accent);
  --bs-pagination-active-border-color: var(--lw-accent);
  --bs-pagination-active-color: var(--lw-on-accent);
  --bs-pagination-disabled-bg: var(--lw-card);
  --bs-pagination-disabled-color: var(--lw-sub);
  --bs-pagination-focus-box-shadow: 0 0 0 3px rgba(196, 61, 18, 0.35);
  gap: 4px; flex-wrap: wrap;
}
.page-link { min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 12px !important; }

/* ---------- Answers and articles ---------- */
.lw-answer, #answer.lw-answer {
  background: var(--lw-card); border: 1px solid var(--lw-line); border-radius: var(--lw-r-card);
  padding: 22px; color: var(--lw-ink); text-align: left; font-size: 1.0625rem;
}
@media (min-width: 768px) { .lw-answer, #answer.lw-answer { padding: 32px; } }
.lw-prose { text-align: left; line-height: 1.65; }
.lw-prose h1, .lw-answer h1 { font-family: var(--lw-display); font-weight: 800; font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.25rem); letter-spacing: -0.02em; margin: 0 0 12px; }
.lw-prose h2, .lw-answer h2 { font-family: var(--lw-display); font-weight: 800; font-size: 1.5rem; margin: 28px 0 10px; }
.lw-prose h3, .lw-answer h3 { font-weight: 700; font-size: 1.1875rem; margin: 22px 0 8px; }
.lw-prose p, .lw-answer p { margin: 0 0 14px; font-weight: 400 !important; }
.lw-prose ul, .lw-prose ol, .lw-answer ul, .lw-answer ol { padding-left: 1.4em; margin: 0 0 16px; }
.lw-prose li, .lw-answer li { margin: 4px 0; }
.lw-prose strong, .lw-answer strong { font-weight: 700; }
.lw-prose a, .lw-answer a { color: var(--lw-accent-text); }
.lw-answer .table, .lw-prose .table {
  --bs-table-bg: var(--lw-card);
  --bs-table-color: var(--lw-ink);
  --bs-table-striped-bg: var(--lw-tile);
  --bs-table-striped-color: var(--lw-ink);
  --bs-table-hover-bg: var(--lw-tile);
  --bs-table-hover-color: var(--lw-ink);
  --bs-table-border-color: var(--lw-line);
  border-radius: 14px; overflow: hidden; font-size: 0.9375rem;
}
.lw-answer .table thead.table-dark, .lw-prose .table thead.table-dark {
  --bs-table-bg: var(--lw-ink); --bs-table-color: var(--lw-page);
}
.lw-answer table, .lw-prose table { display: block; overflow-x: auto; max-width: 100%; }
.lw-answer[aria-busy="true"] { min-height: 120px; }
.lw-prose h4, .lw-answer h4 { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--lw-sub); margin: 18px 0 6px; }
.lw-prose h5, .lw-answer h5 { font-size: 1rem; font-weight: 700; margin: 14px 0 6px; }
.lw-answer > :first-child, .lw-part > :first-child { margin-top: 0; }
.lw-answer > :last-child, .lw-part > :last-child { margin-bottom: 0; }
.lw-answer hr, .lw-prose hr { border: 0; border-top: 1px solid var(--lw-line); opacity: 1; margin: 24px 0; }

/* Waiting and errors share the answer box until the text arrives */
#answer[data-state] { min-height: 0; display: flex !important; align-items: center; gap: 12px; font-weight: 600; }
#answer[data-state="pending"]::before {
  content: ""; flex: none; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid var(--lw-line); border-top-color: var(--lw-accent); animation: lw-spin 0.9s linear infinite;
}
#answer[data-state="error"] { border-color: var(--lw-danger); color: var(--lw-danger); }
@keyframes lw-spin { to { transform: rotate(360deg); } }

/* Options and days: each part of a long answer is its own block */
.lw-part { background: var(--lw-page); border: 1px solid var(--lw-line); border-radius: 20px; padding: 18px; margin: 16px 0; scroll-margin-top: 84px; }
@media (min-width: 768px) { .lw-part { padding: 22px 24px; } }
.lw-jump { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin: 4px -2px 8px; scrollbar-width: thin; }
.lw-jump .lw-chip { flex: none; text-decoration: none; min-height: 36px; font-size: 0.875rem; }

/* The request that produced the answer, with a way back to the form */
.lw-request { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 16px; }
.lw-request__title { flex-basis: 100%; margin: 0; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--lw-sub); }
.lw-request__values { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; flex: 1 1 0; min-width: 0; }
.lw-request__values li { padding: 6px 12px; border-radius: 999px; background: var(--lw-tile); font-size: 0.875rem; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lw-request__edit { flex: none; }

/* Wide tables (a week of meals or workouts) become one card per row on phones */
@media (max-width: 719.98px) {
  .lw-answer .table.lw-stack, .lw-prose .table.lw-stack { --bs-table-striped-bg: transparent; --bs-table-hover-bg: transparent; border-radius: 0; overflow: visible; font-size: 1rem; }
  .lw-stack, .lw-stack tbody, .lw-stack thead, .lw-stack tr, .lw-stack td { display: block; width: 100%; }
  .lw-stack .lw-stack__head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .lw-stack tr { border: 1px solid var(--lw-line); border-radius: 18px; background: var(--lw-page); padding: 4px 16px; margin: 0 0 12px; }
  .lw-answer .table.lw-stack > :not(caption) > * > *, .lw-prose .table.lw-stack > :not(caption) > * > * {
    border: 0; border-bottom: 1px solid var(--lw-line); padding: 10px 0; background: transparent; box-shadow: none;
  }
  .lw-answer .table.lw-stack > :not(caption) > * > :last-child, .lw-prose .table.lw-stack > :not(caption) > * > :last-child { border-bottom: 0; }
  .lw-stack td::before { content: attr(data-label); display: block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--lw-sub); margin-bottom: 2px; }
  .lw-stack td:first-child { font-family: var(--lw-display); font-weight: 800; font-size: 1.125rem; }
  .lw-stack td:first-child::before { display: none; }
}

/* ---------- Structured answers (lwai-structured.js) ---------- */
#answer[data-format="json"] { background: transparent; border: 0; padding: 0; }
#answer[data-format="json"] ~ #newButtons #requestListButton { display: none !important; } /* the plan already has its list */
.lw-s { display: grid; gap: 16px; }
.lw-s h2, .lw-s h3, .lw-s h4, .lw-s p, .lw-s ul, .lw-s ol { margin: 0; }
.lw-s ul, .lw-s ol { padding-left: 0; }
.lw-s li { margin: 0; }
.lw-s-head h2 { font-family: var(--lw-display); font-weight: 800; font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); letter-spacing: -0.02em; line-height: 1.15; }
.lw-s-lead { margin-top: 8px !important; color: var(--lw-sub); font-size: 1.0625rem; }
.lw-s-stack { display: grid; gap: 16px; }
.lw-s-card { background: var(--lw-card); border: 1px solid var(--lw-line); border-radius: var(--lw-r-card); padding: 20px; display: grid; gap: 16px; scroll-margin-top: 84px; overflow: hidden; }
@media (min-width: 768px) { .lw-s-card { padding: 26px 28px; } }
.lw-s-card h3 { font-family: var(--lw-display); font-weight: 800; font-size: 1.3125rem; line-height: 1.2; }
.lw-s-card__top { display: flex; gap: 14px; align-items: flex-start; }
.lw-s-card__titles { display: grid; gap: 4px; min-width: 0; }
.lw-s-emoji { flex: none; width: 52px; height: 52px; border-radius: 16px; background: var(--lw-tile); display: grid; place-items: center; font-size: 1.75rem; line-height: 1; }
.lw-s-sub { color: var(--lw-sub); font-size: 0.9375rem; }
.lw-s-label { display: block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--lw-sub); }
.lw-s-section { display: grid; gap: 8px; }
.lw-s-split { display: grid; gap: 18px; }
@media (min-width: 768px) { .lw-s-split { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 28px; } }
.lw-s-meta { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; }
.lw-s-meta li, .lw-s-pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: var(--lw-tile); font-size: 0.875rem; font-weight: 600; white-space: nowrap; }
.lw-s-chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; }
.lw-s-chips li { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--lw-line); font-size: 0.9375rem; }
.lw-s-chips--have li, .lw-s-chips--soft li { background: var(--lw-accent-soft); color: var(--lw-accent-ink); border-color: transparent; font-weight: 600; }
.lw-s-chips--buy li { border-style: dashed; }
.lw-s-amounts { list-style: none; padding: 0; display: grid; }
.lw-s-amounts li { display: grid; grid-template-columns: minmax(4.5rem, max-content) 1fr; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--lw-line); }
.lw-s-amounts li:last-child { border-bottom: 0; }
.lw-s-amounts__qty { font-weight: 700; font-variant-numeric: tabular-nums; }
.lw-s-steps { list-style: none; padding: 0; counter-reset: lw-step; display: grid; gap: 12px; }
.lw-s-steps li { counter-increment: lw-step; display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; }
.lw-s-steps li::before { content: counter(lw-step); width: 28px; height: 28px; border-radius: 50%; background: var(--lw-ink); color: var(--lw-page); display: grid; place-items: center; font-size: 0.8125rem; font-weight: 700; }
.lw-s-callout { background: var(--lw-tile); border-radius: var(--lw-r-tile); padding: 12px 16px; }
.lw-s-line strong, .lw-s-callout strong { font-weight: 700; }
.lw-s-tips { background: var(--lw-accent-soft); color: var(--lw-accent-ink); border-radius: var(--lw-r-card); padding: 18px 22px; display: grid; gap: 8px; }
.lw-s-tips .lw-s-label { color: inherit; }
.lw-s .lw-s-tips ul { padding-left: 1.2em; display: grid; gap: 4px; }

/* Cocktails */
.lw-s-strength { display: inline-flex; align-items: center; gap: 8px; }
.lw-s-meter { display: inline-flex; gap: 3px; }
.lw-s-meter span { width: 8px; height: 14px; border-radius: 3px; background: var(--lw-line); }
.lw-s-meter span.is-on { background: var(--lw-accent); }

/* Outfits */
.lw-s-palette { display: flex; height: 14px; margin: -20px -20px 0; }
@media (min-width: 768px) { .lw-s-palette { margin: -26px -28px 0; } }
.lw-s-swatch { flex: 1; }
/* One column for badges sized to the longest label, so every piece starts at the same line. */
.lw-s-pieces { list-style: none; padding: 0; display: grid; grid-template-columns: max-content 1fr; gap: 10px 12px; align-items: start; }
.lw-s-pieces li { display: contents; }
.lw-s-pieces .lw-s-badge { justify-self: start; }
.lw-s-pieces__text { display: grid; gap: 2px; }
.lw-s-badge { font-size: 0.75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; margin-top: 2px; }
.lw-s-badge.is-have { background: var(--lw-tile); color: var(--lw-ink); }
.lw-s-badge.is-add { border: 1px dashed var(--lw-accent-text); color: var(--lw-accent-text); }

/* Diet and trip summaries */
.lw-s-summary { background: var(--lw-ink); color: var(--lw-page); border-radius: var(--lw-r-card); padding: 20px 22px; display: grid; gap: 16px; }
@media (min-width: 768px) { .lw-s-summary { grid-template-columns: auto 1fr; align-items: center; gap: 32px; padding: 24px 28px; } }
.lw-s-summary .lw-s-label, .lw-s-summary .lw-s-sub { color: inherit; opacity: 0.75; }
.lw-s-big strong { display: block; font-family: var(--lw-display); font-weight: 800; font-size: 2rem; line-height: 1.1; }
.lw-s-macros { display: grid; gap: 10px; }
.lw-s-macrobar, .lw-s-progress { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: color-mix(in srgb, currentColor 20%, transparent); }
.lw-s-macro--protein { --lw-macro: #FF8A5C; } .lw-s-macro--carbs { --lw-macro: #F2C94C; } .lw-s-macro--fat { --lw-macro: #7CC4A4; }
.lw-s-macrobar span { background: var(--lw-macro); }
.lw-s-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; padding: 0; font-size: 0.9375rem; }
.lw-s-legend li::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--lw-macro); margin-right: 6px; }
.lw-s-progress span { background: #7CC4A4; }
.lw-s-progress.is-over span { background: #FF8A5C; }
.lw-s-budget { display: grid; gap: 8px; }

/* Days (diet, workout, trip) */
.lw-s-day__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.lw-s-day__head h3 { margin-right: auto; }
.lw-s-meals { display: grid; gap: 14px; }
@media (min-width: 900px) { .lw-s-meals { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }
.lw-s-meal { background: var(--lw-page); border-radius: var(--lw-r-tile); padding: 12px 14px; display: grid; gap: 4px; align-content: start; }
.lw-s-meal header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.lw-s-meal .lw-s-amounts li { padding: 5px 0; font-size: 0.9375rem; }
.lw-s-day.is-rest { background: var(--lw-page); }
.lw-s-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.lw-s-week a { display: grid; gap: 2px; padding: 10px 6px; border-radius: 14px; background: var(--lw-ink); color: var(--lw-page); text-decoration: none; text-align: center; min-width: 0; }
.lw-s-week a.is-rest { background: var(--lw-tile); color: var(--lw-sub); }
.lw-s-week strong { font-size: 0.875rem; }
@media (max-width: 599.98px) {
  .lw-s-week a:not(.is-rest) span { font-size: 0; }
  .lw-s-week a:not(.is-rest) span::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--lw-accent); }
}
.lw-s-week span { font-size: 0.6875rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lw-s-exercises { list-style: none; padding: 0; display: grid; }
.lw-s-exercises li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--lw-line); }
.lw-s-exercises li:last-child { border-bottom: 0; }
.lw-s-exercises__name { display: grid; gap: 2px; min-width: 0; }
.lw-s-exercises__dose { display: grid; justify-items: end; text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.lw-s-exercises__dose span:first-child { font-weight: 800; font-size: 1.0625rem; }
.lw-s-exercises__dose span + span { color: var(--lw-sub); font-size: 0.8125rem; }
.lw-s-timeline { list-style: none; padding: 0; display: grid; }
.lw-s-timeline li { display: grid; grid-template-columns: 5.5rem 1fr auto; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--lw-line); }
@media (max-width: 479.98px) { .lw-s-timeline li { grid-template-columns: 1fr auto; } .lw-s-timeline__time { grid-column: 1 / -1; } }
.lw-s-timeline__time { font-size: 0.8125rem; font-weight: 700; color: var(--lw-accent-text); padding-top: 2px; }
.lw-s-timeline__text { display: grid; gap: 2px; min-width: 0; }
.lw-s-timeline__cost { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; margin-left: auto; }
.lw-s-stay { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: baseline; }
.lw-s-daytotal { display: flex; justify-content: space-between; padding-top: 4px; color: var(--lw-sub); }
.lw-s-daytotal strong { color: var(--lw-ink); font-size: 1.0625rem; }
.lw-s-bars { list-style: none; padding: 0; display: grid; gap: 10px; }
.lw-s-bars li { display: grid; grid-template-columns: minmax(6rem, 9rem) 1fr auto; gap: 12px; align-items: center; }
.lw-s-bars__track { height: 10px; border-radius: 999px; background: var(--lw-tile); overflow: hidden; }
.lw-s-bars__fill { display: block; height: 100%; background: var(--lw-accent); border-radius: inherit; }
.lw-s-shopping__groups { display: grid; gap: 18px; }
@media (min-width: 768px) { .lw-s-shopping__groups { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lw-s-checklist { list-style: none; padding: 0; display: grid; gap: 2px; margin-top: 6px !important; }
.lw-s-checklist li { display: flex; gap: 12px; align-items: center; min-height: 44px; border-bottom: 1px solid var(--lw-line); }
.lw-s-checklist .form-check-input { flex: none; width: 22px; height: 22px; margin: 0; }
.lw-s-checklist label { flex: 1; display: flex; justify-content: space-between; gap: 12px; cursor: pointer; }
.lw-s-checklist input:checked + label span:first-child { text-decoration: line-through; color: var(--lw-sub); }

.lw-article { max-width: 46rem; }
.lw-article__meta { display: flex; flex-wrap: wrap; gap: 8px; padding: 18px 0 26px; border-bottom: 1px solid var(--lw-line); margin-bottom: 26px; }
.lw-article__img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 24px; background: var(--lw-tile); margin: 0 0 24px; }
.lw-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 0 0 24px; }
.lw-fact { background: var(--lw-card); border: 1px solid var(--lw-line); border-radius: 18px; padding: 12px 14px; }
.lw-fact dt { font-size: 0.8125rem; font-weight: 600; color: var(--lw-sub); }
.lw-fact dd { margin: 2px 0 0; font-weight: 700; }
.lw-breadcrumb { font-size: 0.9375rem; color: var(--lw-sub); margin: 0 0 12px; }
.lw-breadcrumb a { color: var(--lw-sub); }

/* ---------- Notes, ads, footer ---------- */
.lw-note {
  display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-radius: 20px;
  background: var(--lw-tile); color: var(--lw-ink); font-size: 0.9375rem; text-align: left; margin: 0;
}
.lw-note .lw-icon { margin-top: 2px; }

/* Ads sit directly in the page flow: no box, padding or rounded clipping, because AdSense
   sizes them on the fly. Only a small label above marks them. */
.lw-ad { display: block; width: 100%; max-width: 100%; clear: both; }
.lw-ad:not(:empty) { margin: 28px 0; }
.lw-ad:not(:empty)::before {
  content: attr(data-label); display: block; margin-bottom: 6px; color: var(--lw-sub);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; text-align: center;
}
.lw-ad:not([data-label]):not(:empty)::before { content: none; }
.lw-rail .lw-ad:not(:empty) { margin-top: 0; }
/* AdSense marks slots it cannot fill; collapse them instead of leaving an empty box. */
.lw-ad:has(ins.adsbygoogle[data-ad-status="unfilled"]) { display: none; }

/* Footer: one compact row on larger screens. On phones the tab bar and the More sheet already
   hold every link, so only the copyright and the privacy policy stay. */
.lw-footer { border-top: 1px solid var(--lw-line); background: var(--lw-card); }
.lw-footer__inner { max-width: 1160px; margin: 0 auto; padding: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; }
.lw-footer__brand { margin-right: auto; font-size: 1rem; }
.lw-footer__links { display: flex; flex-wrap: wrap; gap: 0 20px; }
.lw-footer__links a { color: var(--lw-sub); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; font-size: 0.9375rem; overflow-wrap: anywhere; }
.lw-footer__links a:hover { color: var(--lw-ink); text-decoration: underline; }
.lw-footer__legal { flex-basis: 100%; margin: 0; font-size: 0.8125rem; color: var(--lw-sub); }
@media (max-width: 767.98px) {
  .lw-footer { background: transparent; border-top: 0; }
  .lw-footer__inner { justify-content: center; padding: 4px 20px 12px; gap: 0 6px; }
  .lw-footer__brand, .lw-footer__links .lw-footer__extra { display: none; }
  .lw-footer__legal { flex-basis: auto; order: -1; }
  .lw-footer__legal::after { content: " ·"; }
  .lw-footer__links a { font-size: 0.8125rem; }
}

/* ---------- Bootstrap overlays ---------- */
.modal-content {
  --bs-modal-bg: var(--lw-card);
  --bs-modal-color: var(--lw-ink);
  --bs-modal-border-color: var(--lw-line);
  border-radius: var(--lw-r-card);
}
.modal-header, .modal-footer { border-color: var(--lw-line); }
.toast {
  --bs-toast-bg: var(--lw-ink);
  --bs-toast-color: var(--lw-page);
  --bs-toast-border-color: transparent;
  border-radius: 16px;
}
.toast .toast-body { color: var(--lw-page); font-weight: 600; }
.lw-saved-item { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lw-saved-item strong { min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lw-totop {
  position: fixed; right: 16px; bottom: calc(var(--lw-tabbar-space) + 16px); z-index: 1025;
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--lw-line);
  background: var(--lw-card); color: var(--lw-ink); box-shadow: var(--lw-shadow);
  display: none; align-items: center; justify-content: center; cursor: pointer;
}

/* PDF export always renders the light palette, whatever the screen appearance. */
.lw-export {
  --lw-card: #FFFFFF; --lw-tile: #EFEDE6; --lw-ink: #0E2236; --lw-sub: #4E5A6B; --lw-line: #E3E1DA;
  --lw-accent-text: #B5380F; --lw-page: #F6F5F1;
  --bs-table-bg: #FFFFFF; --bs-table-color: #0E2236; --bs-table-striped-bg: #EFEDE6; --bs-table-striped-color: #0E2236;
  --bs-table-border-color: #E3E1DA;
  background: #FFFFFF !important; color: #0E2236 !important;
}
.lw-export h1, .lw-export h2, .lw-export h3, .lw-export h4 { color: #0E2236; }

/* ---------- Preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .lw-card:hover, .lw-read:hover { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .lw-header, .lw-tabbar { background: var(--lw-card); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --lw-line: #4E5A6B; --lw-sub: #2F3A48; }
  .lw-header, .lw-tabbar { background: var(--lw-card); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root { --lw-line: #A9B4C2; --lw-sub: #D3DAE3; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .lw-header, .lw-tabbar { background: var(--lw-card); }
}
@media print {
  .lw-header, .lw-tabbar, .lw-footer, .lw-rail, .lw-ad, .lw-totop, #newButtons { display: none !important; }
  body { background: #fff; color: #000; padding: 0; }
}

/* An excluded food still appears in the answer */
.lw-s-warning { border: 1px solid var(--lw-danger); color: var(--lw-danger); border-radius: var(--lw-r-tile); padding: 12px 16px; font-weight: 600; }

/* ---------- Diet: one day at a time, dishes written once ---------- */
.lw-s-daytabs { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.lw-s-daytab { display: grid; gap: 2px; justify-items: center; min-height: 52px; padding: 8px 2px; border-radius: 14px; border: 1px solid var(--lw-line);
  background: var(--lw-card); color: var(--lw-ink); font: inherit; cursor: pointer; }
.lw-s-daytab strong { font-size: 0.875rem; }
.lw-s-daytab span { font-size: 0.6875rem; color: var(--lw-sub); font-variant-numeric: tabular-nums; }
.lw-s-daytab[aria-selected="true"] { background: var(--lw-ink); border-color: var(--lw-ink); color: var(--lw-page); }
.lw-s-daytab[aria-selected="true"] span { color: inherit; opacity: 0.8; }
.lw-s-daytab:focus-visible { outline: 3px solid var(--lw-accent); outline-offset: 2px; }
/* Every day stays in the page (the PDF reads them all); only the chosen one is shown. */
.lw-s-dietday:not(.is-current) { display: none; }
.lw-s-dishes { display: grid; }
.lw-s-dish { border-bottom: 1px solid var(--lw-line); }
.lw-s-dish:last-child { border-bottom: 0; }
.lw-s-dish > summary { display: grid; grid-template-columns: 1fr auto 16px; grid-template-areas: "meal kcal chevron" "name kcal chevron"; align-items: center; gap: 2px 12px;
  min-height: 56px; padding: 10px 0; list-style: none; cursor: pointer; }
.lw-s-dish > summary::-webkit-details-marker { display: none; }
.lw-s-dish > summary::after { content: ""; grid-area: chevron; width: 8px; height: 8px; border-right: 2px solid var(--lw-sub); border-bottom: 2px solid var(--lw-sub); transform: rotate(45deg); justify-self: center; }
.lw-s-dish[open] > summary::after { transform: rotate(-135deg); }
.lw-s-dish > summary:focus-visible { outline: 3px solid var(--lw-accent); outline-offset: 2px; border-radius: 8px; }
.lw-s-dish__meal { grid-area: meal; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--lw-sub); }
.lw-s-dish__name { grid-area: name; font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.lw-s-dish__kcal { grid-area: kcal; font-size: 0.875rem; color: var(--lw-sub); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lw-s-dish__body { display: grid; gap: 10px; padding: 0 0 14px; }
.lw-s-dish__prep { margin: 0; font-size: 0.9375rem; }
.lw-s-tag { display: inline-flex; padding: 1px 8px; border-radius: 999px; background: var(--lw-tile); color: var(--lw-sub); font-size: 0.75rem; font-weight: 700; }
.lw-s-weektable { display: none; }
@media (min-width: 900px) {
  .lw-s-weektable { display: grid; }
  .lw-s-weektable__scroll { overflow-x: auto; }
  .lw-s-weektable table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; table-layout: fixed; }
  .lw-s-weektable th, .lw-s-weektable td { padding: 8px 6px; border-bottom: 1px solid var(--lw-line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
  .lw-s-weektable thead th { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--lw-sub); }
  .lw-s-weektable tbody th { width: 7.5rem; color: var(--lw-sub); font-weight: 600; }
}
.lw-s-shopping > summary { display: flex; align-items: center; gap: 12px; list-style: none; cursor: pointer; min-height: 44px; }
.lw-s-shopping > summary::-webkit-details-marker { display: none; }
.lw-s-shopping > summary h3 { margin: 0 auto 0 0; }
.lw-s-shopping > summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--lw-sub); border-bottom: 2px solid var(--lw-sub); transform: rotate(45deg); }
.lw-s-shopping[open] > summary::after { transform: rotate(-135deg); }
.lw-s-shopping > summary:focus-visible { outline: 3px solid var(--lw-accent); outline-offset: 4px; border-radius: 8px; }
.lw-s-shopping:not([open]) { gap: 0; }

/* Trip budget: say how far over or under, not a percentage. */
.lw-s-fit { margin: 0; font-weight: 600; opacity: 0.9; }
.lw-s-fit.is-over { color: #FFB08F; }

/* Amounts line up in one column across all rows of a list. */
.lw-s-amounts { grid-template-columns: max-content 1fr; column-gap: 14px; }
.lw-s-amounts li { grid-column: 1 / -1; grid-template-columns: subgrid; }

/* Tips are information, not a warning: neutral colours. */
.lw-s-tips { background: var(--lw-tile); color: var(--lw-ink); }
.lw-s-tips .lw-s-label { color: var(--lw-sub); }

/* Fitness: the focus always sits on its own line under the day name. */
.lw-s-day__head > .lw-s-sub { order: 3; flex-basis: 100%; }
@media (max-width: 599.98px) {
  .lw-s-week a.is-rest span { font-size: 0; }
  .lw-s-week a.is-rest span::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; border: 1.5px solid currentColor; }
}
@media (prefers-color-scheme: dark) { .lw-s-fit.is-over { color: #9A2F0C; } }

/* Outfit pieces: the badge sits under the name, so names get the full width. */
.lw-s-pieces { grid-template-columns: 1fr; gap: 14px; }
.lw-s-pieces li { display: grid; justify-items: start; gap: 4px; }
.lw-s-pieces .lw-s-badge { margin-top: 0; }
.lw-s-colors { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.lw-s-colors li { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9375rem; }
.lw-s-colors__dot { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); flex: none; }

/* Request bar: PDF, share and save sit with the request, above long answers. */
.lw-request__tools { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.lw-request__tool { min-height: 44px; padding: 0 12px; gap: 6px; font-size: 0.875rem; }
.lw-request__tool[hidden] { display: none; }

/* End-of-answer buttons size to their labels instead of a fixed two-column grid. */
.lw-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.lw-actions .lw-btn { flex: 1 1 auto; min-width: max-content; }

/* Once an answer is on the page, the page title steps back so the answer starts higher. */
.lw-main:has(#answer[data-format="json"]) .lw-page-head h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); }
.lw-main:has(#answer[data-format="json"]) .lw-page-head .lw-lead { display: none; }
.lw-main:has(#answer[data-format="json"]) .lw-page-head { padding-bottom: 12px; }
/* Request bar: title and "Edit" share the first row, so the chips get the full width below. */
.lw-request__title { flex: 1 1 auto; flex-basis: auto; order: 0; }
.lw-request__edit { order: 1; min-height: 44px; }
.lw-request__values { order: 2; flex: 1 1 100%; }
.lw-request__tools { order: 3; }
/* Number fields keep room for at least three digits next to their unit. */
.lw-form .input-group > .form-control[type="number"] { min-width: 4.5rem; }
