/* Website — brand tokens, layout and components.
   Logical properties (inline-start/end) keep the layout correct in Persian (RTL). */

@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/plex-sans.016a13a8e09a.woff") format("woff"); font-weight: 100 700; font-stretch: 85% 100%; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/plex-mono-regular.09f455514ef0.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/plex-mono-medium.08536e83062b.woff") format("woff"); font-weight: 500 700; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/vazirmatn.b736a0745abd.woff") format("woff"); font-weight: 100 900; font-display: swap; }

:root {
  --steel: #0E1E2B;
  --steel-2: #16314A;
  --blue: #1C5D99;
  --cyan: #2BB3C0;
  --amber: #F2A900;
  --sand: #D9C7A7;
  --mist: #EEF2F5;
  --graphite: #4A5763;
  --ink: #0E1E2B;
  --muted: #4A5763;
  --line: #D5DDE4;
  --paper: #FFFFFF;
  --tint: #F4F7F9;
  --on-dark: #EEF2F5;
  --on-dark-muted: #A9B8C6;

  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --radius: 14px;
  --radius-sm: 8px;
  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
  --section: clamp(56px, 8vw, 104px);
  --shadow: 0 1px 2px rgb(14 30 43 / .06), 0 8px 24px rgb(14 30 43 / .06);
}

:root:lang(fa) {
  --font: "Vazirmatn", "IBM Plex Sans", Tahoma, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  text-rendering: optimizeLegibility;
}
:lang(fa) body, body:lang(fa) { line-height: 1.9; }
img, svg { max-width: 100%; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--steel); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.01em; }
:lang(fa) h1, :lang(fa) h2, :lang(fa) h3 { line-height: 1.5; letter-spacing: 0; }
h1 { font-size: clamp(34px, 5.2vw, 58px); font-weight: 700; }
h2 { font-size: clamp(26px, 3.2vw, 38px); font-weight: 700; }
h3 { font-size: 19px; font-weight: 600; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 720px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: 16px; top: -60px; z-index: 100; background: var(--amber); color: var(--steel); padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 600; }
.skip-link:focus { top: 12px; }

/* --- Header ------------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgb(14 30 43 / .96);
  backdrop-filter: saturate(140%) blur(8px);
  color: var(--on-dark);
  border-bottom: 1px solid rgb(255 255 255 / .06);
}
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand .mark { flex: none; border-radius: 9px; box-shadow: 0 0 0 1px rgb(255 255 255 / .08); }
.brand-name { font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 15px; white-space: nowrap; }
:lang(fa) .brand-name { letter-spacing: 0; text-transform: none; font-size: 18px; font-weight: 800; }
.brand:hover { color: #fff; }
.site-nav { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.site-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav a { display: block; padding: 8px 14px; border-radius: 999px; color: var(--on-dark-muted); text-decoration: none; font-weight: 500; font-size: 15px; }
:lang(fa) .site-nav a { font-size: 16px; }
.site-nav a:hover { color: #fff; background: rgb(255 255 255 / .06); }
.site-nav a[aria-current="page"] { color: #fff; background: rgb(43 179 192 / .16); }
.site-nav .lang-switch { margin-inline-start: 8px; border: 1px solid rgb(255 255 255 / .22); color: #fff; }
.site-nav .lang-switch:lang(fa) { font-family: "Vazirmatn", sans-serif; }
.site-nav .lang-switch:lang(en) { font-family: "IBM Plex Sans", sans-serif; }
.nav-toggle { display: none; }

@media (max-width: 860px) {
  .js .nav-toggle {
    display: inline-grid; place-items: center; margin-inline-start: auto;
    width: 44px; height: 44px; border-radius: 10px; border: 1px solid rgb(255 255 255 / .2);
    background: transparent; color: #fff; cursor: pointer;
  }
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
    display: block; width: 20px; height: 2px; background: currentColor; border-radius: 2px; position: relative; content: "";
  }
  .nav-toggle-bars::before { position: absolute; top: -6px; }
  .nav-toggle-bars::after { position: absolute; top: 6px; }
  .header-inner { flex-wrap: wrap; }
  .site-nav { flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 4px; padding-bottom: 14px; margin-inline-start: 0; }
  .site-nav ul { flex-direction: column; }
  .site-nav a { padding: 12px 14px; border-radius: 10px; font-size: 17px; }
  .site-nav .lang-switch { margin: 6px 0 0; text-align: center; }
  .js .site-nav { display: none; }
  .js .site-nav.is-open { display: flex; }
}

/* --- Buttons and chips -------------------------------------------------------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.actions-center { justify-content: center; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}
.button:active { transform: translateY(1px); }
.button-primary { background: var(--amber); color: var(--steel); }
.button-primary:hover { background: #FFC02E; color: var(--steel); }
.button-ghost { border-color: rgb(255 255 255 / .35); color: #fff; }
.button-ghost:hover { border-color: #fff; color: #fff; background: rgb(255 255 255 / .06); }
.button-ghost-dark { border-color: var(--line); color: var(--ink); }
.button-ghost-dark:hover { border-color: var(--ink); color: var(--ink); background: var(--tint); }
.button-block { width: 100%; margin-top: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  background: #FFF6DE; color: #7A5500; font-size: 13px; font-weight: 600; white-space: nowrap;
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.kicker {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 18px;
  font-family: var(--font-mono); font-size: 14px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan);
}
:lang(fa) .kicker { font-family: var(--font); letter-spacing: 0; font-size: 16px; font-weight: 700; }
.kicker .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 5px rgb(242 169 0 / .18); }
.eyebrow { font-family: var(--font-mono); font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: var(--blue); font-weight: 500; margin-bottom: 10px; }
:lang(fa) .eyebrow { font-family: var(--font); letter-spacing: 0; font-size: 16px; font-weight: 700; }

/* --- Hero ------------------------------------------------------------------------ */
.hero { position: relative; overflow: hidden; background: var(--steel); color: var(--on-dark); isolation: isolate; }
.hero-art { position: absolute; z-index: -1; inset-block: 0; inset-inline-end: 0; height: 100%; width: auto; aspect-ratio: 600 / 560; max-width: none; opacity: .9; }
@media (max-width: 1180px) { .hero-art { opacity: .35; } }
[dir="rtl"] .hero-art { transform: scaleX(-1); }
.hero-inner { padding-block: clamp(72px, 11vw, 140px) clamp(72px, 10vw, 128px); }
.hero h1 { max-width: 15ch; color: #fff; }
:lang(fa) .hero h1 { max-width: 16ch; }
.hero .lead { max-width: 58ch; color: var(--on-dark-muted); font-size: clamp(17px, 1.6vw, 20px); }
.hero-path { stroke-dasharray: 900; stroke-dashoffset: 0; animation: drill 2.4s ease-out both; }
@keyframes drill { from { stroke-dashoffset: 900; } to { stroke-dashoffset: 0; } }
@media (max-width: 760px) {
  .hero-art { opacity: .28; }
}

/* --- Sections ---------------------------------------------------------------------- */
.section { padding-block: var(--section); }
.section-tight { padding-block: clamp(40px, 6vw, 72px) var(--section); }
.section-tint { background: var(--tint); }
.section-head { max-width: 760px; margin-bottom: 40px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.split-reverse > :first-child { order: 2; }
.split > div > p { color: var(--muted); }
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .split-reverse > :first-child { order: 0; }
}
.lead { font-size: 19px; color: var(--muted); max-width: 62ch; }

/* Well model diagram */
.model-diagram { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1.25fr); align-items: center; gap: 0; }
.model-box { background: var(--steel); color: var(--on-dark); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.model-title { font-family: var(--font-mono); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); margin-bottom: 12px; }
:lang(fa) .model-title { font-family: var(--font); letter-spacing: 0; font-size: 15px; font-weight: 700; }
.model-inputs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.model-inputs li { padding: 8px 12px; border-radius: var(--radius-sm); background: rgb(255 255 255 / .06); border-inline-start: 3px solid var(--cyan); font-size: 15px; }
.model-arrow { height: 3px; background: var(--amber); position: relative; margin-inline: 4px; }
.model-arrow::after { content: ""; position: absolute; inset-inline-end: -2px; top: -6px; border: 7px solid transparent; border-inline-start: 10px solid var(--amber); border-inline-end: 0; }
.model-modules { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.model-modules li { display: flex; align-items: baseline; gap: 10px; padding: 7px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; font-size: 14px; line-height: 1.35; }
.num { font-family: var(--font-mono); font-size: 12px; color: var(--blue); font-weight: 500; flex: none; }
:lang(fa) .num { font-family: var(--font); font-size: 13px; font-weight: 700; }
@media (max-width: 560px) {
  .model-diagram { grid-template-columns: 1fr; }
  .model-arrow { width: 3px; height: 28px; margin: 4px auto; }
  .model-arrow::after { inset-inline-end: auto; left: -6px; top: auto; bottom: -2px; border: 7px solid transparent; border-top: 10px solid var(--amber); border-bottom: 0; }
}

/* Module cards */
.card-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
@media (min-width: 1100px) { .card-grid { grid-template-columns: repeat(5, 1fr); } .card-link { padding: 20px; } }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.card:hover { border-color: var(--cyan); box-shadow: var(--shadow); transform: translateY(-2px); }
.card-link { display: flex; flex-direction: column; height: 100%; padding: 22px; color: inherit; text-decoration: none; }
.card-num { font-family: var(--font-mono); font-size: 14px; color: var(--blue); font-weight: 500; margin-bottom: 14px; }
:lang(fa) .card-num { font-family: var(--font); font-weight: 700; }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 15px; flex: 1; }
.card .chip { align-self: flex-start; }

/* Tick lists */
.ticks { list-style: none; margin: 0 0 1em; padding: 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-inline-start: 30px; color: var(--muted); }
.ticks li::before {
  content: ""; position: absolute; inset-inline-start: 2px; top: .55em; width: 14px; height: 8px;
  border-left: 2.5px solid var(--cyan); border-bottom: 2.5px solid var(--cyan); transform: rotate(-45deg);
}

/* Report illustration */
.report-stack { position: relative; min-height: 360px; }
.sheet { position: absolute; width: 62%; border-radius: 10px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); padding: 20px; }
.sheet-tag { position: absolute; top: 14px; inset-inline-end: 14px; font-family: var(--font-mono); font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 6px; color: #fff; }
.sheet-pdf { inset-inline-start: 4%; top: 30px; min-height: 320px; z-index: 2; }
.sheet-pdf .sheet-tag { background: var(--blue); }
.sheet-xlsx { inset-inline-end: 2%; top: 0; min-height: 280px; background: var(--mist); }
.sheet-xlsx .sheet-tag { background: #2F7D4F; }
.sheet-grid { margin-top: 36px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.sheet-grid span { height: 22px; border-radius: 3px; background: #fff; border: 1px solid var(--line); }
.sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.sheet-head span { height: 10px; width: 45%; border-radius: 4px; background: var(--steel); }
.sheet-line { display: block; height: 8px; border-radius: 4px; background: var(--line); margin-bottom: 10px; }
.w60 { width: 60%; } .w70 { width: 70%; } .w80 { width: 80%; } .w90 { width: 90%; }
.sheet-plot { display: block; width: 100%; height: auto; margin: 14px 0 16px; background: var(--tint); border-radius: 6px; }
@media (max-width: 900px) { .report-stack { min-height: 340px; max-width: 520px; } }

/* Method points and roadmap */
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 48px; }
.point { background: #fff; border-radius: var(--radius); padding: 24px; border-top: 3px solid var(--cyan); }
.point p { color: var(--muted); margin: 0; font-size: 16px; }
@media (max-width: 900px) { .three-col { grid-template-columns: 1fr; } }
.roadmap { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.roadmap li { position: relative; padding-top: 18px; display: flex; flex-direction: column; gap: 2px; }
.roadmap li::before { content: ""; position: absolute; top: 0; inset-inline: 0; height: 8px; border-radius: 4px; background: var(--line); }
.roadmap li.is-current::before { background: var(--amber); }
.road-code { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--graphite); }
:lang(fa) .road-code { font-family: var(--font); font-weight: 700; }
.road-name { font-size: 14px; line-height: 1.4; color: var(--ink); }
.road-now { align-self: flex-start; margin-top: 4px; font-size: 12px; font-weight: 700; color: #7A5500; background: #FFF6DE; padding: 1px 8px; border-radius: 999px; }
@media (max-width: 760px) { .roadmap { grid-template-columns: repeat(2, 1fr); row-gap: 18px; } }
.roadmap-vertical { grid-template-columns: 1fr; gap: 0; margin: 18px 0 20px; }
.roadmap-vertical li { padding: 0 0 14px; padding-inline-start: 22px; flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 10px; }
.roadmap-vertical li::before { top: 6px; bottom: -6px; inset-inline: 0 auto; width: 6px; height: auto; }
.roadmap-vertical li:last-child::before { bottom: 6px; }
.roadmap-vertical .road-now { margin-top: 0; }

/* CTA band */
.cta-band { background: var(--steel); color: var(--on-dark); padding-block: clamp(48px, 7vw, 80px); }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.cta-band h2 { color: #fff; margin-bottom: 8px; }
.cta-band p { color: var(--on-dark-muted); margin: 0; }
.cta-band .actions { margin-top: 0; }

/* --- Inner pages ------------------------------------------------------------------- */
.page-head { background: var(--steel); color: var(--on-dark); padding-block: clamp(56px, 8vw, 96px) clamp(40px, 6vw, 72px); position: relative; overflow: hidden; }
.page-head::after {
  content: ""; position: absolute; inset-inline-end: -40px; bottom: -60px; width: 320px; height: 220px;
  border-inline-start: 10px solid var(--cyan); border-bottom: 10px solid var(--cyan); border-end-start-radius: 160px;
  opacity: .22; pointer-events: none;
}
.page-head h1 { color: #fff; max-width: 22ch; }
.page-head .lead { color: var(--on-dark-muted); }
.page-head-center { text-align: center; }
.page-head-center h1, .page-head-center .lead { margin-inline: auto; }
.page-head-center::after { display: none; }
.success-mark { margin-bottom: 18px; }

.modules-layout { display: grid; grid-template-columns: 280px 1fr; gap: 48px; padding-block: 56px var(--section); align-items: start; }
.module-index { position: sticky; top: 92px; }
.module-index ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.module-index a { display: flex; gap: 10px; align-items: baseline; padding: 8px 12px; border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; font-size: 15px; line-height: 1.4; }
.module-index a:hover { background: var(--tint); color: var(--ink); }
.module-list { display: grid; gap: 20px; }
.module { border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 3vw, 32px); scroll-margin-top: 92px; }
.module:target { border-color: var(--cyan); box-shadow: 0 0 0 3px rgb(43 179 192 / .18); }
.module-head { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: start; margin-bottom: 18px; }
.module-head h2 { font-size: clamp(22px, 2.4vw, 28px); margin-bottom: 6px; }
.module-head p { color: var(--muted); margin: 0; }
.module-num { font-family: var(--font-mono); font-size: 15px; font-weight: 500; color: #fff; background: var(--steel); border-radius: 10px; width: 46px; height: 46px; display: grid; place-items: center; }
:lang(fa) .module-num { font-family: var(--font); font-weight: 700; font-size: 17px; }
.module-sub { font-family: var(--font-mono); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); font-weight: 500; margin: 0 0 12px; }
:lang(fa) .module-sub { font-family: var(--font); letter-spacing: 0; font-size: 15px; font-weight: 700; }
.note { color: var(--muted); font-size: 15px; border-inline-start: 3px solid var(--amber); padding-inline-start: 14px; margin-top: 8px; }
@media (max-width: 900px) {
  .modules-layout { grid-template-columns: 1fr; gap: 24px; padding-top: 32px; }
  .module-index { position: static; }
  .module-index ol { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media (max-width: 560px) {
  .module-head { grid-template-columns: auto 1fr; }
  .module-head .chip { grid-column: 2; justify-self: start; }
}

.prose-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: clamp(32px, 6vw, 72px); align-items: start; }
.prose h2 { font-size: 24px; margin-top: 1.6em; }
.prose h2:first-child { margin-top: 0; }
.prose p { color: var(--muted); }
.narrow-prose { max-width: 760px; }
.aside-card { background: var(--tint); border-radius: var(--radius); padding: 26px; position: sticky; top: 92px; }
.aside-card h2 { font-size: 21px; }
.aside-card p { color: var(--muted); font-size: 16px; }
@media (max-width: 900px) {
  .prose-grid { grid-template-columns: 1fr; }
  .aside-card { position: static; }
}

/* --- Form -------------------------------------------------------------------------- */
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: clamp(32px, 6vw, 72px); align-items: start; }
@media (max-width: 900px) { .form-layout { grid-template-columns: 1fr; } }
.form { display: grid; gap: 20px; max-width: 640px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 15px; }
.optional { font-weight: 400; color: var(--muted); }
.field input[type="text"], .field input[type="email"], .field input[type="number"], .field input[type="password"], .field input[type="tel"], .field input[type="url"], .field input[type="search"], .field input[type="date"], .field input[type="datetime-local"], .field select, .field textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: #fff;
  border: 1px solid #B8C4CE; border-radius: 10px; padding: 12px 14px; min-height: 48px;
}
.field textarea { resize: vertical; min-height: 150px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgb(28 93 153 / .2); }
.has-error input, .has-error select, .has-error textarea { border-color: #B42318; }
.field-error { color: #B42318; font-size: 14px; margin: 0; }
.field-check { grid-template-columns: auto 1fr; align-items: start; column-gap: 12px; }
.field-check input { width: 20px; height: 20px; margin-top: 4px; accent-color: var(--blue); }
.field-check label { font-weight: 400; color: var(--muted); }
.field-check .field-error { grid-column: 2; }
.form-alert { background: #FEF3F2; border: 1px solid #FECDCA; color: #912018; border-radius: 10px; padding: 12px 16px; }
.form-alert p { margin: 0; }
.trap { position: absolute; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form .button { justify-self: start; }

/* --- Footer ---------------------------------------------------------------------------- */
.site-footer { background: #0A1722; color: var(--on-dark-muted); padding-top: 56px; font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; padding-bottom: 40px; }
.footer-brand p { margin-top: 14px; max-width: 34ch; }
.brand-on-dark { color: #fff; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { color: var(--on-dark); text-decoration: none; }
.site-footer a:hover { color: var(--cyan); }
.footer-label { font-family: var(--font-mono); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 10px; }
:lang(fa) .footer-label { font-family: var(--font); letter-spacing: 0; font-size: 15px; font-weight: 700; }
.linkedin-link { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border: 1px solid rgb(255 255 255 / .18); border-radius: 999px; }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; border-top: 1px solid rgb(255 255 255 / .08); padding-block: 20px 28px; font-size: 14px; }
.footer-base p { margin: 0; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  .site-header, .site-footer, .hero-art, .cta-band, .actions { display: none !important; }
  .hero, .page-head { background: none; color: #000; }
  .hero h1, .page-head h1 { color: #000; }
}

/* ===================================================================================
   Platform (Phase 1): sign-in pages and the signed-in panel
   =================================================================================== */
.nav-cta { background: var(--amber); color: var(--steel) !important; font-weight: 600 !important; }
.nav-cta:hover { background: #FFC02E !important; }
.flash-wrap { padding-top: 16px; }
.flash-list { display: grid; gap: 8px; margin-bottom: 16px; }
.flash { margin: 0; padding: 12px 16px; border-radius: 10px; background: #E7F1FB; color: #123B63; border: 1px solid #C9DDF2; }
.flash-success { background: #E6F6F1; color: #0F5132; border-color: #BFE6D6; }
.flash-error { background: #FEF3F2; color: #912018; border-color: #FECDCA; }
.flash-warning { background: #FFF6DE; color: #6B4A00; border-color: #F5DFA0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-button.on-dark { color: var(--on-dark-muted); text-decoration: none; font-size: 15px; }
.link-button.on-dark:hover { color: #fff; }
.link-button.danger { color: #B42318; }
.button-small { min-height: 36px; padding: 6px 14px; font-size: 14px; background: var(--steel); color: #fff; }
.button-small:hover { background: var(--steel-2); color: #fff; }
.button-quiet { background: #fff; color: var(--ink); border-color: var(--line); }
.button-quiet:hover { background: var(--tint); color: var(--ink); border-color: #B8C4CE; }
.button-small.button-quiet { background: #fff; color: var(--ink); }
.button-danger { background: #B42318; color: #fff; }
.button-danger:hover { background: #912018; color: #fff; }
.button-danger-text { color: #B42318; }
.chip-on { background: #E6F6F1; color: #0F5132; }
.chip-on::before { background: #12B76A; }
.chip-grey { background: var(--tint); color: var(--graphite); }
.chip-grey::before { display: none; }

/* Sign-in pages */
.auth-body { background: var(--tint); }
.auth { padding: clamp(32px, 6vw, 72px) var(--gutter) 72px; display: grid; justify-items: center; gap: 18px; }
.auth-card { width: 100%; max-width: 460px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: clamp(22px, 4vw, 36px); box-shadow: var(--shadow); }
.auth-card h1 { font-size: 30px; margin-bottom: 18px; }
.auth-card .form { max-width: none; gap: 16px; }
.auth-note { max-width: 460px; text-align: center; color: var(--muted); font-size: 14px; margin: 0; }
.auth-switch { margin: 20px 0 0; text-align: center; color: var(--muted); }
.form-links { margin: 4px 0 0; text-align: center; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--tint); border-radius: 999px; margin-bottom: 22px; }
.tab { flex: 1; text-align: center; padding: 8px 10px; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; }
.tab.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgb(14 30 43 / .12); }
.radio-group { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.radio-group legend { font-weight: 600; font-size: 15px; margin-bottom: 6px; padding: 0; }
.radio-group > div, .radio-group label.radio { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.radio input { accent-color: var(--blue); width: 18px; height: 18px; margin: 0; }
.radio:has(input:checked) { border-color: var(--blue); background: #F2F7FC; }
.help { margin: 0; font-size: 13px; color: var(--muted); }
.code-input { font-family: var(--font-mono); font-size: 26px !important; letter-spacing: .4em; text-align: center; }
.field input[type="password"] { width: 100%; font: inherit; font-size: 16px; border: 1px solid #B8C4CE; border-radius: 10px; padding: 12px 14px; min-height: 48px; }
.field input[type="password"]:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgb(28 93 153 / .2); }
.field select { appearance: auto; }

/* Panel layout */
.app-body { background: #F7F9FB; }
.app-header { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 18px; min-height: 60px; padding-inline: 20px; background: var(--steel); color: var(--on-dark); }
.app-header .brand-name { font-size: 14px; }
.account-switch select { background: var(--steel-2); color: #fff; border: 1px solid rgb(255 255 255 / .2); border-radius: 8px; padding: 6px 10px; font: inherit; font-size: 14px; max-width: 280px; }
.account-name { color: var(--on-dark-muted); font-size: 14px; padding-inline-start: 16px; border-inline-start: 1px solid rgb(255 255 255 / .15); }
.app-header-end { margin-inline-start: auto; display: flex; align-items: center; gap: 18px; }
.app-header .lang-switch { color: #fff; text-decoration: none; border: 1px solid rgb(255 255 255 / .22); border-radius: 999px; padding: 4px 12px; font-size: 14px; }
.app-header .lang-switch:lang(fa) { font-family: "Vazirmatn", sans-serif; }
.app-header .lang-switch:lang(en) { font-family: "IBM Plex Sans", sans-serif; }
.app-shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: calc(100vh - 60px); }
.app-nav { background: #fff; border-inline-end: 1px solid var(--line); padding: 20px 12px; display: flex; flex-direction: column; justify-content: space-between; }
.app-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.app-nav a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 15px; }
.app-nav a:hover { background: var(--tint); color: var(--ink); }
.app-nav a[aria-current="page"] { background: #E8F1F8; color: var(--steel); font-weight: 600; }
.app-nav-user { font-size: 14px; color: var(--ink); padding: 12px; border-top: 1px solid var(--line); margin: 16px 0 0; }
.app-nav-user span { color: var(--muted); font-size: 13px; }
.app-main { padding: 28px clamp(16px, 3vw, 40px) 64px; max-width: 1240px; width: 100%; min-width: 0; }
@media (max-width: 860px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .app-nav { border-inline-end: 0; border-bottom: 1px solid var(--line); padding: 8px 12px; }
  .app-nav ul { display: flex; overflow-x: auto; gap: 4px; }
  .app-nav a { white-space: nowrap; }
  .app-nav-user { display: none; }
  .app-header { flex-wrap: wrap; padding-block: 8px; gap: 10px; }
  .app-header .brand-name { display: none; }
  .account-name { border: 0; padding: 0; }
}
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--blue); text-decoration: underline; }
.notice { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; background: #FFF6DE; border: 1px solid #F5DFA0; color: #6B4A00; border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; }
.notice p { margin: 0; }
.page-title { margin-bottom: 22px; }
.page-title h1 { font-size: clamp(26px, 3vw, 34px); margin-bottom: 4px; }
.page-title-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.eyebrow-sm { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); margin: 0 0 4px; }
:lang(fa) .eyebrow-sm { font-family: var(--font); letter-spacing: 0; font-size: 14px; font-weight: 700; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; }
.actions-row form { margin: 0; }
.actions-row .button, .form-actions .button { min-height: 40px; padding: 8px 16px; font-size: 15px; }
.panel-section { margin-top: 32px; }
.panel-section h2 { font-size: 21px; margin: 0; }
.section-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-row h3 { margin: 0; font-size: 17px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 0; }
.facts div { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 500; }
.facts-stack { grid-template-columns: 1fr; margin-bottom: 18px; }
.facts-stack div { border: 0; padding: 0; background: none; }
.notes { background: #fff; border-inline-start: 3px solid var(--sand); padding: 10px 14px; border-radius: 0 8px 8px 0; color: var(--muted); }
.tile-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 12px; transition: border-color .15s ease, box-shadow .15s ease; }
.tile:hover { border-color: var(--cyan); box-shadow: var(--shadow); }
.tile a { display: block; padding: 18px; color: inherit; text-decoration: none; height: 100%; }
.tile h2 { font-size: 19px; margin-bottom: 4px; }
.tile h3 { font-size: 16px; margin-bottom: 4px; }
.tile p { margin: 0; }
.tile-meta { font-size: 13px; color: var(--muted); margin-top: 10px !important; }
.tile-list-small { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.empty { background: #fff; border: 1px dashed #B8C4CE; border-radius: 14px; padding: 32px; text-align: center; }
.empty p { color: var(--muted); max-width: 560px; margin-inline: auto; }
.empty-inline { color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: 10px; padding: 14px 16px; margin: 0; }
.archived { margin-top: 18px; }
.archived summary { cursor: pointer; color: var(--muted); }
.plain-list { list-style: none; padding: 0; display: grid; gap: 6px; }
.module-chips { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
.module-chips li { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.module-chips .chip { margin-inline-start: auto; font-size: 12px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.card h2 { font-size: 19px; }
.narrow-card { max-width: 560px; margin-top: 24px; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.panel-form { max-width: 620px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.danger-zone { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); }
.inline-fields { max-width: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.h3 { font-size: 19px; }

/* Tables */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { text-align: start; font-weight: 600; color: var(--graphite); background: var(--tint); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 8px 12px; border-bottom: 1px solid #EDF1F4; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table:not(.numeric) { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.table-scroll .data-table { border: 0; }
.data-table.numeric td, .data-table.numeric th { text-align: end; font-variant-numeric: tabular-nums; }
.data-table.numeric .text-col { text-align: start; }
.data-table .num-col { text-align: end; }
.data-table tr.inherited td { color: #8A97A3; background: #FAFBFC; }
.ltr-cell { text-align: start; unicode-bidi: plaintext; }
.inline-form { display: flex; gap: 6px; align-items: center; margin: 0; }
.inline-form select { font: inherit; font-size: 14px; padding: 4px 8px; border-radius: 6px; border: 1px solid #B8C4CE; }
.filter-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.filter-row select { font: inherit; font-size: 15px; padding: 6px 10px; border-radius: 8px; border: 1px solid #B8C4CE; background: #fff; }
.import-box { margin-top: 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; }
.import-box summary { cursor: pointer; font-weight: 600; }
.import-box .form { margin-top: 12px; max-width: 640px; }
.mono { font-family: var(--font-mono); font-size: 14px; }
.edit-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.edit-table th { text-align: start; font-weight: 600; color: var(--graphite); background: var(--tint); padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.edit-table td { padding: 6px; border-bottom: 1px solid #EDF1F4; vertical-align: top; }
.edit-table input[type="text"], .edit-table select { width: 100%; min-width: 90px; font: inherit; font-size: 14px; padding: 7px 8px; border: 1px solid #C5D0D9; border-radius: 6px; background: #fff; }
.edit-table input:focus, .edit-table select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px rgb(28 93 153 / .2); }
.edit-table td.has-error input, .edit-table td.has-error select { border-color: #B42318; }
.edit-table .cell-check { text-align: center; vertical-align: middle; }
.edit-table .field-error { font-size: 12px; margin-top: 2px; }
.row-error td { color: #912018; background: #FEF3F2; font-size: 13px; }
.grid-form .form-actions { margin-top: 16px; }
.string-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.string-card .table-scroll { border: 0; }

/* User-entered names may be Latin inside Persian pages: let each one take its own direction. */
.data-table:not(.numeric) td, .data-table .text-col, .tile h2, .tile h3, .tile p, .page-title h1, .crumbs a, .user-text { unicode-bidi: plaintext; }
[dir="rtl"] .data-table:not(.numeric) td, [dir="rtl"] .data-table .text-col { text-align: right; }
[dir="ltr"] .data-table:not(.numeric):not(.num-table) td, [dir="ltr"] .data-table .text-col, [dir="ltr"] .num-table td:first-child { text-align: left; }

/* ---------- Engineering modules (v1.0) ---------- */
.module-tiles .tile-off { opacity: .6; }
.module-tiles .tile-inner { display: block; padding: inherit; }
.module-chips a { display: contents; color: inherit; text-decoration: none; }
.calc-form { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
.calc-form > * { min-width: 0; }
.calc-group { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px 16px; margin: 0; background: var(--paper); min-width: 0; }
.calc-group legend { font-weight: 600; padding: 0 6px; }
.calc-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.calc-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px 16px; }
.calc-fields .field, .calc-head .field { margin: 0; }
.calc-group input, .calc-group select { width: 100%; }
.unit { color: var(--muted); font-weight: 400; font-size: .85em; white-space: nowrap; }
.calc-table input, .calc-table select { min-width: 84px; padding: 6px 8px; }
.calc-table td:last-child { width: 32px; text-align: center; }
.calc-table th { font-size: .85rem; vertical-align: bottom; }
.sticky-actions { position: sticky; bottom: 0; background: var(--paper); padding: 12px 0; border-top: 1px solid var(--line); z-index: 2; }
.check-list { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 6px; }
.check { padding: 9px 12px 9px 36px; border-radius: var(--radius-sm); position: relative; background: var(--tint); }
:lang(fa) .check { padding: 9px 36px 9px 12px; }
.check::before { position: absolute; inset-inline-start: 12px; top: 9px; font-weight: 700; }
.check-ok { background: #E7F5EC; } .check-ok::before { content: "✓"; color: #2E7D4F; }
.check-warn { background: #FFF6DE; } .check-warn::before { content: "!"; color: #9A6A00; }
.check-fail { background: #FDECEA; } .check-fail::before { content: "✕"; color: #B3261E; }
.check-info { background: var(--mist); } .check-info::before { content: "i"; color: var(--blue); }
.result-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 18px; }
.result-card h2 { font-size: 1rem; margin: 0 0 8px; color: var(--blue); }
.result-list { margin: 0; display: grid; gap: 4px; }
.result-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.result-list dt { color: var(--muted); }
.result-list dd { margin: 0; text-align: end; white-space: nowrap; }
.result-list .num { font-weight: 600; font-variant-numeric: tabular-nums; }
.num-table td { font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-figure { margin: 18px 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink); }
.chart-figure figcaption { font-weight: 600; margin-bottom: 6px; }
.chart { width: 100%; height: auto; display: block; }
.chart-legend { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .85rem; }
.swatch { display: inline-block; width: 18px; height: 3px; background: var(--c); vertical-align: middle; margin-inline-end: 6px; }
.swatch-dash { background: repeating-linear-gradient(90deg, var(--c) 0 5px, transparent 5px 8px); }
.notes-box p { color: var(--muted); }
.inline-h { display: inline; font-size: 1.1rem; }
.compare-table tr.differs td { background: #FFF6DE; }
.plan-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.actions-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.actions-row form { margin: 0; }
@media (max-width: 640px) {
  .result-list > div { flex-direction: column; gap: 2px; }
  .result-list dd { text-align: start; }
}
.table-scroll { position: relative; }

/* ---------- Sample results (v1.1) ---------- */
.shot { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption { padding: 12px 16px 14px; font-size: .92rem; color: var(--muted); border-top: 1px solid var(--line); }
.shot figcaption strong { color: var(--ink); }
.shot figcaption .num { font-family: var(--font-mono); color: var(--blue); }
.shot-wide { margin-bottom: 28px; }
.sample-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 22px; }
.sample-grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); margin: 24px 0; }
.report-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.report-pair img { width: 100%; height: auto; border-radius: 6px; box-shadow: 0 2px 4px rgb(14 30 43 / .08), 0 14px 32px rgb(14 30 43 / .14); border: 1px solid var(--line); }
.report-pair img:last-child { margin-top: 36px; }
.sample-downloads li { padding: 6px 0; }
.actions-center { text-align: center; }

/* ---- release 2.0 ------------------------------------------------------------------ */
.announce { background: var(--amber, #F2A900); color: #0E1E2B; font-size: 14px; padding: 8px 0; text-align: center; }
.units-prompt { border: 1px solid #F2A900; background: #FFF6DE; border-radius: 10px; padding: 14px 16px; margin: 0 0 18px; }
.units-prompt p { margin: 0 0 8px; }
.units-prompt .inline-form { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.units-switch { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 14px; }
.units-switch select { width: auto; min-width: 0; max-width: 100%; flex: 0 1 auto; padding: 4px 8px; font-size: 14px; }
.page-title-row > div { min-width: 0; }
.figure-grid, .chart-grid { display: grid; gap: 18px; margin: 18px 0; }
@media (min-width: 1100px) { .chart-grid { grid-template-columns: 1fr 1fr; } }
.eng-figure { margin: 0; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.eng-figure svg, .figure-svg { width: 100%; height: auto; display: block; color: var(--ink); }
:root:lang(fa) .eng-figure svg { font-family: "Vazirmatn", "IBM Plex Sans", sans-serif; }
.term, abbr.term { text-decoration: underline dotted rgb(28 93 153 / .5); text-underline-offset: 3px; cursor: help; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; margin: 10px 0 20px; }
.plan-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.plan-card.is-featured, .plan-item.is-featured { border: 2px solid var(--cyan, #2BB3C0); box-shadow: 0 8px 24px rgb(14 30 43 / .08); }
.plan-card h2 { font-size: 20px; margin: 0; }
.plan-price { font-size: 22px; font-weight: 700; color: var(--ink); margin: 0; }
.plan-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.plan-item .plan-price { font-size: 16px; display: block; margin: 2px 0 6px; }
.input-small { width: 140px !important; display: inline-block; padding: 6px 10px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 8px 0 26px; }
.tool-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  color: var(--ink); text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
.tool-card:hover { border-color: var(--cyan, #2BB3C0); transform: translateY(-1px); }
.tool-card span { color: var(--muted); font-size: 14px; }
.tool-layout { display: grid; gap: 18px; }
@media (min-width: 900px) { .tool-layout { grid-template-columns: 1.1fr .9fr; align-items: start; } }
.swatch-box { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgb(0 0 0 / .25); vertical-align: -2px; }
.add-box { margin-top: 12px; } .add-box summary { cursor: pointer; font-weight: 600; color: var(--blue, #1C5D99); }
.actions-cell { white-space: nowrap; } .actions-cell .inline-form { display: inline; }
.narrow-card { max-width: 640px; }
.steps-list li { margin-bottom: 8px; }

/* ---- release 2.0 design review ------------------------------------------------------ */
.result-list .num { font-family: var(--font); font-size: 15px; font-weight: 600; color: var(--ink); }
.result-card .result-list { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); column-gap: 32px; }
@media (max-width: 640px) { .chart-figure { overflow-x: auto; } .chart { min-width: 520px; } }
.figure-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); align-items: start; }
.eng-figure svg { max-height: min(85vh, 900px); }
.figure-grid > .chart-figure, .chart-grid > .chart-figure, .figure-grid > .eng-figure { margin: 0; }
.button-small.button-primary { background: var(--amber); color: var(--steel); }
.button-small.button-primary:hover { background: #FFC02E; color: var(--steel); }
.button:not([class*="button-"]) { background: var(--steel); color: #fff; }
input[type=file]::file-selector-button { font: inherit; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; margin-inline-end: 10px; cursor: pointer; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-group { display: inline-flex; flex-wrap: wrap; row-gap: 6px; max-width: 100%; }
.btn-group .button { border-radius: 0; margin: 0; }
.btn-group .button + .button { margin-inline-start: -1px; }
.btn-group .button:first-child { border-start-start-radius: 999px; border-end-start-radius: 999px; }
.btn-group .button:last-child { border-start-end-radius: 999px; border-end-end-radius: 999px; }
.num-table td:not(:first-child), .num-table th:not(:first-child) { text-align: end; }
.table-scroll.is-tall { max-height: 480px; overflow-y: auto; }
.is-tall thead th { position: sticky; top: 0; background: #fff; z-index: 1; }
.card-grid .card { padding: 0; }
@media (min-width: 1100px) { .card-grid { grid-template-columns: repeat(4, 1fr); } }
.roadmap { grid-template-columns: repeat(7, 1fr); }
@media (max-width: 760px) { .roadmap { grid-template-columns: repeat(2, 1fr); } }
.roadmap-vertical { grid-template-columns: 1fr; }
.calc-table select { min-width: 130px; }
.row-remove { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.row-remove:hover, .row-remove:focus-visible { color: #B42318; background: #FDECEA; }
.calc-table tbody:empty::after { content: attr(data-empty); display: table-cell; padding: 10px; color: var(--muted); }
.sticky-actions { margin-inline: calc(-1 * clamp(16px, 3vw, 40px)); padding-inline: clamp(16px, 3vw, 40px); box-shadow: 0 -6px 16px rgb(14 30 43 / .06); }
.tile p { font-size: 15px; color: var(--muted); }
.module-chips .chip-on, .module-list .chip-on { display: none; }
@media (max-width: 760px) { .hero-art { opacity: .12; inset-inline-end: -40%; } }
.plan-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 340px)); justify-content: center; }
.plan-price { font-size: 32px; line-height: 1.1; }
.plan-card .button { margin-top: auto; align-self: flex-start; }
.tool-grid + h2, .section-tight h2 { font-size: 22px; }
.eng-figure { overflow-x: auto; }
@media (max-width: 640px) { .eng-figure svg { min-width: 620px; max-height: none; } .eng-figure::after { content: "⟷"; display: block; text-align: center; color: var(--muted); font-size: 14px; } }
.nowrap { white-space: nowrap; }
[dir="rtl"] .page-title h1, [dir="rtl"] .tile :is(h2, h3, p) { text-align: right; }
.result-groups { align-items: start; }
.result-card.card:hover { transform: none; box-shadow: none; border-color: var(--line); }
@media (max-width: 640px) { .result-list > div { flex-direction: row; flex-wrap: wrap; } .result-list dd { margin-inline-start: auto; text-align: end; } }
.table-scroll :is(th, td):first-child { position: sticky; inset-inline-start: 0; background: #fff; z-index: 1; }
.num-table td.text-col { white-space: normal; min-width: 14ch; }
:lang(fa) .term { text-underline-offset: 7px; text-decoration-thickness: 1px; }
.term-en { display: none; color: var(--muted); font-weight: 400; font-size: 13px; }
@media (max-width: 640px) { .term-en { display: block; } }

/* ---- release 2.1 ------------------------------------------------------------------ */
.app-version { color: var(--muted); font-size: 14px; margin: 0; }
.app-notes p { margin: 0 0 6px; }
.hash { display: block; word-break: break-all; font-size: 12px; background: var(--tint); padding: 6px 8px; border-radius: 6px; margin-top: 6px; }
.field-human input { width: 120px !important; }
/* figures and charts on phones: fit the screen, tap to open them full size */
.zoom-hint { display: none; }
@media (max-width: 640px) {
  .eng-figure { overflow: visible; }
  .eng-figure svg { min-width: 0; max-height: none; }
  .eng-figure::after { content: none; }
  .chart-figure { overflow: visible; }
  .chart { min-width: 0; }
  .zoomable { cursor: zoom-in; }
  .zoom-hint { display: block; text-align: center; font-size: 13px; color: var(--blue); margin-top: 8px; }
}
.fig-viewer { position: fixed; inset: 0; z-index: 10000; background: #0E1E2B; display: flex; flex-direction: column; }
.fig-viewer-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; color: #fff; }
.fig-viewer-bar strong { flex: 1; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fig-viewer-bar button { min-width: 40px; height: 40px; border: 1px solid rgb(255 255 255 / .35); border-radius: 10px; background: transparent; color: #fff; font-size: 20px; line-height: 1; }
.fig-viewer-body { flex: 1; overflow: auto; direction: ltr; background: #fff; -webkit-overflow-scrolling: touch; }
.fig-viewer-body > div { padding: 12px; width: max-content; }
.fig-viewer-body svg { display: block; height: auto; max-width: none; max-height: none; }
.fig-viewer-body .chart-legend, .fig-viewer-body figcaption { direction: inherit; }
body.has-viewer { overflow: hidden; }
/* handy tools: search, groups, formula card */
.tool-search { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: 0 0 12px; }
.tool-search input[type=search] { flex: 1 1 260px; max-width: 520px; }
.check-inline { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; }
.chip { display: inline-flex; gap: 6px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 13px; text-decoration: none; color: var(--ink); }
.chip:hover { border-color: var(--cyan, #2BB3C0); }
.tool-card .tag { font-style: normal; font-size: 11px; font-weight: 600; color: var(--blue, #1C5D99); background: #E8F1F8; border-radius: 999px; padding: 1px 8px; align-self: flex-start; }
.formula-card { grid-column: 1 / -1; }
.formula-list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.formula-list code { display: block; white-space: pre-wrap; background: var(--tint); padding: 8px 10px; border-radius: 8px; font-size: 14px; text-align: left; }
.source-list { margin: 0 0 8px; padding-inline-start: 20px; }
.note-box { background: #FFF6DE; border: 1px solid #F2A900; border-radius: 10px; padding: 10px 12px; }
.tool-layout > * { min-width: 0; }
.tool-layout .result-card .table-scroll { margin-top: 6px; }

/* release 2.1 — catalogue */
.catalog-filters { flex-wrap: wrap; gap: .5rem .75rem; align-items: center; }
.catalog-filters input[type=search] { min-width: 14rem; flex: 1 1 14rem; }
.catalog-count { margin: .5rem 0 1rem; }
.pager { display: flex; gap: .75rem; align-items: center; justify-content: center; margin: 1rem 0; flex-wrap: wrap; }
.key-values th { width: 50%; font-weight: 500; }
.key-values td { text-align: end; }
.key-values td.text-col { text-align: start; }
@media (max-width: 640px) {
  .catalog-filters label { flex: 0 0 30%; }
  .catalog-filters select, .catalog-filters input[type=search] { flex: 1 1 60%; min-width: 0; }
}

/* release 2.1 — Excel input import/export */
.form-note { background: #ECFDF3; border: 1px solid #ABEFC6; color: #085D3A; border-radius: 10px; padding: 12px 16px; margin-bottom: 12px; }
.form-note p { margin: 0; }
.excel-box > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.excel-box[open] > summary { margin-bottom: 8px; }
.excel-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.excel-row input[type=file] { max-width: 100%; font-size: 14px; }
.table-upload { margin-top: 10px; padding-top: 8px; border-top: 1px dashed #D5DDE4; }
.table-upload label { font-size: 14px; color: #5B6B7A; }

/* ---------- AI assistant (release 2.2) ---------- */
.assistant-layout { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 20px; align-items: start; }
.assistant-list { padding: 16px; }
.assistant-list:hover { transform: none; }
.assistant-list .plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.assistant-list li { display: grid; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.assistant-list li.is-current a { font-weight: 600; color: var(--ink); }
.assistant-main { display: grid; gap: 16px; min-width: 0; }
.chat { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.chat-msg { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; background: #fff; max-width: 100%; overflow-wrap: anywhere; }
.chat-user { background: #EEF4FA; border-color: #C8DAEC; margin-inline-start: 12%; }
.chat-assistant { margin-inline-end: 6%; }
.chat-error { border-color: #E9B3B3; background: #FDF3F3; }
.chat-who { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.chat-body p { margin: 0 0 8px; }
.chat-body ul, .chat-body ol { margin: 0 0 8px; padding-inline-start: 22px; }
.chat-body h3, .chat-body h4, .chat-body h5 { margin: 10px 0 6px; font-size: 15px; }
.chat-body pre { background: #F4F6F8; padding: 10px; border-radius: 8px; overflow-x: auto; }
.chat-body table { margin: 6px 0 10px; }
.chat-form { padding: 16px; display: grid; gap: 10px; }
.chat-form:hover { transform: none; }
.chat-form textarea { width: 100%; font: inherit; padding: 10px; border: 1px solid var(--line); border-radius: 8px; resize: vertical; }
.webmail-link { margin-top: 8px; }
@media (max-width: 760px) {
  .assistant-layout { grid-template-columns: 1fr; }
  .assistant-list { order: 2; }
  .chat-user { margin-inline-start: 0; }
  .chat-assistant { margin-inline-end: 0; }
}
.h-small { font-size: 16px; margin: 0 0 10px; }
.check-line { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; }
.check-line input { margin-top: 4px; }

/* small screens: nothing may push the page wider than the phone (2.2.1) */
.inline-form.card { flex-wrap: wrap; }
.inline-form.card select { flex: 1 1 220px; min-width: 0; max-width: 100%; }
.data-table.key-values { width: 100%; }
.data-table.key-values th, .data-table.key-values td.text-col { overflow-wrap: anywhere; }

/* --- Simulator promotion on the home page (release 2.5) ------------------------------------ */
.sim-promo { background: var(--steel); color: var(--on-dark); }
.sim-promo .eyebrow { color: var(--amber); }
.sim-promo p { color: var(--on-dark-muted); max-width: 640px; }
.sim-promo-inner { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center; }
.sim-promo-art { width: min(260px, 40vw); }
@media (max-width: 720px) { .sim-promo-inner { grid-template-columns: 1fr; } .sim-promo-art { display: none; } }

/* --- Yearly rate editor (release 2.6) ------------------------------------------------------ */
.rates-form { margin-top: 14px; }
.rates-table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--paper); }
.rates-table thead th {
  text-align: start; font-weight: 600; font-size: 13px; color: var(--graphite);
  background: var(--tint); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.rates-table tbody th {
  text-align: start; font-weight: 500; color: var(--ink); padding: 12px 14px;
  border-bottom: 1px solid var(--tint); width: 38%; overflow-wrap: anywhere;
}
.rates-table tbody td { padding: 10px 14px; border-bottom: 1px solid var(--tint); vertical-align: middle; }
.rates-table tbody th code { display: block; margin-top: 3px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.rates-table .rate-value { width: 1%; white-space: nowrap; }
.rates-table .rate-unit { width: 1%; white-space: nowrap; color: var(--muted); }
.rates-table .rate-note { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.rates-table input {
  width: 9rem; max-width: 100%; font: inherit; font-size: 15px; font-variant-numeric: tabular-nums;
  text-align: end; padding: 8px 10px; border: 1px solid #C5D0D9; border-radius: var(--radius-sm); background: var(--paper);
}
.rates-table input:focus-visible { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgb(28 93 153 / .2); }
.rates-table input[aria-invalid="true"] { border-color: #B42318; background: #FEF3F2; }
.rates-table .field-error { margin: 4px 0 0; font-size: 12px; color: #912018; text-align: start; }

@media (max-width: 700px) {
  .rates-scroll { overflow: visible; border: 0; background: none; }
  .rates-table, .rates-table tbody, .rates-table tr, .rates-table tbody th, .rates-table tbody td { display: block; width: auto; }
  .rates-table thead { display: none; }
  .rates-table tbody tr {
    border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper);
    padding: 12px 14px; margin-bottom: 10px;
  }
  .rates-table tbody th { padding: 0 0 8px; border-bottom: 1px solid var(--tint); font-weight: 600; }
  .rates-table tbody td { padding: 8px 0 0; border-bottom: 0; }
  .rates-table tbody td::before {
    content: attr(data-label); display: block; font-size: 12px; font-weight: 600;
    color: var(--graphite); margin-bottom: 4px;
  }
  .rates-table .rate-value, .rates-table .rate-unit, .rates-table .rate-note { width: auto; white-space: normal; }
  .rates-table input { width: 100%; max-width: none; font-size: 16px; }
  .rates-table .rate-note:empty { display: none; }
  .rates-table .rate-note { font-size: 13px; line-height: 1.6; }
}
