/* Cadence Scheduler design system.
   Black, white and greys. One accent role: state dots. Type is the system UI font
   (SF Pro on Apple devices). Everything is built from the tokens below. */

:root {
  --bg: #ffffff;
  --bg-subtle: #f5f5f7;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #a1a1a6;
  --line: #e5e5ea;
  --line-strong: #d2d2d7;
  --ink: #0b0b0c;
  --on-ink: #f5f5f7;
  --focus: #0071e3;
  --ok: #30a46c;
  --warn: #e5a50a;
  --bad: #d92d20;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-subtle: #111113;
    --surface: #161618;
    --surface-raised: #1c1c1e;
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #6e6e73;
    --line: #2c2c2e;
    --line-strong: #3a3a3c;
    --ink: #f5f5f7;
    --on-ink: #0b0b0c;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.5);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 32px; line-height: 1.1; font-weight: 600; letter-spacing: -0.02em; }
h2 { font-size: 21px; line-height: 1.2; font-weight: 600; letter-spacing: -0.015em; }
h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.005em; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px;
  padding: 22px 14px; background: var(--bg-subtle); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; text-decoration: none; }
.brand img { width: 30px; height: 30px; border-radius: 8px; display: block; }
.brand b { display: block; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.1; }
.brand small { display: block; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); }
.nav a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-radius: 9px; text-decoration: none; color: var(--text-2); font-weight: 500;
}
.nav a:hover { background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); }
.nav a.active { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.nav .soon { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.sidebar .spacer { flex: 1; }
.me { padding: 10px; border-top: 1px solid var(--line); margin-top: 8px; }
.me small { display: block; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me button { margin-top: 8px; }
.main { padding: 44px clamp(20px, 5vw, 64px) 96px; max-width: 1180px; width: 100%; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 32px; flex-wrap: wrap; }
.page-head p { color: var(--text-2); margin-top: 6px; max-width: 56ch; }

/* ---------- Controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); cursor: pointer; font-weight: 500; text-decoration: none; transition: background .15s, transform .05s;
}
.btn:hover { background: var(--bg-subtle); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.btn.primary:hover { opacity: .88; background: var(--ink); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.quiet:hover { color: var(--text); background: var(--bg-subtle); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field > label, .label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.field .hint { font-size: 12.5px; color: var(--text-3); }
input[type=text], input[type=email], input[type=password], select, textarea {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface);
}
textarea { resize: vertical; min-height: 92px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 10%, transparent); }

.segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--bg-subtle); border: 1px solid var(--line); }
.segmented button { border: 0; background: transparent; padding: 7px 16px; border-radius: 999px; cursor: pointer; color: var(--text-2); font-weight: 500; }
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(0,0,0,.06); }

.switch { position: relative; width: 40px; height: 24px; border-radius: 999px; border: 0; cursor: pointer; background: var(--line-strong); transition: background .15s; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.switch[aria-checked=true] { background: var(--ink); }
.switch[aria-checked=true]::after { transform: translateX(16px); background: var(--on-ink); }

/* ---------- Cards and lists ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.channel-card { display: block; text-decoration: none; padding: 22px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); transition: box-shadow .2s, transform .2s; }
.channel-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.channel-card h3 { font-size: 18px; letter-spacing: -0.01em; }
.channel-card .meta { display: flex; gap: 18px; margin-top: 18px; color: var(--text-2); font-size: 13px; }
.channel-card .meta b { display: block; font-size: 22px; font-weight: 600; color: var(--text); letter-spacing: -0.02em; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); display: inline-block; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }
.empty { text-align: center; padding: 64px 24px; color: var(--text-2); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty h2 { color: var(--text); margin-bottom: 8px; }
.empty .btn { margin-top: 18px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--text-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--text); border-color: var(--ink); }
.crumb { color: var(--text-2); text-decoration: none; font-size: 13px; display: inline-block; margin-bottom: 14px; }
.crumb:hover { color: var(--text); }

/* ---------- Shelves ---------- */
.shelves { display: grid; gap: 16px; }
.shelf { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.shelf-head { display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; align-items: start; padding: 18px 20px; }
.shelf-num { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--on-ink); display: grid; place-items: center; font-weight: 600; font-size: 14px; }
.shelf-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; border: 0; background: transparent; padding: 2px 4px; margin: -2px -4px; border-radius: 6px; width: 100%; }
.shelf-title:hover { background: var(--bg-subtle); }
.shelf-brief { margin-top: 6px; }
.shelf-brief textarea { min-height: 64px; font-size: 14px; }
.shelf-tools { display: flex; align-items: center; gap: 4px; }
.shelf-opt { display: flex; align-items: center; gap: 10px; padding: 0 20px 16px 74px; color: var(--text-2); font-size: 13px; }
.assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; padding: 0 20px 20px 74px; }
.asset { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--bg-subtle); border: 1px solid var(--line); }
.asset img, .asset video { width: 100%; height: 100%; object-fit: cover; display: block; }
.asset .x { position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border-radius: 50%; border: 0; cursor: pointer; background: rgba(0,0,0,.6); color: #fff; font-size: 14px; line-height: 1; opacity: 0; transition: opacity .15s; }
.asset:hover .x, .asset:focus-within .x { opacity: 1; }
.drop { margin: 0 20px 20px 74px; padding: 22px; border: 1px dashed var(--line-strong); border-radius: 12px; text-align: center; color: var(--text-2); font-size: 13.5px; cursor: pointer; transition: background .15s, border-color .15s; }
.drop:hover, .drop.over { background: var(--bg-subtle); border-color: var(--text-2); }
.assets + .drop { margin-top: -6px; }
/* AI keys */
.ai-list { display: grid; gap: 0; }
.ai-row { border-top: 1px solid var(--line); padding: 12px 0; }
.ai-row:first-child { border-top: 0; }
.ai-tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--ok, #1f8a4c); color: #fff; vertical-align: 1px; }
.ai-steps { display: grid; gap: 10px; margin-top: 10px; padding: 12px 14px; border-radius: 10px; background: var(--bg-subtle); }
.ai-steps ol { margin: 0; padding-left: 20px; line-height: 1.6; color: var(--text-2); font-size: 13.5px; }
.ai-steps .btn { justify-self: start; }

/* Reels editor */
.reel-badge { position: absolute; right: 4px; bottom: 4px; font-size: 11px; padding: 2px 7px; border-radius: 999px; border: 0; cursor: pointer; background: var(--ink); color: var(--on-ink); }
.modal.reel-modal { width: min(760px, 100%); max-height: calc(100vh - 40px); overflow: auto; }
.reel-grid { display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: 22px; align-items: start; }
.reel-left, .reel-right { min-width: 0; }
.reel-stage { position: relative; width: 100%; overflow: hidden; border-radius: 12px; background: #000; cursor: grab; touch-action: none; user-select: none; }
.reel-stage:active { cursor: grabbing; }
.reel-stage video { display: block; }
.reel-safe { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); border-radius: 12px; }
.reel-wait { position: absolute; inset: 0; display: grid; place-items: center; color: #ddd; font-size: 13px; }
.reel-cover { margin-top: 12px; width: 140px; aspect-ratio: 9 / 16; max-width: 100%; border-radius: 10px; overflow: hidden; background: var(--bg-subtle); border: 1px solid var(--line); display: grid; place-items: center; text-align: center; padding: 0; }
.reel-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.reel-cover .hint { padding: 10px; font-size: 12px; }
@media (max-width: 620px) { .reel-grid { grid-template-columns: 1fr; } .reel-left { max-width: 280px; margin: 0 auto; width: 100%; } }

/* Folding shelves and their sections */
.chev { display: inline-block; transition: transform .15s; font-size: 18px; line-height: 1; }
.chev.open { transform: rotate(90deg); }
.chev-btn { background: none; border: 0; cursor: pointer; color: var(--text-2); width: 32px; height: 32px; border-radius: 8px; display: inline-grid; place-items: center; }
.chev-btn:hover { background: var(--bg-subtle); color: var(--text); }
.sec-head { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; cursor: pointer; text-align: left;
  padding: 6px 20px 6px 74px; font: inherit; font-size: 13px; font-weight: 600; color: var(--text-2); letter-spacing: .01em; }
.sec-head:hover { color: var(--text); }
.sec-head .chev { font-size: 16px; width: 12px; }
.sec-body { padding-top: 4px; }
.sec:not(:has(.sec-body > *)) { display: none; }
.sec:last-child { padding-bottom: 4px; }

/* ---------- Modal, toast, auth ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { width: min(460px, 100%); background: var(--surface-raised); border-radius: 20px; padding: 28px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.modal h2 { margin-bottom: 20px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--on-ink); padding: 11px 18px; border-radius: 999px; font-size: 14px; box-shadow: var(--shadow); z-index: 60; }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg-subtle); }
.auth-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 36px 32px; box-shadow: var(--shadow); }
.auth-card .logo { width: 56px; height: 56px; border-radius: 14px; display: block; margin: 0 auto 22px; }
.auth-card h1 { text-align: center; font-size: 26px; }
.auth-card .sub { text-align: center; color: var(--text-2); margin: 8px 0 26px; }
.auth-card .btn { width: 100%; padding: 12px; }
.err { color: var(--bad); font-size: 13.5px; margin: -6px 0 14px; }
.loading { display: grid; place-items: center; min-height: 50vh; color: var(--text-3); }

.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 16px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.account-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--line); }
.account-row:first-of-type { border-top: 0; }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0 8px 0 0; }
  .nav { display: flex; gap: 2px; flex-wrap: wrap; }
  .sidebar .spacer { display: none; }
  .me { border: 0; margin: 0 0 0 auto; padding: 0; display: flex; align-items: center; gap: 10px; }
  .me small { display: none; } .me button { margin: 0; }
  .main { padding-top: 28px; }
  .two { grid-template-columns: 1fr; }
  .shelf-head { grid-template-columns: 32px 1fr; } .shelf-tools { grid-column: 1 / -1; }
  .assets, .drop, .shelf-opt { padding-left: 20px; margin-left: 0; margin-right: 20px; }
  .assets { margin: 0; padding-right: 20px; }
  .sec-head { padding-left: 20px; }
  h1 { font-size: 27px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Master Calendar ---------- */
.cal-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-range { margin-left: 8px; font-weight: 600; letter-spacing: -0.01em; }
.cal-filter { width: auto; padding: 6px 12px; border-radius: 999px; }
.cal-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.cal { display: grid; grid-template-columns: 150px repeat(7, minmax(132px, 1fr)); min-width: 1080px; }
.cal-head { padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--bg-subtle); display: flex; gap: 8px; align-items: baseline; position: sticky; top: 0; }
.cal-head span { color: var(--text-2); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.cal-head b { font-size: 16px; font-weight: 600; }
.cal-head.today b { background: var(--ink); color: var(--on-ink); border-radius: 999px; padding: 0 8px; }
.cal-rowhead { padding: 14px 12px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.cal-rowhead a { font-weight: 600; text-decoration: none; letter-spacing: -0.01em; }
.cal-rowhead a:hover { text-decoration: underline; }
.cal-rowhead small { color: var(--text-2); font-size: 12px; }
.cal-cell { padding: 8px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; min-height: 96px; }
.cal-cell:nth-child(8n) { border-right: 0; }
.cal-cell.today { background: color-mix(in srgb, var(--text) 3%, transparent); }
.cal-hint { color: var(--text-2); margin-top: 16px; text-align: center; }
.cal-chip { display: flex; gap: 8px; align-items: center; width: 100%; text-align: left; padding: 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: box-shadow .15s, transform .1s; }
.cal-chip:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.cal-chip.skipped { opacity: .5; }
.cal-chip.skipped .shelf { text-decoration: line-through; }
.cal-chip.past { opacity: .6; }
.cal-chip .thumb { width: 34px; height: 34px; border-radius: 7px; overflow: hidden; background: var(--bg-subtle); flex: none; display: grid; place-items: center; }
.cal-chip .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vid { width: 0; height: 0; border-left: 10px solid var(--text-2); border-top: 6px solid transparent; border-bottom: 6px solid transparent; margin-left: 3px; }
.cal-chip .meta { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.cal-chip .top { display: flex; align-items: center; gap: 5px; font-size: 12.5px; }
.cal-chip .top em { font-style: normal; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 5px; }
.cal-chip .shelf { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip .dests { display: flex; gap: 4px; }
.cal-chip .dests i { font-style: normal; font-size: 9.5px; font-weight: 600; letter-spacing: .04em; color: var(--text-2); }
.cal-chip .dests i.off { color: var(--text-3); text-decoration: line-through; }
.notice { background: var(--bg-subtle); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.notice ul { margin: 8px 0 0 18px; padding: 0; color: var(--text-2); }
.warn-text { color: var(--warn); font-style: normal; font-size: 13px; }

/* ---------- Drawer ---------- */
.drawer-scrim { place-items: stretch end; padding: 0; }
.drawer { width: min(460px, 100%); height: 100%; overflow-y: auto; background: var(--surface-raised); border-left: 1px solid var(--line); padding: 26px; box-shadow: var(--shadow); }
.drawer h2 { margin-top: 2px; }
.drawer-media { margin-top: 18px; border-radius: 14px; overflow: hidden; background: var(--bg-subtle); display: grid; place-items: center; max-height: 46vh; }
.drawer-media img, .drawer-media video { max-width: 100%; max-height: 46vh; display: block; }
.dest-list { display: grid; gap: 8px; }
.dest-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.dest-row small { color: var(--text-2); }
.dest-note { flex-basis: 100%; color: var(--text-2); font-size: 12.5px; line-height: 1.4; }
.drawer-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.picker { margin-top: 16px; }
.picker .assets { padding: 0; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
.asset.pick { cursor: pointer; padding: 0; }
.asset.pick.current { outline: 2px solid var(--ink); }
.asset.pick:hover:not([disabled]) { box-shadow: var(--shadow); }
.drawer input[type=date], .drawer input[type=time], .slot-row input[type=time] { width: auto; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); }

/* ---------- Rotation and destinations ---------- */
.slot-list { display: grid; gap: 10px; }
.slot-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.order { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.order li { display: flex; align-items: center; gap: 12px; }
.order small { color: var(--text-2); }
.shelf-num.sm { width: 24px; height: 24px; font-size: 12px; }
.dest-setting { padding: 16px 0; border-top: 1px solid var(--line); }
.dest-setting:first-of-type { border-top: 0; }
.check { display: inline-flex; align-items: center; gap: 10px; color: var(--text-2); }
.drawer-scrim { backdrop-filter: none; background: rgba(0,0,0,.28); }
/* ---------- Account, recovery, banner ---------- */
.auth-link { text-align: center; margin-top: 16px; }
.linkish { background: none; border: 0; padding: 0; color: var(--text-2); cursor: pointer; font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; }
.linkish:hover { color: var(--text); }
.me-link { display: block; text-decoration: none; padding: 2px 0; }
.me-link span { display: block; font-size: 13px; color: var(--text-2); }
.me-link:hover span, .me-link.active span { color: var(--text); }
.banner { background: var(--bg-subtle); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; margin: -20px 0 24px; color: var(--text-2); font-size: 14px; }
.banner a { color: var(--text); }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.codes code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; letter-spacing: .06em; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg-subtle); text-align: center; user-select: all; }
.hint { font-size: 12.5px; color: var(--text-3); }

.pick-row { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer; }
.pick-row.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.pick-row input { margin-top: 4px; accent-color: var(--ink); }
.pick-row small { display: block; color: var(--text-2); }

/* ---------- Messages ---------- */
.badge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 8px; border-radius: 999px; background: var(--ink); color: var(--on-ink); font-size: 11.5px; font-weight: 600; line-height: 20px; text-align: center; vertical-align: 1px; }
.inbox { display: grid; grid-template-columns: 340px 1fr; height: min(72vh, 760px); min-height: 460px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.inbox-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--bg-subtle); }
.inbox-head { padding: 16px; border-bottom: 1px solid var(--line); }
.inbox-rows { overflow-y: auto; flex: 1; }
.inbox-empty { padding: 28px 20px; color: var(--text-2); font-size: 14px; }
.conv-row { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer; position: relative; }
.conv-row:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.conv-row.on { background: var(--surface); box-shadow: inset 3px 0 0 var(--ink); }
.avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; background: var(--ink); color: var(--on-ink); display: grid; place-items: center; font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.avatar.lg { width: 42px; height: 42px; }
.conv-main { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 2px; }
.conv-top { display: flex; justify-content: space-between; gap: 8px; }
.conv-top b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-row.unread .conv-top b { font-weight: 700; }
.conv-top time { color: var(--text-3); font-size: 12px; flex: none; }
.conv-snip { color: var(--text-2); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-row.unread .conv-snip { color: var(--text); }
.conv-meta { display: flex; gap: 8px; }
.conv-meta i { font-style: normal; font-size: 11px; color: var(--text-3); letter-spacing: .04em; text-transform: uppercase; }
.unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink); position: absolute; right: 14px; bottom: 16px; }
.inbox-thread { min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.thread-empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--text-2); padding: 24px; }
.thread-empty h3 { color: var(--text); margin-bottom: 4px; }
.thread { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.thread-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.thread-head small { color: var(--text-2); }
.thread-head .spacer { flex: 1; }
.thread-head .back { display: none; }
.thread-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.day-sep { align-self: center; color: var(--text-3); font-size: 12px; margin: 14px 0 6px; }
.bubble-row { display: flex; }
.bubble-row.out { justify-content: flex-end; }
.bubble { max-width: min(520px, 78%); padding: 9px 14px; border-radius: 18px; background: var(--bg-subtle); border: 1px solid var(--line); font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 3px; }
.bubble-row.out .bubble { background: var(--ink); color: var(--on-ink); border-color: var(--ink); border-bottom-right-radius: 6px; }
.bubble-row.in .bubble { border-bottom-left-radius: 6px; }
.bubble time { font-size: 11px; opacity: .6; }
.bubble.failed { background: transparent; color: var(--bad); border-color: var(--bad); }
.bubble em { font-style: normal; font-size: 12px; }
.bubble .attach { color: inherit; font-size: 13px; text-decoration: underline; }
.composer { padding: 12px 18px 14px; border-top: 1px solid var(--line); background: var(--surface); }
.composer-row { display: flex; gap: 10px; align-items: flex-end; }
.composer-row textarea { min-height: 44px; max-height: 140px; border-radius: 14px; }
.composer-note { background: var(--bg-subtle); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; color: var(--text-2); font-size: 13.5px; margin: 0 0 10px; }
@media (max-width: 820px) {
  .inbox { grid-template-columns: 1fr; height: 78vh; }
  .inbox-thread { display: none; }
  .inbox.show-thread .inbox-list { display: none; }
  .inbox.show-thread .inbox-thread { display: flex; }
  .thread-head .back { display: inline-flex; }
}

.inbox-off { margin: 12px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--text-2); font-size: 13px; }

.checklist { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; }
.checklist .dot { margin-top: 7px; flex: none; }
.checklist b { font-weight: 500; display: block; }
.checklist small { display: block; color: var(--text-2); font-size: 12.5px; line-height: 1.4; }

/* ---- Comments ---- */
.cmt-list { display: flex; flex-direction: column; gap: 12px; }
.cmt-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; gap: 14px; }
.cmt-card.is-hidden { opacity: .7; }
.cmt-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.cmt-top { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.cmt-top b { font-weight: 600; }
.cmt-top time, .cmt-top i { font-style: normal; color: var(--text-3); font-size: 12px; }
.cmt-top i { letter-spacing: .04em; text-transform: uppercase; }
.cmt-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.cmt-post { font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmt-post a { color: var(--text-2); }
.cmt-replies { border-left: 2px solid var(--line); padding-left: 12px; display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.cmt-reply { font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; }
.cmt-reply small { display: block; color: var(--text-3); font-size: 12px; }
.cmt-reply.failed { color: var(--bad); }
.cmt-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.cmt-compose { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.cmt-compose textarea { width: 100%; resize: vertical; }
@media (max-width: 640px) { .cmt-card { padding: 14px; gap: 10px; } }

/* ---- Ads ---- */
.ads-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.ads-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.ads-tile small, .ads-figures small { color: var(--text-3); font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; }
.ads-tile b { font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.ads-figures { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 2px; }
.ads-figures span { display: flex; flex-direction: column; gap: 2px; font-size: 14.5px; }
@media (max-width: 760px) { .ads-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- Month calendar ---- */
.mcal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); min-width: 760px; }
.mcal-head { padding: 8px 10px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.mcal-head:nth-child(7n) { border-right: 0; }
.mcal-day { min-height: 118px; padding: 6px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mcal-day:nth-child(7n + 7) { border-right: 0; }
.mcal-day.other { background: var(--bg-subtle); }
.mcal-day.today { background: color-mix(in srgb, var(--text) 4%, transparent); }
.mcal-day.open { outline: 2px solid var(--ink, currentColor); outline-offset: -2px; }
.mcal-num { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.mcal-day.other .mcal-num { opacity: .45; }
.mcal-daybtn { border: 0; background: none; cursor: pointer; font: inherit; font-weight: 600; padding: 0 4px; border-radius: 6px; }
.mcal-daybtn:hover { background: var(--bg-subtle); }
.mchip { display: flex; align-items: center; gap: 5px; width: 100%; min-width: 0; text-align: left; padding: 3px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; font-size: 12px; }
.mchip:hover { box-shadow: var(--shadow); }
.mchip.skipped { opacity: .5; text-decoration: line-through; }
.mchip.past { opacity: .65; }
.mchip .mt { font-weight: 600; flex: none; }
.mchip .ml { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; color: var(--text-2); }
.mcal-more { border: 0; background: none; cursor: pointer; font-size: 12px; color: var(--text-2); text-align: left; padding: 2px 6px; text-decoration: underline; }

/* Channels in the side menu, with each one's accounts */
@media (min-width: 821px) { .sidebar { overflow-y: auto; } }
.chan-nav { display: grid; gap: 1px; margin: 0 0 4px 8px; }
.chan-head { display: flex; align-items: center; gap: 2px; border-radius: 8px; }
.chan-head .chev-btn { width: 22px; height: 26px; flex: none; }
.chan-head .chev-btn .chev { font-size: 15px; }
.chan-head a { flex: 1; min-width: 0; padding: 5px 4px !important; font-size: 13px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: none !important; box-shadow: none !important; }
.chan-head.active a { color: var(--text); font-weight: 600; }
.chan-head small { font-size: 11px; color: var(--text-3); padding-right: 6px; }
.chan-accts { display: grid; gap: 0; margin: 0 0 6px 24px; }
.chan-acct { display: flex !important; align-items: center; gap: 6px; padding: 3px 4px !important; font-size: 12.5px !important; color: var(--text-2); }
.chan-acct small { margin-left: auto; color: var(--text-3); font-size: 11px; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan-acct .dot { flex: none; }
.chan-manage { font-size: 11.5px !important; color: var(--text-3) !important; padding: 3px 4px !important; }

/* Settings: its own side menu, one section per login */
.settings-layout { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; }
.settings-nav { display: grid; gap: 2px; position: sticky; top: 20px; }
.settings-nav a { display: block; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--text-2); font-size: 14px; }
.settings-nav a small { display: block; font-size: 11.5px; color: var(--text-3); }
.settings-nav a:hover { background: var(--bg-subtle); color: var(--text); }
.settings-nav a.active { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--line); font-weight: 600; }
.settings-group { margin: 12px 10px 2px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.settings-body { min-width: 0; max-width: 720px; }
.conn-table { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.conn-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-top: 1px solid var(--line); }
.conn-row:first-child { border-top: 0; }
.conn-row select { max-width: 220px; }
.settings-body .banner { margin: 0 0 14px; }
.ok-banner { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.bad-banner { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
@media (max-width: 820px) {
  .settings-layout { grid-template-columns: 1fr; gap: 14px; }
  .settings-nav { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .settings-nav a small, .settings-group { display: none; }
  .chan-nav { display: none; }
}
.chan-acct.active { background: var(--surface) !important; color: var(--text) !important; box-shadow: 0 0 0 1px var(--line) !important; }
.chan-acct { white-space: nowrap; min-width: 0; }
.chan-acct small { max-width: 72px; flex: 0 1 auto; min-width: 0; }
.chan-accts { margin-left: 18px; }
