/* Run a Moment: design D "Finisher" (bib, medal, certificate) in the brand CI: black, orange #FF6A3D, off-white. */
:root {
  --bg: #F8F8F8;
  --paper: #FFFFFF;
  --ink: #111111;
  --accent: #FF6A3D;
  --accent-2: #FFB59E;
  --muted: #5F6670;
  --line: #DADCE0;
  --photo: #E4E5E7;
  --danger: #C62828;
  --ok: #2E7D4F;
  --radius: 12px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 'Prompt', 'Sukhumvit Set', 'Noto Sans Thai', sans-serif;
}
.num { font-family: 'Montserrat', 'Prompt', sans-serif; }
a { color: var(--ink); }
img { max-width: 100%; display: block; }
p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap;
  min-height: 56px; padding: 8px 20px; max-width: 960px; margin: 0 auto;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand img { width: 34px; height: 34px; }
.brand span { font-family: 'Montserrat', 'Prompt', sans-serif; font-weight: 700; font-size: 14px; letter-spacing: 0.22em; }
.on-home .brand span { display: none; }
.brand small { font-family: 'Prompt', sans-serif; font-size: 15px; font-weight: 600; letter-spacing: 0; color: var(--ink); }
.top-link { font-size: 14px; color: var(--muted); text-decoration: none; }
.home-hero { text-align: center; padding: 6px 0 22px; }
.home-hero img { width: min(340px, 86%); margin: 0 auto; }
.by {
  font-family: 'Montserrat', 'Prompt', sans-serif; font-weight: 600; font-size: 12px;
  letter-spacing: 0.2em; color: var(--muted); text-decoration: none; text-transform: uppercase;
}
/* Keeps a longer name like WINMIX.PICTURE on the brand row on 390px phones. */
@media (max-width: 420px) { .by { letter-spacing: 0.1em; } }
main { max-width: 960px; margin: 0 auto; padding: 0 20px 120px; }
footer { max-width: 960px; margin: 0 auto; padding: 24px 20px 40px; color: var(--muted); font-size: 14px; display: flex; gap: 18px; flex-wrap: wrap; }
footer a { color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 10px 18px; border-radius: 8px; border: 2px solid var(--ink);
  background: transparent; color: var(--ink); cursor: pointer; font-weight: 600; font-size: 17px; text-decoration: none;
}
.btn svg { flex: none; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn.primary { background: var(--ink); color: #FFFFFF; }
.btn.big { min-height: 58px; font-size: 18px; width: 100%; }
.btn.ghost { border-color: var(--line); }
.btn.wide { width: 100%; }
.btn.small { min-height: 42px; padding: 6px 14px; font-size: 15px; border-width: 1.5px; }
.btn.danger { color: var(--danger); border-color: currentColor; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > .btn { flex: 1 1 140px; }
.stack { display: grid; gap: 10px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.linkish { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 8px; min-height: 40px; font-size: 15px; }

/* race bib */
.bib { position: relative; background: var(--paper); border-radius: 12px; box-shadow: 0 10px 24px rgba(17, 17, 17, 0.16); overflow: hidden; }
.bib-band {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--ink); color: #FFFFFF;
  padding: 8px 28px; font-family: 'Montserrat', 'Prompt', sans-serif; font-weight: 700; font-size: 11px; letter-spacing: 0.22em;
}
.bib-band b { color: var(--accent-2); font-weight: 700; }
.bib-body { display: flex; align-items: center; gap: 14px; padding: 6px 28px 8px; }
.bib-no { display: flex; flex-direction: column; flex: none; }
.bib-no small { font-family: 'Montserrat', 'Prompt', sans-serif; font-size: 10px; font-weight: 700; letter-spacing: 0.22em; color: var(--muted); }
.bib-no strong { font-family: 'Montserrat', 'Prompt', sans-serif; font-size: 48px; font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; }
.bib-name { font-size: 20px; font-weight: 600; line-height: 1.3; }
.bib-date { font-size: 14px; color: var(--muted); }
.bib-foot { display: flex; justify-content: space-between; gap: 10px; border-top: 2px dashed var(--line); padding: 7px 28px 9px; font-size: 14px; }
.bib-hole { position: absolute; width: 9px; height: 9px; border-radius: 5px; background: var(--bg); border: 1px solid var(--line); }
.bib-hole.tl { top: 40px; left: 9px; } .bib-hole.tr { top: 40px; right: 9px; }
.bib-hole.bl { bottom: 9px; left: 9px; } .bib-hole.br { bottom: 9px; right: 9px; }

/* home */
.album-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px; margin-top: 4px; }
.album-card { display: block; text-decoration: none; color: inherit; }
.album-cover { height: 200px; border-radius: 12px; overflow: hidden; background: var(--photo); }
.album-cover img { width: 100%; height: 100%; object-fit: cover; }
.album-card .bib { margin: -36px 12px 0; }

/* album page */
.hero-img { margin: 0 -20px; height: 250px; overflow: hidden; background: var(--photo); }
.hero-img img { width: 100%; height: 100%; object-fit: cover; }
.hero-bib { margin-top: -44px; position: relative; }
@media (min-width: 700px) {
  .hero-img { margin: 0; height: 360px; border-radius: 12px; }
  .hero-bib { margin: -56px 24px 0; }
}
.actions { display: grid; gap: 10px; margin: 18px 0 8px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 26px 0 6px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.time-head { font-size: 16px; font-weight: 600; margin: 14px 0 8px; }
.subhead { font-size: 15px; font-weight: 500; color: var(--muted); margin: 18px 0 8px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 6px; }
.ph { position: relative; padding: 0; border: 0; background: var(--photo); aspect-ratio: 1; cursor: pointer; overflow: hidden; border-radius: 8px; }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.tag {
  position: absolute; left: 7px; bottom: 7px; background: var(--paper); color: var(--ink);
  font-family: 'Montserrat', 'Prompt', sans-serif; font-weight: 700; font-size: 12px; letter-spacing: 0.06em;
  padding: 2px 8px 2px 6px; border-radius: 4px; border-left: 4px solid var(--accent); line-height: 1.3;
}
.ph .tick {
  position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; border: 2px solid #FFFFFF;
  background: rgba(17, 17, 17, 0.35); display: none; align-items: center; justify-content: center; color: #FFFFFF;
}
.selecting .ph .tick { display: flex; }
.ph.selected .tick { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.ph.selected img { opacity: 0.75; }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 14px 0; }
.panel h2, .panel h3 { margin: 0 0 6px; }
.status { display: flex; align-items: center; gap: 12px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* The whole card is the tip button. */
.water-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; color: var(--ink); cursor: pointer; text-decoration: none; }
.water-card span.label { flex: 1 1 auto; min-width: 0; font-size: 16px; font-weight: 600; }
.water-card .chev { flex: none; color: var(--muted); }
.water { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.water h2 { margin: 0; }
.water-icon { flex: none; width: 52px; height: 52px; border-radius: 26px; background: var(--accent); color: #FFFFFF; display: flex; align-items: center; justify-content: center; }
.water-card .water-icon { width: 44px; height: 44px; }
/* Same card shape as the matcha tip button, but its own colour so the two don't blend together -
   this one is an outbound link to Facebook, not an in-page action. */
.follow-card .water-icon { background: var(--ink); }
.account-box { display: grid; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.account-box strong { font-size: 17px; overflow-wrap: anywhere; user-select: text; }
.account-box .btn { margin-top: 8px; justify-self: start; }

/* medal */
.medal { position: relative; width: 120px; height: 150px; margin: 8px auto 0; }
.medal svg { position: absolute; left: 0; top: 0; }
.medal-disc {
  position: absolute; left: 12px; top: 52px; width: 96px; height: 96px; border-radius: 48px; background: var(--accent);
  border: 5px solid var(--accent-2); display: flex; align-items: center; justify-content: center;
  font-family: 'Montserrat', 'Prompt', sans-serif; font-weight: 700; font-size: 44px; line-height: 1;
}
.results-title { text-align: center; font-size: 26px; font-weight: 700; line-height: 1.3; margin-top: 8px; }
.results-sub { text-align: center; font-size: 15px; color: var(--muted); }

/* checkpoints */
.cp { display: flex; gap: 12px; align-items: flex-start; }
.cp-no {
  flex: none; width: 48px; height: 28px; border-radius: 6px; background: var(--ink); color: #FFFFFF; margin-top: 1px;
  font-family: 'Montserrat', 'Prompt', sans-serif; font-weight: 700; font-size: 12px; letter-spacing: 0.08em;
  display: flex; align-items: center; justify-content: center;
}
.saved-line {
  display: flex; align-items: center; gap: 10px; background: #E8F5EC; border-radius: 12px;
  padding: 10px 14px; margin-bottom: 14px; font-size: 16px; font-weight: 700; color: var(--ok);
}
.saved-badge { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--ok); color: #FFFFFF; display: flex; align-items: center; justify-content: center; }

.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.97); border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: center;
}
.bar .btn { flex: 1; max-width: 320px; }
.bar .bar-note { align-self: center; font-size: 14px; color: var(--muted); }
.flow-bar { display: flex; align-items: center; justify-content: flex-end; gap: 14px; width: 100%; max-width: 1080px; }
.flow-bar .flow-info { margin-right: auto; }
.flow-bar .btn { flex: 0 1 auto; max-width: none; padding-left: 22px; padding-right: 22px; }
@media (max-width: 640px) {
  .flow-bar { flex-direction: column-reverse; align-items: stretch; gap: 8px; }
  .flow-bar .flow-info { display: none; }
  .flow-bar .btn { width: 100%; }
}
.fb-chk { list-style: none; margin: 4px 0 12px; padding: 0; }
.fb-chk li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.fb-chk li > b { width: 28px; height: 28px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-size: 13px; background: #E9F4EC; color: #2E7D32; }
.fb-chk li.todo > b { background: var(--paper); border: 2px solid var(--ink); color: var(--ink); }
.fb-chk li > span { flex: 1; }
.fb-cap { width: 100%; min-height: 120px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 16px; background: #F7F7F7; resize: vertical; }

/* bottom sheet */
/* While a sheet is open the page is pinned (top set in common.js) so it can't scroll behind it. */
body.sheet-open { position: fixed; left: 0; right: 0; width: 100%; }
.backdrop { position: fixed; inset: 0; background: rgba(17, 17, 17, 0.55); z-index: 40; touch-action: none; }
.sheet {
  position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px; max-height: 92vh; overflow: auto;
  overscroll-behavior: contain;
  background: var(--paper); border-radius: 18px 18px 0 0; padding: 12px 22px calc(24px + env(safe-area-inset-bottom));
}
.sheet::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 18px; }
.sheet h2 { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.3; }
.lead { color: var(--muted); }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 14px; background: var(--bg); border-radius: 10px; margin-top: 18px; cursor: pointer; font-size: 15px; }
.check input { width: 24px; height: 24px; flex: none; margin: 2px 0 0; accent-color: var(--ink); }
.qrbox { background: #FFFFFF; border-radius: 12px; padding: 14px; width: min(280px, 100%); margin: 12px auto; border: 1px solid var(--line); }
.qrbox img { width: 100%; image-rendering: pixelated; }
label.field { display: grid; gap: 6px; margin: 12px 0; font-size: 15px; }
.field input, .field textarea { width: 100%; padding: 12px; border-radius: 8px; border: 1.5px solid var(--line); background: #FFFFFF; min-height: 48px; }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); height: 46px; border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; margin-top: 16px; }
.seg button { border: 0; background: transparent; cursor: pointer; font-size: 16px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #FFFFFF; font-weight: 600; }
.cert-preview { display: block; width: 100%; max-width: 330px; margin: 14px auto 0; border-radius: 4px; box-shadow: 0 12px 28px rgba(17, 17, 17, 0.2); }

/* full-screen viewer */
.viewer { position: fixed; inset: 0; z-index: 30; background: #111111; color: #FFFFFF; display: flex; flex-direction: column; }
.viewer .stage { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; position: relative; }
.viewer .stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer .vtop { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; font-size: 15px; }
.viewer .vtop .num { font-size: 15px; font-weight: 600; letter-spacing: 0.08em; }
.viewer .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 64px; border: 0; background: rgba(0, 0, 0, 0.35); color: #FFFFFF; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.viewer .nav.prev { left: 0; border-radius: 0 10px 10px 0; }
.viewer .nav.next { right: 0; border-radius: 10px 0 0 10px; }
.viewer .vbar { padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.viewer .btn { color: #FFFFFF; border-color: rgba(255, 255, 255, 0.45); }
.viewer .btn.primary { background: var(--accent); border-color: var(--accent); color: #111111; }
.viewer .vlinks { grid-column: 1 / -1; display: flex; justify-content: center; gap: 12px; }
.viewer .linkish { color: #C9D0DE; }

.prose { max-width: 680px; }
.prose h1 { font-size: 26px; margin: 8px 0; }
.prose h2 { font-size: 18px; margin-top: 14px; }
.prose p, .prose li { margin: 6px 0; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }

/* home page, no album published yet */
.soon-card { max-width: 460px; margin: 4px auto 0; background: var(--paper); border-radius: var(--radius); box-shadow: 0 10px 24px rgba(17, 17, 17, 0.16); overflow: hidden; }
.soon-cover { height: 200px; background: var(--photo); overflow: hidden; }
.soon-cover img { width: 100%; height: 100%; object-fit: cover; }
.soon-body { padding: 22px 24px 26px; text-align: center; }
.soon-body h2 { margin: 0 0 8px; font-size: 22px; }
.soon-body p { color: var(--muted); font-size: 15px; line-height: 1.6; margin: 0 0 18px; }

/* toast sits at the top so it never covers buttons in a bottom sheet */
.toast {
  position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 60;
  background: var(--ink); color: #FFFFFF; padding: 10px 18px; border-radius: 999px; font-weight: 600;
  max-width: calc(100% - 32px); text-align: center; box-shadow: 0 8px 20px rgba(17, 17, 17, 0.25);
}

/* back office */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 8px; }
.card { display: block; background: var(--paper); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); border: 1px solid var(--line); }
.card .cover { aspect-ratio: 16 / 9; background: var(--photo); }
.card .cover img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 12px 14px 14px; }
.card h2 { margin: 0 0 2px; font-size: 18px; }
.meta { color: var(--muted); font-size: 14px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.tabs { display: flex; gap: 6px; margin: 4px 0 16px; flex-wrap: wrap; }
.tabs button { min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { background: var(--ink); color: #FFFFFF; border-color: var(--ink); font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 10px 0; }
.stat { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.stat b { display: block; font-family: 'Montserrat', 'Prompt', sans-serif; font-size: 22px; line-height: 1.2; }
.stat span { color: var(--muted); font-size: 13px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; background: var(--bg); color: var(--muted); }
.badge.live { background: var(--accent); color: var(--ink); font-weight: 600; }
.progress { height: 10px; background: var(--bg); border-radius: 99px; overflow: hidden; margin: 10px 0; }
.progress div { height: 100%; background: var(--accent); width: 0; transition: width 0.3s; }
.aph { position: relative; }
.aph .info { position: absolute; left: 4px; bottom: 4px; font-size: 12px; background: rgba(17, 17, 17, 0.75); color: #FFFFFF; padding: 1px 6px; border-radius: 6px; }
.aph .eye-flag { position: absolute; right: 4px; top: 4px; font-size: 11px; font-weight: 600; background: #FFF2D9; color: #6A3E00; padding: 2px 6px; border-radius: 6px; }
.eye-note { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; background: #FFF2D9; color: #6A3E00; }
.aph.is-hidden img { opacity: 0.3; }
.req { display: flex; gap: 12px; align-items: flex-start; border-top: 1px solid var(--line); padding: 12px 0; }
.req img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; flex: none; }
.req .body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.error { color: var(--danger); }
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px 16px; text-align: center; background: var(--paper); }
.speed-test { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.speed-copy { flex: 1; min-width: 0; }
.speed-copy b { display: block; margin-bottom: 2px; }
.speed-ok { color: var(--ok); }
.speed-loading { display: flex; align-items: center; gap: 12px; min-height: 52px; }
@media (max-width: 520px) {
  .speed-test { align-items: stretch; flex-direction: column; }
  .speed-test .btn { width: 100%; }
}
details.panel summary { cursor: pointer; font-weight: 600; min-height: 32px; }

/* back office: Facebook post set */
.post-entry h3 { margin: 0 0 4px; }
.strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 12px 0 14px; }
.strip span { aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--photo); }
.strip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.strip .more { display: flex; align-items: center; justify-content: center; background: var(--ink); color: #FFFFFF; font-family: 'Montserrat', 'Prompt', sans-serif; font-weight: 700; }
.seg.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.seg.three button { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 6px; }
.seg-label { font-size: 14px; color: var(--muted); margin: 16px 0 -8px; }
.pgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 16px; }
.pgrid .ph { cursor: default; }
.ph-open { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.ord { position: absolute; top: 6px; left: 6px; width: 24px; height: 24px; border-radius: 12px; background: var(--accent); color: #FFFFFF;
  font: 700 13px 'Montserrat', sans-serif; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.pgrid .rm, .pgrid .add { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 15px; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; }
.pgrid .rm { background: rgba(255, 255, 255, 0.94); color: var(--ink); }
.pgrid .add { background: var(--accent); color: #FFFFFF; font: 700 20px/1 'Montserrat', sans-serif; }
.why { position: absolute; left: 6px; bottom: 6px; background: rgba(17, 17, 17, 0.72); color: #FFFFFF; font-size: 11px; line-height: 1.3;
  padding: 2px 7px; border-radius: 6px; pointer-events: none; }
.wm-prev { margin-top: 14px; }
.wm-prev canvas { display: block; width: 100%; height: auto; border-radius: 10px; background: var(--photo); }
textarea.caption { display: block; width: 100%; box-sizing: border-box; margin: 8px 0 12px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--bg); font: inherit; font-size: 15px; line-height: 1.6; resize: vertical; color: var(--ink); }
#view.with-bar { padding-bottom: 96px; }

/* post set: drag to reorder, add from all photos */
.pgrid.sortable .ph { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.pgrid.sortable .ph img { -webkit-user-drag: none; }
.pgrid .ph.dragging { z-index: 20; pointer-events: none; box-shadow: 0 10px 28px rgba(17, 17, 17, 0.35); transition: none; }
.pgrid.is-sorting .ph:not(.dragging) { transition: transform 0.12s; }
.pgrid .add.is-in { display: flex; align-items: center; justify-content: center; background: var(--ink); cursor: default; font-size: 16px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.chip { border: 1.5px solid var(--line); background: var(--paper); border-radius: 18px; padding: 6px 14px; font: inherit; font-size: 14px; cursor: pointer; color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }

/* album cover crop editor */
.cover-frames { display: grid; gap: 12px; margin: 12px 0 16px; }
.cover-frames figure { margin: 0; }
.cover-frame { width: 100%; overflow: hidden; border-radius: 10px; background: var(--photo); }
.cover-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-frame.editing { cursor: grab; touch-action: none; }
.cover-frame.editing:active { cursor: grabbing; }

/* System health page: one row per check, with a colour dot AND a word, never colour alone. */
.health-head { display: flex; align-items: center; gap: 10px; }
.health-head b { font-size: 18px; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.dot.ok { background: var(--ok); }
.dot.warn { background: #E0A100; }
.dot.bad { background: var(--danger); }
.checks { list-style: none; margin: 12px 0 0; padding: 0; }
.checks li { display: flex; gap: 12px; align-items: flex-start; border-top: 1px solid var(--line); padding: 11px 0; }
.checks .dot { margin-top: 6px; }
.checks .txt { flex: 1; min-width: 0; }
.checks .txt b { display: block; font-weight: 500; }
.checks .txt span { color: var(--muted); font-size: 13px; display: block; }
.checks .val { font-family: 'Montserrat', 'Prompt', sans-serif; font-weight: 700; text-align: right; }
.checks .val small { display: block; font-family: 'Prompt', sans-serif; font-weight: 500; font-size: 12px; white-space: nowrap; }
.lbl-ok { color: var(--ok); }
.lbl-warn { color: #8A5A00; }
.lbl-bad { color: var(--danger); }

/* Time filter on the album page: one row that scrolls sideways, so a long shoot with many
   15-minute blocks never pushes the photos down the page. */
.tf-hint { margin: 2px 0 0; }
.time-chips {
  margin: 6px 0 2px; flex-wrap: nowrap; overflow-x: auto; gap: 6px;
  scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch;
  padding-bottom: 2px; margin-right: -20px; padding-right: 20px; /* let it run to the screen edge */
}
.time-chips::-webkit-scrollbar { display: none; }
.time-chips .chip {
  flex: none; padding: 5px 12px; font-size: 14px; border-radius: 16px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.chip-n { margin-left: 5px; font-size: 11px; opacity: 0.65; }

/* Back to the album list. Runners arriving from a shared link (often inside the Facebook in-app
   browser) have no history to go back to, and few people try tapping the logo on a phone. */
.back-home { margin: 4px 0 8px; }
.back-home a { display: inline-flex; align-items: center; min-height: 40px; color: var(--muted); font-size: 15px; text-decoration: none; }

/* Post set, two steps: heart the photos worth posting, then order them. */
.ps-steps { display: flex; gap: 8px; margin: 14px 0 0; }
.ps-steps span { flex: 1; text-align: center; font-size: 13px; padding: 7px 0; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.ps-steps span.on { background: var(--ink); border-color: var(--ink); color: #FFFFFF; font-weight: 600; }
.ps-count { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 14px 0 0; }
.ps-count b { font: 700 22px 'Montserrat', 'Prompt', sans-serif; }
.pgrid .heart { position: absolute; top: 4px; right: 4px; width: 36px; height: 36px; border-radius: 18px; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; background: rgba(17, 17, 17, 0.45); }
.pgrid .heart svg { fill: none; stroke: #FFFFFF; stroke-width: 2; }
.pgrid .heart.on { background: rgba(255, 255, 255, 0.95); }
.pgrid .heart.on svg { fill: var(--accent); stroke: var(--accent); }
.pgrid .ph.feed { outline: 3px solid var(--accent); outline-offset: -3px; }
.ps-divider { display: flex; align-items: center; gap: 8px; margin: 16px 0 -6px; font-size: 13px; color: var(--muted); }
.feedtag { background: #FFF2D9; color: #6A3E00; font-size: 12px; padding: 2px 8px; border-radius: 6px; font-weight: 600; }
/* The album page in the order the job is actually done: upload, cull + cover, publish, post set.
   Only the current step is open; finished ones collapse to a line, later ones say what unlocks them. */
.ev-steps { display: flex; gap: 8px; margin: 16px 0 0; flex-wrap: wrap; }
.ev-steps button {
  flex: 1 1 140px; text-align: center; font: inherit; font-size: 13px; padding: 7px 4px; border-radius: 999px;
  background: var(--paper); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; cursor: pointer;
}
.ev-steps button.on { background: var(--ink); border-color: var(--ink); color: #FFFFFF; font-weight: 600; }
.ev-steps button.done { background: #EAF5EE; border-color: #BFE0CC; color: var(--ok); }
.ev-steps button:disabled { cursor: default; opacity: 0.55; }
.ev-steps { display: grid; grid-template-columns: repeat(6, 1fr); } /* 3 Nov: six steps in one row on a computer */
@media (max-width: 640px) { .ev-steps { grid-template-columns: repeat(3, 1fr); gap: 6px; } .ev-steps button { padding: 8px 4px; font-size: 13px; min-height: 44px; line-height: 1.2; } }
.ev-card { background: var(--paper); border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 20px; margin: 14px 0; }
.ev-card h3 { margin: 0; font-size: 19px; }
.ev-card .lead { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.ev-now { display: inline-block; background: var(--accent); color: #FFFFFF; font: 600 12px 'Montserrat', 'Prompt', sans-serif; letter-spacing: 0.06em; padding: 3px 10px; border-radius: 999px; margin-bottom: 8px; }
.ev-row { display: flex; align-items: center; gap: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 16px; margin: 8px 0; color: var(--muted); font-size: 15px; }
.ev-row .n { flex: none; width: 26px; height: 26px; border-radius: 13px; background: var(--bg); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font: 600 13px 'Montserrat', sans-serif; color: var(--muted); }
.ev-row.ok .n { background: #EAF5EE; border-color: #BFE0CC; color: var(--ok); }
.ev-row b { color: var(--ink); font-weight: 600; }
.ev-row .what { flex: 1; min-width: 0; overflow-wrap: anywhere; } /* the album URL is one long unbreakable word */
.ev-row .sum { flex: none; display: flex; gap: 8px; align-items: center; }
.ev-row .btn.small { min-height: 36px; font-size: 14px; padding: 4px 12px; }
.ev-row.locked { opacity: 0.55; }
.ev-row.tappable { cursor: pointer; }
.ev-drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 26px 16px; text-align: center; background: var(--bg); margin-top: 14px; }
.ev-drop .btn { max-width: 340px; margin: 0 auto; }
.ev-cover { display: flex; gap: 16px; align-items: flex-start; margin-top: 14px; flex-wrap: wrap; }
.ev-cover .cover-frame { flex: none; width: min(280px, 100%); border-radius: 10px; overflow: hidden; background: var(--photo); }
.ev-cover .cover-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ev-cover .acts { display: flex; flex-direction: column; gap: 10px; }
.ev-bar { display: flex; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.ev-bar .btn { flex: 1 1 200px; }
.ev-eta { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--muted); margin-top: 4px; flex-wrap: wrap; }
.ev-note { background: #FFF7E8; border: 1px solid #F0DCB4; border-radius: 10px; padding: 10px 14px; font-size: 14px; color: #6A3E00; margin-top: 14px; }
/* (class names are namespaced: .top is the site header) How the first five sit in a Facebook feed post, roughly: two on top, three below, "+N" on the last. */
.fbp { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 6px; margin-top: 10px; }
.fbp-row { display: grid; gap: 3px; }
.fbp-a { aspect-ratio: 420 / 170; }
.fbp-a.n1 { aspect-ratio: 420 / 240; }
.fbp-b { aspect-ratio: 420 / 110; margin-top: 3px; }
.fbp-row.n1 { grid-template-columns: 1fr; } .fbp-row.n2 { grid-template-columns: 1fr 1fr; } .fbp-row.n3 { grid-template-columns: 1fr 1fr 1fr; }
.fbp-row > * { min-width: 0; min-height: 0; overflow: hidden; border-radius: 2px; }
.fbp img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; display: block; }
/* 5 photos or more, measured on Bro!'s own post (10 Oct): two squares over three squares, each cropped from the centre. */
.fbp-a.n2:has(+ .fbp-b.n3) { aspect-ratio: 2 / 1; }
.fbp-a.n2 + .fbp-b.n3 { aspect-ratio: 3 / 1; }
.fbp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; aspect-ratio: 1 / 1; }
.fbp-col { display: grid; gap: 3px; min-width: 0; min-height: 0; } .fbp-col.l { grid-template-rows: 1fr 1fr; } .fbp-col.r { grid-template-rows: 1fr 1fr 1fr; }
.fbp-col > * { min-width: 0; min-height: 0; overflow: hidden; border-radius: 2px; }
.fbp .more { position: relative; }
.fbp .more span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.5); color: #FFFFFF; font: 700 26px 'Montserrat', sans-serif; }
/* Full-screen viewer for comparing photos at size. */
.psv { position: fixed; inset: 0; z-index: 60; background: #111111; color: #FFFFFF; display: flex; flex-direction: column; overscroll-behavior: contain; }
.psv-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; }
.psv-top .num { font: 600 15px 'Montserrat', sans-serif; }
.psv-top .small { color: #B8BCC2; }
.psv-x { width: 44px; height: 44px; border: 0; border-radius: 22px; background: rgba(255, 255, 255, 0.12); color: #FFFFFF; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.psv-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; touch-action: pan-y; }
.psv-img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-select: none; }
.psv-arr { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 0; border-radius: 22px;
  background: rgba(255, 255, 255, 0.18); color: #FFFFFF; font-size: 26px; line-height: 1; cursor: pointer; }
.psv-arr.l { left: 8px; } .psv-arr.r { right: 8px; }
.psv-actions { padding: 12px 16px 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.psv-actions .btn.psv-colour:not(.like-on) { background: #FFFFFF; border-color: #FFFFFF; color: var(--ink); }
.psv-actions .btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; }
.psv-actions .btn:not(.like-on) { background: transparent; border-color: #FFFFFF; color: #FFFFFF; }
.psv-actions .btn svg { fill: none; stroke: currentColor; stroke-width: 2; }
.psv-actions .btn.like-on { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.psv-actions .btn.like-on svg { fill: #FFFFFF; stroke: #FFFFFF; }
.psv-note { margin: 4px 16px 8px; color: #B8BCC2; }
.psv-strip { display: flex; gap: 6px; padding: 0 16px calc(16px + env(safe-area-inset-bottom)); overflow-x: auto; }
.psv-strip button { flex: none; padding: 0; border: 0; background: none; border-radius: 6px; overflow: hidden; opacity: 0.55; cursor: pointer; }
.psv-strip button.cur { opacity: 1; outline: 2px solid var(--accent); outline-offset: -2px; }
.psv-strip img { width: 52px; height: 52px; object-fit: cover; display: block; }

/* tip thank-you sheet (after "โอนแล้ว") */
.btn.accent { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.ty-burst { position: relative; height: 0; }
.ty-burst i {
  position: absolute; top: 40px; left: 50%; width: 8px; height: 8px; border-radius: 2px; opacity: 0;
  background: var(--accent); animation: ty-pop 900ms ease-out forwards; animation-delay: calc(var(--i) * 25ms);
  --a: calc(var(--i) * 30deg);
}
.ty-burst i:nth-child(3n) { background: var(--ink); width: 6px; height: 6px; }
.ty-burst i:nth-child(3n+1) { background: var(--accent-2); }
@keyframes ty-pop {
  0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(0.6); }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(-130px) scale(1); }
}
@media (prefers-reduced-motion: reduce) { .ty-burst i { animation: none; } }
.ty-drink { width: 228px; margin: 0 auto; }
.ty-drink svg { display: block; overflow: visible; }
.ty-pour { transform-box: fill-box; transform-origin: 50% 50%; animation: ty-pour 2900ms ease-in-out forwards; }
/* Rests beside the cup at the end; pours from above it (lip over the rim) in between. */
@keyframes ty-pour {
  0% { opacity: 0; transform: translate(-34px, -122px) rotate(0deg); }
  12% { opacity: 1; transform: translate(-34px, -111px) rotate(-48deg); }
  72% { opacity: 1; transform: translate(-34px, -111px) rotate(-48deg); }
  90%, 100% { opacity: 1; transform: translate(0, 0) rotate(0deg); }
}
.ty-stream { stroke-dasharray: 130; stroke-dashoffset: 130; opacity: 0; animation: ty-stream 2900ms linear forwards; }
@keyframes ty-stream {
  0%, 14% { stroke-dashoffset: 130; opacity: 0; }
  15% { opacity: 1; }
  26% { stroke-dashoffset: 0; }
  72% { stroke-dashoffset: 0; opacity: 1; }
  80%, 100% { stroke-dashoffset: -130; opacity: 0; }
}
.ty-lid { opacity: 0; transform: translateY(-26px); animation: ty-lid 380ms cubic-bezier(.3, 1.4, .5, 1) 2750ms forwards; }
@keyframes ty-lid { to { opacity: 1; transform: translateY(0); } }
.ty-fill { transform: translateY(98px); animation: ty-fill 1700ms cubic-bezier(.35, .1, .3, 1) 600ms forwards; }
@keyframes ty-fill { to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .ty-stream { animation: none; opacity: 0; }
  .ty-pour { animation: none; opacity: 1; transform: none; }
  .ty-fill { animation: none; transform: none; }
  .ty-lid { animation: none; opacity: 1; transform: none; }
}
.sheet h2.ty-title { text-align: center; font-size: 28px; line-height: 1.25; margin-top: 14px; }
.ty-note { margin-top: 18px; background: var(--bg); border-radius: 12px; padding: 14px 16px; border-left: 4px solid var(--accent); }
.ty-sig { font-family: 'Montserrat', 'Prompt', sans-serif; font-weight: 700; font-size: 12px; letter-spacing: 0.14em; color: var(--muted); margin-top: 8px; text-transform: uppercase; }

/* Autopilot (Mac) folder rows */
.ap-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line, #e5e5e5); }
.ap-row:first-of-type { border-top: 0; }
.ap-row .btn { flex: none; }

/* Back-office photo viewer: big on open, click to zoom to full size, arrows to step */
.blur-flag { position: absolute; left: 6px; top: 6px; background: #c0392b; color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 6px; }
.grid-sort { margin: 4px 0 8px; }
.pv { position: fixed; inset: 0; z-index: 60; background: #0d0d0d; color: #eee; display: grid; grid-template-rows: auto 1fr auto; }
.pv-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; }
.pv-top .small { color: #ccc; white-space: pre-wrap; }
.pv-soft { color: #ff8a7a; }
.pv-x { background: none; border: 0; color: #fff; font-size: 22px; min-width: 44px; min-height: 44px; cursor: pointer; }
.pv-stage { overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 0; }
.pv-stage img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; user-select: none; }
.pv-stage.zoomed { overflow: auto; display: block; }
.pv-stage.zoomed img { max-width: none; max-height: none; cursor: zoom-out; }
.pv-nav { position: fixed; top: 50%; transform: translateY(-50%); width: 52px; height: 72px; border: 0; border-radius: 10px; background: rgba(255,255,255,.12); color: #fff; font-size: 38px; cursor: pointer; }
.pv-nav.prev { left: 10px; } .pv-nav.next { right: 10px; }
.pv-nav:disabled { opacity: .25; cursor: default; }
.pv-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: #181818; }
.pv-bar .btn { background: #fff; }
.pv-bar .btn.danger { background: #fff; }
.pv-hint { color: #aaa; flex-basis: 100%; text-align: center; }
@media (max-width: 600px) { .pv-nav { width: 40px; height: 56px; font-size: 30px; } }

/* Shirt-colour filter and the "found them all?" question */
.color-chips { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 8px; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.color-chips .chip { flex: none; white-space: nowrap; min-height: 34px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.25); }
.fb-panel { margin-top: 16px; }
.fb-panel h2 { font-size: 18px; margin: 0 0 10px; }
.fb-row { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-row .btn { flex: 1 1 30%; min-height: 44px; }
.fb-panel textarea { width: 100%; margin-top: 10px; min-height: 64px; border-radius: 10px; border: 1.5px solid var(--line); padding: 8px 10px; font: inherit; font-size: 15px; box-sizing: border-box; }

/* Autopilot page: status box, three stages, alerts, setup steps */
.ap-hero { background: var(--paper); border: 1.5px solid var(--line); border-radius: 16px; padding: 22px; margin-bottom: 14px; }
.ap-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; vertical-align: 0; }
.ap-big { font-size: 24px; font-weight: 600; line-height: 1.3; margin: 6px 0; }
.ap-bar { height: 10px; background: #EEE; border-radius: 6px; overflow: hidden; margin-top: 14px; }
.ap-bar i { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.ap-pipe { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 8px; align-items: center; margin: 16px 0 12px; }
.ap-st { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; background: #fff; }
.ap-st b { display: block; font-size: 22px; font-family: 'Montserrat', 'Prompt', sans-serif; }
.ap-st.on { border-color: var(--ink); } .ap-st.done { border-color: var(--ok); } .ap-st.warn { border-color: #E0A800; background: #FFFBEA; }
.ap-arrow { color: var(--muted); }
.ap-ok { color: var(--ok); font-weight: 600; }
.ap-alert { background: #FFFBEA; border: 1.5px solid #E0A800; border-radius: 12px; padding: 14px 16px; margin-top: 14px; }
.ap-alert h3 { margin: 0 0 6px; font-size: 17px; }
.ap-alert ol { margin: 6px 0 10px; padding-left: 20px; }
.ap-update { background: var(--ink); color: #fff; border-radius: 12px; padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.ap-update .btn { background: #fff; color: var(--ink); }
.ap-meter { display: flex; gap: 4px; margin: 8px 0; } .ap-meter i { width: 24px; height: 24px; border-radius: 6px; background: var(--ok); } .ap-meter i.x { background: #E6E6E6; }
.ap-steps { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; } .ap-steps span { flex: 1 1 0; min-width: 90px; text-align: center; font-size: 13px; padding: 6px; border-radius: 8px; background: #EEE; }
.ap-steps span.on { background: var(--ink); color: #fff; } .ap-steps span.done { background: #DCEFE3; }
.ap-fold { border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 8px 0; background: #fff; }
@media (max-width: 600px) { .ap-pipe { grid-template-columns: 1fr; } .ap-arrow { display: none; } .ap-big { font-size: 20px; } }
.ap-hero .row { margin-top: 12px; gap: 10px; }
.bad { color: var(--danger); }
/* Phone view of the Mac autopilot: three counters side by side even on a narrow screen. */
.ap-pipe3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0; }
.ap-pipe3 .ap-st b { font-size: 20px; }
.ap-cmds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ap-cmds .btn { min-height: 48px; }
/* Phone (8 Oct walk at 390px): rows with three buttons squeezed the album link into one letter per line, the
   album grid showed two photos a row (858 photos = 50,000px of scrolling), the viewer spoke of keys. */
@media (max-width: 520px) {
  .ev-row { flex-wrap: wrap; }
  .ev-row .sum { flex-wrap: wrap; width: 100%; padding-left: 38px; }
  #agrid { grid-template-columns: repeat(3, 1fr); gap: 4px; }
  #agrid .aph .info { font-size: 11px; padding: 0 4px; }
  .pv-bar .btn.small { min-height: 44px; padding: 6px 16px; }
}
.clean-box { border: 1.5px solid #E0A800; background: #FFFBEA; border-radius: var(--radius); padding: 12px 14px; margin: 12px 0; display: grid; gap: 6px; }
.clean-box .chips { margin: 2px 0 0; }
.clean-box .chip { background: #fff; min-height: 40px; }
.clean-box[hidden] { display: none; }
/* Post set: what this album's suggestions should be (8 Oct). */
.ps-want { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-top: 12px; display: grid; gap: 8px; }
.ps-preset { display: flex; flex-wrap: wrap; gap: 6px; }
.ps-want .chip { min-height: 40px; }
.ps-want .chips { margin: 0; }
.chip[aria-pressed="true"] .muted { color: #D0D0D0; }
/* Bad-photo check after an upload (8 Oct). */
.rv-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 4px; }
.rv .rv-only { position: absolute; left: 4px; top: 4px; font-size: 10px; font-weight: 600; background: var(--ok); color: #fff; padding: 1px 6px; border-radius: 6px; }
.clean-box .btn.primary { justify-self: start; min-height: 44px; }
.rv .tick { display: flex; }
.clean-box .chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
/* Step 2 (8 Oct): the bad-photo check inline, and its big view. */
#rvInline { margin-top: 14px; }
.rv-group { display: grid; gap: 6px; }
.rv-group .section-head { margin: 0; }
.rv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
.rv { position: relative; }
.rv .rv-open { display: block; width: 100%; border: 0; padding: 0; background: none; cursor: zoom-in; }
.rv .rv-open img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 8px; }
.rv .tick { display: flex; width: 34px; height: 34px; cursor: pointer; }
.rv-more { position: absolute; left: 4px; bottom: 4px; font-size: 10px; background: rgba(17, 17, 17, 0.75); color: #fff; padding: 1px 6px; border-radius: 6px; }
.rv-kinds summary { cursor: pointer; padding: 6px 0; }
.rv-bar { padding: 10px 16px 14px; display: grid; gap: 8px; background: #0d0d0d; }
.rv-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.rv-strip button { flex: none; width: 56px; height: 76px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: none; cursor: pointer; }
.rv-strip button.on { border-color: var(--accent); }
.rv-strip img { width: 100%; height: 100%; object-fit: cover; }
.rv-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rv-acts .btn { min-height: 48px; }
#rvStage.zoomed { overflow: auto; display: block; }
#rvStage.zoomed img { max-width: none; max-height: none; cursor: zoom-out; }
.rv .rv-more, .rv .rv-only { pointer-events: none; }
.ph.rv { aspect-ratio: auto; }
.rv-bar .btn { background: #fff; color: var(--ink); border-color: #fff; }
.rv-bar .btn.primary { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.ps-show { align-items: center; }
.rv .rv-why { position: absolute; left: 4px; top: 4px; font-size: 10px; font-weight: 600; background: #FFF2D9; color: #6A3E00; padding: 1px 6px; border-radius: 6px; pointer-events: none; }
.rv .rv-only { top: auto; bottom: 22px; }
/* 9 Oct: tiles zoomed on the face, no fading, a clear orange ring for "will be hidden", bigger on both screens. */
.rv-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important; gap: 8px !important; }
@media (max-width: 520px) { .rv-grid { grid-template-columns: 1fr 1fr !important; } }
.rv .rv-open { position: relative; }
.rv-frame { display: block; position: relative; width: 100%; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 8px; background: var(--photo); }
.rv-frame .rv-zoom { position: absolute; max-width: none; height: auto; }
.rv-frame .rv-zoom-full { width: 100%; height: 100%; object-fit: cover; }
.rv .rv-open img { aspect-ratio: auto !important; border-radius: 0 !important; }
.ph.rv.selected img { opacity: 1 !important; }
.ph.rv { border-radius: 10px; outline: 3px solid transparent; outline-offset: -3px; }
.ph.rv.selected { outline-color: var(--accent); }
.rv .rv-why { top: auto !important; bottom: 34px; left: 6px; font-size: 11px; }
.rv .rv-only { bottom: 6px !important; top: auto !important; left: 6px; }
.rv .rv-more { bottom: 6px; left: 6px; }
.rv .tick { top: 6px; right: 6px; }
.rv-mid summary { cursor: pointer; padding: 8px 0; font-weight: 600; }
.rv-hover { position: fixed; z-index: 70; width: 320px; pointer-events: none; box-shadow: 0 10px 30px rgba(0,0,0,.35); border-radius: 12px; overflow: hidden; background: #000; }
.rv-hover .rv-frame { border-radius: 0; }
/* quick check: face beside the frame on wide screens, face over it on phones */
#rvv .rv-two { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 0; overflow: hidden; }
#rvv .rv-face { max-width: 240px; width: 46%; margin: 0 auto 6px; }
#rvv .rv-face .rv-frame { border-radius: 10px; }
@media (min-width: 900px) {
  #rvv .rv-two { grid-template-columns: minmax(260px, 34%) 1fr; gap: 12px; padding: 0 12px; align-items: center; }
  #rvv .rv-face { max-width: none; width: 100%; margin: 0; }
}
#rvv .pv-stage { min-height: 0; }
#rvv { grid-template-rows: auto 1fr auto; }
.rv-st-hide { color: var(--accent); } .rv-st-keep { color: #7CD69B; }
#rvv .rv-two { height: 100%; }
#rvv .pv-stage { height: 100%; }
#rvv .pv-stage:not(.zoomed) img { max-height: 100%; max-width: 100%; object-fit: contain; }
/* 9 Oct: a tap near the edge of the 34px circle landed on the photo and opened it. The circle stays 34px, the
   touch area around it is 56px (top-right corner of the tile). */
.rv .rv-tick { top: 0 !important; right: 0 !important; width: 56px !important; height: 56px !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; padding: 0; z-index: 2; }
.rv .rv-tick svg { box-sizing: content-box; width: 18px; height: 18px; padding: 8px; border-radius: 50%; border: 2px solid #fff; background: rgba(17,17,17,.35); }
.rv.selected .rv-tick svg { background: var(--accent); border-color: var(--accent); }
.grid.grid-zoom { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
@media (max-width: 520px) { #agrid.grid-zoom { grid-template-columns: 1fr 1fr; gap: 8px; } }
.grid-zoom .aph { aspect-ratio: 3 / 4; }
.grid-zoom .aph .rv-frame { height: 100%; aspect-ratio: auto; }
/* Floating buttons over the album grid (9 Oct). */
.grid-float { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 25; display: flex; gap: 8px; padding: 6px; background: rgba(17, 17, 17, 0.88); border-radius: 999px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); }
.grid-float[hidden] { display: none; }
body:has(#psBar) .grid-float { bottom: calc(84px + env(safe-area-inset-bottom)); } /* above the step bar */
@media (max-width: 640px) { body:has(#psBar) .grid-float { bottom: calc(128px + env(safe-area-inset-bottom)); } }
.grid-float button { border: 0; border-radius: 999px; padding: 10px 16px; min-height: 44px; font: 600 14px 'Prompt', sans-serif; background: #fff; color: var(--ink); white-space: nowrap; cursor: pointer; }
.grid-float button.on { background: var(--accent); }
.tap-hide .aph { outline: 2px dashed rgba(255, 106, 61, 0.5); outline-offset: -2px; }
.aph.is-hidden::after { content: 'ซ่อนแล้ว'; position: absolute; inset: auto 0 0 0; padding: 4px; text-align: center; font: 600 13px 'Prompt', sans-serif; color: #fff; background: rgba(198, 40, 40, 0.85); }
.aph.is-hidden .rv-frame img { opacity: 0.35; }
.aph.is-hidden .info { display: none; }

/* Post sets: more than one per album (10 Oct) */
.btn.ps-kind { flex-direction: column; gap: 2px; height: auto; padding: 12px 14px; line-height: 1.35; }
.btn.ps-kind .small { font-weight: 400; opacity: .85; }
.ps-old { border-top: 1px solid var(--line, #E3E3E3); padding: 12px 0 14px; }
.ps-old .strip { margin: 0 0 8px; }

/* Feed crop warning (10 Oct) */
.pgrid .ph .cutwarn { position: absolute; left: 6px; bottom: 6px; background: #B42318; color: #FFFFFF; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; pointer-events: none; }
.cutbox { background: #FFF4F2; border: 1.5px solid #F2B8B0; border-radius: 10px; padding: 12px 14px; margin-top: 12px; }

/* Colour fix (12 Oct) */
.ce { position: fixed; inset: 0; z-index: 62; background: #0d0d0d; display: flex; flex-direction: column; overflow: hidden; }
.ce-load { margin: auto; text-align: center; color: #ddd; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px; }
.ce-stage { position: relative; flex: 1 1 0; min-height: 180px; display: flex; align-items: center; justify-content: center; }
.ce-stage canvas { max-width: 100%; max-height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.ce-hint, .ce-clip { position: absolute; left: 12px; top: 12px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 13px; padding: 4px 10px; border-radius: 999px; pointer-events: none; }
.ce-clip { top: auto; bottom: 22px; background: #B42318; }
.ce-x { position: absolute; right: 6px; top: 4px; background: rgba(0, 0, 0, .45); border-radius: 50%; }
.ce-pane { flex: none; background: var(--paper); border-radius: 18px 18px 0 0; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 62vh; overflow: auto; }
.ce-pick { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; background: var(--bg); border: 2px solid transparent; border-radius: 10px; padding: 10px 12px; font-size: 15px; cursor: pointer; min-height: 56px; }
.ce-pick.on { border-color: var(--accent); }
.ce-pick i { width: 24px; height: 24px; border: 3px solid var(--ink); border-radius: 50%; flex: none; }
.ce-ai { margin-bottom: 8px; }
.ce-ai i { border-radius: 6px; }
.ce-ai.on i { background: var(--accent); border-color: var(--accent); }
.ce-ai:disabled { opacity: .75; cursor: progress; }
.ce-aiwarn { margin: -2px 0 8px; color: var(--danger); }
.ce-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.ce-row label { width: 88px; flex: none; font-size: 15px; }
.ce-row input { flex: 1; min-width: 0; height: 44px; accent-color: var(--ink); }
.ce-row b { width: 38px; text-align: right; font-size: 14px; flex: none; }
.ce-ends { display: flex; justify-content: space-between; font-size: 12px; color: #6B6F76; margin: -8px 48px 0 98px; }
.ce-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.ce-many { flex: 1 1 0; overflow: auto; background: var(--paper); padding: 16px 16px 24px; }
.ce-bar { flex: none; background: var(--paper); border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.ce-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; margin-top: 12px; }
.ce-tile { position: relative; aspect-ratio: 2 / 3; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: var(--photo); cursor: pointer; }
.ce-tile img, .ce-tile canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ce-tile:not(.on) img { opacity: .45; }
.ce-tile.on { outline: 3px solid var(--accent); outline-offset: -3px; }
.ce-tick { position: absolute; right: 6px; top: 6px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; display: none; align-items: center; justify-content: center; font-size: 15px; }
.ce-tile.on .ce-tick { display: flex; }
.ce-tag { position: absolute; left: 6px; bottom: 6px; background: rgba(0, 0, 0, .7); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 6px; }
.ce-tag.dim { bottom: auto; top: 6px; }
@media (min-width: 900px) {
  .ce { flex-direction: row; }
  .ce-pane { width: 380px; max-height: none; border-radius: 0; align-self: stretch; padding-top: 24px; }
  .ce-many { max-width: 1100px; margin: 0 auto; }
  .ce:has(.ce-many) { flex-direction: column; background: var(--paper); }
}

/* Face search in the back office (12 Oct) */
.ff { position: fixed; inset: 0; z-index: 58; background: var(--bg); overflow: auto; }
.ff-in { max-width: 1100px; margin: 0 auto; padding: 16px 16px calc(28px + env(safe-area-inset-bottom)); }
.ff-h { margin: 20px 0 8px; font-size: 17px; }
.ff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
.ff-tile { position: relative; aspect-ratio: 2 / 3; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: var(--photo); cursor: pointer; }
.ff-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ff-tile.is-hidden img { opacity: .5; }
.ff-tag { position: absolute; left: 6px; bottom: 6px; right: 6px; background: rgba(0, 0, 0, .7); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ff-tag.warn { background: #B42318; right: auto; bottom: auto; top: 6px; }
.ff-dayh { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 20px 0 8px; }
.ff-dayh h3 { margin: 0; font-size: 17px; }
.ff-notme { flex: none; min-height: 40px; padding: 4px 12px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--paper); color: #B42318; font: 500 14px 'Prompt', sans-serif; cursor: pointer; }
.ff-gone { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; padding: 8px 12px; background: var(--paper); border-radius: 8px; color: var(--muted); font-size: 15px; }
#ffv { z-index: 61; }
#ffvStage { touch-action: pan-y pinch-zoom; } /* a sideways swipe stays ours: pointerup fires, not pointercancel */

/* Share a picked set with a runner (12 Oct) */
.ff-pick:not(.on) img { opacity: .4; }
.ff-pick.on { outline: 3px solid var(--accent); outline-offset: -3px; }
.ff-pick.on .ce-tick { display: flex; }
.ff-link { width: 100%; font-size: 15px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--bg); }

/* Cover picked in the post set (14 Oct) */
.pgrid .ph .ps-cv { position: absolute; left: 6px; bottom: 6px; min-height: 32px; padding: 4px 10px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .94); color: var(--ink); font: 600 12px 'Prompt', sans-serif; cursor: pointer; }
.pgrid .ph .ps-cv.on { background: var(--ink); color: #FFFFFF; }
/* Feed crop and split (18 Oct) */
.pgrid .ph .ps-crop { position: absolute; right: 6px; bottom: 6px; min-height: 32px; padding: 4px 10px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .94); color: var(--ink); font: 600 12px 'Prompt', sans-serif; cursor: pointer; z-index: 2; }
.pgrid .ph .ps-crop.on { background: var(--accent); color: #FFFFFF; }
.crop-frame { position: relative; width: min(100%, 320px); aspect-ratio: 1 / 1; margin: 0 auto; overflow: hidden; border-radius: 10px; background: #111; touch-action: none; cursor: grab; }
.crop-frame img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; user-select: none; }
.fbp img.fbp-drag { cursor: ns-resize; -webkit-touch-callout: none; user-select: none; }
.fbp img.dragging { outline: 3px solid var(--accent); outline-offset: -3px; }
.pgrid .ph.ce-tile { padding: 0; border: 0; background: none; position: relative; cursor: pointer; }
.pgrid .ph.ce-tile.on { outline: 3px solid var(--accent); outline-offset: -3px; }
.pgrid .ph.ce-tile.on .ce-tick { display: flex; }
.pgrid .ph .cutwarn { bottom: 44px; }
.ps-coverrow { display: grid; grid-template-columns: minmax(0, 220px) 1fr; gap: 14px; align-items: center; margin: 14px 0 4px; }
.ps-coverrow .cover-frame { border-radius: 10px; overflow: hidden; }
@media (max-width: 420px) { .ps-coverrow { grid-template-columns: 1fr; } }

.ce-pill { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 70; background: var(--ink); color: #FFFFFF; font-size: 14px; padding: 10px 16px; border-radius: 999px; box-shadow: 0 4px 16px rgba(0,0,0,.25); max-width: calc(100vw - 32px); text-align: center; }

/* Crop and straighten (15 Oct) */
.ce-stage canvas { touch-action: none; }

/* Preview gate (18 Oct) */
.ap-alert.pvgate { border-color: var(--accent); background: #FFF7F2; }
.pv-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 10px; }
.pv-grid img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; display: block; }
@media (max-width: 520px) { .pv-grid { grid-template-columns: repeat(3, 1fr); } }

/* photos that came out too bright (29 Oct) */
.psv-stacks { margin: 8px 0; padding: 0 16px; }
.psv-stacks .btn { background: #FFFFFF; color: var(--ink); border-color: #FFFFFF; }
.psv-stacks .btn:disabled { opacity: 0.35; }
.hz-sam { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.hz-t { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 9px; overflow: hidden; aspect-ratio: 2 / 3; background: var(--photo); cursor: pointer; }
.hz-t img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hz-l { position: absolute; left: 5px; top: 5px; background: rgba(17, 17, 17, 0.72); color: #FFFFFF; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 7px; }
.hz-st { position: absolute; left: 5px; bottom: 5px; background: #FFFFFF; color: var(--ink); font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 7px; }
.hz-st.ok { background: var(--ok); color: #FFFFFF; }
.hz-sw { display: block; width: 100%; font-size: 13px; }
.hz-pairs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
.hz-p { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; padding: 0; border: 0; border-radius: 8px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--photo); cursor: pointer; }
.hz-p img, .hz-p canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.hz-p.off { opacity: 0.4; }
.hz-p.off .bp-ck { background: rgba(255, 255, 255, 0.85); color: transparent; }
.bp summary { cursor: pointer; }
.bp-sec { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.bp-sec .section-head { margin-bottom: 6px; }
.bp-mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 4px; }
.bp-mini img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; display: block; background: var(--photo); }
.bp-files { margin-top: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-family: Montserrat, sans-serif; font-size: 14px; line-height: 1.7; user-select: text; word-break: break-all; }
.bp-none { margin: 0; }
.bp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.bp-tile { position: relative; padding: 0; border: 0; border-radius: 8px; overflow: hidden; aspect-ratio: 2 / 3; background: var(--photo); cursor: pointer; }
.bp-tile img, .bp-tile canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bp-grid.before .bp-tile canvas { display: none; }
.bp-tile.off img, .bp-tile.off canvas { opacity: 0.4; }
.bp-ck { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 13px; background: var(--ink); color: #FFFFFF; border: 2px solid #FFFFFF; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.bp-tile.off .bp-ck { background: rgba(255, 255, 255, 0.85); color: transparent; }
.bp-lv { position: absolute; left: 6px; bottom: 6px; font-size: 11px; font-weight: 600; background: rgba(0, 0, 0, 0.55); color: #FFFFFF; border-radius: 6px; padding: 1px 7px; }

/* step 4: cover from the post set, then publish (29 Oct) */
.cp-big { position: relative; margin-top: 12px; }
.cp-big .cover-frame { border-radius: 12px; }
.cp-big span { position: absolute; left: 10px; bottom: 10px; background: rgba(0, 0, 0, 0.55); color: #FFFFFF; font-size: 12px; font-weight: 600; border-radius: 6px; padding: 2px 8px; }
.cp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 5px; margin-top: 10px; }
.cp-grid button { position: relative; padding: 0; border: 0; border-radius: 8px; overflow: hidden; aspect-ratio: 1; background: var(--photo); cursor: pointer; }
.cp-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cp-grid button.on { outline: 3px solid var(--accent); outline-offset: -3px; }
.cp-grid button.on::after { content: "ปก"; position: absolute; top: 4px; left: 4px; background: var(--accent); color: #FFFFFF; font-size: 11px; font-weight: 600; border-radius: 5px; padding: 1px 6px; }
.pub-warn { background: #FFF6E5; border: 1.5px solid #E0A800; border-radius: 12px; padding: 14px; margin-top: 18px; }
.pub-warn p { margin: 4px 0 10px; font-size: 14px; color: #5A4A1A; }
.warn-text { color: #B3441F; font-weight: 600; font-size: 13px; }

/* "หารูปฉันวันอื่น" (29 Oct) */
.other-days { background: var(--paper); border: 2px solid var(--accent); border-radius: 16px; padding: 16px; margin-top: 16px; }
.other-days h3 { margin: 0; font-size: 18px; }
.other-days p { margin: 6px 0 12px; color: var(--muted); font-size: 14px; }
.od-head { text-align: center; margin: 6px 0 14px; }
.od-head h2 { margin: 0; font-size: 24px; }
.od-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.od-day { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-top: 12px; }
.od-dh { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.od-dh b { font-size: 16px; }
.od-dh span { color: var(--muted); font-size: 13px; }
.od-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.od-grid button { padding: 0; border: 0; background: var(--photo); border-radius: 6px; overflow: hidden; aspect-ratio: 1; cursor: pointer; }
.od-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.od-more { display: block; margin: 10px auto 0; font-weight: 600; }
.od-maybe { border: 1px dashed var(--line); border-radius: 14px; padding: 12px 14px; margin-top: 12px; color: var(--muted); }
.od-maybe summary { cursor: pointer; font-size: 14px; }
.od-self { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.od-self img { width: 64px; height: 64px; flex: none; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent); }
.od-self p { margin: 0; font-size: 14px; color: var(--muted); }
.od-tag { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--photo); }
.od-tag img { width: 100%; height: 100%; object-fit: cover; display: block; }
.od-tag span { position: absolute; left: 4px; bottom: 4px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 6px; }
.od-note { font-size: 13px; color: var(--muted); text-align: center; margin: 10px 0 0; }
@media (min-width: 700px) { .od-grid { grid-template-columns: repeat(6, 1fr); } }

/* Tip button under the save button in the scan results, and the quieter zone around it (5 Nov). */
/* Only while the results really show the tip button (any path that rewrites #searchArea, an
   error or the other-days question included, brings the row back by itself). */
#searchArea:has(.tipb) ~ .water-card[data-act="tip"] { display: none; }
.tipb { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 2px solid var(--accent);
  border-radius: var(--radius); background: var(--paper); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.tipb .water-icon { width: 44px; height: 44px; }
.tipb .t { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.tipb .t b { font-size: 17px; }
.tipb .t span { font-size: 14px; color: var(--muted); }
.tipb .chev { flex: none; color: var(--accent); }
.relink { display: block; margin: 10px auto 0; min-height: 44px; padding: 8px 12px; background: none; border: 0; font: inherit; font-size: 15px; color: var(--muted); cursor: pointer; }
.relink u { color: var(--ink); text-underline-offset: 3px; }
.fb-lite { margin: 18px 0 0; text-align: center; }
.fb-lite p { margin: 0 0 10px; font-size: 15px; color: var(--muted); }
.fb-lite .chips { justify-content: center; margin: 0; }
.fb-lite .chip { min-height: 44px; padding: 8px 16px; border-radius: 22px; font-size: 15px; }
.zone-end { border: 0; border-top: 1px solid var(--line); margin: 28px 0 8px; }
/* A phone cannot scan its own screen, so there the QR is a preview to save, not a code to aim at. */
.tip-how { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--bg); font-size: 14px; line-height: 1.5; color: var(--muted); }
.tip-how b { color: var(--ink); }
.tip-how .on-desk { display: none; }
@media (hover: hover) and (pointer: fine) { .tip-how .on-phone { display: none; } .tip-how .on-desk { display: inline; } }
@media (hover: none), (pointer: coarse) {
  .qrbox.tip-qr { width: min(166px, 100%); padding: 6px; margin: 8px auto; }
  /* Number and a short "คัดลอก" on one row, so the bigger QR still leaves บันทึก QR on screen. */
  .account-box { grid-template-columns: 1fr auto; align-items: center; column-gap: 10px; padding: 10px 12px; }
  .account-box > span { grid-column: 1 / -1; }
  .account-box strong { white-space: nowrap; }
  .account-box .btn { margin-top: 0; }
  .account-box .btn .long { display: none; }
  .tip-how { margin-top: 8px; padding: 8px 12px; }
}
/* Inside the results zone the other-days offer is a quiet second option, not a rival to save + tip. */
.other-days.od-quiet { border: 1px solid var(--line); }

/* ---------- รายรับเลี้ยงมัทฉะ (admin tab, public/income.js) ---------- */
.inc-h { font-size: 22px; margin: 4px 0 2px; }
.inc-sub { color: var(--muted); margin: 0 0 14px; font-size: 14px; white-space: pre-wrap; }
.inc-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
@media (min-width: 700px) { .inc-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.inc-tile { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.inc-tile span { display: block; color: var(--muted); font-size: 13px; }
.inc-tile b { display: block; font-size: 24px; margin-top: 2px; }
.inc-tile small { color: var(--muted); font-size: 12px; white-space: pre-wrap; }
.inc-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.inc-card h3 { font-size: 16px; margin: 0 0 10px; }
.inc-chart { display: flex; gap: 6px; }
.inc-bar { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.inc-bar .plot { height: 150px; width: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.inc-bar i { display: block; width: 100%; max-width: 38px; min-height: 2px; background: var(--accent); border-radius: 6px 6px 0 0; }
.inc-bar .v { font-size: 11px; color: var(--muted); margin-bottom: 3px; white-space: nowrap; }
.inc-bar .l { font-size: 12px; margin-top: 4px; }
.inc-axis { font-size: 12px; color: var(--muted); text-align: center; margin: 2px 0 0; }
.inc-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.inc-top { display: flex; justify-content: space-between; gap: 8px; font-size: 16px; }
.inc-sub2 { font-size: 13px; color: var(--muted); margin-top: 2px; white-space: pre-wrap; }
.inc-money { color: var(--ok); font-weight: 700; }
.inc-tw { display: none; overflow-x: auto; }
.inc-tw table { border-collapse: collapse; width: 100%; font-size: 14px; }
.inc-tw th, .inc-tw td { text-align: right; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.inc-tw th:first-child, .inc-tw td:first-child { text-align: left; }
.inc-tw th { font-weight: 600; color: var(--muted); font-size: 12px; }
@media (min-width: 700px) { .inc-list { display: none; } .inc-tw { display: block; } }
.inc-note { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.inc-ok { background: #E8F4EC; border: 1px solid #9CCBAE; border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 0 0 12px; white-space: pre-wrap; }
.inc-up { margin-top: 12px; }
.inc-sender { display: grid; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.inc-sender .who { display: grid; gap: 2px; min-width: 0; }
.inc-sender .who b { overflow-wrap: anywhere; }
.inc-sender .who span { font-size: 13px; color: var(--muted); white-space: pre-wrap; }
.inc-sender .chips { margin-top: 0; }
.inc-sender .chip { min-height: 44px; }
.inc-sender.marked .who b { color: var(--muted); }
@media (min-width: 700px) { .inc-sender { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } }
/* รายรับ: วิเคราะห์ (6 Nov) */
.ia-tabs { display: flex; gap: 8px; margin: 0 0 14px; }
.ia-tabs button { min-height: 40px; padding: 6px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font: inherit; font-size: 15px; color: var(--ink); cursor: pointer; }
.ia-tabs button[aria-selected="true"] { background: var(--ink); color: #FFFFFF; border-color: var(--ink); }
.ia-range { margin: 0 0 12px; }
.ia-range .chip { min-height: 40px; }
.ia-lead { background: #FFF1EB; border: 1px solid var(--accent-2); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.ia-lead p { margin: 6px 0 0; }
.ia-note { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.ia-pair { padding: 12px 0; border-bottom: 1px solid var(--line); }
.ia-pair:last-child { border-bottom: 0; padding-bottom: 0; }
.ia-ph { margin-bottom: 8px; }
.ia-ph h4 { margin: 0 0 6px; font-size: 16px; }
.ia-tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; margin: 0 6px 4px 0; border: 1px solid var(--line); color: var(--muted); }
.ia-tag.clear { background: #E8F4EC; border-color: #9CCBAE; color: var(--ok); }
.ia-tag.hint { background: #FFF6E0; border-color: #F0D28A; color: #8A6200; }
.ia-tag.wait { background: var(--bg); }
.ia-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ia-side { background: var(--bg); border-radius: 10px; padding: 10px; min-width: 0; }
.ia-side .ia-lbl { font-size: 13px; color: var(--muted); display: block; }
.ia-side b { font-size: 22px; display: block; }
.ia-side small { display: block; font-size: 12px; color: var(--muted); }
.ia-side i { display: block; height: 6px; border-radius: 3px; background: var(--accent-2); margin: 6px 0; }
.ia-side.win i { background: var(--accent); }
.ia-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.ia-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.ia-legend .k1 { background: var(--accent); }
.ia-legend .k2 { background: var(--accent-2); }
.ia-chart { display: flex; gap: 2px; align-items: flex-end; }
.ia-b { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.ia-b .plot { height: 150px; width: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.ia-b i { display: block; width: 100%; max-width: 22px; background: var(--accent-2); border-radius: 3px 3px 0 0; }
.ia-b.early i { background: var(--accent); }
.ia-b .v { font-size: 8px; color: var(--muted); writing-mode: vertical-rl; transform: rotate(180deg); margin-bottom: 2px; }
.ia-b .d { font-size: 9px; margin-top: 3px; }
.ia-b .w { font-size: 7px; line-height: 11px; height: 11px; white-space: nowrap; }
.ia-chg { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.ia-ct { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.ia-ct .linkish { min-height: 32px; padding: 0 4px; font-size: 13px; flex: none; }
.ia-wait { font-size: 13px; color: var(--muted); background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.ia-ba { display: flex; align-items: center; gap: 10px; }
.ia-ba > div:not(.arrow) { flex: 1; background: var(--bg); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.ia-ba span, .ia-ba small { display: block; font-size: 12px; color: var(--muted); }
.ia-ba b { font-size: 20px; display: block; }
.ia-ba b.ok { color: var(--ok); }
.ia-ba b.down { color: var(--danger); }
.ia-ba .arrow { color: var(--muted); font-size: 20px; }
.ia-add { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 4px; }
.ia-add input { min-height: 48px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font: inherit; font-size: 16px; min-width: 0; }
.ia-hl { padding: 0 6px; border-radius: 6px; background: var(--bg); white-space: nowrap; }
.ia-hl.good { background: #FFF1EB; color: #B5401A; }
@media (min-width: 700px) { .ia-add { grid-template-columns: 170px 1fr auto; } .ia-b .v { font-size: 10px; } }
/* รายรับ: who made up an album's total (6 Nov) */
.inc-open { display: block; width: 100%; background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.inc-open .inc-top, .inc-open .inc-sub2 { display: flex; }
.inc-open .inc-sub2 { display: block; }
.inc-open-td { white-space: nowrap; min-height: 40px; }
.inc-chev { color: var(--muted); font-size: 13px; }
.inc-who { background: var(--bg); border-radius: 10px; padding: 4px 12px 10px; margin-top: 8px; text-align: left; white-space: normal; }
.inc-who-row { display: grid; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.inc-who-row .who { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; min-width: 0; }
.inc-who-row .tm { color: var(--muted); font-size: 13px; }
.inc-who-row .nm { overflow-wrap: anywhere; min-width: 0; }
.inc-who-row .chips { margin-top: 0; }
.inc-who-row .chip { min-height: 40px; }
.inc-who-row.marked .amt, .inc-who-row.marked .nm { color: var(--muted); text-decoration: line-through; }
.inc-flag { font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.inc-who-tr td { padding: 0 6px 12px; }
@media (min-width: 700px) { .inc-who-row { grid-template-columns: 1fr auto; align-items: center; } }
/* รายรับ: open the album, rate its photos (6 Nov) */
.inc-alb { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.inc-alb-go { min-height: 44px; padding: 8px 14px; font-size: 15px; }
.inc-rate { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inc-rate > span { font-size: 13px; color: var(--muted); }
.inc-rate .chips { margin-top: 0; }
.inc-rate .chip { min-height: 40px; }

/* how long each day took (health tab) */
.js-list { list-style: none; margin: 12px 0 0; padding: 0; }
.js-list li { border-top: 1px solid var(--line); padding: 12px 0; }
.js-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.js-total { margin-left: auto; }
.js-tag { font-size: 12px; border-radius: 999px; padding: 1px 8px; }
.js-tag.ok { background: #E6F4EA; color: #1E6B34; }
.js-tag.warn { background: #FFF1DB; color: #8A4B00; }
.js-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--bg); margin: 8px 0 6px; }
.js-bar i { display: block; height: 100%; }
.js-bar .sys { background: #3B7BD8; }
.js-bar .sys + .sys { border-left: 2px solid var(--card, #fff); }
.js-bar .wait { background: #B9C0CA; }
.js-parts { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.js-bad { margin: 6px 0 0; color: #8A4B00; }
.js-info { margin: 4px 0 0; }
.od-grid a { display: block; border-radius: 6px; overflow: hidden; aspect-ratio: 1; background: var(--photo); }

/* Day note (18 Nov): step 6 card and the income rows */
.dn-wrap { margin: 0 0 14px; }
.dn { background: var(--paper); border: 1.5px solid var(--ink); border-radius: 14px; padding: 14px 16px; }
.dn h3 { margin: 0; font-size: 18px; }
.dn .chips { margin-top: 6px; gap: 7px; }
.dn .chip { min-height: 40px; font-size: 15px; padding: 6px 13px; }
.dn-q { display: block; font-size: 15px; font-weight: 600; margin: 12px 0 0; }
.dn textarea { display: block; width: 100%; min-height: 60px; border-radius: 10px; border: 1.5px solid var(--line); padding: 8px 10px; font-size: 16px; margin-top: 6px; box-sizing: border-box; }
.dn-act { display: flex; gap: 8px; margin-top: 14px; }
.dn-act .btn { flex: 1; }
.dn-sum { background: var(--paper); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.dn-sum-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dn-sum-h .btn { min-height: 38px; }
.dn-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.dn-tag { font-size: 13px; border-radius: 12px; padding: 2px 10px; background: #F1F2F4; color: var(--ink); }
.dn-tag.warn { background: #FFF1E0; color: #8A4B00; }
.dn-note { display: block; font-size: 14px; margin-top: 6px; color: #333; white-space: pre-wrap; overflow-wrap: anywhere; }
.dn-line { margin: 0; }
.inc-who .dn-wrap { margin: 10px 0; }

/* Quick pick (18 Nov): one stack at a time on the Mac, keyboard first. */
.qp-entry { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; }
.qp { position: fixed; inset: 0; z-index: 60; background: #111111; color: #FFFFFF; display: flex; flex-direction: column; overscroll-behavior: contain; }
.qp-top { display: flex; align-items: center; gap: 20px; padding: 12px 16px 12px 20px; }
.qp-t { font-weight: 600; white-space: nowrap; }
.qp-trial { background: #FFFFFF; color: var(--ink); font-size: 13px; padding: 2px 10px; border-radius: 12px; margin-right: 4px; }
.qp-prog { flex: 1; position: relative; height: 8px; background: #2C2F33; border-radius: 4px; margin-bottom: 14px; }
.qp-fill { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 4px; }
.qp-line { position: absolute; top: -6px; bottom: -6px; width: 3px; margin-left: -1px; background: #FFFFFF; border-radius: 2px; }
.qp-lab { position: absolute; top: 12px; transform: translateX(-50%); font-size: 12px; color: #B8BCC2; white-space: nowrap; }
.qp-likes { white-space: nowrap; font-size: 14px; } .qp-likes b { font-size: 20px; color: var(--accent); }
.qp-main { flex: 1; min-height: 0; display: flex; gap: 12px; padding: 0 16px; }
.qp-stage { flex: 1; min-width: 0; position: relative; display: flex; align-items: center; justify-content: center; }
.qp-stage img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-select: none; }
.qp-tag, .qp-on { position: absolute; top: 10px; padding: 3px 10px; border-radius: 14px; font-size: 13px; }
.qp-tag { left: 10px; background: rgba(0, 0, 0, 0.6); }
.qp-on { right: 10px; background: var(--accent); display: flex; align-items: center; gap: 6px; }
.qp-on svg { fill: #FFFFFF; width: 14px; height: 14px; }
.qp-side { width: 200px; flex: none; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.qp-side .small { color: #B8BCC2; }
.qp-fr { position: relative; flex: none; padding: 0; border: 3px solid transparent; border-radius: 8px; overflow: hidden; background: #2C2F33; cursor: pointer; }
.qp-fr img { width: 100%; height: 120px; object-fit: cover; }
.qp-fr.cur { border-color: #FFFFFF; } .qp-fr.liked { border-color: var(--accent); }
.qp-k { position: absolute; left: 6px; top: 6px; width: 24px; height: 24px; border-radius: 6px; background: #FFFFFF; color: var(--ink); font-size: 13px; display: flex; align-items: center; justify-content: center; }
.qp-best { position: absolute; right: 6px; bottom: 6px; font-size: 11px; background: var(--accent); color: #FFFFFF; padding: 1px 8px; border-radius: 10px; }
.qp-keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); }
.qp-key { display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-radius: 12px; border: 1.5px solid #4A4E55; background: none; color: #FFFFFF; cursor: pointer; }
.qp-key:disabled { opacity: 0.4; cursor: default; }
.qp-key.pri { background: var(--accent); border-color: var(--accent); }
.qp-key.hint { cursor: default; }
.qp-key kbd { font: 700 14px 'Montserrat', 'Prompt', sans-serif; background: #FFFFFF; color: var(--ink); border-radius: 6px; padding: 2px 8px; }
.qp-key.pri kbd { color: var(--accent); }
.qp-dim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.65); display: flex; align-items: center; justify-content: center; padding: 16px; }
.qp-card { width: 100%; max-width: 540px; background: #FFFFFF; color: var(--ink); border-radius: 16px; padding: 28px; }
.qp-card h2 { margin: 0 0 10px; } .qp-card p { margin: 0 0 6px; color: #454B53; }
.qp-pct { font-size: 42px; font-weight: 700; color: var(--accent); line-height: 1.1; }
.qp-btns { display: grid; gap: 10px; margin-top: 18px; }
@media (max-width: 760px) {
  .qp-top { flex-wrap: wrap; gap: 8px 12px; }
  .qp-t { flex: 1; min-width: 0; font-size: 14px; } .qp-trial { font-size: 11px; padding: 1px 7px; } .qp-likes { font-size: 12px; }
  .qp-prog { order: 3; flex-basis: 100%; margin-bottom: 4px; }
  .qp-main { flex-direction: column; }
  .qp-side { width: auto; flex-direction: row; overflow-x: auto; overflow-y: hidden; }
  .qp-side .small { display: none; }
  .qp-fr { width: 96px; } .qp-fr img { height: 64px; }
  .qp-lab, .qp-key.hint, .qp-best { display: none; }
}
