/* Minato Studio. The night-harbour palette of the Minato brand: ink canvas, one violet accent,
   sea-glass for good, amber for "look at this", rose for problems. Space Grotesk for headings and
   numbers, Inter for everything else. */
:root {
  --ink: #0b0e14;
  --s1: #11151e;
  --s2: #171c27;
  --s3: #1e2431;
  --line: rgba(232, 234, 242, 0.08);
  --line-2: rgba(232, 234, 242, 0.14);
  --text: #e8eaf2;
  --mist: #b4b9cc;
  --fog: #868ca3;
  --accent: #7b61ff;
  --accent-hi: #9886ff;
  --ok: #2bd9a7;
  --warn: #f2b85e;
  --bad: #ff5c8a;
  --r-sm: 8px;
  --r: 14px;
  --display: "Space Grotesk", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ink); color: var(--text); font: 400 15px/1.55 var(--body); }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--fog); }
.small { font-size: 13px; }
.inline { display: inline; }

/* ---------- header */
.top { position: sticky; top: 0; z-index: 10; background: rgba(11, 14, 20, 0.92); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1240px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 32px; }
.brand { font: 600 18px/1 var(--display); letter-spacing: -0.01em; white-space: nowrap; }
.brand span { color: var(--accent-hi); font-weight: 500; }
.tabs { display: flex; gap: 4px; }
.tabs a { padding: 8px 12px; border-radius: var(--r-sm); color: var(--mist); font-weight: 500; }
.tabs a:hover { color: var(--text); background: var(--s2); }
.tabs a[aria-current="page"] { color: var(--text); background: var(--s3); }
.top-status { margin-left: auto; display: flex; align-items: center; gap: 16px; }

.pill { font-size: 13px; font-weight: 500; padding: 4px 10px; border-radius: 99px; border: 1px solid; white-space: nowrap; }
.pill-ok { color: var(--ok); border-color: rgba(43, 217, 167, 0.35); }
.pill-warn { color: var(--warn); border-color: rgba(242, 184, 94, 0.35); }

/* ---------- page */
.page { max-width: 1240px; margin: 0 auto; padding: 32px 24px 80px; }
.h1 { font: 600 32px/1.15 var(--display); letter-spacing: -0.02em; margin: 0 0 24px; }
.h2 { font: 600 18px/1.25 var(--display); margin: 0 0 12px; }
.block { margin-top: 40px; }
.block-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.block-head .h1 { margin-bottom: 16px; }
.empty { color: var(--fog); padding: 24px; border: 1px dashed var(--line-2); border-radius: var(--r); margin: 0; }
.link { color: var(--accent-hi); background: none; border: 0; padding: 0; cursor: pointer; font-weight: 500; }
.link:hover { text-decoration: underline; }

.flash { padding: 12px 16px; border-radius: var(--r-sm); margin-bottom: 24px; border: 1px solid; }
.flash-ok { border-color: rgba(43, 217, 167, 0.35); background: rgba(43, 217, 167, 0.08); }
.flash-error { border-color: rgba(255, 92, 138, 0.4); background: rgba(255, 92, 138, 0.08); }

.card { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03); }
.card + .card { margin-top: 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--s2); color: var(--text); font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: rgba(232, 234, 242, 0.28); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.btn-quiet { background: transparent; }

input, textarea { width: 100%; background: var(--ink); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 10px 12px; }
input:focus, textarea:focus { border-color: var(--accent); outline: none; }
textarea { resize: vertical; line-height: 1.5; }
input[readonly], textarea[readonly] { color: var(--mist); }
label { display: block; font-size: 13px; font-weight: 500; color: var(--mist); }
label > input { margin-top: 6px; }
.field-error { color: var(--bad); }

/* ---------- today */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.stat p { margin: 0; }
.stat-k { font-size: 13px; color: var(--fog); }
.stat-v { font: 600 24px/1.3 var(--display); margin-top: 4px !important; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.stat-s { font-size: 13px; color: var(--mist); margin-top: 4px !important; }

.issues { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.issue a { display: block; padding: 12px 16px; border-radius: var(--r-sm); border: 1px solid; }
.issue-warn a { border-color: rgba(242, 184, 94, 0.3); background: rgba(242, 184, 94, 0.06); }
.issue-bad a { border-color: rgba(255, 92, 138, 0.35); background: rgba(255, 92, 138, 0.07); }
.issue a:hover { filter: brightness(1.2); }

.rows { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--s1); overflow: hidden; }
.rows li + li { border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 16px; padding: 12px 16px; }
.row:hover { background: var(--s2); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 13px; color: var(--fog); }
.row-when { text-align: right; font-size: 14px; font-weight: 500; }

/* ---------- thumbnails and chips */
.thumb { display: block; flex: none; background: var(--s3); border-radius: 6px; overflow: hidden; aspect-ratio: 9 / 16; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-xs { width: 24px; border-radius: 4px; }
.thumb-sm { width: 36px; }
.thumb-lg { width: 100%; border-radius: 10px; }

.chip { display: inline-block; font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 99px; background: var(--s3); color: var(--mist); }
.chip-scheduled { color: var(--accent-hi); background: rgba(123, 97, 255, 0.14); }
.chip-posted { color: var(--ok); background: rgba(43, 217, 167, 0.12); }
.chip-publishing { color: var(--warn); background: rgba(242, 184, 94, 0.12); }
.chip-failed { color: var(--bad); background: rgba(255, 92, 138, 0.12); }

/* ---------- library */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.filters a { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--mist); font-size: 14px; font-weight: 500; }
.filters a span { color: var(--fog); margin-left: 4px; }
.filters a[aria-current="page"] { border-color: var(--accent); color: var(--text); background: rgba(123, 97, 255, 0.12); }
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 16px; }
.reel-card { display: flex; flex-direction: column; gap: 12px; padding: 12px; height: 100%; }
.reel-card:hover { border-color: var(--line-2); background: var(--s2); }
.reel-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.reel-num { font: 600 15px/1.2 var(--display); display: flex; gap: 8px; width: 100%; justify-content: space-between; }
.reel-num .muted { font: 400 13px var(--body); }
.reel-title { font-size: 14px; color: var(--mist); line-height: 1.35; }
.reel-when { font-size: 12px; color: var(--fog); }

/* ---------- calendar */
.month-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.plan { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 24px; }
.plan p { margin: 0; max-width: 75ch; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--line); gap: 1px; }
.cal-dow { background: var(--s1); padding: 8px 12px; font-size: 12px; font-weight: 500; color: var(--fog); }
.cal-day { background: var(--s1); min-height: 112px; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.cal-out { background: #0e121a; }
.cal-out .cal-date { color: #4d5265; }
.cal-today .cal-date { color: var(--accent-hi); font-weight: 600; }
.cal-date { margin: 0 0 4px; font: 500 13px var(--display); color: var(--mist); }
.cal-dname, .cal-mname { display: none; }
.cal-item { display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: 6px; background: var(--s2); border-left: 2px solid var(--accent); min-width: 0; }
.cal-item:hover { background: var(--s3); }
.cal-item > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.cal-time { font-size: 11px; color: var(--fog); line-height: 1.2; }
.cal-name { font-size: 12px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-posted { border-left-color: var(--ok); }
.cal-failed { border-left-color: var(--bad); }
.cal-publishing { border-left-color: var(--warn); }

/* ---------- one reel */
.reel-layout { display: grid; grid-template-columns: minmax(260px, 380px) 1fr; gap: 32px; align-items: start; }
.player video { width: 100%; aspect-ratio: 9 / 16; background: #000; border-radius: var(--r); border: 1px solid var(--line); }
.player p { margin: 8px 0 0; }
.side .card p { margin: 0 0 12px; }
.time-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; margin: 16px 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.caption-form { display: grid; gap: 8px; }
.caption-form label { margin-top: 4px; }
.caption-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.caption-foot > span { margin-right: auto; }
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.log .muted { font-size: 12px; margin-right: 8px; }
.log-bad, .log-error { color: var(--bad); }
.log-warn { color: var(--warn); }

/* ---------- settings */
.rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 16px; }
.rules-foot { grid-column: 1 / -1; }
.card > p.muted { max-width: 75ch; }

/* ---------- login */
.login-body { min-height: 100vh; display: grid; place-items: center; }
.login { width: min(360px, calc(100vw - 32px)); }
.login .brand { text-align: center; font-size: 22px; margin: 0 0 24px; }
.login-card { display: grid; gap: 12px; }

/* ---------- phones and small tablets */
@media (max-width: 900px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .reel-layout { grid-template-columns: 1fr; }
  .player { max-width: 360px; }
}
@media (max-width: 720px) {
  .top-in { padding: 0 16px; gap: 12px; height: auto; flex-wrap: wrap; padding-top: 12px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; padding-bottom: 8px; }
  .top-status { gap: 12px; }
  .page { padding: 24px 16px 64px; }
  .h1 { font-size: 26px; }
  .stat-v { font-size: 20px; }
  .plan { flex-direction: column; align-items: stretch; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .time-form { grid-template-columns: 1fr 1fr; }
  .time-form .btn { grid-column: 1 / -1; }
  /* the calendar becomes a list of the days that have reels */
  .cal { display: block; background: var(--s1); }
  .cal-dow, .cal-empty, .cal-out { display: none; }
  .cal-day { min-height: 0; padding: 12px 16px; border-top: 1px solid var(--line); }
  .cal-day:first-of-type { border-top: 0; }
  .cal-dname, .cal-mname { display: inline; }
  .cal-item { padding: 8px; }
  .cal-name { font-size: 14px; white-space: normal; }
  .cal-time { font-size: 12px; }
  .thumb-xs { width: 32px; }
  .row-when { font-size: 13px; }
}
@media (max-width: 380px) {
  .stats { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

/* ---------- multi-account additions */
select { width: 100%; margin-top: 6px; background: var(--ink); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 10px 12px; }
.pill-bad { color: var(--bad); border-color: rgba(255, 92, 138, 0.4); }
.h1-sub { font: 400 16px var(--body); margin-left: 8px; letter-spacing: 0; }
.h1-tight { margin-bottom: 4px; }
.lead { max-width: 75ch; margin: -8px 0 24px; }
.hello p { max-width: 70ch; }
.switch { position: relative; }
.switch summary { list-style: none; cursor: pointer; padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 99px; font-weight: 500; font-size: 14px; }
.switch summary::-webkit-details-marker { display: none; }
.switch summary::after { content: " ▾"; color: var(--fog); }
.switch-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--s2); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 6px; display: grid; z-index: 20; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); }
.switch-menu a { padding: 8px 10px; border-radius: 6px; }
.switch-menu a:hover, .switch-menu a[aria-current] { background: var(--s3); }
.acct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.acct-card { display: flex; flex-direction: column; gap: 8px; }
.acct-card:hover { border-color: var(--line-2); background: var(--s2); }
.acct-head { display: flex; align-items: center; gap: 12px; }
.acct-head > span:last-child { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.acct-name { font: 600 18px/1.2 var(--display); }
.acct-line { font-size: 14px; }
.acct-add { align-items: center; justify-content: center; color: var(--accent-hi); font-weight: 500; border-style: dashed; min-height: 120px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--s3); object-fit: cover; flex: none; display: inline-block; }
.avatar-lg { width: 64px; height: 64px; }
.thumb video { width: 100%; height: 100%; object-fit: cover; }
.plan-inline { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.plan-inline p { margin: 0; }
.link.danger { color: var(--bad); }
.push-right { margin-left: auto; }
.actions { align-items: center; margin-top: 8px; }
.drop { display: grid; gap: 8px; place-items: center; text-align: center; padding: 48px 24px; border: 1.5px dashed var(--line-2); border-radius: var(--r); cursor: pointer; }
.drop.is-over { border-color: var(--accent); background: rgba(123, 97, 255, 0.06); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-title { font: 600 18px var(--display); color: var(--text); }
.up-list { list-style: none; margin: 16px 0 8px; padding: 0; display: grid; gap: 8px; }
.up-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 16px; background: var(--s2); border-radius: var(--r-sm); font-size: 14px; }
.up-bar { grid-column: 1 / -1; height: 4px; background: var(--s3); border-radius: 2px; overflow: hidden; }
.up-bar span { display: block; height: 100%; width: 0; background: var(--accent); }
.up-item.is-done .up-bar span { background: var(--ok); }
.up-item.is-error { color: var(--bad); }
@media (max-width: 720px) {
  .switch-menu { right: auto; left: 0; }
  .h1-sub { display: block; margin: 4px 0 0; }
}
.acct-grid .card + .card { margin-top: 0; }
.page > .block-head:has(.acct-head) { margin-bottom: 24px; }

/* ---------- public pages, sign-in extras */
.prose-page { max-width: 820px; }
.prose { line-height: 1.65; }
.prose h1 { font: 600 32px/1.2 var(--display); letter-spacing: -0.02em; margin: 0 0 8px; }
.prose h2 { font: 600 20px/1.3 var(--display); margin: 32px 0 8px; }
.prose p, .prose li { max-width: 70ch; color: var(--mist); }
.prose strong { color: var(--text); }
.prose ul, .prose ol { padding-left: 20px; }
.prose li + li { margin-top: 6px; }
.foot { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; padding: 24px 16px 40px; font-size: 13px; }
.foot a { color: var(--fog); }
.foot a:hover { color: var(--text); }
.login-links { display: flex; justify-content: space-between; gap: 12px; margin: 4px 0 0; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; line-height: 1.4; }
.check input { width: auto; margin-top: 3px; }
.btn-danger { border-color: rgba(255, 92, 138, 0.5); color: var(--bad); background: transparent; }
.btn-danger:hover { background: rgba(255, 92, 138, 0.1); border-color: var(--bad); }
.mono { font-family: ui-monospace, Menlo, monospace; }
.login-body { flex-direction: column; }
