@import url("https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  --ground: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #eceff3;
  --ink: #16202b;
  --ink-2: #4a5a6b;
  --ink-3: #78889a;
  --rule: #dde3ea;
  --rule-strong: #c3ccd7;
  --accent: #0f6b7a;
  --accent-2: #0a4f5b;
  --accent-wash: #e0eef1;
  --good: #2c7050;
  --good-wash: #e2f0e9;
  --warn: #8f6412;
  --warn-wash: #f6eedc;
  --bad: #9d3a34;
  --bad-wash: #f7e5e4;
  --shadow: 0 1px 2px rgba(22, 32, 43, 0.05), 0 8px 24px -16px rgba(22, 32, 43, 0.3);
  --radius: 8px;
  --font: "Vazirmatn", "Segoe UI", Tahoma, "Iranian Sans", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0e1418;
    --surface: #161e24;
    --surface-2: #1d272e;
    --ink: #e6edf2;
    --ink-2: #b0c0cc;
    --ink-3: #7f929f;
    --rule: #26323a;
    --rule-strong: #35434d;
    --accent: #4cc3d4;
    --accent-2: #74d6e4;
    --accent-wash: #11313a;
    --good: #64bd92;
    --good-wash: #152c22;
    --warn: #d3a457;
    --warn-wash: #2d2517;
    --bad: #de8a83;
    --bad-wash: #2d1b19;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 28px -18px rgba(0, 0, 0, 0.9);
  }
}

* {
  box-sizing: border-box;
}

/* صفت hidden همیشه برنده است. بدون این، هر کلاسی که display می‌گذارد (مثل
   button.ghost با inline-block) پنهان‌کردن را بی‌اثر می‌کرد — دکمه‌ی «توقف»
   در همه‌ی بخش‌ها همیشه دیده می‌شد. */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- shell ---------- */

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-inner {
  max-width: 1240px; /* بیشتر از main، تا منوی کامل ادمین در یک ردیف جا شود */
  margin: 0 auto;
  padding: 0 24px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand {
  font-weight: 800;
  font-size: 16px;
  color: var(--ink);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand span {
  color: var(--accent);
}
.topnav {
  display: flex;
  gap: 4px;
  align-items: center;
  /* اگر پیوندها (مثلاً با منوهای ادمین) جا نشوند، خود منو اسکرول می‌خورد نه کل صفحه */
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.topnav::-webkit-scrollbar {
  display: none;
}
.topnav a {
  flex: 0 0 auto;
  white-space: nowrap;
}
.topnav a {
  color: var(--ink-2);
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 6px;
}
.topnav a:hover {
  background: var(--surface-2);
  text-decoration: none;
  color: var(--ink);
}
.topnav a.on {
  background: var(--accent-wash);
  color: var(--accent-2);
  font-weight: 600;
}
.spacer {
  margin-inline-start: auto;
}
.who {
  font-size: 13px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* زیر ۱۲۴۰px منوی کامل ادمین (۱۰ پیوند + برند + کاربر، حدود ۱۱۶۰px) در یک ردیف
   جا نمی‌شود — قبلاً عنوان‌ها دوخطی می‌شدند یا منو از صفحه بیرون می‌زد. حالا ردیف
   اول برند و کاربر است و منو در ردیف دوم، که فقط خودش افقی اسکرول می‌خورد. */
@media (max-width: 1240px) {
  .topbar-inner {
    height: auto;
    flex-wrap: wrap;
    gap: 6px 12px;
    padding: 10px 16px 0;
  }
  .topnav {
    order: 3;
    flex: 1 0 100%;
    padding-bottom: 8px;
  }
  main {
    padding: 20px 16px 64px;
  }
}
@media (max-width: 480px) {
  .who a span {
    display: none; /* فقط آواتار؛ نام کاربر جا را از دکمه‌ی خروج می‌گرفت */
  }
}

/* ---------- typography ---------- */

h1.page {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 6px;
  letter-spacing: -0.015em;
}
p.sub {
  color: var(--ink-2);
  margin: 0 0 28px;
  max-width: 70ch;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.page-head p.sub {
  margin-bottom: 0;
}

.icon-btn {
  position: relative;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--rule-strong);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.icon-btn.has-value::after {
  content: '';
  position: absolute;
  top: -2px;
  inset-inline-end: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--ground);
}

/* ---------- پنجره تنظیمات مدل ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 20, 0.45);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 50;
}
.modal-backdrop[hidden] {
  display: none;
}
.modal {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.modal-head strong {
  font-size: 15px;
}
.modal-head .icon-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
}
.modal-desc {
  font-size: 12.5px;
  color: var(--ink-3);
  margin: 0 0 16px;
  line-height: 1.7;
}

/* ---------- section cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}
.card .glyph {
  font-size: 22px;
  color: var(--accent);
  line-height: 1;
}
.card h2 {
  font-size: 18px;
  margin: 0;
  color: var(--ink);
  font-weight: 700;
}
.card .tag {
  font-size: 13px;
  color: var(--accent-2);
  font-weight: 500;
  margin: 0;
}
.card p.desc {
  font-size: 13.5px;
  color: var(--ink-2);
  margin: 0;
  line-height: 1.75;
}
.card .steps-count {
  font-size: 12px;
  color: var(--ink-3);
  border-top: 1px solid var(--rule);
  padding-top: 10px;
  margin-top: auto;
}

/* ---------- form ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.panel h3 {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 700;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 16px;
}
.field label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.field label .req {
  color: var(--bad);
  font-weight: 400;
}
.field .help {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.6;
}
.field input,
.field textarea,
.field select {
  font-family: inherit;
  font-size: 14px;
  line-height: 1.7;
  padding: 9px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  background: var(--ground);
  color: var(--ink);
  width: 100%;
  resize: vertical;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.field input[type="number"] {
  direction: ltr;
  text-align: right;
}

/* ---------- خلاصه ورودی‌های اجرا (صفحه تاریخچه) ---------- */
.input-value {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.input-plain-line {
  font-size: 13.5px;
  color: var(--ink-2);
  white-space: pre-wrap;
  line-height: 1.6;
}
.input-link-row {
  display: flex;
  align-items: center;
  gap: 6px;
  direction: ltr;
  text-align: left;
  min-width: 0;
}
.input-link {
  font-size: 13px;
  color: var(--accent-2);
  font-family: var(--mono);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.input-link:hover {
  text-decoration: underline;
}
.input-link-open {
  flex: 0 0 auto;
  color: var(--ink-3);
  text-decoration: none;
  font-size: 13px;
}
.input-link-open:hover {
  color: var(--accent);
}

/* ---------- کمبوباکس جستجوپذیر (فیلد پروژه) ---------- */
.combo {
  position: relative;
}
.combo-input {
  font-family: inherit;
  font-size: 14px;
  padding: 9px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  background: var(--ground);
  color: var(--ink);
  width: 100%;
}
.combo-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.combo-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.combo-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  max-height: 260px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  box-shadow: var(--shadow);
  padding: 4px;
}
.combo-option {
  padding: 8px 10px;
  border-radius: 5px;
  font-size: 13.5px;
  cursor: pointer;
  color: var(--ink);
}
.combo-option.has-avatar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.combo-option .combo-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent-wash);
  flex: none;
}
.combo-option:hover,
.combo-option.active {
  background: var(--accent-wash);
  color: var(--accent-2);
}
.combo-empty {
  padding: 8px 10px;
  font-size: 13px;
  color: var(--ink-3);
}

button.primary {
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 11px 20px;
  border-radius: 6px;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  width: 100%;
}
button.primary:hover:not(:disabled) {
  background: var(--accent-2);
}
button.primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
button.ghost, a.ghost {
  font-family: inherit;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--rule-strong);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button.ghost:hover, a.ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- run progress ---------- */

.steps {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 20px;
}
.step {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 13.5px;
}
.step.active {
  background: var(--accent-wash);
}
.step .dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--rule-strong);
  margin-top: 4px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-size: 10px;
  color: #fff;
  line-height: 1;
}
.step.active .dot {
  border-color: var(--accent);
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}
.step.done .dot {
  background: var(--good);
  border-color: var(--good);
}
.step.failed .dot {
  background: var(--bad);
  border-color: var(--bad);
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .step.active .dot {
    animation: none;
    border-top-color: var(--accent);
  }
}
.step .title {
  font-weight: 600;
  color: var(--ink);
}
.step .note,
.step .preview {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.65;
}
.step.pending .title {
  color: var(--ink-3);
  font-weight: 500;
}

/* ---------- output ---------- */

.output {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.output-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--rule);
  background: var(--surface-2);
}
.output-head strong {
  font-size: 14px;
}
.output pre {
  margin: 0;
  padding: 20px;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.9;
  max-height: 70vh;
  overflow-y: auto;
}

/* ---------- ادیتور متن نهایی (rich-editor.js) ---------- */

.rich-editor {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--rule);
  background: var(--surface-2);
  position: sticky;
  top: 0;
  z-index: 1;
}
.rich-tb-btn {
  font-family: inherit;
  font-size: 13px;
  min-width: 30px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}
.rich-tb-btn:hover {
  border-color: var(--rule-strong);
  background: var(--surface);
  color: var(--ink);
}
.rich-tb-select {
  font-family: inherit;
  font-size: 13px;
  padding: 5px 8px;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.rich-tb-sep {
  width: 1px;
  align-self: stretch;
  margin: 2px 4px;
  background: var(--rule-strong);
}
.rich-editor-content {
  padding: 20px 24px;
  min-height: 200px;
  max-height: 70vh;
  overflow-y: auto;
  font-size: 15px;
  line-height: 1.9;
  color: var(--ink);
}
.rich-editor-content:focus {
  outline: none;
}
.rich-editor-content > *:first-child {
  margin-top: 0;
}
.rich-editor-content p {
  margin: 0 0 14px;
}
.rich-editor-content h2 {
  font-size: 19px;
  margin: 26px 0 12px;
}
.rich-editor-content h3 {
  font-size: 16.5px;
  margin: 20px 0 10px;
}
.rich-editor-content h4 {
  font-size: 15px;
  margin: 16px 0 8px;
}
.rich-editor-content ul,
.rich-editor-content ol {
  margin: 0 0 14px;
  padding-inline-start: 26px;
}
.rich-editor-content li {
  margin-bottom: 6px;
}
.rich-editor-content blockquote {
  margin: 0 0 14px;
  padding: 10px 16px;
  border-inline-start: 3px solid var(--accent);
  background: var(--accent-wash);
  border-radius: 4px;
  color: var(--ink-2);
}
.rich-editor-content a {
  color: var(--accent-2);
}
.rich-editor-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 16px;
  font-size: 14px;
}
.rich-editor-content th,
.rich-editor-content td {
  border: 1px solid var(--rule);
  padding: 8px 10px;
  text-align: start;
}
.rich-editor-content th {
  background: var(--surface-2);
}
.rich-save-status {
  margin-inline-start: auto;
  padding: 4px 8px;
  font-size: 12.5px;
  color: var(--ink-3);
  white-space: nowrap;
}
.rich-save-status-busy { color: var(--ink-2); }
.rich-save-status-ok   { color: var(--good); }
.rich-save-status-err  { color: var(--bad); }

/* ---------- خروجی چندبخشی (ساختار صفحه / YMYL) ---------- */

.out-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.out-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.out-card > h4 {
  margin: 0 0 14px;
  font-size: 14.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.out-ic {
  font-size: 15px;
  line-height: 1;
}

.out-hero-card {
  background: linear-gradient(135deg, var(--accent-wash), var(--surface) 60%);
  border-color: var(--accent);
}
.out-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.out-hero-title {
  font-size: 21px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px 22px;
}
.kv-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}
.kv-k {
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 600;
}
.kv-v {
  color: var(--ink);
  line-height: 1.6;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  white-space: nowrap;
}
.badge.info   { background: var(--accent-wash); color: var(--accent-2); }
.badge.good   { background: var(--good-wash); color: var(--good); }
.badge.warn   { background: var(--warn-wash); color: var(--warn); }
.badge.bad    { background: var(--bad-wash); color: var(--bad); }
.badge.kw     { background: var(--surface-2); color: var(--ink-2); font-family: var(--mono); font-weight: 500; }
.badge.layer  { background: var(--accent-wash); color: var(--accent-2); }

/* ---------- ابزار جستجوی لینک داخلی (دستی) ---------- */
.link-finder {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.link-finder-input {
  font-family: inherit;
  font-size: 14.5px;
  padding: 11px 14px;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--ground);
  color: var(--ink);
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.link-finder-input::placeholder {
  color: var(--ink-3);
}
.link-finder-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.link-finder-hint {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
}
.link-finder-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
  padding-inline-end: 2px;
}
.link-finder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.link-finder-row:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  background: var(--surface-2);
}
.link-finder-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}
.link-finder-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.link-finder-url {
  display: flex;
  align-items: center;
  gap: 6px;
  direction: ltr;
  text-align: left;
  min-width: 0;
}
.link-finder-url-text {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.link-finder-url-text:hover {
  color: var(--accent-2);
  text-decoration: underline;
}
.link-finder-open {
  flex: 0 0 auto;
  color: var(--ink-3);
  text-decoration: none;
  font-size: 12px;
}
.link-finder-open:hover {
  color: var(--accent);
}
.link-finder-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.link-finder-add {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.link-finder-add:hover:not(:disabled) {
  background: var(--accent-2);
}
.link-finder-add:disabled {
  opacity: .6;
  cursor: not-allowed;
}
.link-finder-copy {
  flex: 0 0 auto;
  padding: 7px 14px;
  font-size: 12.5px;
  border-radius: 999px;
  white-space: nowrap;
}
.link-finder-empty {
  font-size: 13px;
  color: var(--ink-3);
  padding: 8px 0;
}

/* ---- ادیتور ساختار هدینگ‌ها ---- */
.outline-editor {
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 6px 18px;
  background: var(--ground);
}
.outline-editor:focus {
  outline: none;
  border-color: var(--accent);
}
.h2-block {
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}
.h2-block:last-child {
  border-bottom: none;
}
.h2-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.h2-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  flex: 0 0 auto;
}
.h2-head h2 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 700;
  color: var(--ink);
}
.h2-block > .chip-row {
  margin-bottom: 8px;
}
.h2-purpose {
  margin: 6px 0;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.75;
}
.safety-note {
  background: var(--warn-wash);
  color: var(--warn);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  margin: 8px 0;
  line-height: 1.7;
}
.must-include {
  margin: 6px 0;
  padding-right: 20px;
  font-size: 13px;
  color: var(--ink-2);
}
.must-include li {
  margin-bottom: 3px;
}
.src-refs {
  font-size: 12px;
  color: var(--accent-2);
  font-family: var(--mono);
  margin: 4px 0;
}
.h3-item {
  margin: 10px 0 0 24px;
  padding-inline-start: 12px;
  border-inline-start: 2px solid var(--rule-strong);
}
.h3-item h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.h3-purpose {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.6;
}

/* ---- ادیتور دستی ساختار هدینگ‌ها (پاپ‌آپ + درگ‌اند‌دراپ) ---- */
.h2-block.editable {
  cursor: default;
}
.h2-block.dragging {
  opacity: 0.4;
}
.h2-block.drag-over {
  border-top: 2px solid var(--accent);
}
.h2-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-inline-start: auto;
}
.h2-drag-handle {
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
  color: var(--ink-3);
  font-size: 15px;
  padding: 2px 4px;
  flex: 0 0 auto;
}
.h2-drag-handle:active {
  cursor: grabbing;
}
.icon-btn-sm {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--rule-strong);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.icon-btn-sm:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.add-heading-btn {
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  border: 1px dashed var(--rule-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  cursor: pointer;
}
.add-heading-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.modal-lg {
  max-width: 620px;
  max-height: 85vh;
  overflow-y: auto;
}
.h3-edit-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}
.h3-edit-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--ground);
}
.h3-edit-row .field {
  flex: 1;
  margin-bottom: 0;
}
.h3-edit-row .h3-edit-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 0 0 auto;
}
.edit-pct-box {
  font-size: 12.5px;
  color: var(--ink-2);
}
.item-actions {
  display: flex;
  gap: 4px;
  align-self: flex-end;
}
.item-actions-cell {
  white-space: nowrap;
  width: 1%;
}
.notes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.note-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--warn-wash);
  border-radius: 6px;
}
.note-text {
  font-size: 13px;
  color: var(--warn);
  line-height: 1.7;
  flex: 1;
}

/* ---- بج قابل‌کلیک درصد تغییر + پاپ‌آپ تاریخچه تغییرات ---- */
.badge-btn {
  border: none;
  font-family: inherit;
  cursor: pointer;
}
.badge-btn:hover {
  filter: brightness(0.94);
}
.edit-log-empty {
  font-size: 13px;
  color: var(--ink-3);
  padding: 12px 0;
  text-align: center;
}
.edit-log-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}
.edit-log-row:last-child {
  border-bottom: none;
}
.edit-log-avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent-wash);
  flex: 0 0 auto;
}
.edit-log-main {
  flex: 1;
  min-width: 0;
}
.edit-log-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.edit-log-top strong {
  font-size: 13.5px;
  color: var(--ink);
}
.edit-log-pct {
  font-size: 12px;
  color: var(--ink-3);
  font-family: var(--mono);
}
.edit-log-note {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.7;
  margin-top: 4px;
}
.edit-log-time {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 3px;
}

/* ---- پاپ‌آپ «مدل استفاده‌شده» (history.php) ---- */
.model-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 13px;
}
.model-info-row:last-child {
  border-bottom: none;
}
.model-info-label {
  color: var(--ink-3);
}
.model-info-value {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  direction: ltr;
  text-align: left;
}
.ai-info-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
}
.ai-info-btn:hover {
  background: var(--accent-wash);
}

/* ---- کارت‌های رسانه ---- */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.media-card {
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--ground);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.media-type {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.media-concept {
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.6;
}
.media-line {
  font-size: 12px;
  color: var(--ink-3);
}
.media-place {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: auto;
  padding-top: 6px;
}

/* ---- چک‌لیست بازبینی ---- */
.qc-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.qc-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13.5px;
  line-height: 1.7;
}
.qc-ic {
  flex: 0 0 auto;
  font-size: 14px;
  margin-top: 1px;
}
.qc-item .qc-sub {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 2px;
}
.qc-item.status-bad .qc-sub { color: var(--bad); }
.qc-item.status-warn .qc-sub { color: var(--warn); }

.callout {
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.75;
}
.callout.warn { background: var(--warn-wash); color: var(--warn); }
.callout.bad  { background: var(--bad-wash); color: var(--bad); }
.callout ul { margin: 4px 0 0; padding-inline-start: 18px; }

.out-toggle {
  font-size: 12.5px;
  color: var(--accent);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}
.out-toggle:hover { text-decoration: underline; }

.empty {
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  color: var(--ink-3);
  font-size: 14px;
}

.alert {
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 13.5px;
  margin-bottom: 16px;
  line-height: 1.7;
}
/* فقط هشدارهای تزریقی اجرا (alertMsg در section.php) که با textContent
   نوشته می‌شوند و می‌توانند چندخطی باشند — مثل پیام اعتبارسنجی فهرست URL.
   روی خودِ .alert گذاشته نمی‌شود چون هشدارهای سمت سرور داخل HTML تورفتگی
   و خط خالی دارند و pre-line آن‌ها را نمایش می‌دهد. */
.alert.multiline {
  white-space: pre-line;
}
.alert.err {
  background: var(--bad-wash);
  color: var(--bad);
}
.alert.ok {
  background: var(--good-wash);
  color: var(--good);
}

.usage {
  font-size: 12px;
  color: var(--ink-3);
  font-family: var(--mono);
  direction: ltr;
  text-align: left;
  margin-inline-start: auto;
  white-space: nowrap;
}

/* ---------- table ---------- */

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 720px;
}
th,
td {
  text-align: right;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}
thead th {
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  white-space: nowrap;
  /* مرجع چسبندگی خودِ .table-wrap است (چون overflow-x دارد)، نه پنجره صفحه؛
     پس top باید صفر باشد. با 58px هدر داخل کادر پایین می‌افتد و ردیف‌ها را می‌پوشاند. */
  position: sticky;
  top: 0;
}
tbody tr:last-child td {
  border-bottom: none;
}
tbody tr:hover td {
  background: var(--surface-2);
}
td.num {
  font-family: var(--mono);
  direction: ltr;
  text-align: left;
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  white-space: nowrap;
  color: var(--ink-2);
}

/* ---- ستون اقدامات جدول ---- */
.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.row-action-form {
  display: contents;
}
a.row-action,
button.row-action {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--rule-strong);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  line-height: 1.4;
  white-space: nowrap;
}
a.row-action:hover,
button.row-action:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
button.row-action-danger {
  color: var(--bad);
  border-color: var(--bad-wash);
}
button.row-action-danger:hover {
  border-color: var(--bad);
  color: var(--bad);
  background: var(--bad-wash);
}
.pill {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
}
.pill.ok {
  background: var(--good-wash);
  color: var(--good);
}
.pill.err {
  background: var(--bad-wash);
  color: var(--bad);
}
.pill.run {
  background: var(--warn-wash);
  color: var(--warn);
}
.pill.info {
  background: var(--accent-wash);
  color: var(--accent-2);
}
.info-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-inline-start: 5px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  cursor: help;
  vertical-align: middle;
}

/* ---------- داشبورد ادمین ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}
.stat-tile {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.stat-tile .n {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  direction: ltr;
}
.stat-tile .l {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 4px;
}
.admin-section {
  margin-top: 30px;
}
.admin-section h2 {
  font-size: 16px;
  margin: 0 0 12px;
}
.period-tabs {
  display: inline-flex;
  gap: 4px;
  background: var(--surface-2);
  border-radius: 999px;
  padding: 3px;
}
.period-tabs a {
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: none;
}
.period-tabs a.on {
  background: var(--surface);
  color: var(--accent);
  font-weight: 700;
  box-shadow: var(--shadow);
}
.provider-health {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}
.provider-health .ph-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13.5px;
}
.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.quick-links a {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.quick-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- اطلاعیه‌ها ---------- */

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  margin-inline-start: 5px;
  border-radius: 999px;
  background: var(--bad);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  vertical-align: 2px;
}

.announce-compose {
  margin-bottom: 22px;
}
.announce-compose summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--accent-2);
  list-style: none;
}
.announce-compose summary::-webkit-details-marker {
  display: none;
}
.announce-compose summary::before {
  content: "";
}

.field-inline {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  color: var(--ink-2);
  margin-bottom: 16px;
  cursor: pointer;
}

.announce-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.announce-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.announce-card.pinned {
  border-inline-start: 3px solid var(--accent);
}
.announce-title-row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.announce-title-row h2 {
  font-size: 16.5px;
  margin: 0;
  color: var(--ink);
  font-weight: 700;
}
.announce-meta {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 5px;
}
.announce-body {
  min-height: 0;
  max-height: none;
  margin-top: 14px;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 14px;
}
.announce-body > :first-child {
  margin-top: 0;
}
.announce-body > :last-child {
  margin-bottom: 0;
}
.announce-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}
.announce-edit-form {
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px dashed var(--rule-strong);
}

/* ---------- login ---------- */

.login-wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-box {
  width: 100%;
  max-width: 370px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}
.login-box h1 {
  font-size: 21px;
  margin: 0 0 4px;
  font-weight: 800;
}
.login-box p {
  color: var(--ink-3);
  font-size: 13.5px;
  margin: 0 0 24px;
}

/* ---- ویرایشگر HTML اطلاعات برند ---- */
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: var(--surface-2);
  border: 1px solid var(--rule);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
}
.editor-toolbar button {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 4px 9px;
  font-family: var(--font);
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
}
.editor-toolbar button:hover {
  background: var(--surface);
  border-color: var(--rule);
  color: var(--ink);
}
.editor-toolbar .sep {
  width: 1px;
  height: 18px;
  background: var(--rule-strong);
  margin: 0 3px;
}
.editor {
  min-height: 220px;
  max-height: 460px;
  overflow-y: auto;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: 14px;
  line-height: 1.85;
  color: var(--ink);
}
.editor:focus {
  outline: none;
  border-color: var(--accent);
}
.editor:empty::before {
  content: attr(data-placeholder);
  color: var(--ink-3);
}
.editor h2 { font-size: 17px; margin: 18px 0 8px; font-weight: 700; }
.editor h3 { font-size: 15px; margin: 16px 0 6px; font-weight: 700; }
.editor h4 { font-size: 14px; margin: 14px 0 6px; font-weight: 700; }
.editor p  { margin: 0 0 10px; }
.editor ul, .editor ol { margin: 0 0 10px; padding-right: 22px; }
.editor li { margin-bottom: 4px; }
.editor table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 12px;
  font-size: 13px;
}
.editor th, .editor td {
  border: 1px solid var(--rule);
  padding: 6px 9px;
  text-align: right;
}

/* ---------- دکمه شناور + پنل کشویی چت ویرایش خروجی ---------- */
/* کشویی (نه پایین صفحه) عمداً انتخاب شد: کاربر با هر پیام مجبور نیست
   اسکرول کند بالا تا ببیند اعمال شد یا نه — باز/بسته‌کردن پنل موقعیت
   اسکرول صفحه پشتش را دست نمی‌زند. از گوشه چپ صفحه (نه سمت راست‌چین
   محتوا) باز می‌شود تا روی پنل فرم ورودی (که در RTL سمت راست است) ننشیند. */

.chat-fab {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.chat-fab:hover {
  background: var(--accent-2);
}
.chat-fab-icon,
.chat-fab span:first-child {
  font-size: 16px;
}

.chat-drawer {
  position: fixed;
  inset-block: 0;
  left: 0;
  width: min(420px, 100vw);
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: var(--surface);
  border-inline-end: 1px solid var(--rule);
  box-shadow: var(--shadow);
  transform: translateX(-105%);
  transition: transform 0.22s ease;
}
.chat-drawer.open {
  transform: translateX(0);
}
.chat-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.chat-drawer-head strong {
  font-size: 15px;
  font-weight: 700;
}
.chat-drawer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
/* ریستور کل ساختار را با یک کلیک پاک می‌کند (خودِ confirm() هم جلویش را
   می‌گیرد) — عمداً یک آیکن کوچک در هدر است، نه یک دکمه پررنگ کنار «ارسال»،
   تا زیر دست کاربر موقع تایپ/ارسال چت نباشد و دستی به آن نخورد. */
.chat-restore-btn {
  font-size: 15px;
  color: var(--ink-3);
}
.chat-restore-btn:hover {
  border-color: var(--bad);
  color: var(--bad);
}
.chat-panel-desc {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.7;
}
.chat-log {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  margin: 14px 0;
}
.chat-log:empty {
  display: none;
}
.chat-msg {
  max-width: 88%;
  padding: 9px 13px;
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.7;
  white-space: pre-wrap;
}
.chat-msg-user {
  align-self: flex-end;
  background: var(--accent-wash);
  color: var(--accent-2);
  border-end-end-radius: 3px;
}
.chat-msg-ai {
  align-self: flex-start;
  background: var(--surface-2);
  color: var(--ink-2);
  border-end-start-radius: 3px;
}
/* نشانگر «در حال تایپ» — سه نقطه متحرک، مثل ChatGPT/واتساپ، به‌جای عوض
   کردن متن دکمه ارسال (که برای پیام‌های صرفاً سؤالی گمراه‌کننده بود). */
.chat-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
}
.chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-3);
  animation: chat-typing-bounce 1.1s infinite ease-in-out;
}
.chat-typing span:nth-child(2) {
  animation-delay: 0.15s;
}
.chat-typing span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes chat-typing-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .chat-typing span {
    animation: none;
    opacity: 0.7;
  }
}
.chat-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex: 0 0 auto;
}
.chat-form textarea {
  flex: 1;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.7;
  padding: 9px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  background: var(--ground);
  color: var(--ink);
  resize: vertical;
}
.chat-form textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.chat-form button.primary {
  width: auto;
  white-space: nowrap;
}
.chat-hint {
  margin-top: 6px;
  font-size: 11px;
  color: var(--ink-3);
  text-align: left;
}
@media (max-width: 480px) {
  .chat-fab span:last-child {
    display: none;
  }
}

/* ---------- داشبورد ---------- */

.dash-quota {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  margin-bottom: 26px;
}
.dash-quota-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  font-size: 13px;
  color: var(--ink-2);
}
.dash-quota-row strong {
  color: var(--ink);
  font-size: 14px;
}
.dash-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}
.dash-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--accent-wash);
  overflow: hidden;
}
.dash-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}
.dash-bar-fill.full {
  background: var(--bad);
}

.dash-section {
  margin-bottom: 30px;
}
.dash-section h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 14px;
}
.dash-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.dash-section-head h2 {
  margin: 0;
}
.dash-section-head a {
  font-size: 12.5px;
}

.dash-announce-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dash-announce-item {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 12px 16px;
  background: var(--accent-wash);
  border-radius: 8px;
  color: inherit;
}
.dash-announce-item:hover {
  text-decoration: none;
  outline: 1px solid var(--accent);
}
.dash-announce-item strong {
  font-size: 13.5px;
  color: var(--ink);
}
.dash-announce-snip {
  font-size: 12.5px;
  color: var(--ink-2);
  flex-basis: 100%;
}
.dash-announce-meta {
  font-size: 11.5px;
  color: var(--ink-3);
}

.dash-jobs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dash-job-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  flex-wrap: wrap;
}
.dash-job-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.dash-job-title {
  font-size: 13.5px;
  color: var(--ink);
}
.dash-job-time {
  font-size: 12px;
  color: var(--ink-3);
}

.dash-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.dash-chip {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  color: inherit;
  min-width: 160px;
}
.dash-chip:hover {
  border-color: var(--accent);
  text-decoration: none;
}
.dash-chip strong {
  font-size: 13.5px;
  color: var(--ink);
}
.dash-chip span {
  font-size: 12px;
  color: var(--ink-3);
}
