/* Goud Studio: calm and professional. A quiet surface, thin grey lines, one accent for actions.
   Each channel has one colour (validated together, light and dark); a clip's state is a small icon
   and a word, never a colour alone. */
:root {
  color-scheme: light;
  --bg: #f6f6f4; --panel: #fcfcfb; --raised: #ffffff; --ink: #18181a; --ink-2: #52514e; --muted: #84837e;
  --line: #e4e3df; --line-2: #eeede9; --hover: #f1f0ec; --accent: #3f3fd1; --accent-ink: #ffffff; --accent-soft: #ececfb;
  --good: #0ca30c; --warn: #b57a00; --warn-dot: #fab219; --bad: #d03b3b; --live: #18181a;
  --good-soft: #e7f5e7; --warn-soft: #fdf3dc; --bad-soft: #fbe9e9;
  --ch-football-thrones: #2a78d6; --ch-goud-fact: #eb6834; --ch-hokm-reels: #1baf7a;
  --today: #3f3fd1; --scrim: rgba(20, 20, 24, .35); --shadow: 0 1px 2px #0000000d, 0 4px 16px #00000010;
  --fa: "Vazirmatn", Tahoma, sans-serif; --en: "Inter", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) {
  color-scheme: dark;
  --bg: #121212; --panel: #1a1a19; --raised: #20201f; --ink: #f0efec; --ink-2: #c3c2b7; --muted: #8e8d86;
  --line: #2e2e2c; --line-2: #262625; --hover: #252524; --accent: #8f8ff5; --accent-ink: #121212; --accent-soft: #26263f;
  --good: #0ca30c; --warn: #fab219; --warn-dot: #fab219; --bad: #e66767; --live: #f0efec;
  --good-soft: #15281a; --warn-soft: #2e2612; --bad-soft: #321a1a;
  --ch-football-thrones: #3987e5; --ch-goud-fact: #d95926; --ch-hokm-reels: #199e70;
  --today: #8f8ff5; --scrim: rgba(0, 0, 0, .55); --shadow: 0 1px 2px #0006, 0 6px 20px #0005;
} }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121212; --panel: #1a1a19; --raised: #20201f; --ink: #f0efec; --ink-2: #c3c2b7; --muted: #8e8d86;
  --line: #2e2e2c; --line-2: #262625; --hover: #252524; --accent: #8f8ff5; --accent-ink: #121212; --accent-soft: #26263f;
  --good: #0ca30c; --warn: #fab219; --warn-dot: #fab219; --bad: #e66767; --live: #f0efec;
  --good-soft: #15281a; --warn-soft: #2e2612; --bad-soft: #321a1a;
  --ch-football-thrones: #3987e5; --ch-goud-fact: #d95926; --ch-hokm-reels: #199e70;
  --today: #8f8ff5; --scrim: rgba(0, 0, 0, .55); --shadow: 0 1px 2px #0006, 0 6px 20px #0005;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.6 var(--fa); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button { font: 500 13.5px var(--fa); color: var(--ink); background: var(--raised); border: 1px solid var(--line); border-radius: 8px; padding: 5px 12px; cursor: pointer; }
button:hover { background: var(--hover); }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.primary:hover { background: var(--accent); filter: brightness(1.08); }
.quiet { background: transparent; border-color: transparent; color: var(--ink-2); }
.quiet:hover { background: var(--hover); }
.en { font-family: var(--en); direction: ltr; unicode-bidi: isolate; }
.num { font-family: var(--en); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--muted); }

/* the bar on top */
.top { position: sticky; top: 0; z-index: 10; background: var(--panel); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1320px; margin: 0 auto; display: flex; align-items: center; gap: 6px 18px; padding: 8px max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font: 700 16px var(--fa); padding-bottom: 8px; }
.brand i { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); display: inline-grid; place-items: center; color: var(--accent-ink); font: 700 12px var(--en); font-style: normal; }
.tabs { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 8px 12px 10px; color: var(--ink-2); white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 700; }
.tabs b { font: 600 11px var(--en); background: var(--bad); color: #fff; border-radius: 99px; padding: 0 6px; margin-inline-start: 5px; }
.tabs b:empty { display: none; }
.top-tools { display: flex; gap: 4px; padding-bottom: 8px; }

.wrap { max-width: 1320px; margin: 0 auto; padding: 14px max(16px, env(safe-area-inset-right)) 60px max(16px, env(safe-area-inset-left)); }

/* the door */
.door { max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 24px; margin: 40px auto; box-shadow: var(--shadow); }
.door h2 { margin: 0 0 4px; font-size: 18px; }
.door form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-top: 16px; }
.door label { display: flex; flex-direction: column; gap: 4px; flex: 1 1 220px; font-size: 13px; color: var(--ink-2); }
.door input { font: 16px var(--en); padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--raised); color: var(--ink); }
.msg { min-height: 1.6em; font-size: 13px; color: var(--ink-2); margin: 10px 0 0; }
.msg.bad { color: var(--bad); }

/* toolbar: filters, range, view */
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.bar-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.range { font: 700 17px var(--fa); margin-inline: 6px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--raised); }
.seg button { border: 0; border-radius: 0; padding: 5px 14px; background: transparent; }
.seg button + button { border-inline-start: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.chan { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 3px 11px; font-size: 13px; }
.chan::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--muted)); }
.chan[aria-pressed="false"] { color: var(--muted); }
.chan[aria-pressed="false"]::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c, var(--muted)); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }

/* state: an icon and a word */
.st { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.st::before { font: 700 11px var(--en); width: 15px; height: 15px; border-radius: 50%; display: inline-grid; place-items: center; }
.st.s-idea::before, .st.s-check::before { content: "!"; background: var(--warn-dot); color: #1a1300; }
.st.s-making::before { content: "…"; background: var(--line); color: var(--ink-2); line-height: 1; }
.st.s-ready::before { content: "✓"; background: var(--good); color: #fff; }
.st.s-live::before { content: "▶"; background: var(--live); color: var(--bg); font-size: 7px; }
.st.s-redo::before, .st.s-dropped::before, .st.late::before { content: "×"; background: var(--bad); color: #fff; }
.st.s-open::before { content: "+"; background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--muted); }

/* the week: one row per posting time, one column per day */
.cal { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.week { display: grid; grid-template-columns: 58px repeat(7, minmax(120px, 1fr)); overflow-x: auto; }
.wk-head { position: sticky; top: 0; background: var(--panel); border-bottom: 1px solid var(--line); padding: 8px 8px 6px; text-align: start; cursor: pointer; font: inherit; color: inherit; border-inline-start: 1px solid var(--line-2); border-radius: 0; border-top: 0; border-inline-end: 0; display: flex; flex-direction: column; gap: 0; }
.wk-head:hover { background: var(--hover); }
.wk-head small { color: var(--muted); font-size: 12px; }
.wk-head b { font: 600 20px/1.2 var(--en); }
.wk-head.today b { color: var(--today); }
.wk-head.today small { color: var(--today); }
.wk-corner { border-bottom: 1px solid var(--line); }
.wk-time { font: 500 12px var(--en); color: var(--muted); padding: 10px 8px; text-align: center; border-bottom: 1px solid var(--line-2); direction: ltr; }
.wk-cell { border-inline-start: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 5px; display: flex; flex-direction: column; gap: 5px; min-height: 58px; min-width: 0; }
.wk-cell.past { background: color-mix(in srgb, var(--bg) 55%, transparent); }
.wk-cell.today { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }

.card { display: flex; gap: 7px; align-items: stretch; background: var(--raised); border: 1px solid var(--line); border-inline-start: 3px solid var(--c); border-radius: 7px; padding: 5px 6px; cursor: pointer; text-align: start; font: inherit; color: inherit; min-width: 0; width: 100%; }
.card:hover { border-color: color-mix(in srgb, var(--c) 50%, var(--line)); border-inline-start-color: var(--c); box-shadow: var(--shadow); }
.card img { width: 30px; height: 40px; object-fit: cover; border-radius: 4px; flex: none; background: var(--line-2); }
.card-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.card-title { font-size: 12.5px; font-weight: 500; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-title.en { text-align: left; }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.card-foot .num { font-size: 11.5px; color: var(--ink-2); }
.card.dropped .card-title { text-decoration: line-through; color: var(--muted); }
.card.open { background: transparent; border-style: dashed; border-inline-start-style: solid; color: var(--muted); font-size: 12px; cursor: default; box-shadow: none; }
.card[data-key] { touch-action: none; }
.card.drag-src { opacity: .35; }
.card.drop-on { outline: 2px solid var(--accent); outline-offset: 1px; }
.card.pick-src { outline: 2px dashed var(--accent); outline-offset: 1px; }
.dragghost { position: fixed; z-index: 60; pointer-events: none; box-shadow: var(--shadow); width: 170px; opacity: .95; }

/* the month */
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.mo-dow { font-size: 12px; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); }
.mo-day { min-height: 118px; border-inline-start: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 5px 6px; display: flex; flex-direction: column; gap: 2px; cursor: pointer; text-align: start; font: inherit; color: inherit; background: none; border-radius: 0; border-top: 0; border-inline-end: 0; min-width: 0; }
.mo-day:hover { background: var(--hover); }
.mo-day.out { color: var(--muted); background: color-mix(in srgb, var(--bg) 50%, transparent); }
.mo-day .d { font: 600 12.5px var(--en); align-self: flex-start; padding: 0 5px; border-radius: 99px; }
.mo-day.today .d { background: var(--today); color: var(--accent-ink); }
.mo-row { display: flex; align-items: center; gap: 5px; font-size: 11.5px; min-width: 0; border-radius: 4px; padding: 0 2px; }
.mo-row .num { color: var(--muted); font-size: 11px; flex: none; }
.mo-row span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mo-row.wait { background: var(--warn-soft); }
.mo-row.bad { background: var(--bad-soft); }
.mo-more { font-size: 11px; color: var(--muted); }

/* the day */
.day-list { display: flex; flex-direction: column; gap: 10px; }
.day-slot { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: start; }
.day-slot > .num { font-size: 13px; color: var(--ink-2); padding-top: 12px; text-align: center; }

/* one clip, full: in the day list and in the drawer */
.clip { background: var(--panel); border: 1px solid var(--line); border-inline-start: 4px solid var(--c); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.clip-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 12.5px; color: var(--ink-2); }
.clip-head .ch { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink); }
.clip h3 { margin: 0; font: 600 16px/1.4 var(--en); direction: ltr; text-align: left; }
.clip h3.fa { font-family: var(--fa); direction: rtl; text-align: right; }
.note { font-size: 13px; color: var(--ink-2); margin: 0; white-space: pre-wrap; }
.media { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.media video, .media iframe { width: 240px; max-width: 100%; aspect-ratio: 9 / 16; background: #000; border: 0; border-radius: 10px; }
.media img { width: 120px; border-radius: 8px; border: 1px solid var(--line); }
.stats { width: 100%; border-collapse: collapse; font-size: 13px; }
.stats th { font-weight: 500; color: var(--muted); text-align: start; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.stats td { padding: 6px 8px; border-bottom: 1px solid var(--line-2); }
.stats td.num, .stats th.num { text-align: end; }
.stats a { color: var(--accent); text-decoration: none; }
.stats a:hover { text-decoration: underline; }
.when-read { font-size: 11.5px; color: var(--muted); }
details.caps { font-size: 13px; }
details.caps summary { cursor: pointer; color: var(--ink-2); }
details.caps pre { white-space: pre-wrap; font: 12.5px/1.55 var(--en); direction: ltr; text-align: left; background: var(--bg); border-radius: 8px; padding: 8px 10px; margin: 6px 0 0; }
details.caps pre.fa { font-family: var(--fa); direction: rtl; text-align: right; }
.verdict { border-top: 1px solid var(--line-2); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.verdict-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.stage { font-size: 12.5px; font-weight: 700; min-width: 96px; }
.vb.ok.on { background: var(--good); border-color: var(--good); color: #fff; }
.vb.no.on { background: var(--bad); border-color: var(--bad); color: #fff; }
.vb.no { color: var(--bad); }
.reason { width: 100%; min-height: 60px; font: 13.5px/1.5 var(--fa); color: var(--ink); background: var(--raised); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; resize: vertical; }
.said { font-size: 12.5px; color: var(--ink-2); margin: 0; }
.warn { font-size: 12.5px; color: var(--ink); background: var(--warn-soft); border-radius: 8px; padding: 6px 10px; }
.warn.bad { background: var(--bad-soft); }
.pickbar { position: sticky; top: 52px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; }

/* drawer */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 20; }
.drawer { position: fixed; z-index: 30; inset-block: 0; inset-inline-start: 0; width: min(580px, 100%); background: var(--bg); border-inline-end: 1px solid var(--line); overflow-y: auto; padding: 14px 16px 40px; box-shadow: var(--shadow); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.drawer-head h2 { margin: 0; font-size: 15px; color: var(--ink-2); font-weight: 500; }

/* waiting, log */
.group-title { font-size: 13.5px; color: var(--ink-2); margin: 18px 0 8px; font-weight: 700; }
.empty { color: var(--muted); text-align: center; padding: 34px 0; }
.list { display: flex; flex-direction: column; gap: 10px; }
.log { list-style: none; padding: 0; margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.log li { display: grid; grid-template-columns: 150px 1fr; gap: 2px 14px; padding: 8px 14px; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.log li:last-child { border-bottom: 0; }
.log .by { font-size: 12px; color: var(--muted); }
.log .txt { direction: ltr; text-align: left; font-family: var(--en); font-size: 12.5px; overflow-wrap: anywhere; }

/* dashboard */
.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; grid-column: span 12; min-width: 0; }
.panel.half { grid-column: span 6; }
.panel h3 { margin: 0 0 2px; font-size: 14.5px; }
.panel .sub { margin: 0 0 12px; color: var(--muted); font-size: 12.5px; }
.tiles { grid-column: span 12; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.tile .label { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.tile .big { font: 600 28px/1.2 var(--en); font-variant-numeric: tabular-nums; }
.tile .small { font-size: 12px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table.top { width: 100%; border-collapse: collapse; font-size: 13px; }
table.top th { font-weight: 500; color: var(--muted); text-align: start; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; cursor: pointer; user-select: none; }
table.top th.num, table.top td.num { text-align: end; }
table.top th[aria-sort] { color: var(--ink); }
table.top td { padding: 7px 8px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.top tr.row { cursor: pointer; }
table.top tr.row:hover td { background: var(--hover); }
table.top .t { display: flex; align-items: center; gap: 8px; min-width: 220px; }
table.top .t span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 340px; }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 180px) 1fr auto; gap: 10px; align-items: center; font-size: 12.5px; }
.bar-track { height: 14px; position: relative; }
.bar-fill { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--c); border-radius: 0 4px 4px 0; min-width: 2px; }
[dir="rtl"] .bar-fill { border-radius: 4px 0 0 4px; }
.bar-row .num { color: var(--ink-2); }
.insight { margin: 12px 0 0; font-size: 13px; background: var(--accent-soft); border-radius: 8px; padding: 8px 12px; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text { fill: var(--muted); font: 11px var(--en); }
.chart .grid line { stroke: var(--line-2); }
.chart .base { stroke: var(--line); }
.tip { position: absolute; pointer-events: none; background: var(--raised); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 12px; box-shadow: var(--shadow); white-space: nowrap; z-index: 2; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--ink-2); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 16px; height: 2px; background: var(--c); display: inline-block; }
.trend { border: 1px solid var(--line); border-inline-start: 3px solid var(--c, var(--muted)); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; background: var(--raised); }
.trend-head { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 12.5px; color: var(--ink-2); }
.trend h4 { margin: 0; font-size: 14px; }
.trend .why { margin: 0; font-size: 13px; color: var(--ink-2); }
.trend a { color: var(--accent); font-size: 12.5px; }
.trends { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.score { height: 4px; background: var(--line-2); border-radius: 2px; overflow: hidden; width: 80px; }
.score i { display: block; height: 100%; background: var(--accent); }
.need { font-size: 12.5px; color: var(--ink-2); background: var(--bg); border: 1px dashed var(--line); border-radius: 8px; padding: 8px 12px; margin-top: 8px; }

@media (max-width: 900px) {
  .panel.half { grid-column: span 12; }
}
@media (max-width: 640px) {
  .week { grid-template-columns: 46px repeat(7, minmax(108px, 1fr)); }
  .mo-day { min-height: 74px; }
  .mo-row span:last-child { display: none; }
  .log li { grid-template-columns: 1fr; }
  .day-slot { grid-template-columns: 1fr; }
  .day-slot > .num { padding-top: 0; text-align: start; }
}
