@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-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("fonts/Vazirmatn-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --page: #f4f4f2;
  --surface: #ffffff;
  --border: #e4e4e0;
  --text: #191919;
  --text-2: #5f5f5f;
  --accent: #1f5fae;
  --grid: #ececea;
  --radius: 12px;
  /* status colours: categorical slots 1-6, validated (light, adjacent pairs) */
  --c-discovered: #257de0;
  --c-solution_ready: #f47230;
  --c-sent: #00b894;
  --c-shipped: #f2a600;
  --c-archived: #ee7fac;
  --c-dropped: #008a17;
  --critical: #c62828;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--text);
  font-family: "Vazirmatn", Tahoma, sans-serif; font-size: 16px; line-height: 1.8;
}
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
a { color: var(--accent); }
h1, h2, h3, h4, h5, h6 { line-height: 1.4; }
h1 { font-size: 1.7rem; margin: .2em 0; }
h2 { font-size: 1.3rem; margin: 1.6em 0 .6em; }
h3 { font-size: 1.05rem; margin: 1em 0 .4em; }
.muted { color: var(--text-2); }
.small { font-size: .85rem; }
.num { unicode-bidi: isolate; direction: ltr; font-variant-numeric: tabular-nums; }
.empty { color: var(--text-2); background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 14px 18px; }

.page-head { background: var(--surface); border-bottom: 1px solid var(--border); padding: 24px 0 18px; }
.page-head p { margin: .2em 0; }
.back { font-size: .9rem; text-decoration: none; }

.section-nav { position: sticky; top: 0; z-index: 5; background: rgba(244, 244, 242, .94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--border); }
.section-nav .wrap { display: flex; gap: 6px; overflow-x: auto; padding-top: 8px; padding-bottom: 8px; }
.section-nav a { white-space: nowrap; text-decoration: none; color: var(--text); padding: 4px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: .9rem; }
.section-nav a:hover { border-color: var(--accent); }
section { scroll-margin-top: 64px; }

.card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin: 12px 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 20px; }
.report-card { text-decoration: none; color: var(--text); margin: 0; }
.report-card:hover { border-color: var(--accent); }
.report-card h2 { margin: 0 0 .3em; font-size: 1.15rem; }

.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 20px; }
.summary-card { margin: 0; border-top: 4px solid var(--border); }
.summary-card h3 { margin: 0; font-size: .9rem; color: var(--text-2); font-weight: 500; }
.summary-card p { margin: .3em 0 0; font-weight: 500; }
.summary-card.strength { border-top-color: #008a17; }
.summary-card.pain { border-top-color: var(--critical); }
.summary-card.urgent { border-top-color: #f2a600; }

/* charts */
.chart { width: 100%; height: auto; display: block; font-family: inherit; }
.chart text { fill: var(--text-2); font-size: 12px; }
.chart .value { fill: var(--text); font-weight: 700; font-size: 13px; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: #c8c8c4; stroke-width: 1; }
.chart .line { fill: none; stroke: var(--c-discovered); stroke-width: 2; stroke-linejoin: round; }
.chart .point { fill: var(--c-discovered); stroke: var(--surface); stroke-width: 2; }
.chart .marker { stroke: var(--text-2); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .marker-label { fill: var(--text); font-size: 11px; }
.status-bar { max-height: 44px; }
.status-bar rect { stroke: var(--surface); stroke-width: 2; }
.status-bar .bar-count { fill: var(--text); font-weight: 700; font-size: 14px; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
rect.s-discovered { fill: var(--c-discovered); }
rect.s-solution_ready { fill: var(--c-solution_ready); }
rect.s-sent { fill: var(--c-sent); }
rect.s-shipped { fill: var(--c-shipped); }
rect.s-archived { fill: var(--c-archived); }
rect.s-dropped { fill: var(--c-dropped); }
.legend { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .9rem; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 6px; vertical-align: middle; background: var(--text-2); }
.dot.s-discovered { background: var(--c-discovered); }
.dot.s-solution_ready { background: var(--c-solution_ready); }
.dot.s-sent { background: var(--c-sent); }
.dot.s-shipped { background: var(--c-shipped); }
.dot.s-archived { background: var(--c-archived); }
.dot.s-dropped { background: var(--c-dropped); }

/* tables */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: start; padding: 7px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--text-2); font-weight: 500; }

/* issues */
.count { color: var(--text-2); font-weight: 400; font-size: .95rem; }
details.issue { scroll-margin-top: 64px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin: 10px 0; }
details.issue > summary { cursor: pointer; padding: 14px 18px; list-style-position: inside; }
details.issue[open] > summary { border-bottom: 1px solid var(--border); }
details.issue:target { outline: 2px solid var(--accent); }
.issue-id { font-weight: 700; color: var(--text-2); unicode-bidi: isolate; direction: ltr; }
.issue-title { font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; font-size: .82rem; padding: 1px 10px; border-radius: 999px; background: #f1f1ef; color: var(--text); }
.chip.p-urgent { background: #fdecec; color: #8e1c1c; }
.chip.p-high { background: #fff3e0; color: #7a4a00; }
.chip.impact { background: #eef3fb; color: #173f73; font-weight: 500; }
.chip.parallel-partial, .chip.parallel-covered { background: #fff8e1; color: #6b5200; }
.badge { display: inline-block; font-size: .8rem; padding: 1px 10px; border-radius: 999px; font-weight: 700; }
.badge.regressed { background: var(--critical); color: #fff; }
.badge.regressed::before { content: "⚠ "; }
.issue-body { padding: 4px 20px 16px; }
.meta { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--text-2); font-size: .88rem; }
details.archive > summary { cursor: pointer; padding: 10px 0; color: var(--text-2); }

/* prose */
.prose blockquote { margin: 10px 0; padding: 8px 16px; background: #f7f7f5; border-inline-start: 3px solid #c8c8c4; border-radius: 6px; }
.prose blockquote p { margin: .2em 0; }
.prose code { background: #f1f1ef; padding: 0 4px; border-radius: 4px; font-size: .9em; }
.prose ul, .prose ol { padding-inline-start: 1.4em; }
.intro { margin-top: 16px; }
.mockup { margin: 12px 0 20px; }
.mockup-frame { display: block; width: 100%; height: 760px; border: 1px solid #dcdcd8; border-radius: 10px; background: #fff; }
.mockup figcaption { margin-top: 6px; font-size: .9rem; }

@media (max-width: 720px) {
  .wrap { padding: 0 14px; }
  h1 { font-size: 1.35rem; }
  .summary { grid-template-columns: 1fr; }
  .card { padding: 14px; }
  .issue-body { padding: 4px 14px 14px; }
  .mockup-frame { height: 620px; }
  .chart text { font-size: 14px; }
}

@media print {
  .section-nav { display: none; }
  details.issue { break-inside: avoid; }
}
