/* Kizuki. Built to the prototype in design/reference/prototype.html: everything
   above the "ADDED FOR THE REAL APP" line is its CSS verbatim.
   Layout: one phone-width column (max 460px) centered on wide screens, floating Capture button, three-tab bar. The marker-highlight on remembered quotes is the one expressive move. */
:root{
  --bg:#F8F2F4; --surface:#FFFFFF; --ink:#2A1820; --muted:#6F5A63; --line:#E8DAE0;
  --accent:#B02A55; --accent-ink:#FFFFFF; --accent-soft:#F9E3EA; --mark:#F6D36B; --chip:#EFE5E9;
  --font-display:'Instrument Serif',Georgia,'Times New Roman',serif;
  --font-body:'Figtree',system-ui,-apple-system,'Segoe UI',sans-serif;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#1A1317; --surface:#261B21; --ink:#F8EEF2; --muted:#BEA9B2; --line:#43313A;
    --accent:#F18AAA; --accent-ink:#3A0D1E; --accent-soft:#3D1B28; --mark:#6E5A14; --chip:#33262D;
    color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --bg:#1A1317; --surface:#261B21; --ink:#F8EEF2; --muted:#BEA9B2; --line:#43313A;
  --accent:#F18AAA; --accent-ink:#3A0D1E; --accent-soft:#3D1B28; --mark:#6E5A14; --chip:#33262D;
  color-scheme:dark;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  background:var(--bg); color:var(--ink); font-family:var(--font-body); font-size:15px; line-height:1.45;
  padding-left:max(16px,env(safe-area-inset-left,0px)); padding-right:max(16px,env(safe-area-inset-right,0px));
}
button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer;text-align:inherit}
button:focus-visible,input:focus-visible,textarea:focus-visible,a:focus-visible,label:focus-within{outline:2px solid var(--accent);outline-offset:2px}
a{color:inherit}
.app{max-width:460px;margin:0 auto;padding-block:20px 150px;min-width:0}
.top{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:18px}
.wordmark{font-family:var(--font-display);font-style:italic;font-size:38px;line-height:1;letter-spacing:-.01em}
.tag{color:var(--muted);font-size:13px}
h1,h2,h3{margin:0;text-wrap:balance}
h1{font-family:var(--font-display);font-weight:400;font-size:32px;line-height:1.1}
h2{font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.section{display:flex;flex-direction:column;gap:10px;margin-top:24px}
.stack{display:flex;flex-direction:column;gap:10px}
.row{display:flex;align-items:center;gap:10px;min-width:0}
.grow{flex:1;min-width:0}
.muted{color:var(--muted)}
.small{font-size:13px}

/* occasion tiles */
.occ{display:grid;grid-template-columns:repeat(auto-fit,minmax(118px,1fr));gap:8px}
.tile{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:12px;display:flex;flex-direction:column;gap:2px;min-width:0}
.tile b{font-size:15px}
.tile .when{font-family:var(--font-display);font-size:24px;line-height:1.05;color:var(--accent)}

/* chips */
.chips{display:flex;gap:8px;overflow-x:auto;padding-bottom:4px;scrollbar-width:none}
.chips::-webkit-scrollbar{display:none}
.chip{flex:none;padding:7px 13px;border-radius:999px;background:var(--chip);font-size:14px;font-weight:500}
.chip[aria-pressed="true"]{background:var(--ink);color:var(--bg)}
.wrapchips{display:flex;flex-wrap:wrap;gap:8px}

/* idea cards */
.card{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:14px;display:flex;flex-direction:column;gap:10px;width:100%;min-width:0}
button.card:hover{border-color:var(--accent)}
.meta{display:flex;align-items:center;gap:6px;color:var(--muted);font-size:13px;flex-wrap:wrap}
.meta svg{flex:none}
.said{margin:0;font-family:var(--font-display);font-size:22px;line-height:1.25;overflow-wrap:anywhere}
.said span{background:linear-gradient(transparent 58%,var(--mark) 58%);-webkit-box-decoration-break:clone;box-decoration-break:clone;padding:0 2px}
.said.plain{font-family:var(--font-body);font-size:15px}
.said.plain span{background:none;padding:0}
.itemline{display:flex;align-items:center;justify-content:space-between;gap:10px;border-top:1px dashed var(--line);padding-top:10px;font-weight:600}
.itemline small{font-weight:500;color:var(--accent);white-space:nowrap}
.got{opacity:.6}
.badge{display:inline-block;padding:2px 8px;border-radius:999px;background:var(--accent-soft);color:var(--accent);font-size:12px;font-weight:600}

/* buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:12px 18px;border-radius:12px;font-weight:600;background:var(--accent);color:var(--accent-ink);text-align:center}
.btn.ghost{background:var(--chip);color:var(--ink)}
.btn.block{display:flex;width:100%}
.btn:disabled{opacity:.45;cursor:not-allowed}
.iconbtn{display:inline-flex;align-items:center;gap:6px;color:var(--muted);font-size:14px;padding:4px 0}

/* people */
.avatar{width:44px;height:44px;border-radius:50%;background:var(--accent-soft);color:var(--accent);display:grid;place-items:center;font-family:var(--font-display);font-size:24px;flex:none}
.avatar.lg{width:64px;height:64px;font-size:34px}
.prow{display:flex;align-items:center;gap:12px;background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:12px;width:100%}
.prow:hover{border-color:var(--accent)}

/* options */
.opt{display:flex;align-items:center;gap:12px;text-decoration:none;background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:12px}
.opt:hover{border-color:var(--accent)}
.price{font-weight:700;white-space:nowrap}
.stores{display:flex;flex-wrap:wrap;gap:8px}
.stores a{padding:7px 12px;border-radius:999px;background:var(--chip);font-size:14px;text-decoration:none;display:inline-flex;gap:6px;align-items:center}
.ask{background:var(--accent-soft);border-radius:14px;padding:12px 14px;display:flex;flex-direction:column;gap:4px}
.ask b{color:var(--accent);font-size:12px;letter-spacing:.08em;text-transform:uppercase}

/* capture */
.types{display:grid;grid-template-columns:repeat(5,1fr);gap:6px}
.type{display:flex;flex-direction:column;align-items:center;gap:4px;padding:10px 2px;border-radius:12px;background:var(--chip);font-size:12px;font-weight:600;color:var(--muted)}
.type[aria-pressed="true"]{background:var(--ink);color:var(--bg)}
textarea,input[type=text]{width:100%;font:inherit;color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:12px;resize:vertical}
textarea{min-height:120px}
.drop{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center;border:1.5px dashed var(--line);border-radius:16px;padding:28px 16px;background:var(--surface);cursor:pointer;color:var(--muted)}
.drop img{max-width:100%;max-height:180px;border-radius:10px}
.note{font-size:13px;color:var(--muted);background:var(--chip);border-radius:10px;padding:8px 10px}
label.fieldlabel{font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}

/* nudges */
.nudge{background:var(--ink);color:var(--bg);border-radius:20px;padding:20px;display:flex;flex-direction:column;gap:14px}
.nudge .for{font-size:13px;opacity:.75}
.nudge p{margin:0;font-family:var(--font-display);font-size:28px;line-height:1.15}
.nudge .btn{background:var(--bg);color:var(--ink)}
.nudge .btn.ghost{background:transparent;color:var(--bg);border:1px solid color-mix(in srgb,var(--bg) 40%,transparent)}
.btnrow{display:flex;gap:8px;flex-wrap:wrap}
.look{display:flex;gap:12px;align-items:flex-start;background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:12px 14px}
.look svg{flex:none;color:var(--accent);margin-top:2px}
.switch{display:flex;align-items:center;justify-content:space-between;gap:12px;background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:12px 14px;width:100%}
.sw{width:42px;height:24px;border-radius:999px;background:var(--chip);position:relative;flex:none;transition:background .15s}
.sw::after{content:"";position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:var(--muted);transition:transform .15s,background .15s}
.switch[aria-checked="true"] .sw{background:var(--accent)}
.switch[aria-checked="true"] .sw::after{transform:translateX(18px);background:var(--accent-ink)}

a.btn{text-decoration:none}
.why{margin:0;font-size:14px;color:var(--muted)}
.why b{color:var(--accent);font-weight:700;font-size:12px;letter-spacing:.08em;text-transform:uppercase;margin-right:4px}
/* nav */
.tabbar{position:fixed;left:0;right:0;bottom:0;background:var(--surface);border-top:1px solid var(--line);padding:6px max(16px,env(safe-area-inset-right,0px)) calc(6px + env(safe-area-inset-bottom,0px)) max(16px,env(safe-area-inset-left,0px));z-index:5}
.tabbar-in{max-width:460px;margin:0 auto;display:grid;grid-template-columns:repeat(3,1fr)}
.tabbar button{display:flex;flex-direction:column;align-items:center;gap:2px;padding:6px;font-size:12px;font-weight:600;color:var(--muted);border-radius:10px}
.tabbar button[aria-current="page"]{color:var(--accent)}
.fabwrap{position:fixed;left:0;right:0;bottom:calc(66px + env(safe-area-inset-bottom,0px));padding:0 max(16px,env(safe-area-inset-right,0px)) 0 max(16px,env(safe-area-inset-left,0px));pointer-events:none;z-index:4}
.fabwrap>div{max-width:460px;margin:0 auto;display:flex;justify-content:flex-end}
.fab{pointer-events:auto;display:inline-flex;align-items:center;gap:8px;background:var(--accent);color:var(--accent-ink);font-weight:700;padding:13px 20px;border-radius:999px;box-shadow:0 6px 20px rgba(0,0,0,.22)}
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(140px + env(safe-area-inset-bottom,0px));background:var(--ink);color:var(--bg);padding:10px 16px;border-radius:12px;font-weight:600;z-index:10;max-width:calc(100% - 32px)}
@media (prefers-reduced-motion:reduce){.sw,.sw::after{transition:none}}

/* ===================== ADDED FOR THE REAL APP ===================== */
/* Author `display` beats the UA [hidden] rule; without this, hidden flex rows render. */
[hidden]{display:none !important}
html,body{margin:0}
/* Every single-line control is the same height (fleet rule: selects match inputs). */
input[type=text],input[type=email],input[type=password],input[type=url],select{
  width:100%;height:46px;font:inherit;color:var(--ink);background:var(--surface);
  border:1px solid var(--line);border-radius:12px;padding:0 12px;-webkit-appearance:none;appearance:none}
select{background-image:linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%);
  background-position:calc(100% - 18px) 20px,calc(100% - 13px) 20px;background-size:5px 5px;background-repeat:no-repeat;padding-right:32px}
.field{display:flex;flex-direction:column;gap:6px}
.grid2{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px}
.chip.x{display:inline-flex;align-items:center;gap:6px}
.chip.x button{display:inline-grid;place-items:center;width:18px;height:18px;border-radius:50%;color:var(--muted)}
.chip.x button:hover{color:var(--accent)}
.err{color:var(--accent);font-size:14px;font-weight:600;min-height:1em}
.linkbtn{color:var(--accent);font-weight:600;font-size:14px}
.top .iconbtn{padding:4px}
.empty{background:var(--surface);border:1px dashed var(--line);border-radius:16px;padding:18px;display:flex;flex-direction:column;gap:12px;align-items:flex-start}
.empty p{margin:0}
.empty .btnrow{align-self:stretch;flex-wrap:nowrap}
.empty .btnrow .btn{flex:1 1 0;min-width:0}
.danger{color:var(--accent)}

/* auth */
.auth{max-width:400px;margin:0 auto;padding:48px 0 40px;display:flex;flex-direction:column;gap:16px}
.auth .wordmark{font-size:56px}
.auth .lede{font-family:var(--font-display);font-size:26px;line-height:1.2;margin:0}
.socials{display:flex;flex-direction:column;gap:10px;align-items:stretch}
.socials:empty{display:none}
.or{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:13px}
.or::before,.or::after{content:"";flex:1;border-top:1px solid var(--line)}
/* Matched to Google's own GIS button (pill, large, logo left, label centered):
   white with a hairline outline in light mode, black in dark mode, exactly
   like GIS's "outline" and "filled_black" themes. */
.social-btn{position:relative;display:flex;align-items:center;justify-content:center;width:100%;height:40px;border-radius:20px;
  font:400 14px/1 'Google Sans','Roboto',-apple-system,system-ui,sans-serif;letter-spacing:.25px;
  background:#fff;color:#3c4043;border:1px solid #dadce0;cursor:pointer;transition:background-color .15s;padding:0 16px 0 60px}
.social-btn svg{position:absolute;left:12px;top:50%;transform:translateY(-50%);color:#000}
.social-btn:hover{background:#f8faff}
/* Colors sampled from GIS's own rendered button: outline (light), filled_black (dark). */
:root[data-theme="dark"] .social-btn{background:#202124;color:#e8eaed;border-color:#202124}
:root[data-theme="dark"] .social-btn svg{color:#fff}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) .social-btn{background:#202124;color:#e8eaed;border-color:#202124}
  :root:not([data-theme="light"]) .social-btn svg{color:#fff}
  :root:not([data-theme="light"]) .social-btn:hover{background:#2b2c2f}}
#btn-google{min-height:40px;color-scheme:normal}
.msg{font-size:14px;min-height:0}
.msg.on.err{color:var(--accent);font-weight:600}

/* bottom sheet (edit person, settings) */
.scrim{position:fixed;inset:0;background:rgba(20,10,15,.45);z-index:20}
.sheet{position:fixed;left:0;right:0;bottom:0;z-index:21;background:var(--bg);border-radius:22px 22px 0 0;
  max-height:92dvh;overflow:auto;padding:18px max(16px,env(safe-area-inset-right,0px)) calc(24px + env(safe-area-inset-bottom,0px)) max(16px,env(safe-area-inset-left,0px))}
.sheet-in{max-width:460px;margin:0 auto;display:flex;flex-direction:column;gap:14px}
.sheet-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.sheet-head h1{font-size:28px}
.grip{width:40px;height:5px;border-radius:3px;background:var(--line);margin:0 auto 4px}

/* the in-app confirm (never the browser's confirm()) */
.ask-dialog{position:fixed;inset:0;z-index:30;display:grid;place-items:center;padding:16px;background:rgba(20,10,15,.45)}
.ask-dialog .box{background:var(--surface);border-radius:18px;padding:20px;max-width:360px;width:100%;display:flex;flex-direction:column;gap:12px}
.ask-dialog h3{font-size:18px}
.ask-dialog p{margin:0;color:var(--muted)}
.loading{display:grid;place-items:center;min-height:60vh;color:var(--muted)}

/* ===================== MOTION ===================== */
/* Played on NAVIGATION only (go() sets #root.enter), never on an in-place
   re-render, so flipping a switch does not replay the whole screen. */
:root{--ease-out:cubic-bezier(.2,.8,.2,1);--spring:cubic-bezier(.34,1.56,.64,1)}
@keyframes rise{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
@keyframes in-right{from{opacity:0;transform:translateX(28px)}to{opacity:1;transform:none}}
@keyframes in-left{from{opacity:0;transform:translateX(-28px)}to{opacity:1;transform:none}}
@keyframes pop{0%{transform:scale(.6);opacity:0}70%{transform:scale(1.08);opacity:1}100%{transform:scale(1)}}
@keyframes draw{from{background-size:0 100%}to{background-size:100% 100%}}
@keyframes sheet-up{from{transform:translateY(100%)}to{transform:none}}
@keyframes sheet-down{from{transform:none}to{transform:translateY(100%)}}
@keyframes fade-in{from{opacity:0}to{opacity:1}}
@keyframes fade-out{from{opacity:1}to{opacity:0}}
@keyframes twinkle{0%,100%{transform:rotate(0) scale(1)}50%{transform:rotate(180deg) scale(1.25)}}
@keyframes shimmer{from{background-position:-200% 0}to{background-position:200% 0}}
@keyframes toast-in{from{opacity:0;transform:translate(-50%,16px) scale(.96)}to{opacity:1;transform:translate(-50%,0) scale(1)}}
@keyframes burst{0%{transform:translate(0,0) rotate(0) scale(1);opacity:1}70%{opacity:1}100%{transform:translate(var(--dx),var(--dy)) rotate(var(--rot)) scale(.5);opacity:0}}
@keyframes stamp{0%{transform:scale(1)}40%{transform:scale(.94)}75%{transform:scale(1.04)}100%{transform:scale(1)}}

/* the screen comes in: whole view slides by direction, then its pieces rise in a stagger */
#root.enter{animation:fade-in .18s ease-out both}
#root.enter[data-dir="fwd"]{animation:in-right .32s var(--ease-out) both}
#root.enter[data-dir="back"]{animation:in-left .32s var(--ease-out) both}
#root.enter .stagger{animation:rise .42s var(--ease-out) both;animation-delay:calc(var(--i,0) * 45ms + 60ms)}
#root.enter .tile .when{animation:pop .5s var(--spring) both;animation-delay:calc(var(--i,0) * 70ms + 200ms)}

/* the marker highlight is drawn across a quote, left to right, like a real highlighter */
.said span{background-repeat:no-repeat}
#root.enter .said span{animation:draw .7s var(--ease-out) both;animation-delay:calc(var(--i,0) * 45ms + 260ms)}
.said.plain span{animation:none !important}

/* tactile presses */
.btn,.chip,.card,.tile,.prow,.type,.fab,.opt,.tabbar button,.switch{transition:transform .14s var(--ease-out),border-color .15s,background-color .15s,color .15s,opacity .2s}
.btn:active:not(:disabled),.chip:active,.type:active,.fab:active{transform:scale(.95)}
.card:active,.tile:active,.prow:active,.opt:active,.switch:active{transform:scale(.985)}
.tabbar button[aria-current="page"] svg{animation:pop .4s var(--spring)}
.chip[aria-pressed="true"],.type[aria-pressed="true"]{animation:pop .3s var(--spring)}
.fab{animation:pop .45s var(--spring) .15s both}

/* reading: the sparkle spins and the button shimmers while Kizuki thinks */
.btn.reading{background-image:linear-gradient(100deg,transparent 30%,rgba(255,255,255,.28) 50%,transparent 70%);background-size:200% 100%;animation:shimmer 1.1s linear infinite;opacity:1 !important}
.btn.reading svg{animation:twinkle 1.1s var(--ease-out) infinite}

/* Mark as Given: the card stamps down and a burst of confetti goes up */
.got-burst{position:fixed;left:0;top:0;width:0;height:0;pointer-events:none;z-index:40}
.got-burst i{position:absolute;width:9px;height:14px;border-radius:2px;animation:burst 1.1s var(--ease-out) forwards}
.stamp{animation:stamp .45s var(--spring)}

/* sheets and dialogs */
.scrim{animation:fade-in .2s ease-out both}
.sheet{animation:sheet-up .34s var(--ease-out) both}
.closing .scrim{animation:fade-out .2s ease-in both}
.closing .sheet{animation:sheet-down .24s ease-in both}
.ask-dialog{animation:fade-in .16s ease-out both}
.ask-dialog .box{animation:pop .28s var(--spring) both}
.toast:not([hidden]){animation:toast-in .3s var(--spring) both}

/* fact chips arrive with a pop when added */
.chip.x.new{animation:pop .4s var(--spring) both}

@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;animation-delay:0s !important;transition-duration:.01ms !important}
  .got-burst{display:none}
}

/* ===================== FLOATING LABELS ===================== */
/* The label sits inside the field like a placeholder and floats to the top
   edge on focus or once there is a value. Markup: input/select FIRST, label
   after it, both inside .fl (the sibling selector needs that order). Inputs
   carry placeholder=" " so :placeholder-shown means "empty". Every
   single-line control here is 56px, selects included (fleet rule). */
.fl{position:relative;display:block;min-width:0}
.fl > input,.fl > select{height:56px;padding:22px 14px 6px;line-height:1.2}
.fl > select{padding-right:34px;background-position:calc(100% - 18px) 26px,calc(100% - 13px) 26px}
.fl > label{position:absolute;left:15px;top:50%;transform:translateY(-50%);max-width:calc(100% - 30px);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--muted);font-size:15px;pointer-events:none;
  transition:top .18s var(--ease-out),font-size .18s var(--ease-out),color .18s,letter-spacing .18s}
.fl > input:focus + label,
.fl > input:not(:placeholder-shown) + label,
.fl > input:-webkit-autofill + label,
.fl > select + label{top:17px;font-size:12px;font-weight:600;letter-spacing:.02em}
.fl > input:focus + label,.fl > select:focus + label{color:var(--accent)}
.fl > input:focus,.fl > select:focus{border-color:var(--accent);outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 18%,transparent)}
.fl > input::placeholder{color:transparent}
/* a field with a trailing button (Add a detail) */
.row > .fl{flex:1}
.row > .fl + .btn{height:56px}
@media (prefers-reduced-motion: reduce){.fl > label{transition:none}}
.btn.ghost.danger{color:var(--accent)}
