/* Host area: the guest app's shell (app.css) with three tabs, lists instead of tables, and sheets for every edit. */

/* ---------- Sign in ---------- */
.login{position:fixed;inset:0;display:grid;place-items:center;padding:24px max(20px,env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom,0px)) max(20px,env(safe-area-inset-left));background:linear-gradient(180deg,var(--powder) 0%,#F6FBFF 40%,var(--base) 75%);overflow-y:auto}
.login-card{width:min(100%,360px);display:flex;flex-direction:column;align-items:center;text-align:center;animation:rise .5s var(--ease-out) both}
.login-card .monogram{font-size:30px;margin-bottom:18px}
.login-card h1{font-size:40px}
.login-card>p{color:var(--muted);margin:10px 0 22px;max-width:30ch}
#pin{text-align:center;font-size:24px;letter-spacing:.3em;min-height:58px;font-variant-numeric:tabular-nums}
#pin::placeholder{letter-spacing:.1em;font-size:18px}
.login-card .primary{width:100%;margin-top:14px}
.login-card .text-link{margin-top:10px}
.login-card .error{align-self:stretch}

/* ---------- Shell: three tabs ---------- */
.host .tabs{grid-template-columns:repeat(3,1fr)}
.host .tab-ink{width:calc((100% - 2 * max(8px,env(safe-area-inset-left))) / 3)}
.bar-label{font:600 12px Hanken,sans-serif;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);margin-left:6px}
.icon-btn{width:44px;height:44px;min-height:44px;padding:0;border-radius:50%;border-color:var(--hairline);background:rgba(255,255,255,.7)}
.icon-btn svg,.close svg{width:20px;height:20px;fill:none;stroke:var(--ink);stroke-width:1.8;stroke-linecap:round}
.icon-btn circle{fill:var(--ink);stroke:none}
.screen-title{font-size:clamp(30px,4.6dvh,38px);margin:6px 0 2px}
.screen-sub{color:var(--muted);font-size:15px}
.num{font-variant-numeric:tabular-nums}
.button.small,button.small{min-height:44px;padding:8px 16px;font-size:14px}
button.small svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}

/* ---------- Overview: the two numbers that matter, then who to nudge ---------- */
.tiles{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;margin:14px 0 6px}
.tile{grid-column:span 2;min-width:0;display:flex;flex-direction:column;gap:6px;padding:14px 12px 12px;background:var(--paper);border:1.5px solid var(--hairline);border-radius:18px;animation:rise .5s var(--ease-out) both}
.tile b{font:400 36px/1 Bodoni,Georgia,serif;font-variant-numeric:tabular-nums;color:var(--ink)}
.tile-label{display:flex;align-items:center;gap:6px;font:600 11.5px Hanken,sans-serif;letter-spacing:.1em;text-transform:uppercase;color:var(--muted)}
.tile small{font-size:13px;line-height:1.3;color:var(--muted)}
.tile.hero{grid-column:span 6;padding:18px;background:var(--lemon);border-color:var(--sun)}
.tile.hero b{font-size:clamp(56px,9dvh,76px)}
.tile.hero small{font-size:14px;color:var(--ink)}
.tile.half{grid-column:span 3}
.tile.yes .tile-label::before,.tile.maybe .tile-label::before,.tile.no .tile-label::before{content:"";flex:none;width:9px;height:9px;border-radius:3px}
.tile.yes .tile-label::before{background:var(--sun)}
.tile.maybe .tile-label::before{background:var(--baby)}
.tile.no .tile-label::before{background:#B9C9D8}
.tile .bar{margin-top:auto}
.tile:nth-child(2){animation-delay:.04s}.tile:nth-child(3){animation-delay:.08s}.tile:nth-child(4){animation-delay:.12s}.tile:nth-child(5){animation-delay:.16s}.tile:nth-child(6){animation-delay:.2s}
@media (prefers-reduced-motion:reduce){.tile{animation:none}}
.bar{display:flex;gap:3px;height:12px;border-radius:6px;overflow:hidden;background:var(--powder)}
.bar span{display:block;height:100%;min-width:3px;transform-origin:left;animation:grow .7s var(--ease-out) both}
.bar .yes{background:var(--sun)}
.bar .maybe{background:var(--baby)}
.bar .no{background:#B9C9D8}
.bar .done{background:var(--ink)}
.block{margin-top:26px}
.block h3{font:600 17px Hanken,sans-serif;margin:0}
.block-lead{color:var(--muted);font-size:14px;margin-top:4px}

/* ---------- Lists (guests, gifts, nudges, latest) ---------- */
.list-head{padding-top:2px}
.title-row{display:flex;align-items:center;justify-content:space-between;gap:12px}
.list-head input[type=search]{margin:8px 0 2px;min-height:46px}
.chip .count{font-variant-numeric:tabular-nums;opacity:.7;margin-left:6px}
.rows{list-style:none;padding:0;margin:8px 0 0}
.rows>li{border-bottom:1px solid var(--hairline)}
.rows>li:last-child{border-bottom:0}
.row{width:100%;min-height:64px;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:4px 12px;padding:10px 2px;border:0;border-radius:0;background:none;color:var(--ink);text-align:left;font-weight:400;justify-content:stretch}
.row.thumbed{grid-template-columns:52px minmax(0,1fr) auto}
@media (hover:hover) and (pointer:fine){.row:hover{background:linear-gradient(90deg,transparent,var(--lemon) 12%,var(--lemon) 88%,transparent)}}
.row:active{transform:none;background:var(--lemon)}
.row-main{min-width:0;display:flex;flex-direction:column;gap:2px}
.row-name{font-weight:600;font-size:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.row-sub{font-size:14px;color:var(--muted);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.row-title{font-size:15px;line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.row-thumb{width:52px;height:52px;object-fit:contain;background:var(--powder);border-radius:12px;padding:4px}
.row-thumb.none{display:grid;place-items:center;color:var(--muted)}
.row-thumb.none svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.5}
.row.off{opacity:.55}
.empty{color:var(--muted);font-size:15px;margin-top:20px;text-align:center}

/* Status pills: the RSVP's own colours (yes = sun, maybe = baby blue). */
.pill{display:inline-flex;align-items:center;min-height:26px;padding:2px 11px;border-radius:13px;font-size:13px;font-weight:600;white-space:nowrap;background:#EEF3F8;color:var(--muted)}
.pill.yes{background:var(--sun);color:var(--ink)}
.pill.maybe{background:#D7EEFD;color:var(--ink)}
.pill.no{background:#EEF3F8;color:var(--muted)}
.pill.open{background:none;color:var(--muted);padding:0}
.pill.full{background:var(--ink);color:var(--paper)}
.pill.part{background:var(--lemon);color:var(--ink);box-shadow:inset 0 0 0 1.5px var(--sun)}

/* Nudges: name and two big buttons per person */
.nudge{display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px;padding:12px 0}
.nudge .row-main{flex:1 1 140px}
.nudge-actions{display:flex;flex-wrap:wrap;gap:8px}
.nudge-actions>*{min-height:44px;padding:8px 14px;font-size:14px}
.nudge-actions svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}

/* ---------- Sheets ---------- */
dialog.sheet{text-align:left}
.facts{margin:14px 0 0}
.facts div{display:grid;grid-template-columns:96px minmax(0,1fr);gap:12px;padding:10px 0;border-bottom:1px solid var(--hairline);font-size:15px}
.facts div:last-child{border-bottom:0}
.facts dt{color:var(--muted)}
.facts dd{margin:0;overflow-wrap:anywhere;white-space:pre-wrap}
.facts dd a{font-weight:600}
.facts ul{list-style:none;padding:0;margin:0}
.facts li+li{margin-top:4px}
#gdNudge{margin-top:16px}
#gdNudge::before{content:attr(data-label);flex-basis:100%;font-weight:600;font-size:15px}
.danger-zone{display:flex;flex-wrap:wrap;gap:4px 18px;margin-top:18px;padding-top:6px;border-top:1px solid var(--hairline)}
.linkbtn.danger{color:var(--error)}
.confirm{margin-top:12px;padding:14px 16px;background:#FDF1F1;border-radius:16px}
.confirm p{font-size:15px}
.confirm .actions .primary{background:var(--error);border-color:var(--error)}
.claimed{color:var(--muted);font-size:15px}
.field-row{display:flex;gap:8px}
.field-row input{flex:1}
.field-row button{flex:none;min-height:50px;padding:8px 16px;font-size:15px}
.two{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,140px);gap:12px}
.stepper{display:flex;align-items:center;border:1.5px solid var(--line);border-radius:14px;background:var(--paper);min-height:50px;overflow:hidden}
.stepper button{min-height:48px;width:44px;flex:none;padding:0;border:0;border-radius:0;font-size:20px}
.stepper input{border:0;min-height:48px;padding:0;text-align:center;font-variant-numeric:tabular-nums;-moz-appearance:textfield;appearance:textfield}
.stepper input::-webkit-inner-spin-button{-webkit-appearance:none}
select{appearance:none;background:var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231E3A56' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center/18px;padding-right:42px}
.opt{font-weight:400;color:var(--muted)}
.more-fields{margin-top:12px}
.more-fields>summary{min-height:44px;display:flex;align-items:center;cursor:pointer;font-weight:600;font-size:15px;color:var(--blue)}
.preview{display:flex;align-items:center;gap:12px;margin-top:12px;padding:10px;background:var(--powder);border-radius:14px;font-size:14px}
.preview img{width:56px;height:56px;object-fit:contain;background:var(--paper);border-radius:10px;padding:3px;flex:none}
#giftForm .primary{width:100%;margin-top:18px}
.menu{display:grid;margin-top:8px}
.menu>a,.menu>button{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:2px;min-height:64px;padding:10px 2px;border:0;border-bottom:1px solid var(--hairline);border-radius:0;background:none;color:var(--ink);font-weight:600;font-size:16px;text-decoration:none;text-align:left}
.menu>:last-child{border-bottom:0}
.menu small{font-weight:400;font-size:14px;color:var(--muted)}
@media (hover:hover) and (pointer:fine){.menu>a:hover,.menu>button:hover{background:none;color:var(--blue)}}
.menu>button:active{transform:none}

/* Toast: no tab bar on the sign-in screen */
#toast{bottom:calc(var(--tabbar) + 16px + env(safe-area-inset-bottom,0px))}

@keyframes grow{from{transform:scaleX(0)}to{transform:none}}

/* Three tabs leave room for readable labels on small phones (app.css drops to 10.5px for four). */
@media (max-width:360px){.host .tab{font-size:12px}}

/* Gift sheet: who reserved it, each with a release */
.claimed>p{color:var(--muted);font-size:15px}
.claimers{list-style:none;padding:0;margin:8px 0 0;border-top:1px solid var(--hairline)}
.claimers li{display:flex;align-items:center;gap:12px;padding:8px 0;border-bottom:1px solid var(--hairline)}
.claimers .row-main{flex:1}
/* Guest sheet: gifts open their own sheet; a reply-less guest gets a sentence of context */
.gift-link{min-height:44px;padding:0;text-align:left;justify-content:flex-start;font-size:15px;line-height:1.35}
.gd-explain{display:block;margin-top:10px;font-size:15px;color:var(--muted)}
/* Filter chips: a soft fade on the right says the row scrolls */
.host .chips{-webkit-mask:linear-gradient(90deg,#000 calc(100% - 32px),transparent);mask:linear-gradient(90deg,#000 calc(100% - 32px),transparent)}
/* On a computer the host area gets room to work: wider than the guest app's phone frame */
@media (min-width:900px) and (min-height:640px){
  .app.host{width:min(760px,calc(100vw - 48px))}
  .host .screen{padding-left:32px;padding-right:32px}
  .host .scroll{margin:0 -32px;padding-left:32px;padding-right:32px}
  .host .chips{margin:0 -32px;padding-left:32px;padding-right:32px}
}

/* Overview: when replies last came in; the way to the full list */
.last-reply{margin-top:10px;font-size:14px;color:var(--muted)}
.all-replies{margin:22px 0 4px}
.all-replies a{display:inline-flex;align-items:center;min-height:44px;font-weight:600;font-size:15px}
/* Guests: how the list is sorted, and the switch */
.sort-row{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:14px;color:var(--muted)}
/* Gift sheet titled with the gift: long names step down */
.sheet-title.long{font-size:22px;line-height:1.2;padding-right:8px}
/* On a computer the filters have room: wrap instead of scrolling, no fade */
@media (min-width:900px) and (min-height:640px){
  .host .chips{flex-wrap:wrap;overflow:visible;-webkit-mask:none;mask:none}
}
