:root {
  --kh-ink: #07131d;
  --kh-ink-soft: #173245;
  --kh-muted: #627686;
  --kh-line: #d8e5ea;
  --kh-surface: #ffffff;
  --kh-surface-soft: #f4f8f9;
  --kh-navy: #061522;
  --kh-navy-2: #0d3047;
  --kh-cyan: #0eb9d3;
  --kh-cyan-dark: #087ea7;
  --kh-gold: #e3a84f;
  --kh-danger: #c54e55;
  --kh-success: #178a72;
  --kh-radius: 24px;
  --kh-shadow: 0 24px 70px rgba(5, 28, 43, .12);
  --kh-container: min(1240px, calc(100vw - 40px));
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--kh-ink); background: var(--kh-surface); font-family: "Inter", "Vazirmatn", system-ui, sans-serif; line-height: 1.75; -webkit-font-smoothing: antialiased; }
html[dir="rtl"] body { font-family: "Vazirmatn", "Inter", system-ui, sans-serif; }
body.menu-open { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
svg { width: 1.35em; height: 1.35em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.kh-container { width: var(--kh-container); margin-inline: auto; }
.kh-skip { position: fixed; inset-block-start: 8px; inset-inline-start: 10px; z-index: 300; padding: 10px 16px; color: #fff; background: var(--kh-cyan-dark); border-radius: 10px; transform: translateY(-140%); transition: transform .2s; }
.kh-skip:focus { transform: none; }
.kh-progress { position: fixed; inset: 0 0 auto; z-index: 250; width: 0; height: 3px; background: linear-gradient(90deg, var(--kh-gold), #63e8f8); box-shadow: 0 0 14px #4edff1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.kh-header { position: sticky; inset-block-start: 0; z-index: 100; color: #fff; background: rgba(5, 18, 29, .9); border-bottom: 1px solid rgba(184, 245, 255, .12); backdrop-filter: blur(18px); }
.kh-nav { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.kh-brand { display: inline-flex; align-items: center; gap: 12px; min-width: 240px; }
.kh-brand img { flex: none; width: 50px; height: 40px; }
.kh-brand span { display: grid; line-height: 1.25; }
.kh-brand small { color: #88a9b8; font-size: .7rem; font-weight: 600; }
.kh-brand strong { margin-top: 4px; font-size: .78rem; font-weight: 800; }
.kh-desktop-nav { display: flex; align-items: center; gap: clamp(16px, 2vw, 30px); margin-inline: auto; }
.kh-desktop-nav a { position: relative; color: #bcd0d9; font-size: .82rem; font-weight: 600; white-space: nowrap; transition: color .2s; }
.kh-desktop-nav a::after { content: ""; position: absolute; inset: auto 50% -11px; width: 0; height: 2px; background: var(--kh-cyan); transition: .25s; }
.kh-desktop-nav a:hover { color: #fff; }
.kh-desktop-nav a:hover::after { inset-inline-start: 0; width: 100%; }
.kh-nav-actions { display: flex; align-items: center; gap: 9px; }
.kh-search-button, .kh-lang, .kh-menu-toggle { width: 42px; height: 42px; display: inline-grid; place-items: center; color: #c4dbe4; background: rgba(255,255,255,.04); border: 1px solid rgba(196,242,250,.17); border-radius: 12px; }
.kh-lang { width: auto; padding-inline: 12px; font-size: .73rem; font-weight: 800; letter-spacing: .08em; }
.kh-menu-toggle { display: none; cursor: pointer; }
.kh-menu-toggle .menu-close { display: none; }
.kh-menu-toggle[aria-expanded="true"] .menu-open { display: none; }
.kh-menu-toggle[aria-expanded="true"] .menu-close { display: block; }
.kh-mobile-menu { display: none; border-top: 1px solid rgba(255,255,255,.08); }
.kh-mobile-menu nav { padding-block: 16px 24px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; }
.kh-mobile-menu a { padding: 11px 13px; color: #d0e0e7; border-radius: 10px; }
.kh-mobile-menu a:hover { color: #fff; background: rgba(255,255,255,.06); }

.kh-button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 20px; border: 1px solid transparent; border-radius: 13px; font-size: .86rem; font-weight: 800; cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s; }
.kh-button:hover { transform: translateY(-2px); }
.kh-button-primary { color: #03151f; background: linear-gradient(135deg, #81effa, #24c5de); box-shadow: 0 10px 28px rgba(32, 196, 220, .2); }
.kh-button-primary:hover { box-shadow: 0 15px 36px rgba(32, 196, 220, .3); }
.kh-button-dark { color: #fff; background: var(--kh-navy); }
.kh-button-outline { color: var(--kh-ink); border-color: #b8ccd5; background: rgba(255,255,255,.7); }
.kh-button-quiet { padding-inline: 0; color: var(--kh-cyan-dark); background: transparent; }
.kh-button svg { flex: none; }

.kh-hero { position: relative; min-height: 680px; display: grid; align-items: end; overflow: hidden; color: #fff; background: var(--kh-navy); }
.kh-hero-media, .kh-hero-media::after { position: absolute; inset: 0; }
.kh-hero-media img { width: 100%; height: 100%; object-fit: cover; opacity: .84; }
.kh-hero-media::after { content: ""; background: linear-gradient(90deg, rgba(4,15,24,.98) 0%, rgba(4,15,24,.82) 43%, rgba(4,15,24,.22) 82%), linear-gradient(0deg, rgba(4,15,24,.88), transparent 55%); }
html[dir="rtl"] .kh-hero-media::after { background: linear-gradient(-90deg, rgba(4,15,24,.98) 0%, rgba(4,15,24,.82) 43%, rgba(4,15,24,.22) 82%), linear-gradient(0deg, rgba(4,15,24,.88), transparent 55%); }
.kh-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(25% - 1px), rgba(185,245,255,.06) 25%); }
.kh-hero-inner { position: relative; z-index: 2; padding-block: 100px 76px; }
.kh-hero-copy { max-width: 790px; }
.kh-breadcrumbs { margin-bottom: 26px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: #a9c2cd; font-size: .75rem; font-weight: 600; }
.kh-breadcrumbs a { display: inline-flex; align-items: center; gap: 7px; }
.kh-breadcrumbs i { width: 22px; height: 1px; background: rgba(255,255,255,.25); }
.kh-eyebrow { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 20px; color: #81eaf8; font-size: .7rem; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.kh-eyebrow::before { content: ""; width: 42px; height: 2px; background: var(--kh-gold); }
.kh-hero h1 { max-width: 900px; margin: 0; font-size: clamp(2.4rem, 5.2vw, 5.6rem); line-height: 1.08; letter-spacing: -.045em; }
html[dir="rtl"] .kh-hero h1 { letter-spacing: -.035em; }
.kh-hero h1 em { display: block; color: #77e9f8; font-style: normal; font-weight: 400; }
.kh-hero-copy > p { max-width: 720px; margin: 26px 0 0; color: #c2d5dd; font-size: clamp(1rem, 1.45vw, 1.18rem); }
.kh-hero-actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }
.kh-hero-actions .kh-button-outline { color: #fff; border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.04); }
.kh-hero-meta { margin-top: 56px; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid rgba(193,245,253,.16); border-bottom: 1px solid rgba(193,245,253,.16); }
.kh-hero-meta > div { min-height: 98px; padding: 20px 22px; display: grid; align-content: center; border-inline-end: 1px solid rgba(193,245,253,.13); }
.kh-hero-meta > div:last-child { border: 0; }
.kh-hero-meta small { color: #7598a7; font-size: .63rem; font-weight: 800; letter-spacing: .12em; }
.kh-hero-meta strong { margin-top: 5px; color: #eefcff; font-size: .85rem; }

.kh-section { padding-block: 110px; }
.kh-section-soft { background: var(--kh-surface-soft); }
.kh-section-dark { color: #fff; background: var(--kh-navy); }
.kh-section-head { max-width: 810px; margin-bottom: 48px; }
.kh-kicker { display: inline-flex; align-items: center; gap: 10px; color: var(--kh-cyan-dark); font-size: .7rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.kh-kicker::before { content: ""; width: 28px; height: 2px; background: var(--kh-gold); }
.kh-section h2, .kh-content h2 { margin: 13px 0 0; font-size: clamp(1.85rem, 3.4vw, 3.65rem); line-height: 1.22; letter-spacing: -.035em; }
.kh-section-head p { max-width: 700px; margin: 18px 0 0; color: var(--kh-muted); }
.kh-section-dark .kh-section-head p { color: #a8c0cb; }
.kh-grid { display: grid; gap: 20px; }
.kh-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kh-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kh-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kh-card { position: relative; padding: 28px; background: #fff; border: 1px solid var(--kh-line); border-radius: var(--kh-radius); overflow: hidden; transition: transform .25s, box-shadow .25s, border-color .25s; }
.kh-card:hover { transform: translateY(-5px); border-color: #a9dce5; box-shadow: var(--kh-shadow); }
.kh-card-icon { width: 50px; height: 50px; display: grid; place-items: center; color: var(--kh-cyan-dark); background: #eaf9fb; border: 1px solid #c8edf2; border-radius: 15px; }
.kh-card small { display: block; margin-top: 20px; color: #86a0ac; font-size: .65rem; font-weight: 800; letter-spacing: .12em; }
.kh-card h3 { margin: 9px 0 0; font-size: 1.15rem; line-height: 1.45; }
.kh-card p { margin: 11px 0 0; color: var(--kh-muted); font-size: .9rem; }
.kh-card-link { margin-top: 20px; display: inline-flex; align-items: center; gap: 8px; color: var(--kh-cyan-dark); font-size: .78rem; font-weight: 800; }
.kh-note { padding: 22px 24px; display: flex; gap: 15px; color: #284958; background: #eff9fa; border: 1px solid #c9e9ed; border-radius: 18px; }
.kh-note svg { flex: none; margin-top: 4px; color: var(--kh-cyan-dark); }
.kh-tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.kh-tag { padding: 7px 11px; color: #315565; background: #edf5f7; border: 1px solid #d7e7eb; border-radius: 999px; font-size: .68rem; font-weight: 700; }

/* Editorial article */
.article-hero { min-height: 770px; }
.article-shell { display: grid; grid-template-columns: 250px minmax(0, 760px) 210px; justify-content: center; gap: 52px; align-items: start; }
.article-toc { position: sticky; top: 110px; padding: 22px; background: #f3f8f9; border: 1px solid var(--kh-line); border-radius: 18px; }
.article-toc strong { display: block; margin-bottom: 12px; font-size: .77rem; }
.article-toc a { display: block; padding: 8px 0; color: #6c818c; border-bottom: 1px solid #e0eaed; font-size: .75rem; }
.article-toc a:last-child { border: 0; }
.article-toc a.is-active { color: var(--kh-cyan-dark); font-weight: 800; }
.article-body { min-width: 0; }
.article-lead { margin: 0 0 42px; padding-block-end: 36px; color: #214453; border-bottom: 1px solid var(--kh-line); font-size: 1.2rem; font-weight: 500; }
.article-body section { scroll-margin-top: 120px; margin-bottom: 58px; }
.article-body h2 { margin-bottom: 20px; font-size: clamp(1.55rem, 2.6vw, 2.25rem); }
.article-body h3 { margin: 30px 0 12px; font-size: 1.18rem; }
.article-body p { margin: 0 0 20px; color: #3e5967; }
.article-body ul { margin: 20px 0; padding-inline-start: 22px; color: #3e5967; }
.article-body li { margin-block: 8px; }
.article-figure { margin: 38px 0; padding: 16px; background: var(--kh-navy); border-radius: 26px; }
.article-figure img { width: 100%; border-radius: 17px; }
.article-figure figcaption { padding: 14px 8px 2px; color: #91acb8; font-size: .73rem; }
.article-callout { margin: 36px 0; padding: 30px; color: #fff; background: linear-gradient(135deg, #0b3349, #071923); border-radius: 23px; box-shadow: var(--kh-shadow); }
.article-callout svg { color: var(--kh-gold); }
.article-callout blockquote { margin: 14px 0 0; font-size: 1.25rem; font-weight: 700; line-height: 1.7; }
.article-checklist { counter-reset: point; display: grid; gap: 12px; }
.article-checklist li { list-style: none; margin: 0; padding: 16px 18px; display: flex; gap: 13px; background: #f4f8f9; border: 1px solid #dce8eb; border-radius: 14px; }
.article-checklist li::before { counter-increment: point; content: counter(point, decimal-leading-zero); color: var(--kh-cyan-dark); font-size: .75rem; font-weight: 900; }
.article-tools { position: sticky; top: 110px; display: grid; gap: 9px; }
.article-tools button, .article-tools a { min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 8px; color: #496574; background: #fff; border: 1px solid var(--kh-line); border-radius: 13px; font-size: .72rem; cursor: pointer; }
.article-tools [data-copy-state] { min-height: 20px; color: var(--kh-success); font-size: .68rem; text-align: center; }
.author-strip { padding: 30px; display: grid; grid-template-columns: 90px 1fr auto; align-items: center; gap: 22px; background: #eef7f8; border: 1px solid #d6e8eb; border-radius: 24px; }
.author-mark { width: 90px; height: 90px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #123f55, #0db0ca); border-radius: 24px; }
.author-mark svg { width: 36px; height: 36px; }
.author-strip h3 { margin: 0; }
.author-strip p { margin: 6px 0 0; color: var(--kh-muted); font-size: .84rem; }

/* Category and authors */
.filter-bar { margin-bottom: 34px; display: flex; flex-wrap: wrap; gap: 9px; }
.filter-button { padding: 9px 15px; color: #526b77; background: #fff; border: 1px solid #cfdfe4; border-radius: 999px; font-size: .75rem; font-weight: 700; cursor: pointer; }
.filter-button.is-active { color: #fff; background: var(--kh-navy-2); border-color: var(--kh-navy-2); }
.editorial-card { min-height: 330px; display: flex; flex-direction: column; }
.editorial-card .kh-tag-row { margin-bottom: 18px; }
.editorial-card h3 { font-size: 1.3rem; }
.editorial-card footer { margin-top: auto; padding-top: 24px; display: flex; align-items: center; justify-content: space-between; color: #80949f; border-top: 1px solid #e4edef; font-size: .7rem; }
.editorial-card.is-hidden { display: none; }
.category-feature { display: grid; grid-template-columns: 1.1fr .9fr; color: #fff; background: var(--kh-navy); border-radius: 30px; overflow: hidden; }
.category-feature figure { margin: 0; min-height: 420px; }
.category-feature img { width: 100%; height: 100%; object-fit: cover; }
.category-feature-copy { padding: clamp(30px, 5vw, 66px); align-self: center; }
.category-feature-copy h2 { font-size: clamp(1.8rem, 3vw, 3rem); }
.category-feature-copy p { color: #abc2cc; }
.authors-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }
.author-card { grid-column: span 4; min-height: 390px; padding: 28px; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--kh-line); border-radius: 26px; }
.author-card.featured { grid-column: span 8; display: grid; grid-template-columns: .8fr 1.2fr; gap: 32px; color: #fff; background: var(--kh-navy); }
.author-visual { min-height: 180px; display: grid; place-items: center; background: linear-gradient(145deg, #e7f7f9, #cbeff3); border-radius: 20px; overflow: hidden; }
.author-visual img { width: 100%; height: 100%; object-fit: cover; }
.author-symbol { width: 100px; height: 100px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #0a4058, #15b8d0); border-radius: 30px; }
.author-symbol svg { width: 44px; height: 44px; }
.author-card h3 { margin: 24px 0 4px; font-size: 1.35rem; }
.author-card.featured h3 { margin-top: 12px; font-size: 2rem; }
.author-card p { color: var(--kh-muted); font-size: .86rem; }
.author-card.featured p { color: #a9c1cb; }
.author-card .kh-card-link { margin-top: auto; }
.profile-hero-card { position: absolute; z-index: 3; inset-inline-end: max(20px, calc((100vw - 1240px)/2)); inset-block-end: 74px; width: min(360px, 35vw); padding: 26px; color: #fff; background: rgba(5,21,33,.76); border: 1px solid rgba(160,239,250,.25); border-radius: 24px; backdrop-filter: blur(16px); }
.profile-hero-card strong { display: block; font-size: 1.12rem; }
.profile-hero-card p { margin: 9px 0 0; color: #a9c3cd; font-size: .8rem; }
.timeline { position: relative; padding-inline-start: 32px; }
.timeline::before { content: ""; position: absolute; inset-block: 10px; inset-inline-start: 9px; width: 1px; background: #b8d8df; }
.timeline-item { position: relative; margin-bottom: 24px; padding: 24px; background: #fff; border: 1px solid var(--kh-line); border-radius: 18px; }
.timeline-item::before { content: ""; position: absolute; inset-inline-start: -29px; inset-block-start: 34px; width: 13px; height: 13px; background: var(--kh-cyan); border: 4px solid #eaf8fa; border-radius: 50%; }

/* Contact and support */
.contact-stage { display: grid; grid-template-columns: .9fr 1.1fr; gap: 30px; align-items: start; }
.contact-panel { padding: clamp(26px, 4vw, 50px); background: #fff; border: 1px solid var(--kh-line); border-radius: 28px; box-shadow: var(--kh-shadow); }
.contact-panel-dark { color: #fff; background: var(--kh-navy); border-color: transparent; }
.contact-panel h2 { margin: 0; font-size: clamp(1.6rem, 2.7vw, 2.6rem); }
.contact-panel > p { color: var(--kh-muted); }
.contact-panel-dark > p { color: #a8c1cb; }
.contact-channel { padding: 19px 0; display: grid; grid-template-columns: 48px 1fr; gap: 14px; border-bottom: 1px solid rgba(180,228,237,.14); }
.contact-channel:last-child { border: 0; }
.contact-channel i { width: 44px; height: 44px; display: grid; place-items: center; color: #7ce8f7; background: rgba(97,225,242,.09); border: 1px solid rgba(132,232,246,.18); border-radius: 13px; }
.contact-channel small { display: block; color: #7e9caa; font-size: .66rem; font-style: normal; font-weight: 800; letter-spacing: .08em; }
.contact-channel strong, .contact-channel a { margin-top: 3px; display: block; font-size: .9rem; }
.kh-form { margin-top: 32px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: grid; gap: 7px; }
.field-full { grid-column: 1 / -1; }
.field label, .field > span { color: #3c5a68; font-size: .76rem; font-weight: 800; }
.field input, .field select, .field textarea { width: 100%; min-height: 52px; padding: 12px 14px; color: var(--kh-ink); background: #f7fafb; border: 1px solid #ccdce2; border-radius: 13px; outline: 0; transition: border-color .2s, box-shadow .2s; }
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--kh-cyan); box-shadow: 0 0 0 4px rgba(14,185,211,.1); }
.field input[aria-invalid="true"], .field select[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--kh-danger); }
.field-error { color: var(--kh-danger); font-size: .68rem; }
.field-help { color: #82959e; font-size: .67rem; }
.form-check { grid-column: 1 / -1; display: flex; align-items: flex-start; gap: 10px; color: #647984; font-size: .73rem; }
.form-check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--kh-cyan-dark); }
.form-check a { color: var(--kh-cyan-dark); text-decoration: underline; }
.honeypot { position: absolute !important; inset-inline-start: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
.form-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.form-security { display: inline-flex; align-items: center; gap: 7px; color: #78909b; font-size: .68rem; }
.upload-box { position: relative; min-height: 116px; display: grid; place-items: center; padding: 20px; color: #607985; background: #f4f9fa; border: 1px dashed #a9cbd3; border-radius: 16px; text-align: center; cursor: pointer; }
.upload-box input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-box svg { color: var(--kh-cyan-dark); font-size: 1.4rem; }
.support-status { padding: 24px; display: grid; grid-template-columns: auto 1fr; gap: 15px; color: #fff; background: linear-gradient(135deg, #0b334a, #092334); border-radius: 20px; }
.support-status i { width: 46px; height: 46px; display: grid; place-items: center; color: #70e8f8; background: rgba(107,231,247,.09); border-radius: 14px; }
.support-status small { display: block; color: #7d9eac; font-size: .65rem; }
.support-status strong { display: block; margin-top: 3px; }
.map-card { min-height: 460px; position: relative; overflow: hidden; color: #fff; background: var(--kh-navy); border-radius: 30px; }
.map-card img { width: 100%; height: 100%; object-fit: cover; }
.map-card figcaption { position: absolute; inset: auto 24px 24px; padding: 20px; background: rgba(5,20,31,.82); border: 1px solid rgba(177,241,250,.18); border-radius: 18px; backdrop-filter: blur(10px); }

/* FAQ */
.faq-tools { margin-bottom: 32px; display: grid; grid-template-columns: 1fr auto; gap: 12px; }
.faq-search { min-height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 18px; background: #fff; border: 1px solid #cfdfe4; border-radius: 15px; }
.faq-search input { width: 100%; border: 0; outline: 0; background: transparent; }
.faq-category { display: flex; gap: 8px; }
.faq-list { display: grid; gap: 12px; }
.faq-item { background: #fff; border: 1px solid var(--kh-line); border-radius: 17px; overflow: hidden; }
.faq-question { width: 100%; padding: 20px 22px; display: grid; grid-template-columns: 34px 1fr auto; gap: 13px; align-items: center; color: var(--kh-ink); background: transparent; border: 0; text-align: start; cursor: pointer; }
.faq-question > span:first-child { color: var(--kh-cyan-dark); font-size: .68rem; font-weight: 900; }
.faq-question strong { font-size: .92rem; }
.faq-question svg { transition: transform .2s; }
.faq-question[aria-expanded="true"] svg { transform: rotate(180deg); }
.faq-answer { padding: 0 69px 22px 22px; color: #526c78; font-size: .86rem; }
html[dir="rtl"] .faq-answer { padding: 0 22px 22px 69px; }
.faq-item.is-hidden { display: none; }
.faq-empty { padding: 36px; color: var(--kh-muted); background: #fff; border: 1px dashed #bdd1d8; border-radius: 18px; text-align: center; }

/* Legal */
.legal-hero { min-height: 560px; }
.legal-layout { display: grid; grid-template-columns: 280px minmax(0, 800px); justify-content: center; gap: 58px; }
.legal-nav, .legal-content, .legal-summary { min-width: 0; }
.legal-nav { position: sticky; top: 110px; padding: 24px; background: #f2f7f8; border: 1px solid var(--kh-line); border-radius: 20px; }
.legal-nav small { color: #78909b; font-size: .65rem; font-weight: 900; letter-spacing: .1em; }
.legal-nav a { display: block; padding: 10px 0; color: #607783; border-bottom: 1px solid #dce8eb; font-size: .76rem; }
.legal-nav a:last-of-type { border: 0; }
.legal-nav a.is-active { color: var(--kh-cyan-dark); font-weight: 800; }
.legal-content section { scroll-margin-top: 120px; margin-bottom: 52px; }
.legal-content h2 { margin: 0 0 18px; font-size: 1.65rem; }
.legal-content h3 { margin: 28px 0 8px; font-size: 1.02rem; }
.legal-content p, .legal-content li { color: #4d6672; font-size: .9rem; }
.legal-content ul { padding-inline-start: 22px; }
.legal-summary { margin-bottom: 46px; padding: 28px; background: #eef8f9; border-inline-start: 4px solid var(--kh-cyan); border-radius: 16px; }
.legal-summary strong { display: block; margin-bottom: 6px; }
.cookie-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.cookie-table th, .cookie-table td { padding: 14px; border: 1px solid var(--kh-line); text-align: start; vertical-align: top; }
.cookie-table th { background: #edf5f7; }
.preference-panel { padding: 28px; display: grid; gap: 14px; background: #fff; border: 1px solid var(--kh-line); border-radius: 22px; box-shadow: var(--kh-shadow); }
.preference-row { padding: 15px 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid #e3ecef; }
.preference-row:last-child { border: 0; }
.preference-row small { display: block; color: #7a909a; }
.switch { width: 48px; height: 26px; position: relative; flex: none; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: absolute; inset: 0; background: #bacbd1; border-radius: 999px; cursor: pointer; transition: .2s; }
.switch span::after { content: ""; position: absolute; top: 4px; inset-inline-start: 4px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 2px 5px rgba(0,0,0,.18); }
.switch input:checked + span { background: var(--kh-cyan-dark); }
.switch input:checked + span::after { transform: translateX(22px); }
html[dir="rtl"] .switch input:checked + span::after { transform: translateX(-22px); }

/* System pages */
.system-main { min-height: calc(100vh - 82px); position: relative; display: grid; place-items: center; overflow: hidden; color: #fff; background: var(--kh-navy); }
.system-main::before { content: ""; position: absolute; inset: 0; background: url("../assets/img/portal-system-orbit.svg") center/cover no-repeat; opacity: .72; }
.system-card { position: relative; z-index: 2; width: min(720px, calc(100vw - 40px)); margin-block: 90px; padding: clamp(30px, 6vw, 70px); background: rgba(5,20,31,.74); border: 1px solid rgba(170,239,249,.2); border-radius: 32px; box-shadow: 0 30px 100px rgba(0,0,0,.35); backdrop-filter: blur(18px); text-align: center; }
.system-icon { width: 90px; height: 90px; margin: 0 auto 26px; display: grid; place-items: center; color: #061b26; background: linear-gradient(145deg, #d7ffff, #43d7e9); border-radius: 28px; box-shadow: 0 0 50px rgba(61,216,235,.25); }
.system-icon svg { width: 42px; height: 42px; }
.system-code { color: #78e9f7; font-size: .68rem; font-weight: 900; letter-spacing: .18em; }
.system-card h1 { margin: 12px 0 0; font-size: clamp(2.1rem, 5vw, 4.6rem); line-height: 1.1; letter-spacing: -.04em; }
.system-card > p { max-width: 550px; margin: 20px auto 0; color: #aec4cd; }
.system-actions { margin-top: 30px; display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.reference-box { margin: 28px auto 0; padding: 15px 18px; display: flex; align-items: center; justify-content: center; gap: 12px; color: #b9d0d8; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); border-radius: 14px; }
.reference-box code { color: #fff; font-family: "Inter", monospace; font-weight: 800; }
.reference-box button { display: grid; place-items: center; color: #74e8f7; background: transparent; border: 0; cursor: pointer; }
.search-hero { min-height: 480px; }
.search-box-large { max-width: 860px; margin-top: 30px; min-height: 68px; display: flex; align-items: center; gap: 13px; padding: 0 12px 0 23px; background: #fff; border-radius: 18px; box-shadow: 0 20px 50px rgba(0,0,0,.22); }
html[dir="rtl"] .search-box-large { padding: 0 23px 0 12px; }
.search-box-large svg { color: var(--kh-cyan-dark); }
.search-box-large input { min-width: 0; flex: 1; color: var(--kh-ink); background: transparent; border: 0; outline: 0; }
.search-results-head { margin-bottom: 30px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.search-results-head h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.8rem); }
.search-results-head span { color: #7c919b; font-size: .8rem; }
.search-result { padding: 28px 0; display: grid; grid-template-columns: 54px 1fr auto; gap: 20px; align-items: center; border-bottom: 1px solid var(--kh-line); }
.search-result:last-child { border-bottom: 0; }
.search-result-index { color: var(--kh-cyan-dark); font-size: .75rem; font-weight: 900; }
.search-result h3 { margin: 0; font-size: 1.18rem; }
.search-result p { margin: 6px 0 0; color: var(--kh-muted); font-size: .83rem; }
.search-result > svg { color: var(--kh-cyan-dark); }
.search-empty { padding: 70px 30px; color: var(--kh-muted); background: #f3f8f9; border: 1px dashed #b9d0d7; border-radius: 24px; text-align: center; }
.search-empty svg { width: 42px; height: 42px; color: #8eb4c0; }

.kh-footer { color: #fff; background: #04111a; border-top: 1px solid rgba(177,239,248,.1); }
.kh-footer-top { padding-block: 78px 54px; display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 55px; }
.kh-footer-brand p { max-width: 360px; margin: 20px 0 0; color: #7e9ba8; font-size: .82rem; }
.kh-footer nav { display: grid; align-content: start; gap: 9px; }
.kh-footer nav h2 { margin: 0 0 8px; color: #dffbff; font-size: .76rem; }
.kh-footer nav a { color: #7f9ba7; font-size: .75rem; transition: color .2s; }
.kh-footer nav a:hover { color: #69e2f2; }
.kh-footer-bottom { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #66838f; border-top: 1px solid rgba(177,239,248,.1); font-size: .68rem; }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.toast { position: fixed; z-index: 400; inset-inline-end: 20px; inset-block-end: 20px; max-width: 340px; padding: 14px 18px; color: #fff; background: #0a3348; border: 1px solid rgba(157,238,249,.28); border-radius: 13px; box-shadow: var(--kh-shadow); transform: translateY(130%); transition: transform .25s; }
.toast.is-visible { transform: none; }

@media (max-width: 1100px) {
  .kh-desktop-nav, .kh-nav-cta { display: none; }
  .kh-menu-toggle { display: inline-grid; }
  .kh-mobile-menu.is-open { display: block; }
  .kh-hero { min-height: 640px; }
  .kh-hero-inner { padding-block: 82px 56px; }
  .kh-hero-copy { max-width: 760px; min-width: 0; }
  .kh-hero h1 { max-width: 100%; font-size: clamp(2.5rem, 5.6vw, 4.6rem); overflow-wrap: anywhere; }
  .kh-hero-copy > p, .kh-hero-meta, .kh-hero-meta > div { min-width: 0; overflow-wrap: anywhere; }
  .kh-hero-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kh-hero-meta > div:nth-child(2) { border-inline-end: 0; }
  .kh-hero-meta > div:nth-child(-n+2) { border-bottom: 1px solid rgba(193,245,253,.13); }
  .article-shell { grid-template-columns: 210px minmax(0, 1fr); gap: 36px; }
  .article-tools { position: static; grid-column: 2; grid-template-columns: repeat(2, 1fr); }
  .kh-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .author-card { grid-column: span 6; }
  .author-card.featured { grid-column: span 12; }
}

@media (max-width: 820px) {
  :root { --kh-container: min(100% - 28px, 720px); }
  .kh-nav { min-height: 72px; }
  .kh-brand { min-width: 0; }
  .kh-brand span { display: none; }
  .kh-brand img { width: 46px; }
  .kh-hero { min-height: 620px; }
  .kh-hero-inner { padding-block: 76px 48px; }
  .kh-hero-meta { grid-template-columns: repeat(2, 1fr); }
  .kh-hero-meta > div:nth-child(2) { border-inline-end: 0; }
  .kh-hero-meta > div:nth-child(-n+2) { border-bottom: 1px solid rgba(193,245,253,.13); }
  .kh-section { padding-block: 76px; }
  .kh-grid-3, .kh-grid-2 { grid-template-columns: 1fr; }
  .article-shell, .legal-layout { grid-template-columns: minmax(0, 1fr); }
  .article-toc, .legal-nav { position: static; }
  .article-tools { grid-column: 1; }
  .category-feature { grid-template-columns: 1fr; }
  .category-feature figure { min-height: 300px; }
  .contact-stage { grid-template-columns: 1fr; }
  .profile-hero-card { position: relative; inset: auto; width: var(--kh-container); margin: -35px auto 40px; }
  .faq-tools { grid-template-columns: 1fr; }
  .faq-category { overflow-x: auto; padding-bottom: 5px; }
  .kh-footer-top { grid-template-columns: repeat(2, 1fr); }
  .kh-footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .kh-nav-actions { gap: 6px; }
  .kh-search-button { display: none; }
  .kh-hero h1 { font-size: 2.35rem; }
  .kh-hero-meta { grid-template-columns: 1fr; }
  .kh-hero-meta > div { min-height: 76px; border-inline-end: 0; border-bottom: 1px solid rgba(193,245,253,.13); }
  .kh-hero-meta > div:nth-child(3) { border-bottom: 1px solid rgba(193,245,253,.13); }
  .kh-hero-meta > div:last-child { border-bottom: 0; }
  .kh-grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field-full, .form-check, .form-actions { grid-column: 1; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .form-actions .kh-button { width: 100%; }
  .authors-grid { display: grid; grid-template-columns: 1fr; }
  .author-card, .author-card.featured { grid-column: 1; display: flex; }
  .author-strip { grid-template-columns: 70px 1fr; }
  .author-mark { width: 70px; height: 70px; }
  .author-strip .kh-button { grid-column: 1 / -1; }
  .article-toc { overflow-x: auto; white-space: nowrap; }
  .article-toc a { display: inline-block; margin-inline-end: 15px; border: 0; }
  .article-tools { grid-template-columns: 1fr; }
  .faq-question { grid-template-columns: 26px 1fr auto; padding: 17px; }
  .faq-answer, html[dir="rtl"] .faq-answer { padding: 0 17px 20px; }
  .legal-layout { width: 100%; gap: 28px; }
  .legal-nav, .legal-content, .legal-summary { width: 100%; max-width: 100%; }
  .legal-nav { padding: 18px; overflow: hidden; }
  .legal-content section { margin-bottom: 34px; }
  .legal-summary { padding: 20px; }
  .cookie-table { display: block; max-width: 100%; overflow-x: auto; }
  .search-box-large { min-height: 58px; }
  .search-box-large .kh-button { display: none; }
  .search-result { grid-template-columns: 36px 1fr; }
  .search-result > svg { display: none; }
  .kh-footer-top { grid-template-columns: 1fr; gap: 34px; }
  .kh-footer-brand { grid-column: auto; }
  .kh-footer-bottom { padding-block: 20px; align-items: flex-start; flex-direction: column; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .reveal { opacity: 1; transform: none; }
}
