/* Quiet-luxury palette: ivory / espresso / taupe. System fonts only, no external requests.
   App-shell layout: the page never scrolls; only the grid, sheets and the lightbox move. */
:root {
  --bg: #f7f3ec; --card: #fffdf9; --ink: #2b211b; --muted: #6f6256; --line: #ddd3c5; --chip: #ece4d7;
  --accept: #3d5a40; --accept-ink: #fff; --deny: #8a3a33; --deny-ink: #fff; --accent: #2b211b; --accent-ink: #f7f3ec; --focus: #a3702a;
  --stage: #e9e1d4; --scrim: rgba(23,18,15,.45); --sheet: #fffdf9; --shadow-up: 0 -8px 24px rgba(43,33,27,.10);
  --accept-soft: #dfe8df; --deny-soft: #f0dcd9; --pill-accept: #3d5a40; --pill-deny: #8a3a33; --overlay: rgba(23,18,15,.72); --overlay-ink: #f2ebe0;
  --top-h: 52px; --ease: cubic-bezier(.2,.8,.2,1); --t-fast: 160ms; --t-med: 240ms; --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17120f; --card: #221b16; --ink: #f2ebe0; --muted: #b3a595; --line: #3a2f27; --chip: #2e2520;
    --accept: #6f9a74; --accept-ink: #10170f; --deny: #c9726a; --deny-ink: #1d0d0b; --accent: #f2ebe0; --accent-ink: #17120f; --focus: #e0a95a;
    --stage: #100c0a; --scrim: rgba(0,0,0,.6); --sheet: #221b16; --shadow-up: 0 -8px 24px rgba(0,0,0,.5);
    --accept-soft: #1b271d; --deny-soft: #331a17; --pill-accept: #a9d0ad; --pill-deny: #eeb0a8;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* overscroll/overflow live on body, never on html: on iPhone they stopped the keyboard from appearing (Bunny List lesson). */
html { -webkit-text-size-adjust: 100%; height: 100%; }
body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; touch-action: manipulation; background: var(--bg); color: var(--ink); font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body.zoomed { overflow: hidden; }
.sr, .skip:not(:focus) { position: absolute; top: 0; left: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 40; background: var(--card); padding: 12px 16px; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.pad { padding: 16px; }
.muted { color: var(--muted); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 2px solid var(--line); background: var(--card); border-radius: var(--radius); min-height: 48px; padding: 0 16px; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
button:disabled { opacity: .5; cursor: default; }
.link { border: 0; background: none; min-height: 44px; text-decoration: underline; color: var(--muted); padding: 0 8px; }
.ic { display: block; width: 22px; height: 22px; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.ic-card { --m: url("data:image/svg+xml,%3Csvg xmlns='http%3A//www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='6' y='3' width='12' height='18' rx='2.5' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E"); }
.ic-grid { --m: url("data:image/svg+xml,%3Csvg xmlns='http%3A//www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3.5' y='3.5' width='7' height='7' rx='1.5'/%3E%3Crect x='13.5' y='3.5' width='7' height='7' rx='1.5'/%3E%3Crect x='3.5' y='13.5' width='7' height='7' rx='1.5'/%3E%3Crect x='13.5' y='13.5' width='7' height='7' rx='1.5'/%3E%3C/g%3E%3C/svg%3E"); }
.ic-prev { --m: url("data:image/svg+xml,%3Csvg xmlns='http%3A//www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15 4l-8 8 8 8' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.ic-next { --m: url("data:image/svg+xml,%3Csvg xmlns='http%3A//www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 4l8 8-8 8' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.ic-note { --m: url("data:image/svg+xml,%3Csvg xmlns='http%3A//www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 20l1-4L16.5 4.5a2.1 2.1 0 013 3L8 19l-4 1z' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.ic-info { --m: url("data:image/svg+xml,%3Csvg xmlns='http%3A//www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v6M12 7.5v.01'/%3E%3C/g%3E%3C/svg%3E"); }
.ic-expand { --m: url("data:image/svg+xml,%3Csvg xmlns='http%3A//www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14 4h6v6M10 20H4v-6M20 4l-7 7M4 20l7-7' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }

/* ---------- shell ---------- */
.shell { height: 100vh; height: 100dvh; max-width: 760px; margin: 0 auto; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; position: relative; overflow: hidden; }
.shell.v-login { display: block; overflow-y: auto; overscroll-behavior: contain; }
main { min-height: 0; position: relative; overflow: hidden; padding: 0; }
main.login { overflow: visible; padding: max(24px, 5vh) 20px 28px; max-width: 460px; margin: 0 auto; }
.top { padding-top: env(safe-area-inset-top); background: var(--bg); position: relative; z-index: 5; }
.top .bar { height: var(--top-h); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 12px; }
.filterbtn { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 999px; border-color: transparent; background: var(--chip); font-weight: 700; min-width: 0; }
.filterbtn .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filterbtn .n { color: var(--muted); font-weight: 600; }
.filterbtn .caret { font-size: .8rem; color: var(--muted); }
.seg { display: inline-flex; border: 0; box-shadow: inset 0 0 0 2px var(--line); border-radius: 999px; overflow: hidden; background: var(--card); flex: none; }
.seg button { min-height: 44px; width: 48px; border: 0; border-radius: 0; padding: 0; display: grid; place-items: center; background: transparent; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.progress { height: 3px; background: var(--line); }
.progress i { display: block; height: 100%; background: var(--accept); transition: width var(--t-med) var(--ease); }
#foot { background: var(--bg); position: relative; z-index: 4; }

/* ---------- card view ---------- */
.stage { position: absolute; inset: 0; background: var(--stage); display: grid; place-items: center; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; overflow: hidden; }
.stage { grid-template-rows: 100%; grid-template-columns: 100%; }
.stage img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; -webkit-user-drag: none; pointer-events: none; transition: transform var(--t-fast) var(--ease); }
.stage.dragging img { transition: none; }
.stage.logo { background: #fcfaf5; }
.stage.logo img { padding: 12px; }
.stage.enter-r img { animation: in-r var(--t-med) var(--ease); }
.stage.enter-l img { animation: in-l var(--t-med) var(--ease); }
@keyframes in-r { from { opacity: .0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes in-l { from { opacity: .0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
.counter { position: absolute; top: 8px; left: 8px; padding: 3px 12px; border-radius: 999px; background: rgba(23,18,15,.82); color: #fff; font-size: .875rem; font-weight: 600; pointer-events: none; }
.enlarge { position: absolute; right: 8px; bottom: 8px; width: 48px; height: 48px; min-height: 0; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--overlay); color: var(--overlay-ink); }
.dots { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); display: flex; align-items: center; background: var(--overlay); border-radius: 999px; padding: 0 6px; height: 32px; }
.dot { min-height: 44px; min-width: 44px; margin: -6px -2px; padding: 0; border: 0; background: none; display: grid; place-items: center; }
.dot i { width: 8px; height: 8px; border-radius: 50%; background: rgba(242,235,224,.5); display: block; transition: transform var(--t-fast); }
.dot[aria-current="true"] i { background: var(--overlay-ink); transform: scale(1.5); }

.info { padding: 8px 14px 4px; display: grid; gap: 2px; }
.info .row1 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.info .title { font: 600 1.05rem/1.25 Georgia, "Times New Roman", serif; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info .slidepos { color: var(--muted); font-size: .85rem; flex: none; }
.info .row2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; }
.info .where { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detailsbtn { position: relative; width: 44px; height: 44px; min-height: 0; padding: 0; margin: -4px -8px -4px 0; border: 0; background: none; display: grid; place-items: center; color: var(--muted); flex: none; }
.detailsbtn.has::after, .notebtn.has::after { content: ""; position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--focus); }
.pills { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 6px; }
.pills::-webkit-scrollbar { display: none; }
.pill { flex: none; font-size: .78rem; line-height: 1.5; padding: 1px 10px; border-radius: 999px; background: var(--chip); color: var(--ink); white-space: nowrap; }
.pill.accept, .pill.owner.accepted { background: var(--accept-soft); color: var(--pill-accept); font-weight: 600; }
.pill.deny, .pill.owner.denied { background: var(--deny-soft); color: var(--pill-deny); font-weight: 600; }
.pill.stale { outline: 1px dashed var(--muted); }
.pill.none { color: var(--muted); }
.pill.rule { background: transparent; border: 1px dashed var(--muted); color: var(--muted); }
.pill.rule.agree { border-style: solid; border-color: var(--accept); color: var(--accept); font-weight: 600; }

.actions { padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); box-shadow: var(--shadow-up); background: var(--bg); }
.actions .row { display: grid; grid-template-columns: 48px 1fr 56px 1fr 48px; gap: 8px; align-items: center; }
.actions button { min-height: 60px; font-size: 1.05rem; font-weight: 700; padding: 0 6px; position: relative; }
.actions .step { min-height: 60px; display: grid; place-items: center; padding: 0; }
.actions .notebtn { width: 56px; height: 56px; min-height: 0; border-radius: 50%; display: grid; place-items: center; padding: 0; position: relative; }
.accept, .deny { position: relative; }
.accept { background: var(--accept); color: var(--accept-ink); border-color: var(--accept); }
.deny { background: var(--deny); color: var(--deny-ink); border-color: var(--deny); }
.accept.chosen, .deny.chosen { outline: 3px solid var(--ink); outline-offset: 2px; }
.accept.stale, .deny.stale { border-style: dashed; }
button[aria-busy="true"] .lbl { visibility: hidden; }
button[aria-busy="true"]::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 3px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- grid view ---------- */
main.gridmode { overflow: hidden; }
.gridwrap { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 8px 8px 12px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
@media (min-width: 480px) { .grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(5, 1fr); } }
.tile { position: relative; aspect-ratio: 1; min-height: 0; padding: 0; overflow: hidden; border-radius: 8px; border: 2px solid transparent; background: var(--chip); }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile.logo { background: #fcfaf5; }
.tile.logo img { object-fit: contain; padding: 8px; }
.grid.logos { grid-template-columns: repeat(2, 1fr); gap: 8px; }
.grid.logos .tile.logo img { padding: 12px; }
@media (min-width: 640px) { .grid.logos { grid-template-columns: repeat(3, 1fr); } }
.tile.decided img { opacity: .78; }
.tile.voted.accept { border-color: var(--accept); }
.tile.voted.deny { border-color: var(--deny); }
.tile.last { outline: 2px solid var(--focus); outline-offset: -2px; }
.tile .mark { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 700; background: var(--accept); color: var(--accept-ink); }
.tile.voted.deny .mark { background: var(--deny); color: var(--deny-ink); }
.tile .slides, .tile .owner { position: absolute; left: 4px; bottom: 4px; font-size: .68rem; padding: 1px 7px; border-radius: 999px; background: var(--overlay); color: var(--overlay-ink); }
.tile .slides { top: 4px; bottom: auto; }
.tile .owner.accepted { background: var(--accept); color: var(--accept-ink); }
.tile .owner.denied { background: var(--deny); color: var(--deny-ink); }
.sentinel { grid-column: 1 / -1; height: 1px; }
.gridfoot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; padding: 0 12px calc(2px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.gridfoot .summary { border: 0; background: none; padding: 0 4px; min-height: 44px; color: var(--muted); font-size: .9rem; text-align: left; }
.gridfoot .summary:not(:disabled) { color: var(--ink); text-decoration: underline; font-weight: 600; }
.gridfoot .totop { width: 44px; min-height: 44px; padding: 0; border-radius: 50%; }

/* ---------- empty / skeleton ---------- */
.empty { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 12px; padding: 24px; text-align: center; }
.empty h2 { font: 600 1.5rem/1.2 Georgia, serif; margin: 0; }
.empty p { margin: 0; }
.empty button { min-width: 240px; }
.okring { width: 56px; height: 56px; border-radius: 50%; border: 3px solid var(--accept); color: var(--accept); display: grid; place-items: center; font-size: 1.6rem; font-weight: 700; }
.skeleton { position: absolute; inset: 0; display: grid; grid-template-rows: 1fr auto auto auto; gap: 12px; padding: 12px 14px; }
.skeleton i { display: block; border-radius: 12px; background: linear-gradient(90deg, var(--chip) 25%, var(--line) 50%, var(--chip) 75%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.sk-line { height: 18px; } .sk-line.short { width: 55%; } .sk-bar { height: 60px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- toast + banner ---------- */
#layer { position: relative; z-index: 50; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(100px + env(safe-area-inset-bottom)); max-width: calc(100vw - 24px); display: flex; align-items: center; gap: 14px; min-height: 48px; padding: 0 8px 0 18px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.25); animation: rise var(--t-fast) var(--ease); }
.toast .undo { min-height: 44px; border: 0; border-radius: 999px; background: rgba(255,255,255,.18); color: inherit; font-weight: 700; padding: 0 16px; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.banner { position: fixed; left: 0; right: 0; top: calc(env(safe-area-inset-top) + var(--top-h)); z-index: 60; max-width: 760px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 4px 8px 4px 14px; background: var(--deny); color: var(--deny-ink); font-size: .92rem; }
.banner button { min-height: 44px; border: 0; background: rgba(255,255,255,.2); color: inherit; border-radius: 999px; padding: 0 14px; font-weight: 700; }

/* ---------- sheets ---------- */
.scrim { position: fixed; inset: 0; background: var(--scrim); animation: fade var(--t-fast) linear; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; max-width: 760px; margin: 0 auto; max-height: 88vh; max-height: 88dvh; display: flex; flex-direction: column; background: var(--sheet); border-radius: 16px 16px 0 0; box-shadow: var(--shadow-up); padding-bottom: env(safe-area-inset-bottom); animation: slide var(--t-med) var(--ease); }
@keyframes slide { from { transform: translateY(100%); } to { transform: none; } }
.sheet .grab { padding: 8px 18px 4px; touch-action: none; cursor: grab; }
.sheet .grabber { display: block; width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 8px; }
.sheet .grab h2 { font: 600 1.2rem/1.3 Georgia, serif; margin: 0 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet .body { overflow-y: auto; overscroll-behavior: contain; padding: 0 18px 18px; }
.sheet h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 0 6px; }
.sheet .sub { margin: 0; font-size: .9rem; }
.sheet.filter .rows { display: grid; }
.sets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.setchip { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; min-height: 60px; padding: 8px 14px; border-radius: 14px; border: 2px solid transparent; background: var(--chip); text-align: left; }
.setchip:first-child { grid-column: 1 / -1; }
.setchip .lbl { font-weight: 700; font-size: 1rem; line-height: 1.25; }
.setchip .n { color: var(--muted); font-size: .8rem; font-weight: 500; line-height: 1.3; }
.setchip .n.todo { color: var(--ink); font-weight: 600; }
.setchip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.setchip[aria-pressed="true"] .n { color: inherit; opacity: .85; }
.sheet.filter .chip { display: flex; align-items: center; gap: 14px; min-height: 56px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; padding: 0 4px; text-align: left; }
.sheet.filter .chip .lbl { flex: 1; font-weight: 600; }
.sheet.filter .chip .n { color: var(--muted); }
.sheet.filter .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--muted); display: block; flex: none; }
.sheet.filter .chip[aria-pressed="true"] .radio { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 0 45%, transparent 50%); }
.mine-progress { margin: 4px 0 6px; }
.mine-progress .line { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: 6px; }
.mine-progress .line span { color: var(--muted); }
.mine-progress .bar { height: 8px; border-radius: 4px; background: var(--chip); overflow: hidden; }
.mine-progress .bar i { display: block; height: 100%; background: var(--accept); }
.tips { font-size: .82rem; margin: 14px 0 0; }
@media (hover: none) { .kbd-only { display: none; } }
.sheet:focus { outline: none; }
.sheet .who { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; color: var(--muted); font-size: .9rem; }
.votes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.votes li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: .95rem; }
.votes b { min-width: 3.6rem; }
.votes .ok { color: var(--accept); font-weight: 600; } .votes .no { color: var(--deny); font-weight: 600; }
.votes q { flex-basis: 100%; color: var(--muted); font-size: .88rem; padding-left: 3.6rem; }
.cap p { margin: 0; white-space: pre-wrap; font-size: .95rem; }
.cap p.clamp:not(.open) { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
textarea { width: 100%; min-height: 88px; border: 2px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--bg); resize: none; font-size: 16px; }
.sheet .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.sheet .pair button { min-height: 56px; font-weight: 700; }
.sheet .clear { display: block; margin: 6px auto 0; }

/* ---------- login ---------- */
h1 { font: 600 1.75rem/1.2 Georgia, "Times New Roman", serif; letter-spacing: .01em; margin: 12px 0 4px; }
.mono { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 600 1.3rem Georgia, serif; }
.who-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0; }
.who-pick button { min-height: 72px; font-size: 1.2rem; text-transform: capitalize; }
.who-pick button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
label { display: block; font-weight: 600; margin: 8px 0; }
.passrow { display: flex; gap: 8px; align-items: stretch; }
input[type="password"], input[type="text"] { flex: 1; min-width: 0; min-height: 60px; border: 2px solid var(--line); border-radius: var(--radius); padding: 0 14px; background: var(--card); font-size: 1.15rem; }
.peek { min-height: 60px; min-width: 72px; }
.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); width: 100%; margin-top: 16px; min-height: 64px; font-weight: 700; font-size: 1.15rem; }
.ghost { background: transparent; }
.err { background: var(--deny); color: var(--deny-ink); border-radius: var(--radius); padding: 12px 16px; margin: 8px 0; }

/* ---------- lightbox ---------- */
.zoom { position: fixed; inset: 0; z-index: 20; background: #0c0907; display: grid; place-items: center; touch-action: none; overflow: hidden; user-select: none; -webkit-user-select: none; }
.zoom img { max-width: 100vw; max-height: 100vh; max-height: 100dvh; object-fit: contain; display: block; touch-action: none; -webkit-user-drag: none; transform-origin: center; will-change: transform; }
.zoom.loading::after { content: ""; position: absolute; width: 36px; height: 36px; border-radius: 50%; border: 3px solid #d8cdbd; border-right-color: transparent; animation: spin .8s linear infinite; }
.zbar { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: calc(8px + env(safe-area-inset-top)) 10px 8px; transition: opacity var(--t-med); }
.zoom.chrome-hidden .zbar { opacity: 0; pointer-events: none; }
.zbar .counter { position: static; }
.zbar button { min-height: 48px; min-width: 48px; border-radius: 999px; background: rgba(247,243,236,.92); color: #2b211b; border-color: transparent; font-weight: 700; padding: 0 12px; }

/* ---------- landscape phones and desktops: stage left, details + actions right ---------- */
@media (max-height: 520px) and (orientation: landscape), (min-width: 900px) {
  .shell { max-width: 1100px; grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: auto minmax(0, 1fr); }
  .shell > .top { grid-column: 1 / -1; }
  .shell > main { grid-column: 1; grid-row: 2; }
  .shell > #foot { grid-column: 2; grid-row: 2; overflow-x: hidden; overflow-y: auto; display: flex; flex-direction: column; justify-content: space-between; border-left: 1px solid var(--line); }
  .shell.v-grid, .shell.is-empty { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
  .shell.v-grid > #foot, .shell.is-empty > #foot { grid-column: 1; grid-row: 3; display: block; border-left: 0; overflow: visible; }
  .stage img { max-height: calc(100dvh - var(--top-h)); }
}
@media (max-height: 520px) and (orientation: landscape) {
  .top .bar { height: 44px; }
  .actions .row { grid-template-columns: 44px 1fr 48px 1fr 44px; }
  .actions button { min-height: 52px; }
}
/* Desktop and tablets in landscape: a centred app window (never taller than 1000px, so the image is not lost in a tall browser),
   with Deny / Accept big on the first row and Back / Note / Next under them. */
@media (min-width: 900px) {
  body { display: grid; place-items: center; background: var(--stage); }
  .shell { width: 100%; max-width: 1180px; height: min(100dvh, 1000px); border-radius: 0; background: var(--bg); }
  .shell > #foot { padding-bottom: 0; }
  .shell > #foot .info { padding: 16px 18px 6px; }
  .shell > #foot .info .title { font-size: 1.25rem; white-space: normal; }
  .shell > #foot .pills { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; }
  .stage::after { content: none; }
  .actions { border-top: 1px solid var(--line); box-shadow: none; padding: 14px 18px 18px; }
  .actions .row { grid-template-columns: repeat(6, 1fr); gap: 10px; }
  .actions .row > .deny { grid-column: span 3; order: 1; }
  .actions .row > .accept { grid-column: span 3; order: 2; }
  .actions .row > .step:first-child { grid-column: span 2; order: 3; }
  .actions .row > .notebtn { grid-column: span 2; order: 4; width: 100%; height: 48px; min-height: 48px; border-radius: var(--radius); }
  .actions .row > .step:last-child { grid-column: span 2; order: 5; }
  .actions .row > .step { min-height: 48px; }
  .actions button { min-width: 0; white-space: nowrap; }
  .grid { grid-template-columns: repeat(6, 1fr); }
  .grid.logos { grid-template-columns: repeat(4, 1fr); }
  .gridwrap { padding: 12px; }
  /* Sheets become right-anchored panels with a light scrim, so the image is never hidden or dimmed. */
  .scrim { background: rgba(23,18,15,.22); }
  .sheet { left: auto; right: 16px; bottom: auto; top: calc(env(safe-area-inset-top) + var(--top-h) + 4px); width: 380px; max-width: calc(100vw - 32px); max-height: calc(100dvh - var(--top-h) - 32px); border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.25); animation: fade var(--t-fast) linear; }
  .sheet .grabber { display: none; }
}
@media (min-width: 900px) and (min-height: 1020px) { .shell { border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.25); border: 1px solid var(--line); } }
@media (prefers-color-scheme: dark) and (min-width: 900px) { :root:not([data-theme="light"]) { --stage: #221b16; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  button[aria-busy="true"]::after, .zoom.loading::after { animation-duration: .9s !important; animation-iteration-count: infinite !important; }
}

.pills.fade { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.grid > .cell { display: block; min-width: 0; }
.grid > .cell > .tile { width: 100%; }
textarea::placeholder { color: var(--muted); opacity: 1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stage.logo { background: #e9e1d4; } }
@media (max-height: 520px) and (orientation: landscape) { .actions .row { grid-template-columns: 44px 1fr 48px 1fr 44px; } }

.install { margin: 20px 0 0; padding: 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(43,33,27,.08); }
.install .hd { display: flex; align-items: center; gap: 12px; }
.install .appicon { width: 48px; height: 48px; border-radius: 11px; flex: none; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.install .hd b { display: block; font: 600 1rem/1.25 Georgia, "Times New Roman", serif; }
.install .hd span { display: block; color: var(--muted); font-size: .85rem; margin-top: 2px; }
.install .steps { list-style: none; counter-reset: s; margin: 12px 0 4px; padding: 0; display: grid; gap: 8px; }
.install .steps li { counter-increment: s; display: flex; align-items: center; gap: 10px; font-size: .92rem; }
.install .steps li::before { content: counter(s); flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: .75rem; font-weight: 700; }
.install .steps .ic { width: 20px; height: 20px; color: var(--muted); flex: none; }
.install .link { display: block; margin-left: auto; }
.sheet .install { margin: 12px 0 0; box-shadow: none; }
.emblem { width: 76px; height: 76px; margin: 0 auto 4px; background: url("/hosted/icons/emblem-espresso.svg") center / contain no-repeat; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .emblem { background-image: url("/hosted/icons/emblem-ivory.svg"); } }
.shell.v-login h1, .shell.v-login .muted:first-of-type { text-align: center; }
.ic-share { --m: url("data:image/svg+xml,%3Csvg xmlns='http%3A//www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15V3M8 7l4-4 4 4'/%3E%3Cpath d='M7 10H5.5A1.5 1.5 0 004 11.5v8A1.5 1.5 0 005.5 21h13a1.5 1.5 0 001.5-1.5v-8a1.5 1.5 0 00-1.5-1.5H17'/%3E%3C/g%3E%3C/svg%3E"); }
.ic-addbox { --m: url("data:image/svg+xml,%3Csvg xmlns='http%3A//www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3.5' y='3.5' width='17' height='17' rx='3.5'/%3E%3Cpath d='M12 8v8M8 12h8'/%3E%3C/g%3E%3C/svg%3E"); }
.ic-check { --m: url("data:image/svg+xml,%3Csvg xmlns='http%3A//www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.update { position: fixed; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top) + var(--top-h) + 8px); z-index: 70; display: flex; align-items: center; gap: 12px; padding: 4px 6px 4px 16px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.update button { min-height: 44px; border: 0; border-radius: 999px; background: rgba(255,255,255,.18); color: inherit; font-weight: 700; padding: 0 16px; }
.devinfo { font-size: .75rem; margin: 6px 0 0; }
