@font-face { font-family: Inter; src: url(/fonts/inter-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Inter; src: url(/fonts/inter-500.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Inter; src: url(/fonts/inter-600.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: Inter; src: url(/fonts/inter-700.woff2) format('woff2'); font-weight: 700 800; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(/fonts/Vazirmatn-Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(/fonts/Vazirmatn-Medium.woff2) format('woff2'); font-weight: 500 600; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(/fonts/Vazirmatn-Bold.woff2) format('woff2'); font-weight: 700 800; font-display: swap; }

:root {
  color-scheme: light;
  --font: Inter, Vazirmatn, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-fa: Vazirmatn, Inter, Tahoma, sans-serif;
  --bg: #f3f3ef; --surface: #ffffff; --surface-2: #f5f4f0; --surface-3: #ebeae5;
  --border: #e6e5e0; --border-2: #d7d6d0;
  --text: #19191a; --text-2: #4f4e4a; --muted: #85837c;
  --accent: #2a62c9; --on-accent: #fff;
  --good: #1d7f48; --good-soft: #e2f3e9; --warn: #9a6400; --warn-soft: #fbf0d9; --bad: #b83a33; --bad-soft: #fbe7e5; --info: #2a62c9; --info-soft: #e9f0fc;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a;
  --o1: #184f95; --o2: #3987e5; --o3: #86b6ef;
  --grid: #ecebe6;
  --shadow: 0 1px 2px rgba(20, 20, 18, .04), 0 6px 24px rgba(20, 20, 18, .05);
  --radius: 16px;
  /* brand (set per project on .shell / .req): falls back to the portal accent */
  --brand: var(--accent); --brand-ink: #1b2a4a; --brand-soft: #e9f0fc;
  --brand-tint: color-mix(in srgb, var(--brand) 9%, var(--surface));
  --brand-text: color-mix(in srgb, var(--brand) 78%, #000);
  --brand-line: color-mix(in srgb, var(--brand) 30%, var(--surface));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111110; --surface: #1a1a19; --surface-2: #212120; --surface-3: #2a2a28;
    --border: #2c2b29; --border-2: #3a3936;
    --text: #f0efec; --text-2: #c3c2b7; --muted: #8f8d86;
    --accent: #6f9df0; --on-accent: #0d1626;
    --good: #4cc584; --good-soft: #15291e; --warn: #e3ac43; --warn-soft: #2f2411; --bad: #ef7d74; --bad-soft: #351816; --info: #8fb3f4; --info-soft: #1c2a42;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70;
    --o1: #9ec5f4; --o2: #3987e5; --o3: #184f95;
    --grid: #262624;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35);
    --brand-tint: color-mix(in srgb, var(--brand) 14%, var(--surface));
    --brand-text: color-mix(in srgb, var(--brand) 55%, #fff);
    --brand-line: color-mix(in srgb, var(--brand) 40%, var(--surface));
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111110; --surface: #1a1a19; --surface-2: #212120; --surface-3: #2a2a28;
  --border: #2c2b29; --border-2: #3a3936;
  --text: #f0efec; --text-2: #c3c2b7; --muted: #8f8d86;
  --accent: #6f9df0; --on-accent: #0d1626;
  --good: #4cc584; --good-soft: #15291e; --warn: #e3ac43; --warn-soft: #2f2411; --bad: #ef7d74; --bad-soft: #351816; --info: #8fb3f4; --info-soft: #1c2a42;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70;
  --o1: #9ec5f4; --o2: #3987e5; --o3: #184f95;
  --grid: #262624;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  --brand-tint: color-mix(in srgb, var(--brand) 14%, var(--surface));
  --brand-text: color-mix(in srgb, var(--brand) 55%, #fff);
  --brand-line: color-mix(in srgb, var(--brand) 40%, var(--surface));
}

/* derived brand tones: re-declared on every element that sets --brand (custom properties resolve where declared) */
:root, .shell, .req, .bscope {
  --brand-tint: color-mix(in srgb, var(--brand) 9%, var(--surface));
  --brand-text: color-mix(in srgb, var(--brand) 78%, #000);
  --brand-line: color-mix(in srgb, var(--brand) 30%, var(--surface));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]), :root:not([data-theme="light"]) .shell, :root:not([data-theme="light"]) .req, :root:not([data-theme="light"]) .bscope {
    --brand-tint: color-mix(in srgb, var(--brand) 14%, var(--surface));
    --brand-text: color-mix(in srgb, var(--brand) 55%, #fff);
    --brand-line: color-mix(in srgb, var(--brand) 40%, var(--surface));
  }
}
:root[data-theme="dark"], :root[data-theme="dark"] .shell, :root[data-theme="dark"] .req, :root[data-theme="dark"] .bscope {
  --brand-tint: color-mix(in srgb, var(--brand) 14%, var(--surface));
  --brand-text: color-mix(in srgb, var(--brand) 55%, #fff);
  --brand-line: color-mix(in srgb, var(--brand) 40%, var(--surface));
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
[lang="fa"], [lang="fa"] input, [lang="fa"] textarea, [lang="fa"] select, [lang="fa"] button { font-family: var(--font-fa); }
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 600; word-spacing: .06em; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15.5px; } h4 { font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
[lang="fa"] h4 { text-transform: none; letter-spacing: 0; font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .t2 { color: var(--text-2); }
.small { font-size: 13px; } .tiny { font-size: 12px; }
.ltr { direction: ltr; unicode-bidi: isolate; } .rtl { direction: rtl; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--surface); border-inline-end: 1px solid var(--border); padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.brandmark { display: flex; align-items: center; gap: 10px; padding: 2px 6px; font-weight: 650; }
.brandmark .logo { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-size: 14px; font-weight: 700; flex: none; }
.clientcard { border: 1px solid var(--border); border-radius: 14px; padding: 12px; background: linear-gradient(160deg, var(--brand-tint), var(--surface) 70%); }
.clientcard .logochip { background: #fff; border-radius: 10px; padding: 8px 10px; display: flex; align-items: center; justify-content: center; height: 52px; border: 1px solid rgba(0, 0, 0, .05); }
.clientcard .logochip img { max-height: 36px; max-width: 100%; object-fit: contain; }
.clientcard .who { display: flex; align-items: center; gap: 10px; margin-top: 10px; color: inherit; }
.clientcard .who:hover { text-decoration: none; }
.clientcard .who .avatar { border-radius: 50%; flex: none; }
.clientcard .who b { display: block; font-size: 13.5px; }
.clientcard .who span { font-size: 12px; color: var(--muted); }
.clientcard select { width: 100%; margin-top: 10px; padding: 6px 9px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); font-size: 13px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 11px; border-radius: 10px; color: var(--text-2); font-weight: 500; font-size: 14.5px; }
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav a.on { background: var(--brand-tint); color: var(--brand-text); font-weight: 600; }
.nav a.on svg { color: var(--brand); }
.nav a .badge { margin-inline-start: auto; }
.nav .sep { height: 1px; background: var(--border); margin: 8px 4px; }
.nav svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.side .foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; font-size: 13px; padding: 0 6px; }
.main { min-width: 0; }
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; padding: 10px 36px; min-height: 60px; }
.top .title { min-width: 0; flex: 1; display: flex; align-items: center; gap: 12px; }
.top .title .avatar { border-radius: 50%; flex: none; }
.top .title h1 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .title .muted { font-size: 12.5px; }
.tools { display: flex; align-items: center; gap: 6px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 5px 11px; cursor: pointer; font-size: 12.5px; color: var(--text-2); }
.seg button.on { background: var(--brand-tint); color: var(--brand-text); font-weight: 600; }
.iconbtn { border: 1px solid var(--border); background: var(--surface); border-radius: 10px; width: 34px; height: 32px; display: grid; place-items: center; cursor: pointer; color: var(--text-2); }
.iconbtn svg { width: 17px; height: 17px; }
.content { padding: 28px 36px 72px; max-width: 1760px; }
.mtabs { display: none; }
.mobile-only { display: none; }

/* ---------- blocks ---------- */
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.rail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: 18px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); min-width: 0; }
.card.flat { box-shadow: none; }
.card.tint { background: linear-gradient(170deg, var(--brand-tint), var(--surface) 65%); }
.card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card > header .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.card > header h3 { display: flex; align-items: center; gap: 8px; }
.card > header h3 .hi { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand); flex: none; }
.card > header h3 .hi svg { width: 15px; height: 15px; }
.section { margin-top: 20px; }
.section > .sh { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section > .sh p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.stack > * + * { margin-top: 10px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.lead { font-size: 16.5px; line-height: 1.8; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 550; background: var(--surface-2); color: var(--text-2); white-space: nowrap; line-height: 1.75; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.pill.plain::before { display: none; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.brand { background: var(--brand-tint); color: var(--brand-text); }
.badge { display: inline-grid; place-items: center; min-width: 21px; height: 21px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 650; }
.badge.soft { background: var(--surface-3); color: var(--text-2); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 14px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface); cursor: pointer; font-weight: 550; font-size: 13.5px; color: var(--text); white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { filter: brightness(.93); background: var(--brand); }
.btn.ghost { border-color: transparent; background: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn svg { width: 15px; height: 15px; }
.empty { padding: 26px; text-align: center; color: var(--muted); border: 1px dashed var(--border-2); border-radius: 14px; font-size: 14px; }
.note { padding: 12px 15px; border-radius: 12px; background: var(--surface-2); font-size: 14px; color: var(--text-2); }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.info { background: var(--brand-tint); color: var(--text); }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 9px 18px; font-size: 14.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
ul.clean { list-style: none; padding: 0; margin: 0; }
ul.dots { margin: 0; padding-inline-start: 20px; }
ul.dots li + li { margin-top: 5px; }
ul.ticks { list-style: none; padding: 0; margin: 0; }
ul.ticks li { position: relative; padding-inline-start: 26px; }
ul.ticks li + li { margin-top: 9px; }
ul.ticks li::before { content: '✓'; position: absolute; inset-inline-start: 0; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--good-soft); color: var(--good); font-size: 11px; font-weight: 800; display: grid; place-items: center; }
ul.ticks.no li::before { content: '✕'; background: var(--bad-soft); color: var(--bad); }
ul.ticks.br li::before { content: '↑'; background: var(--brand-tint); color: var(--brand); }

/* ---------- hero (brand stage) ---------- */
.hero { position: relative; overflow: hidden; border-radius: 22px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); padding: 26px 30px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 26px; align-items: center; }
.hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(700px 300px at 85% 10%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 70%), radial-gradient(500px 260px at 0% 100%, color-mix(in srgb, var(--brand) 8%, transparent), transparent 70%); pointer-events: none; }
[dir="rtl"] .hero::before { background: radial-gradient(700px 300px at 15% 10%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 70%), radial-gradient(500px 260px at 100% 100%, color-mix(in srgb, var(--brand) 8%, transparent), transparent 70%); }
.hero::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(color-mix(in srgb, var(--brand) 24%, transparent) 1px, transparent 1.3px); background-size: 18px 18px; -webkit-mask-image: linear-gradient(90deg, transparent 45%, #000 100%); mask-image: linear-gradient(90deg, transparent 45%, #000 100%); opacity: .6; pointer-events: none; }
[dir="rtl"] .hero::after { -webkit-mask-image: linear-gradient(270deg, transparent 45%, #000 100%); mask-image: linear-gradient(270deg, transparent 45%, #000 100%); }
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.logochip { background: #fff; border-radius: 12px; padding: 8px 14px; height: 52px; display: inline-flex; align-items: center; border: 1px solid rgba(0, 0, 0, .06); box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }
.logochip img { max-height: 34px; max-width: 220px; object-fit: contain; display: block; }
.hero h1 { font-size: 30px; letter-spacing: -.01em; font-weight: 700; }
.hero .lead { margin: 10px 0 0; max-width: 880px; }
.hero .focus { margin-top: 16px; display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 14px; background: color-mix(in srgb, var(--surface) 75%, transparent); border: 1px solid var(--brand-line); max-width: 880px; font-size: 14.5px; }
.hero .focus b { color: var(--brand-text); white-space: nowrap; }
.persona-mini { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: inherit; padding: 6px; border-radius: 18px; transition: transform .15s; }
.persona-mini:hover { transform: translateY(-2px); text-decoration: none; }
.persona-mini .avatar { border-radius: 34px; box-shadow: 0 14px 30px color-mix(in srgb, var(--brand) 22%, transparent); }
.persona-mini .ptext { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.persona-mini .pname { font-weight: 700; font-size: 15px; color: var(--text); }
.persona-mini .plabel { font-size: 11.5px; color: var(--muted); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
[lang="fa"] .persona-mini .plabel { text-transform: none; letter-spacing: 0; }
.code { display: inline-flex; gap: 4px; direction: ltr; }
.code span { width: 24px; height: 26px; border-radius: 7px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; background: var(--brand); font-family: Inter, sans-serif; }
.code span:nth-child(2) { background: color-mix(in srgb, var(--brand) 72%, #000); }
.code span:nth-child(3) { background: color-mix(in srgb, var(--brand) 55%, #fff); }
.code span:nth-child(4) { background: var(--brand-ink); }
.code.big span { width: 42px; height: 46px; font-size: 22px; border-radius: 12px; }

/* ---------- journey road ---------- */
.journey { position: relative; }
.journey .jwrap { position: relative; }
.journey svg { display: block; width: 100%; overflow: visible; }
.journey .road { fill: none; stroke: var(--surface-3); stroke-linecap: round; }
.journey .road-done { fill: none; stroke: var(--brand); stroke-linecap: round; }
.journey .lane { fill: none; stroke: var(--surface); stroke-width: 2; stroke-dasharray: 8 10; opacity: .9; }
.journey .stop { fill: var(--surface); stroke: var(--border-2); stroke-width: 3; }
.journey .stop.done { fill: var(--brand); stroke: var(--surface); }
.journey .stop.now { fill: var(--surface); stroke: var(--brand); stroke-width: 4; }
.journey text { font-family: var(--font); fill: var(--text-2); font-size: 12.5px; }
[lang="fa"] .journey text { font-family: var(--font-fa); }
.journey text.mn { font-weight: 700; fill: var(--text); font-size: 13px; }
.journey text.mc { fill: var(--muted); font-size: 12px; }
.journey .marker { position: absolute; transform: translate(-50%, -100%); pointer-events: none; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .18)); }
.journey .marker .avatar { border-radius: 50%; display: block; border: 3px solid var(--surface); background: var(--surface); }
.journey .marker .flag { position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 700; padding: 1px 9px; border-radius: 99px; white-space: nowrap; }

/* ---------- KPI tiles ---------- */
.kpi { padding: 16px 18px; }
.kpi .label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.kpi .value { font-size: 27px; font-weight: 650; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .delta { font-size: 12.5px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .delta.up { color: var(--good); } .kpi .delta.down { color: var(--bad); } .kpi .delta.flat { color: var(--muted); }
.kpi .spark { margin-top: 8px; height: 28px; }
.kpi .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.hero-num { font-size: 48px; font-weight: 700; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }

/* ---------- meters ---------- */
.meter { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.meter.good > i { background: var(--good); }
.mrow { display: grid; grid-template-columns: 170px 1fr 64px; gap: 12px; align-items: center; font-size: 14px; }
.mrow .num { text-align: end; color: var(--text-2); }

/* ---------- since last visit ---------- */
.since .counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.since .counts div { background: var(--brand-tint); border-radius: 12px; padding: 10px 12px; }
.since .counts b { font-size: 24px; display: block; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--brand-text); }
.since .counts span { font-size: 12px; color: var(--text-2); }
.since .sitem { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); align-items: start; font-size: 14px; }
.since .sitem:last-child { border-bottom: 0; }
.since .sicon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); font-size: 14px; }

/* ---------- persona page ---------- */
.ptop { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 34px; align-items: center; }
.ptop .avatar { border-radius: 44px; box-shadow: 0 22px 48px color-mix(in srgb, var(--brand) 26%, transparent); }
.ptop .eyebrow { font-size: 12.5px; font-weight: 700; color: var(--brand-text); text-transform: uppercase; letter-spacing: .1em; }
[lang="fa"] .ptop .eyebrow { text-transform: none; letter-spacing: 0; font-size: 13.5px; }
.ptop h1 { font-size: 42px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 12px; line-height: 1.15; }
.ptop .tagline { font-size: 18px; color: var(--text-2); margin: 14px 0 0; line-height: 1.7; }
.arch { display: inline-flex; align-items: center; gap: 8px; padding: 5px 13px 5px 6px; border-radius: 99px; background: var(--surface-2); font-weight: 600; font-size: 13px; border: 1px solid var(--border); }
[dir="rtl"] .arch { padding: 5px 6px 5px 13px; }
.arch i { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); display: grid; place-items: center; }
.arch i svg { width: 17px; height: 17px; }
.axis + .axis { margin-top: 20px; }
.axis .aq { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.axis .ah { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 8px; direction: ltr; }
.axis .ah span { color: var(--muted); }
.axis .ah span.win { color: var(--text); font-weight: 650; }
.axis .ah em { font-style: normal; color: var(--brand-text); font-weight: 700; margin: 0 4px; }
.axis .track { position: relative; height: 12px; border-radius: 99px; background: var(--surface-3); direction: ltr; }
.axis .track i { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 45%, transparent), var(--brand)); }
.axis .track i.rev { background: linear-gradient(270deg, color-mix(in srgb, var(--brand) 45%, transparent), var(--brand)); }
.axis .track b { position: absolute; top: 50%; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); border: 5px solid var(--brand); transform: translate(-50%, -50%); box-shadow: var(--shadow); }
.axis .track u { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: var(--border-2); text-decoration: none; }
.duo { display: grid; grid-template-columns: 46px 1fr; gap: 14px; align-items: start; }
.duo .big-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; }
.duo .big-ic.sp { background: var(--brand-tint); }
.duo .big-ic.kr { background: var(--warn-soft); }
.duo h3 { margin-bottom: 4px; }
.vsbox { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; text-align: center; }
.vsbox .side-a, .vsbox .side-b { padding: 14px; border-radius: 14px; background: var(--surface-2); font-weight: 650; }
.vsbox .side-a { background: var(--brand-tint); color: var(--brand-text); }
.vsbox .vs { font-weight: 800; font-size: 14px; color: var(--muted); }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: start; font-weight: 600; font-size: 12px; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.t td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.n, table.t th.n { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t .url { font-size: 12.5px; color: var(--text-2); word-break: break-all; direction: ltr; unicode-bidi: isolate; }
table.t tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.d-up { color: var(--good); } .d-down { color: var(--bad); }
.bar-in { position: relative; }
.bar-in > i { position: absolute; inset-block: 3px; inset-inline-start: 0; background: var(--brand-tint); border-radius: 4px; z-index: 0; }
.bar-in > span { position: relative; z-index: 1; }

/* ---------- filters ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters input[type=search], .filters select { padding: 6px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: 13px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 4px 12px; font-size: 13px; cursor: pointer; color: var(--text-2); }
.chip.on { background: var(--brand-tint); border-color: transparent; color: var(--brand-text); font-weight: 600; }

/* ---------- roadmap ---------- */
.months { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.month { border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; background: var(--surface); cursor: pointer; text-align: start; }
.month.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.month .mname { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.month.now .mname::after { content: attr(data-now); font-size: 10.5px; padding: 1px 7px; border-radius: 99px; background: var(--brand); color: #fff; font-weight: 650; }
.month .mcount { font-size: 12px; color: var(--muted); margin: 3px 0 8px; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; padding: 15px 0; border-bottom: 1px solid var(--border); }
.item:last-child { border-bottom: 0; }
.item .it-title { font-weight: 600; font-size: 15px; }
.item .it-meta { display: flex; gap: 6px 10px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.item .it-meta .tag { padding: 1px 8px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); }
.item .it-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.item .it-note { grid-column: 1 / -1; font-size: 14px; color: var(--text-2); }
.item .it-wait { grid-column: 1 / -1; font-size: 13.5px; padding: 8px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); }
.item .it-wait a { color: inherit; text-decoration: underline; }

/* ---------- timeline (work log) ---------- */
.tl .day { display: grid; grid-template-columns: 130px 1fr; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.tl .day:last-child { border-bottom: 0; }
.tl .date { font-size: 13px; color: var(--muted); padding-top: 2px; font-variant-numeric: tabular-nums; }
.tl .entry + .entry { margin-top: 11px; }
.tl .entry .et { font-weight: 600; }
.tl .entry .ed { font-size: 14px; color: var(--text-2); margin-top: 2px; }
.month-head { font-size: 13px; font-weight: 700; color: var(--brand-text); margin: 22px 0 4px; }

/* ---------- needs ---------- */
.need { border: 1px solid var(--border); border-radius: 14px; padding: 15px 17px; background: var(--surface); }
.need + .need { margin-top: 10px; }
.need .nq { font-weight: 600; line-height: 1.7; }
.need .nwhy { font-size: 13.5px; color: var(--text-2); margin-top: 4px; }
.need .nans { margin-top: 10px; padding: 10px 13px; border-radius: 10px; background: var(--surface-2); font-size: 14px; white-space: pre-wrap; }
.need textarea, .need input[type=text], .field textarea, .field input, .field select { width: 100%; padding: 8px 11px; border: 1px solid var(--border-2); border-radius: 10px; background: var(--surface); }
.need textarea { min-height: 76px; resize: vertical; margin-top: 10px; }
.need .nactions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.file { display: inline-flex; gap: 6px; align-items: center; padding: 3px 9px; border-radius: 7px; background: var(--surface-3); font-size: 12.5px; }

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(10, 10, 9, .45); z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 16px; width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal.wide { width: min(880px, 100%); }
.modal > header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal > .body { padding: 18px 20px; }
.modal > footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface); }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.field textarea { min-height: 80px; resize: vertical; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
pre.email { white-space: pre-wrap; background: var(--surface-2); border-radius: 10px; padding: 12px 14px; font: 13.5px/1.7 var(--font); max-height: 320px; overflow: auto; }

/* ---------- auth / public ---------- */
.center { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.authcard { width: min(420px, 100%); }
.authcard h1 { margin-bottom: 4px; }
.authcard .field input { padding: 10px 12px; }
.req { max-width: 780px; margin: 0 auto; padding: 32px 20px 80px; }
.req .reqhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .axis text { fill: var(--muted); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .gridl { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border-2); border-radius: 10px; padding: 7px 10px; font-size: 12.5px; box-shadow: var(--shadow); white-space: nowrap; z-index: 5; transform: translate(-50%, -100%); }
.chart .tip b { font-weight: 650; }
.chart .tip .sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-inline-end: 6px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }
.legend .ln { display: inline-block; width: 14px; height: 2px; border-radius: 2px; margin-inline-end: 6px; vertical-align: 3px; }
.insight { display: grid; grid-template-columns: 24px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14.5px; line-height: 1.75; }
.insight:last-child { border-bottom: 0; }
.insight .ic { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; margin-top: 2px; }
.ic.up { background: var(--good-soft); color: var(--good); } .ic.down { background: var(--bad-soft); color: var(--bad); } .ic.flat, .ic.info { background: var(--surface-3); color: var(--text-2); } .ic.warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- project cards (home / admin) ---------- */
.pcard { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; }
.pcard .avatar { border-radius: 22px; }
.pcard .plogo { height: 30px; display: flex; align-items: center; }
.pcard .plogo img { max-height: 26px; max-width: 170px; object-fit: contain; }

/* ---------- monthly report (print) ---------- */
.report { max-width: 980px; }
.report .rh { display: flex; justify-content: space-between; align-items: center; gap: 20px; border-bottom: 3px solid var(--brand); padding-bottom: 16px; margin-bottom: 22px; }
.report h2 { margin: 28px 0 10px; display: flex; align-items: center; gap: 10px; }
.report h2::before { content: ''; width: 6px; height: 20px; border-radius: 3px; background: var(--brand); flex: none; }
@media print {
  .side, .top, .mtabs, .noprint { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
  body { background: #fff; }
}

/* ---------- responsive ---------- */
@media (max-width: 1400px) {
  .rail { grid-template-columns: 1fr; }
}
@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .months { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .mobile-only { display: grid; }
  .top { padding: 10px 16px; }
  .content { padding: 16px 16px 64px; }
  .mtabs { display: flex; gap: 4px; overflow-x: auto; padding: 8px 16px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 60px; z-index: 19; scrollbar-width: none; }
  .mtabs a { padding: 6px 11px; border-radius: 9px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
  .mtabs a.on { background: var(--brand-tint); color: var(--brand-text); font-weight: 600; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .grid.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi { padding: 14px; }
  .span2 { grid-column: auto; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .tl .day { grid-template-columns: 1fr; gap: 4px; }
  .mrow { grid-template-columns: 110px 1fr 54px; }
  .fgrid { grid-template-columns: 1fr; }
  .hero { grid-template-columns: minmax(0, 1fr); padding: 20px; gap: 16px; }
  .hero .persona-mini .avatar { width: 92px; height: 92px; border-radius: 24px; }
  .persona-mini .ptext { align-items: flex-start; }
  .hide-sm { display: none; }
  .top .title h1 { font-size: 15px; }
  .hero h1 { font-size: 24px; }
  .persona-mini { flex-direction: row; text-align: start; }
  .ptop { grid-template-columns: 1fr; justify-items: start; gap: 16px; }
  .ptop h1 { font-size: 30px; }
  .pcard { grid-template-columns: auto 1fr; }
}
@media (max-width: 520px) {
  .g4, .g6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .months { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .value { font-size: 22px; }
  .item { grid-template-columns: 1fr; }
  .item .it-side { flex-direction: row; align-items: center; }
  .top .tools .seg { display: none; }
  .since .counts b { font-size: 18px; }
  .vsbox { grid-template-columns: 1fr; }
}
.pill.wrap { white-space: normal; max-width: 100%; }
