/* Shared styles for the host and guest pages.
   Colours, type and layout come from the Iteration 2 prototype (apps/prototype). */

:root{
  --ground:#EEF1EC;
  --surface:#FBFCFA;
  --surface-2:#F4F6F1;
  --ink:#1B2620;
  --ink-2:#3B4A42;
  --muted:#63736A;
  --line:#D5DCD2;
  --line-strong:#BEC8BA;
  --accent:#8E2A55;
  --accent-ink:#FFFFFF;
  --accent-soft:#F6E6EC;
  --amber:#9C6410;
  --amber-soft:#F8EEDC;
  --red:#B3261E;
  --red-soft:#FBE9E7;
  --good:#256B4D;
  --good-soft:#E2EFE8;
  --heat-1:#E7EDE6;
  --heat-2:#D3E4DA;
  --heat-3:#B4D6C6;
  --heat-4:#8FC5AE;
  --shadow:0 1px 2px rgba(27,38,32,.07), 0 8px 24px -14px rgba(27,38,32,.35);
  --radius:14px;
  --maxw:560px;
  color-scheme:light;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --ground:#111613;
    --surface:#1A211C;
    --surface-2:#212a24;
    --ink:#E7EDE7;
    --ink-2:#C2CCC5;
    --muted:#8E9E95;
    --line:#2B342E;
    --line-strong:#3C4840;
    --accent:#E883A8;
    --accent-ink:#22101a;
    --accent-soft:#341F28;
    --amber:#E0A64F;
    --amber-soft:#2C2418;
    --red:#F2867D;
    --red-soft:#3A1D1B;
    --good:#63C398;
    --good-soft:#17291F;
    --heat-1:#1E2621;
    --heat-2:#22362C;
    --heat-3:#274538;
    --heat-4:#2E5744;
    --shadow:0 1px 2px rgba(0,0,0,.5), 0 10px 28px -16px rgba(0,0,0,.9);
    color-scheme:dark;
  }
}

*{box-sizing:border-box}
[hidden]{display:none!important}
img{max-width:100%}
body{
  margin:0;
  background:var(--ground);
  color:var(--ink);
  font-family:"Public Sans","Helvetica Neue",Helvetica,Arial,sans-serif;
  font-size:16px;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3{font-family:"Bricolage Grotesque","Public Sans",sans-serif;font-weight:700;margin:0;text-wrap:balance;letter-spacing:-.015em}
p{margin:0}
a{color:var(--accent)}
button{font:inherit;color:inherit;cursor:pointer}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:6px}
.mono{font-family:"IBM Plex Mono",ui-monospace,SFMono-Regular,Menlo,monospace;font-variant-numeric:tabular-nums}

/* ---------- chrome ---------- */
.wrap{max-width:var(--maxw);margin:0 auto;padding:0 16px 96px}
.wrap.wide{max-width:1040px}
.chatbar{background:var(--surface-2);border-bottom:1px solid var(--line);padding:8px 16px}
.chatbar-inner{max-width:var(--maxw);margin:0 auto;display:flex;align-items:center;gap:8px;
  font-size:12.5px;color:var(--muted);letter-spacing:.04em;text-transform:uppercase}
.chatbar-inner.wide{max-width:1040px}
.chatbar-inner .dot{width:6px;height:6px;border-radius:50%;background:var(--accent);flex:none}
.chatbar-inner .grow{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chatbar-inner .btn.quiet{text-transform:none;letter-spacing:0;font-size:13px;padding:0}

.rail{position:sticky;top:0;z-index:5;background:var(--ground);border-bottom:1px solid var(--line)}
.rail-inner{max-width:var(--maxw);margin:0 auto;padding:10px 16px;display:flex;gap:4px}
.rail-inner.wide{max-width:1040px}
.rail-step{
  flex:1;display:flex;flex-direction:column;gap:5px;
  font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);
  background:none;border:0;padding:0;text-align:left;
}
.rail-step .bar{height:3px;border-radius:2px;background:var(--line-strong)}
.rail-step[data-state="done"] .bar,.rail-step[data-state="now"] .bar{background:var(--accent)}
.rail-step[data-state="now"]{color:var(--accent);font-weight:600}
.rail-step[data-state="todo"] .bar{background:var(--line-strong);opacity:.55}
.rail-step[disabled]{cursor:default}

/* ---------- blocks ---------- */
.step{padding-top:24px;display:flex;flex-direction:column;gap:18px}
.eyebrow{font-size:11.5px;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);font-weight:600}
h1{font-size:clamp(28px,7vw,36px);line-height:1.08}
h2{font-size:20px;line-height:1.2}
.lede{color:var(--ink-2);font-size:16.5px;max-width:44ch}
.small{font-size:13.5px;color:var(--muted)}
.card{
  background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);
  padding:16px;display:flex;flex-direction:column;gap:12px;
}
.invite{padding:0;overflow:hidden;box-shadow:var(--shadow)}
.invite-top{padding:18px 18px 16px;display:flex;flex-direction:column;gap:6px;
  background:linear-gradient(180deg,var(--accent-soft),transparent)}
.invite-body{padding:0 18px 18px;display:flex;flex-direction:column;gap:14px}
.kv{display:flex;gap:10px;align-items:baseline}
.kv .k{flex:none;width:74px;font-size:12px;text-transform:uppercase;letter-spacing:.07em;color:var(--muted)}
.kv .v{font-size:15.5px;min-width:0;overflow-wrap:anywhere}

.faces{display:flex;gap:6px;flex-wrap:wrap}
.face{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--line);
  border-radius:999px;padding:3px 10px 3px 4px;font-size:13px;background:var(--surface-2)}
.face .av{width:22px;height:22px;border-radius:50%;display:grid;place-items:center;
  font-size:11px;font-weight:600;color:#fff;background:var(--accent);flex:none;font-family:"IBM Plex Mono",monospace}

label.field{display:flex;flex-direction:column;gap:6px}
label.field > span{font-size:12px;letter-spacing:.07em;text-transform:uppercase;color:var(--muted);font-weight:600}
input[type="text"],input[type="email"],input[type="password"],input[type="date"],input[type="time"],input[type="url"],select,textarea{
  font:inherit;color:var(--ink);background:var(--surface-2);
  border:1px solid var(--line-strong);border-radius:10px;padding:11px 12px;width:100%;
}
input::placeholder,textarea::placeholder{color:var(--muted);opacity:.8}
textarea{resize:vertical;min-height:64px}
.hint{font-size:12.5px;color:var(--muted)}
.hint.bad{color:var(--accent)}

.btn{border:1px solid transparent;border-radius:11px;padding:13px 18px;font-weight:600;text-decoration:none;
  background:var(--accent);color:var(--accent-ink);display:inline-flex;align-items:center;justify-content:center;gap:8px}
.btn:disabled{opacity:.45;cursor:not-allowed}
.btn.ghost{background:transparent;color:var(--ink);border-color:var(--line-strong)}
.btn.quiet{background:transparent;color:var(--muted);border:0;padding:8px 0;font-weight:500;
  text-decoration:underline;text-underline-offset:3px}
.btn.block{width:100%}
.actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}

/* ---------- availability grid ---------- */
.weekpick{display:flex;gap:6px;flex-wrap:wrap}
.weekpick button{flex:1;border:1px solid var(--line-strong);background:var(--surface-2);
  border-radius:10px;padding:9px 6px;font-size:13.5px;font-weight:500;min-width:90px}
.weekpick button[aria-pressed="true"]{background:var(--ink);color:var(--ground);border-color:var(--ink)}
.cal{display:flex;flex-direction:column;gap:6px}
.dayrow{display:grid;grid-template-columns:62px repeat(var(--cols,3),1fr);gap:6px;align-items:stretch}
.daylab{display:flex;flex-direction:column;justify-content:center;line-height:1.15}
.daylab b{font-size:14px;font-weight:600}
.daylab span{font-size:11.5px;color:var(--muted)}
.dayrow.weekend .daylab b{color:var(--accent)}
.slot{
  border:1px solid var(--line);border-radius:10px;padding:8px 4px;
  display:flex;flex-direction:column;align-items:center;gap:3px;
  background:var(--heat-1);font-size:11px;color:var(--ink-2);min-height:52px;justify-content:center;
}
.slot[data-n="1"]{background:var(--heat-2)}
.slot[data-n="2"]{background:var(--heat-3)}
.slot[data-n="3"]{background:var(--heat-3)}
.slot[data-n="4"]{background:var(--heat-4)}
.slot .n{font-family:"IBM Plex Mono",monospace;font-size:13px;font-weight:600;color:var(--ink)}
.slot .lab{font-size:10px;letter-spacing:.04em;text-transform:uppercase;opacity:.8;text-align:center}
.slot[aria-pressed="true"]{border:2px solid var(--accent);box-shadow:inset 0 0 0 2px var(--surface)}
.slot[aria-pressed="true"] .lab{color:var(--accent);font-weight:700;opacity:1}
.legend{display:flex;gap:12px;flex-wrap:wrap;font-size:12px;color:var(--muted);align-items:center}
.legend i{width:14px;height:14px;border-radius:4px;display:inline-block;vertical-align:-2px;margin-right:5px;border:1px solid var(--line)}
.legend i.h1{background:var(--heat-1)}
.legend i.h3{background:var(--heat-3)}
.legend i.h4{background:var(--heat-4)}
.legend i.you{border:2px solid var(--accent);background:transparent}

.overlap{display:flex;flex-direction:column;gap:8px}
.olrow{display:flex;align-items:center;gap:10px;padding:9px 12px;border:1px solid var(--line);
  border-radius:11px;background:var(--surface);flex-wrap:wrap}
.olrow.top{border-color:var(--accent);background:var(--accent-soft)}
.olrow .when{flex:1;font-size:14.5px;min-width:0}
.olrow .when b{font-weight:600}
.olrow .cnt{font-size:13px;color:var(--muted);white-space:nowrap}
.olrow .cnt b{color:var(--ink)}
.olrow .who{flex-basis:100%;font-size:12.5px;color:var(--muted)}

/* ---------- pickers ---------- */
.tags{display:flex;flex-wrap:wrap;gap:8px}
.tag{border:1px solid var(--line-strong);background:var(--surface-2);border-radius:999px;padding:9px 14px;font-size:14px}
.tag[aria-pressed="true"]{background:var(--accent);border-color:var(--accent);color:var(--accent-ink);font-weight:600}
.tag.sm{padding:6px 11px;font-size:13px}
.note{border-left:3px solid var(--accent);background:var(--accent-soft);padding:10px 12px;
  border-radius:0 10px 10px 0;font-size:14px;color:var(--ink-2)}
.note.warn{border-color:var(--amber);background:var(--amber-soft)}
.checks{display:flex;flex-wrap:wrap;gap:10px 14px;font-size:14px}
.checks label{display:flex;align-items:center;gap:7px}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:10px}

/* ---------- dishes ---------- */
.gapgrid{display:flex;flex-direction:column;gap:16px}
.cat{display:flex;flex-direction:column;gap:8px}
.cat-title{display:flex;align-items:center;gap:8px;font-size:11.5px;letter-spacing:.1em;
  text-transform:uppercase;color:var(--muted);font-weight:600}
.cat-title::after{content:"";flex:1;height:1px;background:var(--line)}
/* On the guest food step each state has its own signal, so they never compete:
   pick = solid card (the ones to choose from), taken = faded and dashed,
   mine = thick accent border and fill, clash = only the amber strip inside the row.
   The host page uses plain .dish and .dish.open. */
.dish{display:flex;align-items:center;gap:12px;padding:11px 13px;border:1px solid var(--line);
  border-radius:12px;background:var(--surface)}
.dish.open{border-style:dashed;background:transparent}
.dish.pick{border-color:var(--line-strong)}
.dish.taken{border-style:dashed;background:transparent}
.dish.taken .dish-main b{font-weight:500;color:var(--muted)}
.dish.mine{border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent);background:var(--accent-soft)}
.dish.mine .dish-sub{color:var(--accent);font-weight:600}
.dish-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.dish-main b{font-weight:600;font-size:15px;overflow-wrap:anywhere}
.dish-sub{font-size:12.5px;color:var(--muted)}
/* A dish someone else won't eat: a note, not a ban, so the button still works. Preferences are amber.
   The text stays in ink colour because amber text on amber-soft is under 4.5:1. */
.dish-clash{font-size:13px;line-height:1.4;color:var(--ink-2);margin-top:6px;padding:6px 9px;
  border-left:3px solid var(--amber);border-radius:0 8px 8px 0;background:var(--amber-soft)}
.dish-clash [aria-hidden]{color:var(--amber);font-weight:700}
/* An allergy: eating the dish could make someone ill, so red, with "Allergy:" in words too. */
.dish-clash.allergy{border-left-color:var(--red);background:var(--red-soft)}
.dish-clash.allergy [aria-hidden],.dish-clash.allergy b{color:var(--red);font-weight:700}
.mini{border:1px solid var(--line-strong);background:var(--surface-2);border-radius:9px;
  padding:7px 12px;font-size:13.5px;font-weight:600;flex:none}
.mini.on{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
/* Shown in place of "I'll bring it" when you already have a dish: swap is the main choice, bringing both is deliberate. */
.dish.choosing{border-color:var(--accent)}
.dish-choice{margin-top:8px;display:flex;flex-direction:column;gap:8px}
.dish-choice-btns{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.balance{display:flex;gap:8px;flex-wrap:wrap}
.balance-wrap{display:flex;flex-direction:column;gap:6px}
.pill{font-size:12.5px;padding:5px 11px;border-radius:999px;font-weight:600;
  background:var(--surface-2);border:1px solid var(--line);color:var(--ink-2)}
.pill.ok{background:var(--good-soft);border-color:transparent;color:var(--good)}
.pill.gap{background:var(--amber-soft);border-color:transparent;color:var(--amber)}
details.addown{border:1px dashed var(--line-strong);border-radius:12px}
details.addown summary{list-style:none;padding:12px 14px;font-weight:600;font-size:14.5px;cursor:pointer;color:var(--accent)}
details.addown summary::-webkit-details-marker{display:none}
details.addown[open] summary{border-bottom:1px solid var(--line)}
.addown-body{padding:14px;display:flex;flex-direction:column;gap:12px}
.stickybar{position:sticky;bottom:0;background:linear-gradient(180deg,transparent,var(--ground) 22%);
  padding-top:14px;display:flex;flex-direction:column;gap:8px}

/* ---------- plan ---------- */
.plan{display:grid;gap:14px}
@media (min-width:900px){.plan{grid-template-columns:minmax(260px,1fr) minmax(0,1.4fr);align-items:start}}
.panel{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);
  padding:16px;display:flex;flex-direction:column;gap:12px;min-width:0}
.panel-h{font-size:11.5px;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);font-weight:600}
.locked-when{display:flex;flex-direction:column;gap:2px}
.locked-when .big{font-family:"Bricolage Grotesque",sans-serif;font-size:26px;font-weight:800;line-height:1.05}
.locked-when .time{font-size:17px;color:var(--ink-2)}
.bring{display:flex;flex-direction:column}
.bring-row{display:flex;gap:12px;padding:10px 0;border-bottom:1px solid var(--line);align-items:baseline}
.bring-row:last-child{border-bottom:0}
.bring-row .who-n{flex:none;width:84px;font-size:12.5px;color:var(--muted);text-transform:uppercase;letter-spacing:.05em;overflow-wrap:anywhere}
.bring-row .what{flex:1;font-size:15px;min-width:0;overflow-wrap:anywhere}
.bring-row.mine .what{font-weight:600;color:var(--accent)}
/* Summary (task 9): each guest's dish with their confirmed status underneath. */
.guest-info{flex:1;min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:6px}
.bring-row.nodish .what{color:var(--muted)}
.rsvp{display:flex;flex-direction:column;gap:10px}
/* A labelled detail on the summary, e.g. "Location" then the address. */
.detail{display:flex;flex-direction:column;gap:4px}
.detail + .detail{border-top:1px solid var(--line);padding-top:12px}
.detail-label{font-size:12.5px;font-weight:600;color:var(--muted)}
/* Your answers on the summary (task 10): the answer, with a Change button beside it. */
.answer-row{display:flex;align-items:center;gap:12px}
.answer-row .detail{flex:1;min-width:0;overflow-wrap:anywhere}
.answer-row + .answer-row{border-top:1px solid var(--line);padding-top:12px}
.stepbtns{display:flex;flex-direction:column;align-items:center;gap:4px}
.stepbtns .btn.block{align-self:stretch}

/* ---------- host pages ---------- */
.list{display:flex;flex-direction:column;gap:10px}
.item{display:flex;gap:12px;align-items:center;padding:14px;border:1px solid var(--line);border-radius:12px;
  background:var(--surface);color:var(--ink);text-decoration:none}
.item:hover{border-color:var(--line-strong)}
.item .grow{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.item b{font-size:16px;overflow-wrap:anywhere}
.sharebox{display:flex;gap:8px;flex-wrap:wrap}
.sharebox input{flex:1;min-width:0}
.tabs{display:flex;gap:6px}
.tabs button{flex:1;border:1px solid var(--line-strong);background:var(--surface-2);border-radius:10px;padding:10px;font-weight:600}
.tabs button[aria-pressed="true"]{background:var(--ink);color:var(--ground);border-color:var(--ink)}
.tablewrap{overflow-x:auto}
table.grid{width:100%;border-collapse:collapse;font-size:14px}
table.grid th{text-align:left;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);
  font-weight:600;padding:0 10px 6px 0;border-bottom:1px solid var(--line);white-space:nowrap}
table.grid td{padding:8px 10px 8px 0;border-bottom:1px solid var(--line);vertical-align:top;overflow-wrap:anywhere}
.counts{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px}
.count{border:1px solid var(--line);border-radius:10px;padding:8px 10px;display:flex;flex-direction:column}
.count b{font-family:"IBM Plex Mono",monospace;font-size:18px}
.count span{font-size:12px;color:var(--muted)}

/* ---------- messages ---------- */
.toast{position:fixed;left:50%;bottom:20px;transform:translateX(-50%);z-index:30;max-width:calc(100% - 32px);
  background:var(--ink);color:var(--ground);padding:11px 16px;border-radius:11px;font-size:14.5px;box-shadow:var(--shadow)}
.center{min-height:50vh;display:grid;place-items:center;text-align:center}

@media (prefers-reduced-motion:no-preference){
  .step{animation:rise .28s ease both}
  .step.still{animation:none}
  @keyframes rise{from{opacity:.35;transform:translateY(6px)}to{opacity:1;transform:none}}
}
