/* The signed-in dashboard and the sign-in pages. Builds on upload.css (colors, buttons, tables). */

/* Sign-in, claim, code and reset pages: the short band, then one centered white panel. */
body.auth { background: var(--surface); }
body.auth .band-logo img { height: 44px; width: auto; }
body.auth main { background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--ink); border-radius: 0.4rem; margin: 1.5rem auto 3rem; padding: 1.5rem 1.5rem 1.75rem; width: calc(100% - 2rem); }
body.auth main.narrow { max-width: 26rem; }
body.auth main.wide { max-width: 40rem; }
body.auth h1 { margin-top: 0; }

.stack { display: grid; gap: 0.9rem; margin: 1rem 0; }
.stack label { display: grid; gap: 0.3rem; font-weight: 600; }
.stack input[type="email"],
.stack input[type="password"],
.stack input[type="text"],
.stack select {
  font: inherit; padding: 0.8rem 0.9rem; border: 2px solid var(--line); border-radius: 0.4rem; background: #fff; color: var(--ink); width: 100%;
}
.stack input:focus { border-color: var(--ink); }
input.code { font-size: 1.6rem; letter-spacing: 0.35em; text-align: center; font-variant-numeric: tabular-nums; }
.btn.fb { background: #1877f2; border-color: #1877f2; color: #fff; }
.btn.primary { width: 100%; }
.divider { display: flex; align-items: center; gap: 0.75rem; color: var(--muted); margin: 1.1rem 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.divider span { font-size: 0.9rem; }
.alt { margin: 0.4rem 0; font-size: 0.95rem; }

/* --- The dashboard shell --- */
body.dash main { max-width: 64rem; padding: 0 1rem 3rem; }
body.dash { background: var(--surface); }
.linkish { background: none; border: 0; padding: 0.4rem 0; color: var(--link); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }

.tabs { display: flex; gap: 0.25rem; overflow-x: auto; padding: 0.5rem 0; margin: 0 -1rem; padding-inline: 1rem; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.tabs a { white-space: nowrap; padding: 0.55rem 0.9rem; border-radius: 0.4rem; color: var(--ink); text-decoration: none; font-weight: 600; }
.tabs a[aria-current="page"] { background: var(--ink); color: #fff; }
.tabs a:hover:not([aria-current]) { background: #e6ebf0; }

.dash h1 { margin-top: 1.25rem; }
.dash section { margin: 1.5rem 0; }
.dash h2 { font-size: 1.25rem; margin: 0 0 0.6rem; }
.grid2 { display: grid; gap: 1rem; }
@media (min-width: 52rem) { .grid2 { grid-template-columns: 1fr 1fr; } body.dash main { padding-inline: 1.5rem; } }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 0.4rem; padding: 1rem 1.1rem; }
.tile h2 { margin-top: 0; }
.tile p { margin: 0.35rem 0; }
.bigcount { font-size: 2rem; font-weight: 800; line-height: 1; }
.signin-nudge { border: 1px solid var(--line); border-top: 3px solid var(--ink); border-radius: 0.4rem; padding: 0.9rem 1.1rem; background: #fff; }
.signin-nudge h2 { margin-top: 0; }
a.button, .button { display: inline-block; padding: 0.7rem 1.1rem; border-radius: 0.4rem; background: var(--accent); color: #fff; font-weight: 700; text-decoration: none; border: 0; }

/* --- Upload --- */
.dropzone { border: 1px solid var(--line); border-top: 3px solid var(--ink); border-radius: 0.4rem; padding: 1.6rem 1rem; text-align: center; background: #fff; }
.dropzone.over { border-color: var(--accent); background: #eaf5fd; }
.dropzone .actions { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; margin-top: 0.8rem; }
.dropzone .btn { display: inline-block; width: auto; }
.dropzone .hint-desktop { display: none; }
@media (hover: hover) and (pointer: fine) { .dropzone .hint-desktop { display: block; } .dropzone .hint-phone { display: none; } }
@media (hover: none), (pointer: coarse) { .dropzone .only-desktop { display: none; } }
ul.queue { list-style: none; margin: 1rem 0; padding: 0; display: grid; gap: 0.6rem; }
ul.queue li { background: #fff; border: 1px solid var(--line); border-radius: 0.4rem; padding: 0.7rem 0.9rem; display: grid; gap: 0.35rem; }
ul.queue .row1 { display: flex; justify-content: space-between; gap: 0.6rem; align-items: baseline; }
ul.queue .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
ul.queue .state { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }
ul.queue progress { width: 100%; height: 0.55rem; }
ul.queue li.failed .state { color: var(--danger); }
ul.queue li.done .state { color: #2c6e3f; }
table.uploads { width: 100%; }
.pill { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 99px; font-size: 0.85rem; background: #e6ebf0; }
.pill.ready { background: #e3edf7; }
.pill.done { background: #dcefd9; }
.pill.failed { background: #f6d6d1; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; margin: 0.5rem 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.sessions li { margin: 0.3rem 0; }
.inline { display: inline; }

/* "Put Chronovox on your home screen" (web/installable.ts, shown by install.js). */
.install { border: 1px solid var(--line); border-top: 3px solid var(--ink); border-radius: 0.4rem; padding: 0.9rem 1.1rem; background: #fff; margin: 0 0 1rem; }
.install p { margin: 0.4rem 0; }
.install-note { background: #fff; border: 1px solid var(--line); border-radius: 0.4rem; padding: 0.7rem 0.9rem; }

/* --- The Posts page as a rundown: a run sheet, time on the left (WO redesign step 1) --- */
.rundown { margin: 1.75rem 0; }
.rundown h2 { margin: 0 0 0.5rem; padding-top: 0.5rem; border-top: 3px solid var(--ink); font-size: 1.3rem; }
.rundown.needs-ok h2 { border-top-width: 6px; }
.dash ul.posts { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 0.4rem; }
.dash li.post { display: grid; grid-template-columns: 5.5rem 1fr; gap: 0.35rem 0.9rem; padding: 0.85rem 1rem; border-bottom: 1px solid var(--line); }
.dash li.post:last-child { border-bottom: 0; }
.slot-time { font-family: var(--font-time); font-weight: 500; font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; font-size: 0.95rem; line-height: 1.3; color: var(--ink); text-transform: uppercase; display: flex; flex-direction: column; align-items: flex-start; padding-top: 0.1rem; }
.slot-time .day { font-size: 0.8rem; color: var(--muted); letter-spacing: 0.04em; }
.slot-time .clock { font-size: 1.05rem; font-weight: 700; }
.slot-time .next { display: inline-flex; align-items: center; gap: 0.35rem; margin-top: 0.25rem; font-size: 0.7rem; letter-spacing: 0.08em; color: var(--ink); }
.slot-time .glint { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--glint); flex: none; }
.slot-body { min-width: 0; overflow-wrap: anywhere; }
.slot-body .post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.6rem; margin-top: 0.2rem; }
.slot-actions { grid-column: 2; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.4rem 0.6rem; }
.slot-actions form.post-actions, .slot-actions details.change { margin: 0; }
.slot-actions details.change[open] { flex-basis: 100%; }
.dash li.post button { min-height: 2.75rem; padding: 0.4rem 1rem; font: inherit; font-weight: 700; border: 2px solid var(--ink); border-radius: 0.4rem; background: #fff; color: var(--ink); cursor: pointer; }
.dash li.post form.post-actions button:first-of-type, .dash li.post details.change form button { background: var(--ink); color: #fff; }
.dash li.post button[value="decline"], .dash li.post button[value="cancel"] { border-color: var(--line); }
.dash .chan { border-radius: 0.25rem; background: var(--surface); }
.dash .when-label { color: var(--muted); font-size: 0.9rem; }
.dash li.post details.change summary { min-height: 2.75rem; display: flex; align-items: center; cursor: pointer; font-weight: 700; color: var(--link); }
.dash ul.results { margin: 0.2rem 0 0; }
@media (min-width: 52rem) {
  .dash li.post { grid-template-columns: 6.5rem 1fr auto; align-items: start; }
  .slot-actions { grid-column: 3; justify-content: flex-end; align-items: center; }
  .slot-actions details.change[open] { flex-basis: auto; }
}
.slot-body { line-height: 1.35; }
.slot-actions form.post-actions { gap: 0.4rem; }
/* Phones: one line of actions under the post. Post now and Cancel / Don't post share the width equally;
   Change / When... is a text link beside them; the long "OK, post <time>" button takes its own line. */
@media (max-width: 30rem) {
  .slot-actions { grid-column: 1 / -1; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.9rem; }
  .slot-actions form.post-actions { flex: 1 1 0; min-width: 12rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }
  .slot-actions form.post-actions button { flex: 1 1 0; min-width: 0; padding-inline: 0.5rem; white-space: nowrap; }
  .slot-actions form.post-actions button[value="plan"], .slot-actions form.post-actions button[value="due"] { flex: 1 1 100%; white-space: normal; }
  .slot-actions form.post-actions:has(button[value="plan"], button[value="due"]) { flex-basis: 100%; }
  .slot-actions details.change { flex: 0 0 auto; }
  .slot-actions details.change[open] { flex: 1 0 100%; }
}

/* The quiet sections (Facebook, Pages, settings, website, brand): a hairline and a heading, not boxes. */
.dash main > section:not(.rundown):not(.install):not(.signin-nudge):not(.tile) { border-top: 1px solid var(--line); padding-top: 1rem; }
.dash input[type="text"], .dash input[type="email"], .dash input[type="url"], .dash input[type="number"], .dash select, .dash textarea { font: inherit; color: var(--ink); background: #fff; border: 1px solid #9aa7b4; border-radius: 0.4rem; padding: 0.55rem 0.7rem; max-width: 100%; }
.dash input[type="text"]:focus, .dash select:focus, .dash textarea:focus { border-color: var(--ink); }
.dash :where(main form) button:where(:not(.btn, .linkish)) { font: inherit; font-weight: 700; min-height: 2.5rem; padding: 0.3rem 0.9rem; border: 2px solid var(--ink); border-radius: 0.4rem; background: #fff; color: var(--ink); cursor: pointer; }
.dash :where(main form.danger) button:where(:not(.btn, .linkish)) { border-color: var(--danger); color: var(--danger); }

/* The claim QR page: slate with a white code. */
.fullqr { background: linear-gradient(to bottom, var(--logo-top), var(--logo-bottom)); color: #fff; padding: 1.25rem 1rem; border-radius: 0.4rem; margin: 1rem 0; }
.fullqr h1 { color: #fff; }
.fullqr a, .fullqr .seller-note { color: #dbe3ea; }
.fullqr svg { background: #fff; padding: 0.25rem; border-radius: 0.3rem; }
.fullqr a.button, .fullqr code.link { color: var(--ink); background: #fff; }
.fullqr code.link { padding: 0.4rem 0.5rem; border-radius: 0.3rem; }
.stack label.terms-agree, label.terms-agree { display: flex; align-items: flex-start; gap: 0.7rem; font-weight: 400; }
.terms-agree input[type="checkbox"] { width: 1.4rem; height: 1.4rem; margin-top: 0.15rem; flex: none; accent-color: var(--ink); }

/* Reels */
.reel-form textarea { width: 100%; max-width: 40rem; box-sizing: border-box; }
.reel-form progress { width: 100%; max-width: 40rem; height: 0.55rem; }
table.reels { width: 100%; }
table.reels td { vertical-align: top; }
table.reels ul.results { margin: 0 0 0.4rem; padding-left: 1.1rem; }

/* --- Facebook: Pages as cards, nothing preselected (C1) --- */
.page-cards { display: grid; gap: 0.6rem; margin: 0.5rem 0 1rem; }
.page-card-form { margin: 0; }
.page-card, button.page-card { display: grid; gap: 0.2rem; width: 100%; text-align: left; padding: 0.85rem 1rem; border: 2px solid var(--line); border-radius: 0.4rem; background: #fff; color: var(--ink); font: inherit; cursor: pointer; }
.page-card:hover, .page-card:focus-visible { border-color: var(--ink); }
.page-card.off { opacity: 0.7; cursor: default; }
.page-card strong { font-size: 1.05rem; }
.ig-fold, .disconnect { margin: 0.75rem 0; }
.disconnect summary { color: var(--muted); }
.flash.saved { font-weight: 700; border-width: 2px; }
.flash.saved::before { content: "\2713\00a0"; }

.subtabs { display: flex; gap: 0.75rem; flex-wrap: wrap; padding: 0.5rem 0 0; font-size: 0.95rem; }
.subtabs a { color: var(--link); text-decoration: none; padding: 0.2rem 0; border-bottom: 2px solid transparent; font-weight: 600; }
.subtabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.tile h2 a { color: inherit; text-decoration: none; }

/* --- Review page: each card folds to one line (C3) --- */
details.card-fold { margin: 0 0 0.6rem; }
details.card-fold > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.75rem; padding: 0.8rem 1rem; background: #fff; border: 1px solid var(--line); border-radius: 0.4rem; cursor: pointer; list-style: none; }
details.card-fold > summary::-webkit-details-marker { display: none; }
details.card-fold[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; background: var(--surface); }
.fold-title { font-weight: 700; }
.fold-line { color: var(--muted); font-size: 0.95rem; flex: 1 1 12rem; }
.fold-edit { margin-left: auto; color: var(--link); font-weight: 700; text-decoration: underline; }
details.card-fold[open] .fold-edit { display: none; }
.fold-flag { color: var(--danger); font-weight: 700; font-size: 0.9rem; }
details.card-fold > fieldset.event { margin: 0; border-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }
.remove-card { margin: 1rem 0 0; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.remove-card label { display: inline-flex; gap: 0.4rem; align-items: center; color: var(--danger); font-weight: 600; }

/* --- Posts rows show what is being approved (C5) --- */
.post-title { display: flex; gap: 0.7rem; align-items: flex-start; }
.post-thumb { flex: none; width: 54px; height: 68px; object-fit: cover; border: 1px solid var(--line); border-radius: 0.25rem; background: var(--surface); }
.post-thumb.none { display: block; }
.post-caption { color: var(--muted); font-size: 0.92rem; }

.opt { color: var(--muted); font-weight: 400; font-size: 0.9rem; }
.year-note { margin: 0.25rem 0 0; font-size: 0.92rem; }
form.inline { display: inline; }

/* Five tabs fit a 390px phone without sideways scrolling */
@media (max-width: 30rem) { .tabs { gap: 0; } .tabs a { padding: 0.55rem 0.6rem; font-size: 0.95rem; } }
