/* ============================================================
   MAKTAB ERP — MULTI-LANGUAGE FONT SYSTEM (Assamese & Urdu)
   ============================================================ */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Anek+Bangla:wght@400;500;600;700&family=Tiro+Bengali:ital@0;1&family=Noto+Serif+Bengali:wght@400;600;700&family=Noto+Naskh+Arabic:wght@400;500;600;700&family=Noto+Nastaliq+Urdu:wght@400;600;700&family=Amiri:ital,wght@0,400;0,700;1,400&display=swap');

/* --- Kalpurush (Assamese / Bengali Unicode) ---
   Locally-hosted webfont. unicode-range restricts it to the Bengali/Assamese
   script block (U+0980–U+09FF) so any Assamese text rendered anywhere in the
   system is automatically typeset in Kalpurush while Latin glyphs fall
   through to the following fonts in the stack. */
@font-face {
  font-family: 'Kalpurush';
  src: url('../fonts/Kalpurush.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0980-09FF;
}

:root {
  /* --- Language-Specific Font Definitions --- */
  /* Assamese */
  --font-as-serif: 'Kalpurush', 'Tiro Bengali', 'Noto Serif Bengali', serif;
  --font-as-sans: 'Kalpurush', 'Anek Bangla', sans-serif;
  
  /* Urdu */
  --font-ur-nastaliq: 'Noto Nastaliq Urdu', 'Amiri', serif;
  --font-ur-naskh: 'Noto Naskh Arabic', 'Amiri', serif;
}

/* ============================================================
   LANGUAGE CLASS & ATTRIBUTE SPECIFIC RULES
   ============================================================ */

/* --- Assamese Styling (lang="as") --- */
html[lang="as"] {
  --font-display: var(--font-as-serif);
  --font-body: var(--font-as-sans);
  line-height: 1.7;
}

html[lang="as"] body {
  font-family: var(--font-as-sans);
}

html[lang="as"] h1,
html[lang="as"] h2,
html[lang="as"] h3,
html[lang="as"] h4,
html[lang="as"] .hero h1,
html[lang="as"] .brand-text .b1,
html[lang="as"] .brand-text .b2 {
  font-family: var(--font-as-serif);
}

/* Font Style Variant: Assamese Traditional (Serif) */
html[lang="as"].font-variant-serif {
  --font-body: var(--font-as-serif);
}

/* --- Font Style Variant: Assamese Modern (Sans-Serif) */
html[lang="as"].font-variant-sans {
  --font-display: var(--font-as-sans);
  --font-body: var(--font-as-sans);
}

/* ============================================================
   ASSAMESE — LANGUAGE-AWARE TYPE TOKENS
   Centralized per-context typography override. English values
   stay untouched (tokens.css defaults); Assamese overrides each
   context so Kalpurush reads at the same visual weight as the
   Latin stack. Values are tuned for equal readability — NOT
   equal pixel sizes. Bengali digits also get a Kalpurush fallback
   through --font-mono.
   ============================================================ */

html[lang="as"] {
  --font-mono: 'IBM Plex Mono', 'Kalpurush', monospace;

  /* Display / headings */
  --t-hero: clamp(30px, 3.6vw, 46px);
  --t-h1: clamp(23px, 2.5vw, 30px);
  --t-h2: 28px;
  --t-cmd: clamp(21px, 2.6vw, 30px);
  --t-section: 16.5px;
  --t-section-lg: 17.5px;

  /* Cards */
  --t-card-title: 17px;
  --t-card-title-sm: 16px;
  --t-card-desc: 13.5px;
  --t-card-desc-sm: 13px;
  --t-lead: 17.5px;

  /* Body / data */
  --t-body: 16px;
  --t-text: 14px;
  --t-text-sm: 13.5px;
  --t-caption: 12.5px;
  --t-micro: 11.5px;
  --t-table-head: 12px;
  --t-activity-title: 14.5px;
  --t-activity-sub: 12.5px;

  /* Controls */
  --t-btn: 15.5px;
  --t-btn-sm: 14px;
  --t-btn-xs: 13px;
  --t-label: 14px;
  --t-input: 16.5px;
  --t-input-sm: 13.5px;
  --t-nav: 14px;
  --t-page-title: 17px;
  --t-badge: 12px;
  --t-modal-title: 19px;
  --t-kpi: 32px;
  --t-kpi-label: 14px;
  --t-pill: 13px;
  --t-tab: 14px;
  --t-toast: 14px;
  --t-tooltip: 12.5px;
  --t-breadcrumb: 14px;
}


/* --- Urdu Styling (lang="ur") --- */
html[lang="ur"] {
  --font-display: var(--font-ur-nastaliq);
  --font-body: var(--font-ur-naskh);
  direction: rtl;
  text-align: right;
}

html[lang="ur"] body {
  font-family: var(--font-ur-naskh);
  line-height: 1.85;
}

html[lang="ur"] h1,
html[lang="ur"] h2,
html[lang="ur"] h3,
html[lang="ur"] h4,
html[lang="ur"] .hero h1,
html[lang="ur"] .brand-text .b1,
html[lang="ur"] .brand-text .b2 {
  font-family: var(--font-ur-nastaliq);
  line-height: 1.6;
}

/* Font Style Variant: Urdu Naskh (Modern UI) */
html[lang="ur"].font-variant-naskh {
  --font-display: var(--font-ur-naskh);
  --font-body: var(--font-ur-naskh);
}

/* Font Style Variant: Urdu Nastaliq (Calligraphic) */
html[lang="ur"].font-variant-nastaliq {
  --font-display: var(--font-ur-nastaliq);
  --font-body: var(--font-ur-nastaliq);
}

/* ============================================================
   FONT-SIZE-ADJUST: MULTI-SCRIPT VISUAL SIZE EQUALIZATION
   ============================================================ */

/* Normalizes each script's rendered x-height to English body text
   (Plus Jakarta Sans x-height = 0.536 em). Values are tuned to the
   aspect each font reports to the browser (OS/2 sxHeight where set,
   Chrome-computed otherwise) so that Assamese and Urdu body text and
   headings read at the same visual size as English.

     font                     aspect   adjust    resulting scale
     Plus Jakarta Sans (en)    0.536    0.536    1.00x  (reference)
     Kalpurush (as)            0.461    0.536    1.16x
     Noto Naskh Arabic (ur)    0.410    0.47     1.15x
     Noto Nastaliq Urdu (ur)   0.536    0.67     1.25x   */

/* Assamese: single font family, one value everywhere.
   NOTE: this value must equal the reference Latin aspect (0.536);
   it intentionally differs from Kalpurush's own 0.461 so the browser
   scales Assamese up ~1.16x to English visual size. */
html[lang="as"] {
   font-size-adjust: 0.536;
}

/* Urdu body (Noto Naskh Arabic) */
html[lang="ur"] {
  font-size-adjust: 0.47;
}

/* Urdu display/headings (Noto Nastaliq Urdu) need extra up-scaling
   because its tall flourishes make the letter body look smaller */
html[lang="ur"] h1,
html[lang="ur"] h2,
html[lang="ur"] h3,
html[lang="ur"] h4,
html[lang="ur"] h5,
html[lang="ur"] h6,
html[lang="ur"] .hero h1,
html[lang="ur"] .brand-text .b1,
html[lang="ur"] .brand-text .b2,
html[lang="ur"] .cmd-title {
  font-size-adjust: 0.67;
}

/* Variants where the display font swaps to Naskh use the body value */
html[lang="ur"].font-variant-naskh h1,
html[lang="ur"].font-variant-naskh h2,
html[lang="ur"].font-variant-naskh h3,
html[lang="ur"].font-variant-naskh h4,
html[lang="ur"].font-variant-naskh h5,
html[lang="ur"].font-variant-naskh h6,
html[lang="ur"].font-variant-naskh .hero h1,
html[lang="ur"].font-variant-naskh .brand-text .b1,
html[lang="ur"].font-variant-naskh .brand-text .b2,
html[lang="ur"].font-variant-naskh .cmd-title {
  font-size-adjust: 0.47;
}

/* Tight headings need extra leading for the taller scaled glyphs.
   (Urdu headings already inherit line-height 1.6 from its h1-h4 rule.) */
html[lang="as"] .hero h1,
html[lang="as"] .section-head h2,
html[lang="as"] .page-head h2,
html[lang="as"] .cmd-title,
html[lang="as"] .login-brand h1 {
  line-height: 1.35;
}

/* ============================================================
   ASSAMESE — HERO TYPOGRAPHY
   The public homepage hero (index.php) sets its own English-size
   clamp inline. Kalpurush renders ~1.16x taller after font-size-adjust,
   so a dedicated Assamese scale keeps the two-line heading dominant
   without blowing up the whole hero. Eyebrow and lede stay balanced.
   ============================================================ */

html[lang="as"] .hero h1 {
  font-size: clamp(32px, 4.4vw, 56px);
  line-height: 1.4;
  letter-spacing: 0;
}

html[lang="as"] .hero p.lede {
  font-size: 17.5px;
  line-height: 1.85;
  max-width: 560px;
}

html[lang="as"] .hero .eyebrow {
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: none;
}

html[lang="as"] .about-intro {
  font-size: 18px;
  line-height: 1.85;
}

/* ============================================================
   ASSAMESE UI-CHROME LEADING (anti-clipping)
   Kalpurush renders visibly taller than Latin fonts (about 1.16x
   after font-size-adjust). Compact chrome that forces leading
   below ~1.4 or clips overflow can shave ascenders/descenders, so
   for Assamese we relax those values and let long sidebar labels
   wrap instead of clipping at the element edge.
   ============================================================ */

html[lang="as"] .sidebar-link,
html[lang="as"] .sidebar-ws-head {
   line-height: 1.6;
   white-space: normal;
   overflow: visible;
}

html[lang="as"] .sidebar-link .label,
html[lang="as"] .sidebar-ws-head .label {
  line-height: 1.5;
  white-space: normal;
  overflow: visible;
}

html[lang="as"] .action-card span {
   line-height: 1.55;
}

/* ============================================================
   ASSAMESE — PER-CONTEXT RENDERING REFINEMENT
   Kalpurush is ~1.16x taller after equalization. These rules stop
   long Assamese labels clipping / overflowing compact chrome while
   keeping the interface dense. No latin/English sizes are touched.
   ============================================================ */

/* Compact toolbar search */
html[lang="as"] .topbar-search-input {
  height: auto;
  min-height: 38px;
}

/* Compact report / export filter controls */
html[lang="as"] .report-filter select,
html[lang="as"] .report-filter input,
html[lang="as"] .export-input,
html[lang="as"] .export-select {
  min-height: 40px;
}

/* Buttons: let labels wrap instead of clipping the pill */
html[lang="as"] .btn,
html[lang="as"] .btn-sm,
html[lang="as"] .btn-ghost,
html[lang="as"] .btn-gold {
  white-space: normal;
  line-height: 1.35;
}
@media (max-width: 480px) {
  html[lang="as"] .btn { font-size: var(--t-text); }
}

/* Headings & titles: open leading so ascenders don't collide */
html[lang="as"] .page-header h1,
html[lang="as"] .page-head h2,
html[lang="as"] .cmd-title,
html[lang="as"] .section-head h2,
html[lang="as"] .workspace-card .ws-name,
html[lang="as"] .chart-card .head h4,
html[lang="as"] .queue-card .head h4,
html[lang="as"] .op-card .head h4,
html[lang="as"] .timeline-card .head h4,
html[lang="as"] .notif-card .head h4,
html[lang="as"] .modal-header h3,
html[lang="as"] .drawer-header h3,
html[lang="as"] .bulk-modal-header h3 {
  line-height: 1.35;
}

/* Tables: keep density while gaining Kalpurush leading */
html[lang="as"] .data-table th,
html[lang="as"] table th {
  padding-top: 12px;
  padding-bottom: 12px;
}
html[lang="as"] .data-table td,
html[lang="as"] .data-card table td,
html[lang="as"] table td {
  padding-top: 11px;
  padding-bottom: 11px;
}

/* Bulk spreadsheet: relax fixed row/column heights for script height
   (grid stays LTR for Urdu; this block only affects Assamese) */
html[lang="as"] .bulk-table thead th {
  height: auto;
  min-height: 38px;
}
html[lang="as"] .bulk-table tbody tr {
  height: auto;
  min-height: 40px;
}
html[lang="as"] .bulk-table tbody td {
  padding-top: 4px;
  padding-bottom: 4px;
}
html[lang="as"] .bulk-context-item select,
html[lang="as"] .bulk-context-item input {
  height: auto;
  min-height: 38px;
}
html[lang="as"] .bulk-search-box input {
  height: 34px;
}


/* ============================================================
   RTL LAYOUT ADJUSTMENTS FOR URDU
   ============================================================ */

html[dir="rtl"] .nav-inner {
  flex-direction: row-reverse;
}

html[dir="rtl"] .nav-links {
  flex-direction: row-reverse;
}

html[dir="rtl"] .hero-ctas {
  flex-direction: row-reverse;
}

html[dir="rtl"] .hero-ctas .btn svg {
  transform: rotate(180deg);
}

html[dir="rtl"] .mini-hier .row {
  flex-direction: row-reverse;
  text-align: right;
}

html[dir="rtl"] .mini-hier .row:not(:last-child)::after {
  left: auto;
  right: 15px;
}

html[dir="rtl"] .eco-card {
  text-align: right;
}

html[dir="rtl"] .eco-card::before {
  right: auto;
  left: 14px;
}

html[dir="rtl"] .eco-card .ic {
  margin-left: auto;
  margin-right: 0;
}

html[dir="rtl"] .eco-core {
  flex-direction: row-reverse;
  text-align: right;
}

html[dir="rtl"] .footer-bottom {
  flex-direction: row-reverse;
}

html[dir="rtl"] .hier-legend {
  flex-direction: row-reverse;
}

/* --- Admin Layout RTL Rules --- */
html[dir="rtl"] .app-layout {
  direction: rtl;
}

html[dir="rtl"] .app-topbar {
  flex-direction: row-reverse;
}

html[dir="rtl"] .app-topbar-left {
  flex-direction: row-reverse;
}

html[dir="rtl"] .topbar-search {
  margin-left: 0 !important;
  margin-right: 18px !important;
}

html[dir="rtl"] .topbar-search input {
  padding-left: 14px !important;
  padding-right: 32px !important;
  text-align: right;
}

html[dir="rtl"] .topbar-search svg {
  left: auto !important;
  right: 10px !important;
}

html[dir="rtl"] #topbarSearchResults {
  left: auto !important;
  right: 0 !important;
  text-align: right;
}

html[dir="rtl"] .sidebar {
  border-right: none;
  border-left: 1px solid var(--panel-line);
}

html[dir="rtl"] .sidebar-ws-head,
html[dir="rtl"] .sidebar-link {
  flex-direction: row-reverse;
  text-align: right;
}

html[dir="rtl"] .sidebar-ws-head .chev {
  margin-left: 0;
  margin-right: auto;
}

html[dir="rtl"] .sidebar-user {
  flex-direction: row-reverse;
  text-align: right;
}

html[dir="rtl"] .sidebar-toggle {
  right: auto;
  left: -12px;
  transform: rotate(180deg);
}

html[dir="rtl"] .table th,
html[dir="rtl"] .table td {
  text-align: right;
}

html[dir="rtl"] .form-group label {
  text-align: right;
}

html[dir="rtl"] .form-input,
html[dir="rtl"] .form-select,
html[dir="rtl"] textarea {
  text-align: right;
  direction: rtl;
}

html[dir="rtl"] .toast-container {
  left: 20px;
  right: auto;
}


/* ============================================================
   LANGUAGE SWITCHER WIDGET STYLES
   ============================================================ */

.i18n-switcher {
  position: relative;
  display: inline-block;
}

.i18n-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--panel-soft);
  color: var(--text);
  border: 1px solid var(--panel-line-strong);
  padding: 6px 13px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}

.i18n-btn:hover {
  background: var(--panel);
  border-color: var(--gold);
  color: var(--gold-bright);
}

.i18n-btn .globe-icon {
  width: 15px;
  height: 15px;
  stroke: var(--gold);
}

.i18n-btn .arrow-icon {
  width: 12px;
  height: 12px;
  stroke: var(--text-dim);
  transition: transform 0.2s ease;
}

.i18n-switcher.open .i18n-btn .arrow-icon {
  transform: rotate(180deg);
}

.i18n-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  background: var(--panel);
  border: 1px solid var(--panel-line-strong);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 999;
  display: none;
  backdrop-filter: blur(12px);
  animation: i18nFadeIn 0.2s ease-out;
}

html[dir="rtl"] .i18n-dropdown {
  right: auto;
  left: 0;
}

.i18n-switcher.open .i18n-dropdown {
  display: block;
}

@keyframes i18nFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.i18n-dropdown-header {
  font-size: 10px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  padding: 6px 10px 4px;
}

.i18n-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-s);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

html[dir="rtl"] .i18n-option {
  text-align: right;
  flex-direction: row-reverse;
}

.i18n-option:hover {
  background: rgba(198, 161, 91, 0.12);
  color: var(--gold-bright);
}

.i18n-option.active {
  background: rgba(198, 161, 91, 0.2);
  color: var(--gold-bright);
  font-weight: 700;
}

.i18n-option .lang-badge {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-faint);
  background: rgba(0,0,0,0.25);
  padding: 2px 6px;
  border-radius: 4px;
}

.i18n-option.active .lang-badge {
  color: var(--gold);
  background: rgba(198, 161, 91, 0.25);
}

.i18n-divider {
  height: 1px;
  background: var(--panel-line);
  margin: 6px 0;
}

/* Font Variant Selector Submenu */
.i18n-variant-picker {
  display: flex;
  gap: 4px;
  padding: 4px 6px;
  background: var(--ink-2);
  border-radius: var(--radius-s);
  margin-top: 4px;
}

.i18n-variant-btn {
  flex: 1;
  padding: 5px 8px;
  font-size: 11px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.i18n-variant-btn:hover {
  color: var(--text);
}

.i18n-variant-btn.active {
  background: var(--emerald-soft);
  color: var(--parchment);
  font-weight: 600;
}

/* ============================================================
   ORGANISATIONAL HIERARCHY TREE COMPONENT
   ============================================================ */
.hierarchy-section {
  padding-top: 80px;
  padding-bottom: 100px;
  position: relative;
}

.hier-stage {
  border: 1px solid var(--panel-line-strong);
  border-radius: var(--radius-l);
  padding: 70px 30px 50px;
  position: relative;
  overflow: hidden;
  background: radial-gradient(1200px 500px at 50% -20%, rgba(198,161,91,0.09), transparent 60%), var(--ink-2);
  box-shadow: var(--shadow-lg);
}

.tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
}

.node-btn {
  border: 1px solid var(--panel-line-strong);
  background: linear-gradient(160deg, var(--panel-soft), var(--panel));
  border-radius: 18px;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  position: relative;
  color: var(--text);
}

.node-btn:hover {
  border-color: var(--gold);
  box-shadow: 0 12px 30px -14px rgba(198,161,91,0.4);
}

.node-btn.active {
  border-color: var(--gold);
  background: linear-gradient(160deg, var(--emerald-soft), var(--panel-soft));
}

.node-btn .facet {
  width: 38px;
  height: 38px;
  flex: none;
}

.node-btn .facet svg {
  width: 100%;
  height: 100%;
}

.node-btn .txt {
  text-align: left;
}

html[dir="rtl"] .node-btn .txt {
  text-align: right;
}

.node-btn .txt .t1 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--parchment);
}

.node-btn .txt .t2 {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 2px;
}

.node-btn .chev {
  width: 14px;
  height: 14px;
  stroke: var(--text-faint);
  transition: transform 0.3s var(--ease);
  margin-left: 4px;
}

html[dir="rtl"] .node-btn .chev {
  margin-left: 0;
  margin-right: 4px;
}

.node-btn.active .chev {
  transform: rotate(180deg);
  stroke: var(--gold-bright);
}

.board-node .node-btn {
  padding: 22px 34px;
  border-radius: 22px;
}

.board-node .facet {
  width: 48px;
  height: 48px;
}

.board-node .txt .t1 {
  font-size: 17px;
}

.trunk {
  width: 1px;
  height: 46px;
  background: linear-gradient(var(--panel-line-strong), var(--panel-line));
}

.tier {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 14px;
  position: relative;
  padding-top: 46px;
  width: 100%;
}

.tier::before {
  content: '';
  position: absolute;
  top: 0;
  left: 8.33%;
  right: 8.33%;
  height: 1px;
  background: var(--panel-line-strong);
}

.tier > .node-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tier > .node-wrap::before {
  content: '';
  position: absolute;
  top: -46px;
  left: 50%;
  width: 1px;
  height: 46px;
  background: var(--panel-line-strong);
}

.tier .node-btn {
  width: 100%;
  justify-content: space-between;
}

.expand-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.55s var(--ease);
  width: 100%;
}

.expand-panel.open {
  grid-template-rows: 1fr;
}

.expand-panel > div {
  overflow: hidden;
}

.sub-tier {
  padding-top: 40px;
  position: relative;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.sub-tier::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 40px;
  background: var(--panel-line);
}

.maktab-chip {
  border: 1px solid var(--panel-line);
  border-radius: 14px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  transition: all 0.3s var(--ease);
  min-width: 190px;
}

.maktab-chip:hover {
  border-color: var(--emerald);
}

.maktab-chip.active {
  border-color: var(--emerald);
  background: rgba(74,156,126,0.08);
}

.maktab-chip .t1 {
  font-size: 13.2px;
  font-weight: 600;
  color: var(--text);
}

.maktab-chip .t2 {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-faint);
  margin-top: 3px;
}

.leaf-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.5s var(--ease);
}

.leaf-panel.open {
  grid-template-rows: 1fr;
}

.leaf-panel > div {
  overflow: hidden;
}

.leaf-stats {
  display: flex;
  gap: 10px;
  padding-top: 16px;
  justify-content: center;
}

.leaf-stat {
  border: 1px dashed var(--panel-line-strong);
  border-radius: 12px;
  padding: 10px 16px;
  text-align: center;
  min-width: 110px;
}

.leaf-stat .n {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--gold-bright);
  font-size: 17px;
}

.leaf-stat .l {
  font-size: 10.8px;
  color: var(--text-faint);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hier-legend {
  display: flex;
  gap: 28px;
  justify-content: center;
  margin-top: 54px;
  flex-wrap: wrap;
}

.hier-legend .item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  color: var(--text-faint);
  font-family: var(--font-mono);
}

.hier-legend .sw {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

@media (max-width: 1080px) {
  .tier { grid-template-columns: repeat(3, 1fr); row-gap: 40px; }
  .tier::before { display: none; }
}

@media (max-width: 640px) {
  .tier { grid-template-columns: 1fr; }
  .hier-stage { padding: 40px 16px 30px; border-radius: 20px; }
}
