/* Blanksy, Ando's side: Studio's look from the signed-off wireframes. Cream page, white panels, black pill buttons,
   Geist, red only for what waits on him. Phone first; a centred column on wider screens, two columns on Home. */

:root {
  --bg: #FBF9F3; --panel: #FFFEFB; --text: #2a2a26; --head: #000; --muted: #6a665c;
  --rule: #E4DECF; --edge: #CFC8B6; --trough: #F2EDE0; --link: #0d6b62;
  --red: #FF170A; --redtext: #C21007; --amber: #7F5400; --ph: #EDEDEF;
  --gutter: 16px; --col: 640px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 'Geist', system-ui, -apple-system, sans-serif; overflow-x: hidden; }
h1, h2, h3 { margin: 0; color: var(--head); font-weight: 600; }
h1 { font-size: 26px; letter-spacing: -0.03em; line-height: 1.15; }
h1.xl { font-size: 30px; }
h2 { font-size: 19px; }
p { margin: 0; }
a { color: var(--link); }
a:hover { color: #000; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
/* hidden must win over the display rules below (a hidden .field is still a flex box otherwise) */
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Text tones */
.muted { color: var(--muted); }
.red { color: var(--redtext); }
.amber { color: var(--amber); }
.teal { color: var(--link); font-weight: 500; }
.strong { font-weight: 500; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }

/* Layout */
.page { width: 100%; max-width: var(--col); margin: 0 auto; padding: 24px var(--gutter) 40px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.stack.tight { gap: 8px; }
.between { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tightup { margin-top: -8px; }
.foot { margin-top: auto; }
.grow-page { min-height: calc(100vh - 77px); min-height: calc(100dvh - 77px); }
.col { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.home { display: flex; flex-direction: column; gap: 28px; padding-top: 20px; }
@media (min-width: 900px) {
  .home { max-width: 1040px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; align-items: start; }
}

/* Header bar */
.bar { display: flex; align-items: center; gap: 12px; padding: 16px var(--gutter); padding-top: max(16px, env(safe-area-inset-top)); border-bottom: 1px solid var(--rule); background: var(--panel); position: sticky; top: 0; z-index: 5; }
.bar.top { justify-content: space-between; }
.brand { font-weight: 600; font-size: 18px; color: #000; }
.bartitle { font-weight: 600; color: #000; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.baracts { display: flex; align-items: center; gap: 8px; }
.back { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; font-weight: 500; }
.iconbtn { width: 44px; height: 44px; border: 1px solid var(--edge); border-radius: 99px; background: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.iconbtn svg { width: 20px; height: 20px; fill: #000; }

/* Buttons */
.pill { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 99px; background: #000; color: var(--bg); text-decoration: none; font-weight: 500; border: 0; cursor: pointer; white-space: nowrap; }
a.pill:hover { color: var(--bg); }
.bigbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 20px; border-radius: 99px; background: #000; color: var(--bg); text-decoration: none; font-weight: 500; font-size: 17px; border: 0; cursor: pointer; width: 100%; }
a.bigbtn:hover { color: var(--bg); }
.bigbtn:disabled, .bigbtn[aria-disabled=true] { background: #8a857a; cursor: default; }
.ghost { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 99px; background: transparent; border: 1px solid var(--edge); color: #000; font-weight: 500; cursor: pointer; }
.ghost.wide { width: 100%; }
.danger { color: var(--redtext); }
.left { align-self: flex-start; }
.linkbtn { background: none; border: 0; padding: 0; min-height: 44px; color: var(--link); font-weight: 500; cursor: pointer; text-align: left; }
.linkbtn:hover { color: #000; }
.linkish.center { align-self: center; }
.linkish { color: var(--link); font-weight: 500; display: inline-flex; align-items: center; min-height: 44px; }

/* Panels and rows */
.panel { background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; }
.pad { padding: 16px; }
.done { border-color: var(--rule); }
.current { border: 2px solid #000; }
.later { opacity: 0.85; }
.rows { display: flex; flex-direction: column; }
.rows > * + * { border-top: 1px solid var(--rule); }
.ruled { border-top: 1px solid var(--rule); }
.ruled > :last-child { border-bottom: 1px solid var(--rule); }
.line { padding: 10px 0; }
.orow { display: flex; flex-direction: column; gap: 6px; padding: 14px; color: var(--text); text-decoration: none; }
a.orow:hover { background: #fffdf6; color: var(--text); }
.orow b { color: #000; }
.drow { display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: var(--panel); color: var(--text); text-decoration: none; min-height: 68px; }
section > .drow { border: 1px solid var(--rule); border-radius: 12px; }
.drow b { color: #000; display: block; }
.drow .grow { display: flex; flex-direction: column; }
.hexrow { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.hexrow code { font-size: 16px; }
.chip { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--edge); flex: none; }
.month { display: flex; justify-content: space-between; align-items: baseline; padding: 14px; border-radius: 12px; background: var(--trough); }
.month.stack { flex-direction: column; align-items: stretch; }
.month b { color: #000; }
.tagchip { align-self: flex-start; padding: 4px 12px; border-radius: 99px; background: var(--trough); color: #000; font-weight: 500; }
.between .tagchip { align-self: auto; }
.note { padding: 12px 14px; background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; }
.note b { color: #000; }
.sentnote { padding: 12px 14px; border-radius: 12px; background: var(--trough); }
.offline { margin: 0; padding: 10px var(--gutter); background: var(--trough); color: #000; text-align: center; border-bottom: 1px solid var(--rule); }
.warnbox { padding: 16px; border: 2px solid #000; }

/* What needs him */
.ask { display: flex; gap: 12px; align-items: center; padding: 14px; background: var(--panel); border: 2px solid var(--red); border-radius: 12px; color: var(--text); text-decoration: none; }
.ask:hover { color: var(--text); background: #fffdf6; }
.askpic { width: 56px; height: 56px; flex: none; border-radius: 8px; object-fit: cover; }
.askwords { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.askwords b { color: #000; }
.dpic { width: 44px; height: 44px; flex: none; border-radius: 8px; object-fit: cover; }
.ph { display: block; background: var(--ph); border-radius: 8px; }
.ph.askpic, .ph.dpic { display: block; }

/* The route as segments */
.track { display: flex; gap: 4px; }
.track i { flex: 1 1 0; height: 6px; border-radius: 3px; background: var(--rule); }
.track i.on { background: #000; }
.track i.you { background: var(--red); }
.route { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.route li { padding: 4px 10px; border-radius: 99px; background: var(--trough); color: var(--muted); }
.route li.done { color: #000; }
.route li.now { background: #000; color: var(--bg); }
.hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.lead { font-size: 18px; color: #000; font-weight: 500; }

/* Pictures */
.hero img, .hero .ph { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; border-radius: 12px; background: var(--ph); }
.square { aspect-ratio: 1 / 1; border-radius: 12px; background: var(--ph); overflow: hidden; position: relative; }
.v3d { position: absolute; inset: 0; touch-action: pan-y; }
.v3d canvas { width: 100% !important; height: 100% !important; display: block; }
.v3dnote { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; color: var(--muted); pointer-events: none; }
.strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.thumbbtn { flex: none; width: 76px; height: 76px; padding: 0; border: 1px solid var(--rule); border-radius: 8px; background: var(--ph); overflow: hidden; cursor: zoom-in; }
.thumbbtn img { width: 100%; height: 100%; object-fit: cover; }
.clip { width: 100%; border-radius: 12px; background: #000; }
.grid { display: grid; gap: 10px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile { display: block; padding: 6px; border-radius: 12px; cursor: pointer; text-align: left; background: var(--panel); border: 1px solid var(--rule); margin: 0; min-width: 0; }
.tile.still { cursor: default; }
.tile.on { border: 2px solid #000; padding: 5px; }
.tile img, .tile .ph { width: 100%; border-radius: 8px; object-fit: cover; background: var(--ph); }
.tile .tall, .tile .ph.tall { aspect-ratio: 3 / 4; }
.tile .sqpic, .tile .ph.sqpic, figure.tile img, figure.tile .ph { aspect-ratio: 1 / 1; }
.tcap { display: flex; padding: 8px 4px 2px; font-size: 16px; overflow-wrap: anywhere; }
.tcap b { color: #000; }
figcaption { padding: 6px 4px 0; overflow-wrap: anywhere; }
.says { color: #000; font-weight: 500; white-space: nowrap; }
.tcap b { min-width: 0; overflow-wrap: anywhere; }
.unit { padding-bottom: 6px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--edge); border-radius: 99px; overflow: hidden; }
.seg button { min-height: 44px; border: 0; background: transparent; cursor: pointer; font-weight: 500; padding: 0 4px; }
.seg button + button { border-left: 1px solid var(--edge); }
.seg button.on { background: #000; color: var(--bg); }
.picks { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.picks .flabel { width: 100%; }
.swatchpick { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px 0 6px; border: 1px solid var(--edge); border-radius: 99px; cursor: pointer; }
.swatchpick input { width: 32px; height: 32px; border: 0; padding: 0; background: none; cursor: pointer; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { min-height: 44px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--edge); background: transparent; cursor: pointer; }
.tag.on { background: #000; color: var(--bg); border-color: #000; }
.drawrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.drawrow img.small { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.flabel { font-weight: 600; color: #000; }
input[type=text], input[type=email], textarea { width: 100%; font-size: 16px; color: #000; padding: 12px 14px; border: 1px solid var(--edge); border-radius: 12px; background: var(--panel); min-height: 48px; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #8a857a; }
input[type=range] { width: 100%; min-height: 44px; accent-color: #000; }
.codein { font-weight: 600; font-size: 24px !important; letter-spacing: 0.2em; text-align: center; height: 56px; background: var(--bg) !important; }
.choice { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 16px; border-radius: 12px; cursor: pointer; background: transparent; border: 1px solid var(--edge); }
.choice b { color: #000; font-size: 17px; }
.choice.on { background: var(--panel); border: 2px solid #000; padding: 15px; }
.choice.row { flex-direction: row; justify-content: space-between; align-items: center; gap: 12px; padding: 14px; min-height: 56px; }
.choice.row.on { padding: 13px; }
.choice.row > span { display: flex; flex-direction: column; gap: 2px; }
.choice.row b { font-size: 16px; }
.editform h2 { font-size: 17px; }
.missing { outline: 2px solid var(--red); outline-offset: 6px; border-radius: 12px; }
.piecerow { display: flex; gap: 8px; align-items: center; }
.tiles2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 16px; min-width: 0; }
.stat b { font-size: 26px; color: #000; letter-spacing: -0.02em; line-height: 1.2; overflow-wrap: anywhere; }
.picrow { display: flex; gap: 8px; flex-wrap: wrap; }
.picthumb { position: relative; width: 64px; height: 64px; }
.picthumb img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; }
.picthumb .x { position: absolute; top: -10px; right: -10px; width: 32px; height: 32px; border-radius: 99px; border: 0; background: #000; color: #fff; font-size: 18px; cursor: pointer; }
.addpic { position: relative; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border: 1px dashed var(--edge); border-radius: 12px; cursor: pointer; flex: 1 1 auto; }
.addpic.sq { flex: none; width: 64px; height: 64px; min-height: 64px; justify-content: center; padding: 0; }
.addpic input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.addpic:focus-within { outline: 3px solid var(--link); outline-offset: 2px; }

/* PAIRA peek at the foot of Home */
.peek { background: #000; color: #fff; padding: 14px 16px 0; overflow: hidden; height: 64px; font-weight: 700; font-size: 72px; letter-spacing: -0.04em; line-height: 1; text-align: center; margin-top: 12px; }

/* Sheets, lightbox, drawing, toast */
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheetcard { background: var(--panel); width: 100%; max-width: var(--col); border-radius: 16px 16px 0 0; padding: 20px var(--gutter) max(24px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 18px; max-height: 90vh; overflow-y: auto; }
@media (min-width: 700px) { .sheet { align-items: center; } .sheetcard { border-radius: 16px; } }
.lightbox { position: fixed; inset: 0; z-index: 30; background: rgba(20,20,18,0.94); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px var(--gutter); }
.lightbox img { max-height: 76vh; object-fit: contain; border-radius: 8px; }
.lightbox .pill { background: #fff; color: #000; }
.drawsheet { position: fixed; inset: 0; z-index: 30; background: var(--bg); display: flex; flex-direction: column; }
.dtools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px var(--gutter); border-bottom: 1px solid var(--rule); }
.swatches { display: flex; gap: 6px; }
.dtools .sw { width: 44px; height: 44px; border-radius: 99px; border: 2px solid var(--edge); cursor: pointer; }
.dtools .sw.on { border: 3px solid #000; box-shadow: inset 0 0 0 3px var(--bg); }
.dsize { display: flex; align-items: center; gap: 8px; flex: 1 1 140px; }
.dstage { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; padding: 12px; min-height: 0; }
.dpaper { position: relative; max-width: 100%; max-height: 100%; aspect-ratio: 1 / 1; height: 100%; }
.dpaper img, .dpaper canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.dpaper canvas { touch-action: none; cursor: crosshair; }
.dnote { padding: 0 var(--gutter) max(16px, env(safe-area-inset-bottom)); text-align: center; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 40; background: #000; color: #fff; padding: 12px 18px; border-radius: 12px; max-width: calc(100% - 32px); width: max-content; }
.spin { width: 14px; height: 14px; border-radius: 99px; border: 2px solid currentColor; border-right-color: transparent; display: inline-block; animation: spin 0.8s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
.fold summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; color: #000; }
.welcome { padding-top: 32px; }
