/* Media manager. One sheet, light and dark from the system setting. Every text colour reads at
   4.5:1 or more on its ground. */
:root {
  --bg: #f6f6f3; --surface: #ffffff; --sunk: #efefeb; --line: #e2e2dc; --line-strong: #cfcfc7;
  --ink: #17191c; --ink-2: #464b52; --ink-3: #5c636c;
  --accent: #1f4f8f; --accent-ink: #ffffff; --accent-soft: #e8eef8;
  --ok: #1d6b45; --ok-soft: #e6f2ea; --warn: #8a4f00; --warn-soft: #fbf0dc;
  --bad: #a3271d; --bad-soft: #fbe9e6; --info: #2b5797; --info-soft: #e9eff9; --mute-soft: #ececE8;
  --radius: 10px; --radius-s: 7px;
  --shadow: 0 1px 2px rgba(20, 22, 26, .05), 0 2px 8px rgba(20, 22, 26, .04);
  --sans: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101214; --surface: #171a1d; --sunk: #1d2124; --line: #2a2f34; --line-strong: #3a4047;
    --ink: #eceef0; --ink-2: #c3c8ce; --ink-3: #a1a8b0;
    --accent: #8db4ec; --accent-ink: #0d1726; --accent-soft: #1b2738;
    --ok: #7fcc9f; --ok-soft: #16271e; --warn: #f0b45c; --warn-soft: #2c2214;
    --bad: #f3968b; --bad-soft: #2f1a18; --info: #9dbbe8; --info-soft: #18222f; --mute-soft: #22262a;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--sans);
       -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 24px; font-weight: 650; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 13px; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- frame */
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent);
       backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1240px; margin: 0 auto; padding: 0 24px; height: 58px; display: flex; align-items: center; gap: 28px; }
.mark { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 650;
        letter-spacing: -0.01em; white-space: nowrap; }
.mark-dot { width: 18px; height: 18px; border-radius: 5px; background: var(--ink); position: relative; }
.mark-dot::after { content: ""; position: absolute; inset: 5px 5px auto auto; width: 5px; height: 5px;
                   border-radius: 50%; background: var(--bg); }
.nav { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 7px 12px; border-radius: 8px; white-space: nowrap; font-weight: 500; }
.nav a:hover { color: var(--ink); background: var(--sunk); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.who { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 13px; white-space: nowrap; }
.who form { margin: 0; }
main { max-width: 1240px; margin: 0 auto; padding: 32px 24px 80px; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.page-head .sub { color: var(--ink-3); margin-top: 6px; }
.dry { background: var(--warn-soft); color: var(--warn); text-align: center; font-size: 13px; padding: 6px 16px; }
@media (max-width: 720px) {
  .top { position: static; }
  .top-in { padding: 12px 16px 10px; gap: 10px; height: auto; flex-wrap: wrap; justify-content: space-between; }
  .nav { order: 3; flex-basis: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; overflow: visible; }
  .nav a { text-align: center; padding: 8px 6px; }
  .who .email { display: none; }
  main { padding: 20px 16px 64px; gap: 20px; }
  h1 { font-size: 21px; }
}

/* --- pieces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px;
             border-bottom: 1px solid var(--line); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-l { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.muted { color: var(--ink-3); }
.ink { color: var(--ink); }
.small { font-size: 13px; }
.label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.notice { border-radius: var(--radius); padding: 12px 16px; background: var(--info-soft); color: var(--ink); border: 1px solid transparent; }
.notice.warn { background: var(--warn-soft); }
.notice.bad { background: var(--bad-soft); }
.notice.ok { background: var(--ok-soft); }
.notice ul { margin: 6px 0 0; padding-left: 18px; }
.flash { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20; background: var(--ink);
         color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.18);
         max-width: calc(100vw - 32px); animation: flash 4.5s ease forwards; }
@keyframes flash { 0%, 85% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .flash { animation: none; } }

.btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit;
       font-weight: 550; font-size: 14px; line-height: 1; padding: 10px 16px; border-radius: 8px; border: 1px solid var(--line-strong);
       background: var(--surface); color: var(--ink); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--sunk); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--ink-2); padding-inline: 10px; }
.btn.quiet:hover { background: var(--sunk); color: var(--ink); }
.btn.small { padding: 7px 11px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: default; }
form.inline { display: inline; margin: 0; }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 550; padding: 3px 9px 3px 8px;
        border-radius: 999px; background: var(--mute-soft); color: var(--ink-2); white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.info { background: var(--info-soft); color: var(--info); }
.chip.plain::before { display: none; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 6px;
        background: var(--sunk); color: var(--ink-2); }
.pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.pill.ok i { background: var(--ok); } .pill.warn i { background: var(--warn); } .pill.bad i { background: var(--bad); }
.pill.info i { background: var(--info); } .pill.mute { opacity: .7; }

/* --- forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--ink-3); font-size: 12.5px; }
input[type=text], input[type=email], input[type=password], input[type=datetime-local], input[type=number],
input[type=search], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 9px 11px; width: 100%; min-width: 0; }
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
input[type=file] { font: inherit; font-size: 14px; color: var(--ink-2); max-width: 100%; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; font-size: 13px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 7px 12px; margin-right: 10px; cursor: pointer; }
input[type=file]::file-selector-button:hover { background: var(--sunk); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }
.check { display: flex; align-items: center; gap: 10px; font-weight: 550; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.counter { font-variant-numeric: tabular-nums; }
.counter.over { color: var(--bad); font-weight: 600; }

/* --- sign in */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.gate .card { width: 100%; max-width: 400px; padding: 32px 30px; display: flex; flex-direction: column; gap: 20px; }
.gate .mark { margin-bottom: 4px; }
.qr { align-self: center; background: #fff; border-radius: 10px; padding: 4px; line-height: 0; }
.qr svg { display: block; width: 232px; height: 232px; }
.secret { text-align: center; font-family: var(--mono); font-size: 13px; letter-spacing: .04em; color: var(--ink-2);
          background: var(--sunk); border-radius: 8px; padding: 8px; user-select: all; }
.code-input { font-family: var(--mono); font-size: 24px !important; letter-spacing: .3em; text-align: center; }

/* --- schedule */
.weekbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.weekbar .range { font-weight: 600; min-width: 180px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.day { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.day-head { display: flex; align-items: baseline; gap: 6px; padding: 0 2px 6px; border-bottom: 2px solid var(--line); }
.day-head b { font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.day-head span { color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.day.today .day-head { border-color: var(--accent); }
.day.today .day-head b, .day.today .day-head span { color: var(--accent); }
.day-empty { color: var(--ink-3); font-size: 13px; padding: 10px 2px; }
.pc { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
      overflow: hidden; text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: border-color .15s; }
.pc:hover { border-color: var(--line-strong); }
.pc-img { aspect-ratio: 4 / 5; background: var(--sunk) center / cover no-repeat; display: grid; place-items: center;
          color: var(--ink-3); font-size: 12px; position: relative; }
.pc-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-img .vid { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px;
               font-weight: 600; padding: 2px 6px; border-radius: 5px; }
.pc-body { padding: 10px 11px 11px; display: flex; flex-direction: column; gap: 7px; }
.pc-time { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; display: flex; align-items: baseline;
           justify-content: space-between; gap: 6px; white-space: nowrap; }
.pc-time b { color: var(--ink); font-weight: 650; font-size: 14px; }
.pc-title { font-size: 13.5px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3;
            -webkit-box-orient: vertical; overflow: hidden; }
.pc-pills { display: flex; flex-wrap: wrap; gap: 4px; }
@media (max-width: 1080px) {
  .week { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .day-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
  .day.empty { display: none; }
  .pc { flex-direction: row; }
  .pc-img { width: 96px; flex: 0 0 96px; aspect-ratio: 4 / 5; }
  .pc-img .vid { right: 4px; bottom: 4px; font-size: 10px; }
  .pc-body { flex: 1; min-width: 0; justify-content: center; padding: 10px 12px; }
}
@media (min-width: 1081px) { .day-items { display: flex; flex-direction: column; gap: 8px; } }

.attn { display: flex; flex-direction: column; gap: 8px; }
.attn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }

/* --- tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3);
     border-top: 0; background: transparent; white-space: nowrap; }
td.nowrap, th.nowrap { white-space: nowrap; }
tr.link-row:hover td { background: var(--sunk); }

/* --- one post */
.post-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
@media (max-width: 1000px) { .post-grid { grid-template-columns: minmax(0, 1fr); } }
.strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.strip figure { margin: 0; flex: 0 0 auto; width: 180px; display: flex; flex-direction: column; gap: 6px; scroll-snap-align: start; }
.strip img, .strip video { width: 180px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 8px; border: 1px solid var(--line);
                           background: var(--sunk); display: block; }
.strip video { object-fit: contain; background: #000; }
.strip figcaption { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.target { border-top: 1px solid var(--line); padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.target:first-of-type { border-top: 0; }
.target-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.target-name { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--sunk); object-fit: cover; flex: 0 0 auto;
          display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--ink-2); }
.readonly { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--sunk); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.settings-row { display: flex; flex-wrap: wrap; gap: 12px 16px; }
.settings-row .field { min-width: 150px; flex: 1 1 150px; }
.kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 76px; }
@media (max-width: 1000px) { .side { position: static; } }
.err { color: var(--bad); }
.warnings { color: var(--warn); font-size: 13.5px; }

/* --- channels */
.accounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.acc { display: flex; flex-direction: column; }
.acc-head { display: flex; gap: 12px; align-items: center; padding: 16px 18px; }
.acc-head .avatar { width: 40px; height: 40px; font-size: 13px; }
.acc-name { min-width: 0; flex: 1; }
.acc-name b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-name span { color: var(--ink-3); font-size: 13px; }
.acc details { border-top: 1px solid var(--line); }
.acc summary { cursor: pointer; padding: 12px 18px; color: var(--ink-2); font-weight: 550; font-size: 14px; list-style: none; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: " ›"; color: var(--ink-3); }
.acc details[open] summary::after { content: " ⌄"; }
.acc .acc-body { padding: 0 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.acc-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.connect { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.connect form { margin: 0; }
.connect .card { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; height: 100%; }

/* --- live login */
.screen { width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: var(--radius); background: #000; }
.status-line { font-weight: 550; }
.status-line.ok { color: var(--ok); } .status-line.bad { color: var(--bad); }

/* --- new post */
.ch { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.ch > label { padding: 14px 18px; }
.ch .ch-body { border-top: 1px solid var(--line); padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.ch:not(.on) .ch-body { display: none; }
.no-js .ch .ch-body { display: flex; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.grow { flex: 1 1 260px; }
@media (max-width: 720px) { .spacer { display: none; } }
