@font-face {
  font-family: "Funnel Sans";
  src: url("/fonts/FunnelSans-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --black: #000000;
  --white: #ffffff;
  --charcoal: #333333;
  --oat: #faf4e9;
  --strawberry: #edb8c1;
  --blush: #f8e5e8;
  --blush-strong: #f2ccd3;
  --berry: #a65366;
  --neon: #dfff56;
  --cacao: #502f06;
  --blueberry: #b9dee7;
  --ink: var(--charcoal);
  --muted: #666666;
  --cream: var(--oat);
  --paper: var(--white);
  --forest: var(--black);
  --forest-2: var(--charcoal);
  --lime: var(--strawberry);
  --gold: var(--strawberry);
  --rose: var(--strawberry);
  --blue: var(--blush);
  --line: rgba(51, 51, 51, .18);
  --shadow: 0 24px 70px rgba(0, 0, 0, .12);
  --radius: 28px;
  --display: "Funnel Sans", "Helvetica Neue", Arial, sans-serif;
  --body: Futura, "Futura PT", "Helvetica Neue", Arial, sans-serif;
  --serif: var(--display);
  --sans: var(--body);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 0; background: var(--cream); color: var(--ink); font-family: var(--sans); line-height: 1.5; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
img { display: block; max-width: 100%; }

.skip-link { position: fixed; top: 10px; left: 10px; z-index: 100; padding: 10px 14px; border-radius: 10px; background: white; opacity: 0; pointer-events: none; transform: translateY(-160%); }
.skip-link:focus { opacity: 1; pointer-events: auto; transform: translateY(0); }
.site-header { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: 12px clamp(18px, 4vw, 64px); border-bottom: 1px solid var(--line); background: rgba(250,244,233,.96); color: var(--black); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand-logo { width: clamp(142px, 15vw, 190px); height: auto; }
.brand-section { padding-left: 14px; border-left: 1px solid var(--charcoal); color: var(--charcoal); font-size: .58rem; font-weight: 800; letter-spacing: .18em; white-space: nowrap; }
.site-header nav { display: flex; gap: 8px; }
.quiet-button, .text-button, .back-button { border: 0; background: transparent; cursor: pointer; }
.quiet-button { min-height: 42px; padding: 8px 12px; color: var(--charcoal); font-size: .83rem; }
.quiet-button:hover, .quiet-button:focus-visible { color: var(--black); text-decoration: underline; text-underline-offset: 5px; }

#app { min-height: calc(100vh - 76px); outline: none; }
.portal-hero, .tool-hero { overflow: hidden; position: relative; display: grid; align-items: center; gap: clamp(36px, 7vw, 100px); padding: clamp(64px, 9vw, 128px) clamp(20px, 7vw, 112px); }
.portal-hero { grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); min-height: 570px; color: var(--black); background: radial-gradient(circle at 78% 20%, rgba(250,244,233,.88), transparent 29%), linear-gradient(132deg, var(--strawberry) 0%, #f3ccd3 62%, var(--strawberry) 100%); }
.portal-hero::after, .tool-hero::after { content: ""; position: absolute; width: 340px; height: 340px; right: -160px; bottom: -180px; border: 1px solid rgba(0,0,0,.12); border-radius: 50%; box-shadow: 0 0 0 60px rgba(0,0,0,.035), 0 0 0 120px rgba(0,0,0,.022); }
.eyebrow { margin: 0 0 14px; color: var(--forest-2); font-size: .68rem; font-weight: 800; letter-spacing: .18em; }
.portal-hero .eyebrow, .tool-hero .eyebrow { color: var(--black); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 24px; font: 700 clamp(2.8rem, 6vw, 6rem)/.94 var(--serif); letter-spacing: -.045em; }
h1 em, h2 em { color: var(--black); font-style: normal; font-weight: 700; }
.portal-hero > div > p:last-child, .tool-hero > div > p:last-child { max-width: 680px; margin: 0; color: rgba(0,0,0,.72); font-size: clamp(1rem, 1.5vw, 1.25rem); }
.activation-note { display: flex; align-items: center; gap: 18px; padding: 28px; border: 1px solid rgba(0,0,0,.14); border-radius: var(--radius); background: rgba(250,244,233,.78); box-shadow: 0 28px 80px rgba(0,0,0,.13); backdrop-filter: blur(18px); }
.activation-note > span { display: grid; flex: 0 0 52px; height: 52px; place-items: center; border-radius: 50%; background: var(--black); color: var(--oat); font-weight: 900; }
.activation-note strong { display: block; font-family: var(--serif); font-size: 1.22rem; font-weight: 700; }
.activation-note p { margin: 5px 0 0; color: rgba(0,0,0,.62); font-size: .82rem; }

.portal-section { padding: clamp(64px, 9vw, 120px) clamp(18px, 6vw, 96px); }
.section-heading { max-width: 760px; margin-bottom: 34px; }
.section-heading h2, .panel h2, .calibration-banner h2 { margin-bottom: 10px; font: 700 clamp(2rem, 3.6vw, 3.7rem)/1 var(--serif); letter-spacing: -.035em; }
.entitlement-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.entitlement-card { display: flex; min-height: 390px; flex-direction: column; padding: clamp(24px, 3vw, 36px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: 0 8px 26px rgba(0,0,0,.06); }
.entitlement-card[data-status="read_only"] { background: var(--oat); }
.card-topline { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 28px; color: var(--forest-2); font-size: .67rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.card-topline span:last-child { color: var(--muted); }
.entitlement-card h2 { margin-bottom: 14px; font: 700 clamp(1.65rem, 2.5vw, 2.35rem)/1.03 var(--serif); }
.entitlement-card > p { min-height: 72px; color: var(--muted); }
.access-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: auto 0 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.access-dates div { display: grid; gap: 3px; }
.access-dates dt { color: var(--muted); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
.access-dates dd { margin: 0; font-weight: 700; }
.module-actions { display: grid; gap: 9px; }
.button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 16px; padding: 11px 18px; border: 1px solid transparent; border-radius: 999px; cursor: pointer; font-size: .84rem; font-weight: 800; text-decoration: none; transition: .2s ease; }
.button:hover:not(:disabled) { transform: translateY(-2px); }
.button.primary { background: var(--black); color: white; box-shadow: 0 12px 26px rgba(0,0,0,.17); }
.button.primary:hover:not(:disabled) { background: var(--charcoal); }
.button.secondary { border-color: var(--line); background: transparent; color: var(--forest); }
.button:disabled, button:disabled { cursor: not-allowed; opacity: .46; }
.button.wide { width: 100%; }
.privacy-strip { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 0 clamp(18px, 6vw, 96px) 80px; padding: 26px clamp(22px, 3vw, 38px); border-radius: 24px; background: var(--blue); }
.privacy-strip > div { display: flex; align-items: center; gap: 18px; }
.privacy-strip > div > span { font-size: 2rem; }
.privacy-strip strong { font-family: var(--serif); font-size: 1.25rem; font-weight: 700; }
.privacy-strip p { margin: 3px 0 0; color: var(--muted); }
.text-button { display: inline-flex; min-height: 44px; align-items: center; padding: 6px 0; color: var(--forest-2); font-size: .78rem; font-weight: 800; text-decoration: underline; text-underline-offset: 4px; }
.text-button.danger { color: #8a3934; }
.portal-footer { display: flex; justify-content: space-between; gap: 24px; padding: 34px clamp(18px, 6vw, 96px); background: var(--oat); color: var(--muted); font-size: .76rem; }
.portal-footer p { max-width: 780px; margin: 0; }

.scenario-banner { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 12px 18px; background: var(--gold); color: var(--charcoal); font-size: .78rem; }
.scenario-banner p { margin: 0; }
.scenario-banner a { margin-left: auto; font-weight: 800; }
.tool-titlebar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 76px; padding: 12px clamp(18px, 5vw, 80px); border-bottom: 1px solid var(--line); background: var(--paper); }
.back-button { justify-self: start; min-width: 44px; min-height: 44px; padding: 8px 0; color: var(--forest-2); font-weight: 800; }
.tool-titlebar > div:nth-child(2) { display: grid; text-align: center; letter-spacing: .12em; }
.tool-titlebar > div:nth-child(2) span { font-size: .72rem; font-weight: 900; }
.tool-titlebar > div:nth-child(2) small { color: var(--muted); font-size: .55rem; }
.tool-status { display: grid; justify-self: end; text-align: right; }
.tool-status span { color: var(--forest-2); font-size: .68rem; font-weight: 900; text-transform: uppercase; }
.tool-status small { color: var(--muted); font-size: .68rem; }
.tool-hero { grid-template-columns: minmax(0, 1.15fr) minmax(260px, .65fr); min-height: 470px; color: var(--black); background: radial-gradient(circle at 80% 24%, rgba(250,244,233,.82), transparent 29%), linear-gradient(132deg, var(--strawberry), #f3ccd3); }
.beauty-hero { background: radial-gradient(circle at 82% 30%, rgba(250,244,233,.9), transparent 30%), linear-gradient(135deg, var(--strawberry), var(--blush-strong)); }
.blend-hero { background: radial-gradient(circle at 78% 24%, rgba(250,244,233,.82), transparent 31%), linear-gradient(135deg, var(--strawberry), #f3ccd3); }
.hero-metric, .powder-card { position: relative; z-index: 1; padding: 34px; border: 1px solid rgba(0,0,0,.14); border-radius: var(--radius); background: rgba(250,244,233,.76); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.hero-metric > span, .powder-card > span { color: var(--black); font-size: .67rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.hero-metric strong { display: block; margin: 12px 0 4px; font: 700 clamp(4rem, 7vw, 6rem)/.9 var(--serif); }
.hero-metric strong small { font-size: 1.2rem; }
.hero-metric p, .powder-card p { margin: 0; color: rgba(0,0,0,.68); }
.powder-card h2 { margin: 10px 0 14px; color: var(--black); font: 700 clamp(2rem, 3vw, 3rem)/1 var(--serif); }
.powder-card small { display: block; margin-top: 16px; color: rgba(0,0,0,.6); }
.rhythm-ring { display: grid; width: min(290px, 70vw); aspect-ratio: 1; place-items: center; justify-self: center; border-radius: 50%; background: conic-gradient(var(--black) var(--progress), rgba(0,0,0,.13) 0); box-shadow: 0 30px 80px rgba(0,0,0,.14); }
.rhythm-ring::before { content: ""; position: absolute; width: calc(min(290px, 70vw) - 28px); aspect-ratio: 1; border-radius: 50%; background: var(--oat); }
.rhythm-ring span { z-index: 1; display: grid; text-align: center; }
.rhythm-ring strong { font: 700 4.6rem/.9 var(--serif); }
.rhythm-ring small { margin-top: 8px; color: rgba(0,0,0,.64); }
.access-banner { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 13px 20px; background: var(--strawberry); font-size: .8rem; }
.access-banner p { margin: 0; }

.tool-grid { display: grid; gap: 20px; padding: 20px clamp(18px, 5vw, 80px) 0; }
.tool-grid.two-one { grid-template-columns: minmax(0, 1.55fr) minmax(290px, .75fr); }
.tool-grid.one-two { grid-template-columns: minmax(270px, .7fr) minmax(0, 1.4fr); }
.panel { min-width: 0; padding: clamp(22px, 3vw, 36px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: 0 12px 40px rgba(0,0,0,.055); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.panel-heading h2 { margin-bottom: 0; font-size: clamp(1.8rem, 3vw, 2.8rem); }
.panel-heading > span { color: var(--muted); font-size: .72rem; font-weight: 800; }
.count-pill, .fit-badge { padding: 7px 11px; border-radius: 999px; background: var(--blue); color: var(--forest-2); font-size: .64rem; letter-spacing: .08em; text-transform: uppercase; }
.source-list { display: grid; gap: 8px; }
.source-row { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: var(--oat); }
.source-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.source-row div { display: grid; }
.source-row small { color: var(--muted); }
.source-row b { color: var(--forest-2); }
.source-remove { display: grid; width: 44px; height: 44px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.source-remove:hover:not(:disabled), .source-remove:focus-visible { border-color: #8a3934; color: #8a3934; }
form label, .blend-controls > label { display: grid; gap: 7px; color: var(--muted); font-size: .72rem; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; outline: none; background: white; color: var(--ink); }
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--berry); box-shadow: 0 0 0 3px rgba(237,184,193,.58); }
input[type="range"], input[type="checkbox"], input[type="radio"] { accent-color: var(--berry); }
.inline-form { display: grid; grid-template-columns: 1.3fr .7fr .8fr auto; align-items: end; gap: 10px; margin-top: 18px; }
.quick-log form, .checkin-panel form, .blend-controls { display: grid; gap: 14px; }
.quick-log > p, .ingredient-note p, .microcopy { color: var(--muted); }
.protocol-bars { display: flex; height: 190px; align-items: end; gap: 3px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.protocol-bars i { flex: 1; min-width: 2px; height: var(--height); border-radius: 4px 4px 0 0; background: var(--blush-strong); transition: .2s; }
.protocol-bars i.current { background: var(--berry); box-shadow: 0 0 0 2px var(--strawberry); }
.adjustments { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 20px; }
.adjustments p { max-width: 420px; margin: 0; color: var(--muted); }
.adjustments > div { display: flex; flex-wrap: wrap; gap: 8px; }
.history-panel ol { display: grid; gap: 10px; padding: 0; list-style: none; }
.history-panel li { display: grid; gap: 3px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.history-panel li span { color: var(--muted); font-size: .68rem; }
.safety-note { margin: 20px clamp(18px, 5vw, 80px) 70px; padding: 24px clamp(22px, 3vw, 34px); border-left: 4px solid var(--gold); border-radius: 0 18px 18px 0; background: var(--oat); }
.safety-note strong { font-family: var(--serif); font-size: 1.22rem; }
.safety-note p { margin: 6px 0 0; color: var(--muted); }

.daily-focus-banner { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr); gap: 28px; margin: 20px clamp(18px, 5vw, 80px) 0; padding: clamp(26px, 4vw, 44px); border-radius: var(--radius); background: var(--blue); }
.daily-focus-banner h2 { margin-bottom: 10px; font: 400 clamp(2rem, 3.6vw, 3.7rem)/1 var(--serif); letter-spacing: -.035em; }
.daily-focus-banner > div > p:last-child, .daily-focus-banner aside p { margin: 0; color: var(--muted); }
.daily-focus-banner aside { align-self: stretch; padding: 22px; border-radius: 20px; background: rgba(255,255,255,.56); }
.daily-focus-banner aside span { display: block; margin-bottom: 10px; color: var(--forest-2); font-size: .68rem; font-weight: 900; letter-spacing: .12em; }
.calibration-banner { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin: 20px clamp(18px, 5vw, 80px) 0; padding: clamp(26px, 4vw, 44px); border-radius: var(--radius); background: var(--rose); }
.calibration-banner h2 { font-size: clamp(1.8rem, 3vw, 3rem); }
.calibration-banner p:last-child { max-width: 720px; margin: 0; color: var(--charcoal); }
.switch { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .72rem; font-weight: 800; }
.switch input { width: 42px; min-height: 22px; accent-color: var(--berry); }
.checkin-panel output { float: right; min-width: 24px; color: var(--forest-2); font-weight: 900; text-align: right; }
.ritual-list { display: grid; gap: 10px; }
.ritual-action { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; width: 100%; padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: white; text-align: left; cursor: pointer; }
.ritual-action.done { border-color: rgba(166,83,102,.34); background: var(--blush); }
.ritual-action .check { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: white; }
.ritual-action.done .check { border-color: var(--berry); background: var(--berry); }
.ritual-action > span:nth-child(2) { display: grid; }
.ritual-action small { color: var(--muted); }
.ritual-action em { color: var(--forest-2); font-size: .7rem; font-style: normal; font-weight: 800; }
.history-bars { display: flex; height: 190px; align-items: end; gap: 10px; }
.history-bars > div { display: grid; flex: 1; height: 100%; grid-template-rows: 1fr auto auto; align-items: end; text-align: center; }
.history-bars i { width: 100%; height: var(--height); border-radius: 8px 8px 0 0; background: linear-gradient(var(--strawberry), var(--berry)); }
.history-bars span, .history-bars small { color: var(--muted); font-size: .62rem; }
.photo-vault { margin: 20px clamp(18px, 5vw, 80px) 0; }
.file-button { position: relative; overflow: hidden; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-grid, .saved-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.photo-grid article { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--oat); }
.photo-grid img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.photo-grid article > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; }
.photo-grid article > div:nth-child(2) { display: grid; }
.photo-grid small { color: var(--muted); }

.blend-controls fieldset { display: grid; gap: 7px; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 16px; }
.blend-controls legend { padding: 0 6px; color: var(--muted); font-size: .72rem; font-weight: 800; }
.check-row { display: flex; align-items: center; gap: 9px; text-transform: capitalize; }
.check-row input { width: 18px; min-height: 18px; accent-color: var(--berry); }
.pantry-picker { max-height: 250px; overflow: auto; overscroll-behavior: contain; }
.recipe-stage { min-height: 540px; }
.recipe-empty { display: grid; height: 100%; min-height: 460px; place-content: center; justify-items: center; padding: 40px; text-align: center; }
.recipe-empty > span { display: grid; width: 74px; height: 74px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--gold); font-size: 2.8rem; }
.recipe-empty h2 { max-width: 560px; }
.recipe-empty p:last-child { max-width: 580px; color: var(--muted); }
.recipe-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.recipe-head h2 { margin-bottom: 8px; }
.recipe-head p { color: var(--muted); }
.recipe-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; padding-top: 25px; }
.recipe-layout h3 { font: 400 1.5rem var(--serif); }
.ingredient-lines, .steps { display: grid; gap: 10px; padding: 0; list-style: none; }
.ingredient-lines li { display: flex; justify-content: space-between; gap: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.ingredient-lines strong { color: var(--forest-2); }
.steps { counter-reset: step; }
.steps li { position: relative; padding-left: 32px; color: var(--muted); }
.steps li::before { position: absolute; left: 0; content: counter(step); counter-increment: step; display: grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; background: var(--blue); color: var(--forest-2); font-size: .65rem; font-weight: 900; }
.allergen-line { padding: 12px; border-radius: 12px; background: var(--oat); font-size: .76rem; }
.recipe-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.recipe-actions > div { display: flex; align-items: center; gap: 5px; }
.recipe-actions > div span { margin-right: 5px; color: var(--muted); font-size: .72rem; }
.recipe-actions > div button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: white; cursor: pointer; }
.gate-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 20px clamp(18px, 5vw, 80px) 0; }
.gate-card { padding: 26px; border: 1px solid var(--line); border-radius: 22px; background: var(--oat); }
.gate-card.available { background: var(--paper); }
.gate-card > span { color: var(--gold); font: 400 2.2rem var(--serif); }
.gate-card h3 { margin: 10px 0; font: 400 1.5rem var(--serif); }
.gate-card p { color: var(--muted); }
.gate-card label { display: grid; gap: 7px; margin-bottom: 10px; color: var(--muted); font-size: .72rem; font-weight: 700; }
.rescue-result { display: block; margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--blue); color: var(--muted); line-height: 1.45; }
.rescue-result strong { color: var(--forest-2); }
.rotation, .saved-recipes { margin: 20px clamp(18px, 5vw, 80px) 0; }
.rotation > div:last-child { display: grid; gap: 8px; }
.rotation article { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--oat); }
.rotation article > span { color: var(--forest-2); font-size: .7rem; font-weight: 900; }
.rotation article div { display: grid; }
.rotation small { color: var(--muted); }
.saved-grid article { padding: 18px; border-radius: 18px; background: var(--oat); }
.saved-grid article > span { color: var(--forest-2); font-size: .65rem; font-weight: 900; text-transform: uppercase; }
.saved-grid h3 { margin: 8px 0; font: 400 1.3rem var(--serif); }
.saved-grid p { margin: 0; color: var(--muted); font-size: .75rem; }
.empty-state { display: grid; justify-items: center; padding: 38px 20px; text-align: center; }
.empty-state > span { color: var(--gold); font-size: 2.4rem; }
.empty-state strong { font: 400 1.45rem var(--serif); }
.empty-state p { margin: 5px 0 0; color: var(--muted); }

.loading-card, .signed-out { display: grid; min-height: calc(100vh - 76px); place-content: center; justify-items: center; padding: 40px 20px; text-align: center; }
.loading-card span { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--forest); border-radius: 50%; animation: spin 1s linear infinite; }
.signed-out > span { display: grid; width: 70px; height: 70px; place-items: center; margin-bottom: 20px; border-radius: 50%; background: var(--forest); color: var(--lime); font-size: 1.8rem; }
.signed-out h1 { margin-bottom: 14px; font-size: clamp(2.8rem, 6vw, 5.5rem); }
.signed-out p:not(.eyebrow) { max-width: 560px; color: var(--muted); }
.signed-out.error > span { background: #7d3b36; color: white; }
.toast { position: fixed; z-index: 60; right: 20px; bottom: 20px; max-width: min(420px, calc(100vw - 40px)); padding: 14px 18px; border-radius: 14px; background: var(--black); color: white; box-shadow: var(--shadow); opacity: 0; transform: translateY(20px); pointer-events: none; transition: .2s; }
.toast.visible { opacity: 1; transform: translateY(0); }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .entitlement-grid { grid-template-columns: 1fr 1fr; }
  .entitlement-card:last-child { grid-column: 1 / -1; min-height: 330px; }
  .tool-grid.two-one, .tool-grid.one-two { grid-template-columns: 1fr; }
  .quick-log, .ingredient-note { order: -1; }
  .gate-grid { grid-template-columns: 1fr 1fr; }
  .gate-card:last-child { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .site-header { min-height: 68px; }
  .quiet-button:first-child { display: none; }
  .portal-hero, .tool-hero { grid-template-columns: 1fr; min-height: auto; padding-top: 68px; padding-bottom: 72px; }
  .portal-hero h1, .tool-hero h1 { font-size: clamp(3rem, 14vw, 4.8rem); }
  .activation-note { padding: 21px; }
  .entitlement-grid { grid-template-columns: 1fr; }
  .entitlement-card, .entitlement-card:last-child { grid-column: auto; min-height: 360px; }
  .privacy-strip, .portal-footer, .scenario-banner, .access-banner, .calibration-banner { align-items: flex-start; flex-direction: column; }
  .daily-focus-banner { grid-template-columns: 1fr; }
  .privacy-strip .text-button { align-self: flex-start; }
  .scenario-banner a { margin-left: 0; }
  .tool-titlebar { grid-template-columns: auto 1fr auto; }
  .back-button span { display: none; }
  .tool-titlebar > div:nth-child(2) { text-align: left; }
  .tool-status small { display: none; }
  .inline-form { grid-template-columns: 1fr 1fr; }
  .inline-form label:first-child { grid-column: 1 / -1; }
  .inline-form button { grid-column: 1 / -1; }
  .adjustments, .panel-heading, .recipe-head, .recipe-actions { align-items: flex-start; flex-direction: column; }
  .adjustments { display: flex; }
  .adjustments > div { width: 100%; }
  .adjustments .button { flex: 1; }
  .photo-grid, .saved-grid, .gate-grid { grid-template-columns: 1fr; }
  .gate-card:last-child { grid-column: auto; }
  .recipe-layout { grid-template-columns: 1fr; }
  .recipe-actions > div { flex-wrap: wrap; }
  .calibration-banner .button { width: 100%; }
  .rhythm-ring { justify-self: start; }
}

@media (max-width: 430px) {
  .brand-logo { width: 136px; }
  .brand-section { display: none; }
  .portal-section { padding-left: 14px; padding-right: 14px; }
  .portal-hero, .tool-hero { padding-left: 18px; padding-right: 18px; }
  .entitlement-card, .panel { padding: 22px 18px; border-radius: 22px; }
  .tool-grid { padding-left: 12px; padding-right: 12px; }
  .photo-vault, .rotation, .saved-recipes, .safety-note, .calibration-banner, .daily-focus-banner { margin-left: 12px; margin-right: 12px; }
  .access-dates { grid-template-columns: 1fr; }
  .ritual-action { grid-template-columns: auto 1fr; }
  .ritual-action em { grid-column: 2; }
  .inline-form { grid-template-columns: 1fr; }
  .inline-form label:first-child, .inline-form button { grid-column: auto; }
  .protocol-bars { gap: 2px; }
  .adjustments > div { display: grid; grid-template-columns: 1fr; }
  .history-bars { gap: 5px; }
  .photo-vault .panel-heading .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
