@font-face { font-family: "Vazirmatn"; src: url("/fonts/Vazirmatn-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("/fonts/Vazirmatn-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("/fonts/Vazirmatn-Black.ttf") format("truetype"); font-weight: 900; font-display: swap; }

/* Direction: "the page is the object". Ground slate, panels are paper, each post is shown as the real 4:5 / 9:16 object. */
:root {
  --bg: #a6b3bc;
  --surface: #b2bdc5;
  --paper: #ecebe4;
  --paper-2: #f7f6f1;
  --ink: #1c1c1c;
  --muted: #38424a;
  --accent: #2c3620;
  --accent-ink: #e9e8e0;
  --sage: #b7c8be;
  --blush: #d6c4b8;
  --line: #a9a69c;
  --alert: #8a2a1c;
  --step-small: 0.875rem;
  --step-body: 1.0625rem;
  --step-lead: 1.3125rem;
  --step-head: clamp(1.75rem, 1.2rem + 1.6vw, 2.5rem);
  --step-display: clamp(3.5rem, 2rem + 5vw, 7rem);
  --gap: 24px;
  --margin: 24px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Vazirmatn", Tahoma, sans-serif; font-size: var(--step-body); line-height: 1.6;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img, video { display: block; max-width: 100%; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.boot { padding: 48px var(--margin); font-size: var(--step-lead); }
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 900; letter-spacing: 0; }
h1 { font-size: var(--step-head); }
h2 { font-size: var(--step-lead); }
h3 { font-size: var(--step-body); font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: var(--step-small); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- shell */
.shell { display: grid; grid-template-columns: 232px 1fr; grid-template-rows: auto 1fr; min-height: 100svh; }
.bar {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 20px; padding: 14px var(--margin);
  background: var(--ink); color: var(--accent-ink); position: sticky; top: 0; z-index: 20;
}
.wordmark { font-weight: 900; font-size: var(--step-lead); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .state { font-size: var(--step-small); display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.dot { width: 10px; height: 10px; display: inline-block; flex: none; }
.dot.on { background: #9fd08c; } .dot.off { background: #e0a090; }
.nav { padding: 28px 0 40px; display: flex; flex-direction: column; }
.nav a {
  text-decoration: none; padding: 9px var(--margin); color: var(--ink); display: flex; align-items: center; gap: 12px;
  transition: background .2s var(--ease);
}
.nav a::before { content: ""; width: 8px; height: 8px; flex: none; background: transparent; transition: background .2s; }
.nav a:hover { background: var(--surface); }
.nav a[aria-current="page"] { font-weight: 900; }
.nav a[aria-current="page"]::before { background: var(--accent); }
.nav .count { margin-inline-start: auto; font-size: var(--step-small); font-weight: 700; background: var(--blush); padding: 0 8px; }
main { padding: 32px var(--margin) 120px; min-width: 0; max-width: 1280px; }
.pagehead { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 12px 16px; margin-bottom: 28px; }
.pagehead p { grid-column: 1 / -1; max-width: 62ch; color: var(--muted); }
.pagehead .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- surfaces: filled, square, no lines, no shadows */
.paper { background: var(--paper); padding: 28px; }
.field-sage { background: var(--sage); }
.field-blush { background: var(--blush); }
.field-olive { background: var(--accent); color: var(--accent-ink); }
.stack > * + * { margin-top: var(--gap); }
.section { margin-top: 56px; }
.section:first-child { margin-top: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); align-items: start; }

/* ---------- buttons: one shape (square), one accent fill */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 20px;
  border: 0; border-radius: 0; cursor: pointer; font-weight: 700; text-decoration: none; white-space: nowrap;
  background: var(--accent); color: var(--accent-ink); transition: transform .12s var(--ease), background .2s;
}
.btn:hover { background: #3a4729; }
.btn:active { transform: translateY(1px) scale(.985); }
.btn.alt { background: var(--surface); color: var(--ink); }
.btn.alt:hover { background: #c3ccd2; }
.btn.warn { background: var(--blush); color: var(--ink); }
.btn.warn:hover { background: #cdb6a8; }
.btn.ghost { background: transparent; color: var(--ink); padding-inline: 8px; text-decoration: underline; text-underline-offset: 4px; }
.btn[disabled] { opacity: .55; cursor: progress; }
.bar .btn { min-height: 38px; background: var(--accent-ink); color: var(--ink); }
.bar .btn:hover { background: #fff; }

/* ---------- forms (lines are allowed inside forms) */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px; }
.form .wide { grid-column: 1 / -1; }
label.f { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
label.f .help { font-weight: 400; font-size: var(--step-small); color: var(--muted); }
input[type=text], input[type=password], input[type=number], input[type=time], input[type=datetime-local], input[type=url], select, textarea {
  width: 100%; min-height: 46px; padding: 9px 12px; background: var(--paper-2); border: 2px solid var(--line); border-radius: 0;
  font-weight: 400;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.7; }
textarea.tall { min-height: 200px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
input[type=color] { width: 64px; height: 46px; padding: 3px; border: 2px solid var(--line); background: var(--paper-2); }
.ltr { direction: ltr; text-align: left; }
.switch { display: flex; align-items: center; gap: 14px; font-weight: 700; cursor: pointer; }
.switch input { appearance: none; width: 52px; height: 30px; background: var(--surface); position: relative; cursor: pointer; flex: none; transition: background .2s; }
.switch input::after { content: ""; position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; background: var(--paper-2); transition: transform .2s var(--ease); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(-22px); }
.switch .help { display: block; font-weight: 400; font-size: var(--step-small); color: var(--muted); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 20px; }
.tabs button { background: transparent; border: 0; padding: 8px 14px; cursor: pointer; color: var(--muted); font-weight: 700; }
.tabs button[aria-pressed="true"] { background: var(--ink); color: var(--accent-ink); }
.savebar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 30; display: flex; align-items: center; gap: 16px;
  padding: 12px var(--margin); background: var(--ink); color: var(--accent-ink); transform: translateY(110%);
  transition: transform .25s var(--ease);
}
.savebar.show { transform: none; }
.savebar.dirty { background: var(--accent); }
.savebar .btn { background: var(--accent-ink); color: var(--ink); }
.savebar .btn[disabled] { opacity: .45; cursor: default; }
.savebar .savemsg { margin-inline-end: auto; font-weight: 700; }

/* ---------- the object: posts at their real proportions */
.obj { position: relative; background: var(--ink); overflow: hidden; flex: none; }
.obj.c { aspect-ratio: 4 / 5; }
.obj.r { aspect-ratio: 9 / 16; }
.obj img, .obj video { width: 100%; height: 100%; object-fit: cover; }
.obj .ph { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 14px; background: var(--paper); }
.obj .ph b { font-size: var(--step-small); }
.obj .ph span { font-size: var(--step-small); color: var(--muted); }
.fade img { position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s ease; }
.fade img.on { opacity: 1; }

/* ---------- dashboard */
.next { display: grid; grid-template-columns: minmax(0, 380px) 1fr; gap: 40px; align-items: end; }
.next .obj { width: 100%; max-height: 72vh; }
.next .big { font-size: var(--step-head); font-weight: 900; line-height: 1.2; }
.next .when { font-size: var(--step-lead); }
.totals { display: grid; grid-template-columns: 1fr minmax(300px, 420px); gap: 40px; align-items: start; padding: 36px; }
.total-figure { font-size: var(--step-display); font-weight: 900; line-height: .9; font-variant-numeric: tabular-nums; margin-top: 48px; }
.slip { background: var(--paper); padding: 26px 26px 40px; }
.row { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; }
.row .leader { flex: 1; border-bottom: 4px dotted var(--ink); transform: translateY(-5px); opacity: .55; min-width: 24px; }
.row .v { font-variant-numeric: tabular-nums; font-weight: 700; }
.row.sum { background: var(--ink); color: var(--accent-ink); padding: 10px 12px; margin-top: 14px; font-weight: 900; }
.row.sum .leader { border-color: var(--accent-ink); }
.group-name { font-weight: 900; margin-top: 18px; }
.strip { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.strip > a { flex: none; width: 168px; text-decoration: none; scroll-snap-align: start; }
.strip > a .obj { width: 100%; }
.strip > a p { margin-top: 8px; font-size: var(--step-small); }
.errors .row { align-items: flex-start; }
.alert { color: var(--alert); font-weight: 700; }

/* ---------- queue */
.day { margin-top: 44px; }
.day h2 { margin-bottom: 14px; }
.item { display: grid; grid-template-columns: 132px 1fr auto; gap: 22px; padding: 18px; background: var(--paper); text-decoration: none; align-items: center; transition: background .2s; }
.item + .item { margin-top: 10px; }
.item:hover { background: var(--paper-2); }
.item .obj { width: 132px; }
.item .obj.r { width: 96px; justify-self: center; }
.item .t { font-size: var(--step-lead); font-weight: 900; }
.item .topic { font-weight: 700; }
.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: var(--step-small); }
.status i { width: 10px; height: 10px; display: inline-block; }
.s-queued i { background: var(--muted); } .s-producing i { background: #6b7d4f; } .s-review i { background: #b0664a; }
.s-approved i { background: var(--accent); } .s-publishing i { background: #6b7d4f; } .s-published i { background: var(--ink); }
.s-failed i { background: var(--alert); } .s-rejected i { background: var(--line); }
.empty { padding: 48px 28px; background: var(--paper); font-size: var(--step-lead); }

/* ---------- post */
.postgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); gap: 40px; align-items: start; }
.viewer { background: var(--ink); padding: 20px; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 0; scrollbar-width: thin; }
.slides img { flex: none; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; scroll-snap-align: center; }
.viewer .meta { color: var(--accent-ink); display: flex; justify-content: space-between; padding-top: 12px; font-size: var(--step-small); }
.viewer video { width: min(100%, 420px); aspect-ratio: 9 / 16; margin-inline: auto; background: #000; }
.side > * + * { margin-top: 22px; }
.actions-col { display: flex; flex-wrap: wrap; gap: 10px; }
.planrow { display: grid; grid-template-columns: 2.2rem 1fr; gap: 12px; padding: 16px 0; }
.planrow + .planrow { margin-top: 4px; }
.planrow .k { font-weight: 900; font-size: var(--step-lead); color: var(--muted); }
.planrow .fields { display: grid; gap: 10px; }
.loglist .row { font-size: var(--step-small); }

/* ---------- strategy as a printed menu sheet */
.sheet { background: var(--paper); max-width: 640px; padding: 56px 48px; margin-inline: auto; }
.sheet h2 { text-align: center; font-size: var(--step-head); margin-bottom: 8px; }
.sheet .note { text-align: center; color: var(--muted); margin-bottom: 36px; }
.pillar { padding: 12px 0; }
.pillar .line { display: flex; align-items: center; gap: 10px; }
.pillar .line input[type=text] { flex: 2; font-weight: 700; }
.pillar .line .leader { flex: 1; border-bottom: 4px dotted var(--ink); opacity: .55; min-width: 20px; }
.pillar .line input[type=number] { width: 84px; flex: none; text-align: center; }
.pillar .notes { margin-top: 8px; }
.pillar .notes input { font-size: var(--step-small); }
.sheet .foot { text-align: center; margin-top: 28px; }
.stage { background: var(--sage); padding: 48px var(--margin); margin-inline: calc(var(--margin) * -1); }

/* ---------- schedule as a timetable */
table.tt { width: 100%; border-collapse: collapse; background: var(--paper); }
table.tt th, table.tt td { padding: 12px 10px; border-bottom: 2px solid var(--bg); text-align: center; }
table.tt th { font-size: var(--step-small); color: var(--muted); }
table.tt td:first-child, table.tt th:first-child { text-align: right; }
table.tt input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent); }
.tt-wrap { overflow-x: auto; }
.upcoming { columns: 2; column-gap: 40px; }
.upcoming .row { break-inside: avoid; }

/* ---------- replies */
.msg { background: var(--paper); padding: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.msg + .msg { margin-top: 12px; }
.msg .who { font-weight: 900; }
.msg blockquote { margin: 8px 0 0; padding: 14px 16px; background: var(--paper-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg .ctx { margin-top: 8px; font-size: var(--step-small); color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 7.5em; overflow: hidden; }
.msg .act { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }

/* ---------- connections */
.checks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--bg); }
.check { background: var(--paper); padding: 16px 18px; }
.check b { display: block; }
.check .v { font-size: var(--step-small); overflow-wrap: anywhere; }
.check.bad { background: var(--blush); }
.result { margin-top: 12px; padding: 14px 16px; background: var(--paper-2); white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--step-small); }
.result.bad { background: var(--blush); }

/* ---------- automation switch */
.master { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center; padding: 40px; }
.master.on { background: var(--accent); color: var(--accent-ink); }
.master.off { background: var(--blush); }
.master .big { font-size: var(--step-head); font-weight: 900; }
.master .btn { background: var(--paper-2); color: var(--ink); min-height: 56px; padding-inline: 28px; font-size: var(--step-lead); }

/* ---------- login */
.login { min-height: 100svh; display: grid; place-items: center; padding: var(--margin); }
.login .card { background: var(--paper); width: min(100%, 460px); padding: 44px 36px; }
.login h1 { margin-bottom: 8px; }
.login p { color: var(--muted); margin-bottom: 26px; }
.login form > * + * { margin-top: 18px; }
.err { color: var(--alert); font-weight: 700; min-height: 1.6em; }

/* ---------- dialog (it floats, so it may cast a shadow) */
dialog { border: 0; padding: 0; background: var(--paper); width: min(560px, calc(100vw - 24px)); box-shadow: 0 24px 80px rgba(0,0,0,.35); } /* taste-skill-ignore: a modal dialog floats */
dialog::backdrop { background: rgba(28, 28, 28, .55); }
dialog form { padding: 32px; }
dialog form > * + * { margin-top: 18px; }
dialog .row-btns { display: flex; gap: 10px; justify-content: flex-end; }

.toast {
  position: fixed; bottom: 84px; inset-inline-start: 20px; z-index: 40; max-width: min(460px, calc(100vw - 40px));
  background: var(--ink); color: var(--accent-ink); padding: 14px 18px; font-weight: 700;
  transform: translateY(140%); transition: transform .25s var(--ease);
}
.toast.show { transform: none; }
.toast.bad { background: var(--alert); }

/* ---------- entrance motion: transform + opacity only */
.rise { animation: rise .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .rise { animation: none; }
  .fade img { transition: none; }
  * { scroll-behavior: auto; }
}

/* ---------- phone */
@media (max-width: 900px) {
  :root { --margin: 16px; --gap: 16px; }
  .shell { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; }
  .nav { flex-direction: row; overflow-x: auto; padding: 0; background: var(--surface); position: sticky; top: 58px; z-index: 15; }
  .nav a { padding: 12px 14px; white-space: nowrap; }
  .nav a::before { display: none; }
  .nav a[aria-current="page"] { background: var(--ink); color: var(--accent-ink); }
  main { padding-top: 24px; }
  .grid2, .grid3, .form, .postgrid, .totals, .msg, .next { grid-template-columns: 1fr; }
  .next .obj { max-width: 340px; }
  .totals { padding: 24px 16px; }
  .total-figure { margin-top: 12px; }
  .item { grid-template-columns: 88px 1fr; gap: 14px; padding: 14px; }
  .item .obj, .item .obj.r { width: 88px; }
  .item .go { display: none; }
  .checks { grid-template-columns: 1fr; }
  .sheet { padding: 36px 20px; }
  .master { grid-template-columns: 1fr; padding: 28px 20px; }
  .upcoming { columns: 1; }
  .bar .state span.txt { display: none; }
}
