/* JournalFit — an editor's desk: white proof sheets on a cool desk, marked up in blue pencil. */
:root {
  --paper: #ffffff;
  --desk: #eef2f6;
  --desk-2: #e3e9f0;
  --ink: #17212e;
  --muted: #586374;
  --line: #d6dde6;
  --pencil: #2453c7;
  --pencil-ink: #1b3f9c;
  --pencil-wash: #e8eefc;
  --mark: #c0392b;
  --mark-bg: #fcebe9;
  --ok: #1e7b4f;
  --ok-bg: #e2f2e9;
  --warn: #8a5300;
  --warn-bg: #fff2d8;
  --tex: #0d6e57;
  --tex-wash: #e1f3ed;
  --code-bg: #f6f8fb;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --head: var(--serif);
  --r-sheet: 3px;
  --r-ctl: 8px;
  --shadow-sheet: 0 1px 0 rgba(23, 33, 46, .04), 0 10px 30px -12px rgba(23, 33, 46, .22);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1b2330; --desk: #121821; --desk-2: #19212c; --ink: #e8edf3; --muted: #a2adbb;
    --line: #2d3848; --pencil: #7da2ff; --pencil-ink: #a9c1ff; --pencil-wash: #1f2c4a;
    --mark: #ff8a7d; --mark-bg: #3a1f1d; --ok: #6fd3a0; --ok-bg: #173327; --warn: #f3c26b; --warn-bg: #3a2c12;
    --tex: #5fd3b0; --tex-wash: #143229; --code-bg: #151c27;
    --shadow-sheet: 0 10px 30px -12px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1b2330; --desk: #121821; --desk-2: #19212c; --ink: #e8edf3; --muted: #a2adbb;
  --line: #2d3848; --pencil: #7da2ff; --pencil-ink: #a9c1ff; --pencil-wash: #1f2c4a;
  --mark: #ff8a7d; --mark-bg: #3a1f1d; --ok: #6fd3a0; --ok-bg: #173327; --warn: #f3c26b; --warn-bg: #3a2c12;
  --tex: #5fd3b0; --tex-wash: #143229; --code-bg: #151c27;
  color-scheme: dark;
}
html[lang="ar"] { --head: "Noto Naskh Arabic", var(--serif); --sans: "IBM Plex Sans Arabic", "IBM Plex Sans", system-ui, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--desk); color: var(--ink);
  font: 400 1rem/1.6 var(--sans); -webkit-font-smoothing: antialiased;
}
html[lang="ar"] body { line-height: 1.8; }
img, svg { display: block; }
a { color: var(--pencil-ink); }
h1, h2, h3, h4 { font-family: var(--head); line-height: 1.2; margin: 0; letter-spacing: -0.005em; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { letter-spacing: 0; line-height: 1.45; }
h2 { font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.35rem); font-weight: 600; }
h3 { font-size: 1.2rem; font-weight: 600; }
h4 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--pencil); outline-offset: 2px; border-radius: 4px; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--paper); padding: 8px 14px; z-index: 50; border-radius: var(--r-ctl); }
.skip:focus { top: 12px; }
.section-lede { color: var(--muted); max-width: 62ch; margin-top: 10px; font-size: 1.05rem; }
.hint { color: var(--muted); font-size: .9rem; margin-top: 14px; max-width: 75ch; }

/* ------------------------------------------------------------ nav */
.nav { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--desk) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.nav-in { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink);
  font: 700 1.25rem/1 var(--serif); }
.brand-mark { width: 30px; height: 30px; color: var(--ink); }
.nav-links { display: flex; gap: 22px; margin-inline-start: auto; }
.nav-links a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: .95rem; white-space: nowrap; }
.nav-links a:hover { color: var(--ink); }
.lang { font: 600 .95rem/1 var(--sans); background: var(--paper); color: var(--ink); border: 1px solid var(--line);
  padding: 9px 14px; border-radius: 999px; cursor: pointer; }
.lang:hover { border-color: var(--pencil); }
@media (max-width: 1100px) { .nav-links { gap: 16px; } }
@media (max-width: 960px) { .nav-links { display: none; } .lang { margin-inline-start: auto; } }

/* ------------------------------------------------------------ buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px;
  padding: 0 22px; border-radius: var(--r-ctl); font: 600 1rem/1 var(--sans); text-decoration: none;
  border: 1px solid transparent; cursor: pointer; transition: background .15s, border-color .15s, transform .1s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--pencil); color: #fff; }
:root[data-theme="dark"] .btn-primary, .btn-primary { color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #0d1526; } }
.btn-primary:hover { background: var(--pencil-ink); }
.btn-primary:disabled { background: var(--desk-2); color: var(--muted); cursor: not-allowed; transform: none; }
.btn-quiet { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn-quiet:hover { border-color: var(--pencil); color: var(--pencil-ink); }
.btn-big { min-height: 54px; padding: 0 30px; font-size: 1.08rem; }

/* ------------------------------------------------------------ hero */
.hero { padding: clamp(40px, 7vw, 92px) 0 clamp(40px, 6vw, 80px); }
.hero-in { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 1.4rem + 3.4vw, 4rem); font-weight: 700; line-height: 1.04; max-width: 14ch; }
html[lang="ar"] .hero h1 { line-height: 1.3; max-width: 16ch; }
.lede { font-size: 1.12rem; color: var(--muted); margin-top: 22px; max-width: 54ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-facts { list-style: none; padding: 0; margin: 38px 0 0; display: flex; flex-wrap: wrap; gap: 14px 34px; }
.hero-facts li { display: grid; color: var(--muted); font-size: .92rem; }
.hero-facts strong { font: 700 1.5rem/1.2 var(--serif); color: var(--ink); }
@media (max-width: 900px) { .hero-in { grid-template-columns: 1fr; } .morph { max-width: 560px; } }

/* the before → after sheets */
.morph { margin: 0; display: grid; grid-template-columns: 1fr auto 1.15fr; align-items: center; gap: 14px; position: relative; }
.sheet { background: var(--paper); border-radius: var(--r-sheet); box-shadow: var(--shadow-sheet);
  aspect-ratio: 210 / 297; padding: 9% 9%; display: flex; flex-direction: column; gap: 5px; overflow: hidden; }
.sheet .l { display: block; height: 5px; border-radius: 2px; background: var(--line); }
.sheet .l.s { width: 55%; }
.sheet-before { transform: rotate(-3deg); opacity: .92; }
.sheet-before .l { height: 6px; margin-bottom: 3px; }
.sheet-before .l.t { height: 9px; width: 70%; background: var(--muted); opacity: .55; }
.sheet-before .l.h { width: 40%; margin-top: 8px; background: var(--muted); opacity: .45; }
.sheet-before .l:nth-child(4) { width: 88%; margin-inline-start: 10%; }
.sheet-before .l:nth-child(9) { width: 76%; }
.morph-arrow { width: 54px; color: var(--pencil); }
html[dir="rtl"] .morph-arrow svg { transform: scaleX(-1); }
.sheet-after { gap: 0; padding: 8% 7%; }
.sa-head { display: grid; justify-items: center; gap: 4px; margin-bottom: 8px; }
.sa-head .l.t { width: 78%; height: 8px; background: var(--ink); opacity: .82; }
.sa-head .l.a { width: 46%; background: var(--pencil); opacity: .55; }
.sa-head .l.a2 { width: 34%; }
.sa-abs { display: grid; gap: 3px; padding: 6px 0 8px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.sa-abs .l { height: 3.5px; }
.sa-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 9%; transition: grid-template-columns .6s ease; }
.sa-cols > div { display: grid; gap: 4px; align-content: start; }
.sa-cols .l { height: 3.5px; }
.sa-cols .l.h { width: 52%; height: 4.5px; background: var(--ink); opacity: .7; margin-top: 4px; }
.sa-cols .fig { display: block; aspect-ratio: 4 / 3; background: var(--pencil-wash); border: 1px solid color-mix(in srgb, var(--pencil) 35%, transparent); border-radius: 2px; margin: 4px 0; }
.sa-cols .tbl { display: block; height: 30px; margin: 4px 0; border-top: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  background: repeating-linear-gradient(to bottom, transparent 0 9px, var(--line) 9px 10px); opacity: .8; }
.morph.one .sa-cols { grid-template-columns: 1fr 0fr; gap: 0; }
.morph.one .sa-cols > div:last-child { opacity: 0; }
.morph.one .sa-head { justify-items: start; }
.morph-cap { position: absolute; inset-inline-end: 0; bottom: -40px; font-size: .92rem; color: var(--muted); }
.morph-cap b { color: var(--pencil-ink); font-weight: 600; transition: opacity .3s; }
@media (prefers-reduced-motion: no-preference) {
  .sheet-after .l, .sheet-after .fig, .sheet-after .tbl { animation: ink .7s both; }
  .sa-head .l { animation-delay: .2s !important; }
  .sa-abs .l { animation-delay: .35s !important; }
  .sa-cols > div:first-child > * { animation-delay: .5s !important; }
  .sa-cols > div:last-child > * { animation-delay: .65s !important; }
  @keyframes ink { from { opacity: 0; transform: scaleX(.3); transform-origin: left; } }
}

/* ------------------------------------------------------------ tool */
.tool { padding: 40px 0 80px; }
.workspace { margin-top: 28px; background: var(--paper); border-radius: 14px; box-shadow: var(--shadow-sheet);
  border: 1px solid var(--line); }
.step { padding: clamp(20px, 3vw, 34px); border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: 0; }
.step-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.step-n { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font: 700 1rem/1 var(--serif); color: var(--pencil-ink); border: 2px solid var(--pencil); }
.step.done .step-n { background: var(--pencil); color: #fff; border-color: var(--pencil); }
.step-sub { color: var(--muted); font-size: .95rem; margin-top: 2px; }

.drop { display: flex; align-items: center; gap: 18px; padding: 26px; border: 2px dashed var(--line);
  border-radius: 12px; cursor: pointer; background: var(--desk); transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--pencil); background: var(--pencil-wash); }
.drop:focus-within { outline: 3px solid var(--pencil); outline-offset: 2px; }
.drop-icon { width: 44px; color: var(--pencil); flex: none; }
.drop-text { display: grid; color: var(--muted); }
.drop-text b { color: var(--ink); font-size: 1.05rem; }
.drop-file { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ok);
  background: var(--ok-bg); padding: 8px 12px; border-radius: var(--r-ctl); max-width: 48%; overflow: hidden; }
.drop-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop.has-file { border-style: solid; border-color: var(--ok); background: var(--paper); }
.drop-sm { padding: 20px; }
@media (max-width: 640px) { .drop { flex-wrap: wrap; } .drop-file { margin-inline-start: 0; max-width: 100%; } }

.tabs { display: inline-flex; padding: 4px; background: var(--desk); border-radius: 10px; gap: 4px; margin-bottom: 18px; }
.tabs button { font: 600 .95rem/1 var(--sans); border: 0; background: transparent; color: var(--muted);
  padding: 11px 16px; border-radius: 7px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(23,33,46,.12); }

.filter { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
.search { position: relative; flex: 1 1 260px; max-width: 380px; }
.search svg { position: absolute; inset-inline-start: 12px; top: 50%; translate: 0 -50%; width: 18px; color: var(--muted); }
.search input { width: 100%; height: 44px; padding-inline: 40px 12px; font: 400 1rem var(--sans); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--paper); }
.search input:focus { outline: 2px solid var(--pencil); border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: 500 .88rem/1 var(--sans); padding: 9px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--paper); color: var(--muted); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(214px, 1fr)); gap: 12px;
  max-height: 560px; overflow: auto; padding: 4px; margin: -4px; }
.tpl { position: relative; display: grid; grid-template-columns: 62px 1fr; gap: 14px; align-items: start; text-align: start;
  padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); cursor: pointer;
  font: inherit; color: inherit; transition: border-color .12s, box-shadow .12s; }
.tpl:hover { border-color: var(--pencil); }
.tpl[aria-checked="true"] { border-color: var(--pencil); box-shadow: 0 0 0 2px var(--pencil); background: var(--pencil-wash); }
.tpl[aria-checked="true"]::after { content: ""; position: absolute; top: 10px; inset-inline-end: 10px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--pencil) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat; }
.tpl-body { display: grid; min-width: 0; }
.tpl-name { display: block; font-weight: 600; line-height: 1.3; font-size: .97rem; padding-inline-end: 18px; }
.tpl-pub { display: block; color: var(--muted); font-size: .85rem; margin-top: 2px; }
.tpl-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.tag { font-size: .74rem; padding: 3px 7px; border-radius: 5px; background: var(--desk); color: var(--muted); white-space: nowrap; }
.empty { padding: 26px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; }

/* mini page drawn from a format's rules */
.mini { width: 62px; aspect-ratio: 210 / 297; background: var(--paper); border: 1px solid var(--line); border-radius: 2px;
  padding: 7px 6px; display: flex; flex-direction: column; gap: 2px; position: relative; box-shadow: 0 2px 6px -2px rgba(23,33,46,.2); }
.mini.letter { aspect-ratio: 216 / 279; }
.mini i { display: block; height: 2px; background: var(--line); border-radius: 1px; }
.mini .mt { height: 3.5px; background: var(--ink); opacity: .75; width: 80%; margin: 0 auto 2px; }
.mini.left .mt { margin-inline: 0; }
.mini .ma { width: 50%; margin: 0 auto 3px; background: var(--pencil); opacity: .6; }
.mini.left .ma { margin-inline: 0; }
.mini .mc { display: grid; grid-template-columns: 1fr; gap: 2px 4px; }
.mini.two .mc { grid-template-columns: 1fr 1fr; }
.mini.indent .mc { padding-inline-start: 34%; }
.mini.indent .ma, .mini.indent .mt { margin-inline-start: 0; }
.mini.ln::before { content: ""; position: absolute; inset-block: 16px 7px; inset-inline-start: 2px; width: 1.5px;
  background: repeating-linear-gradient(var(--pencil) 0 1.5px, transparent 1.5px 4px); opacity: .55; }
.mini.rtl { direction: rtl; }

.analysis { margin-top: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 10px; }
.analysis-page { color: var(--muted); margin: 6px 0 12px; font-size: .95rem; }
.analysis-logos { margin: -4px 0 12px; padding: 9px 12px; border-radius: 8px; font-size: .93rem; }
.analysis-logos.ok { background: var(--ok-bg); color: var(--ok); }
.analysis-logos.none { background: var(--warn-bg); color: var(--warn); }
.map { width: 100%; border-collapse: collapse; font-size: .93rem; }
.map th { text-align: start; font-weight: 600; color: var(--muted); font-size: .85rem; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.map td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.map tr:last-child td { border-bottom: 0; }
.src { font-size: .76rem; padding: 2px 7px; border-radius: 5px; margin-inline-start: 8px; white-space: nowrap; }
.src.template { background: var(--ok-bg); color: var(--ok); }
.src.learned, .src.derived { background: var(--pencil-wash); color: var(--pencil-ink); }
.src.default { background: var(--warn-bg); color: var(--warn); }
.tip { margin-top: 16px; color: var(--muted); }
.tip summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.tip ul { margin: 10px 0 0; padding-inline-start: 20px; }

.go-row { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.check { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.check.off { opacity: .5; cursor: not-allowed; }
.pdf-off { margin: 0; flex-basis: 100%; }
.check input { width: 20px; height: 20px; accent-color: var(--pencil); }
.progress { margin-top: 18px; }
.progress .bar { height: 6px; border-radius: 3px; background: var(--desk-2); overflow: hidden; }
.progress .bar span { display: block; height: 100%; width: 35%; background: var(--pencil); border-radius: 3px; animation: slide 1.3s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
html[dir="rtl"] .progress .bar span { animation-name: slide-rtl; }
@keyframes slide-rtl { from { transform: translateX(100%); } to { transform: translateX(-300%); } }
.progress p { color: var(--muted); margin-top: 8px; font-size: .95rem; }
.alert { margin-top: 18px; padding: 14px 16px; border-radius: 10px; background: var(--mark-bg); color: var(--mark); font-weight: 500; }

/* ------------------------------------------------------------ result */
.result { margin-top: 22px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: clamp(20px, 3vw, 34px);
  box-shadow: var(--shadow-sheet); }
.result:focus { outline: none; }
.result-head { display: flex; gap: 16px; align-items: center; }
.result-head svg { width: 46px; flex: none; }
.result-head p { color: var(--muted); }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.checklist { margin-top: 26px; }
.checklist ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.checklist li { padding: 10px 14px; border-radius: 8px; background: var(--desk); display: flex; gap: 10px; }
.checklist li.warn { background: var(--warn-bg); color: var(--warn); font-weight: 500; }
.checklist li::before { content: "○"; color: var(--muted); }
.checklist li.warn::before { content: "!"; font-weight: 700; color: var(--warn); }
.mapping { margin-top: 18px; }
.mapping summary { cursor: pointer; font-weight: 600; }
.mapping .map { margin-top: 10px; }

/* ------------------------------------------------------------ formats */
.formats { padding: 80px 0; background: var(--paper); border-block: 1px solid var(--line); }
.pub-list { margin-top: 36px; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 34px 48px; }
.pub h3 { font-size: 1.15rem; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.pub ul { list-style: none; padding: 0; margin: 0; }
.pub li { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.pub li > div { min-width: 0; }
.pub .fname { font-weight: 600; }
.pub .fdesc { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.pub .dl { font-size: .88rem; white-space: nowrap; font-weight: 500; }
.pub .use { font: 500 .88rem var(--sans); color: var(--pencil-ink); background: none; border: 0; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.pub .acts { display: flex; gap: 14px; flex: none; }

/* ------------------------------------------------------------ how */
.how { padding: 90px 0; }
.how-in { display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(30px, 6vw, 90px); }
.how-steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: 28px; }
.how-steps li { counter-increment: s; display: grid; grid-template-columns: 48px 1fr; gap: 4px 16px; }
.how-steps li::before { content: counter(s); grid-row: span 2; font: 700 2rem/1 var(--serif); color: var(--pencil); }
.how-steps p { color: var(--muted); }
@media (max-width: 860px) { .how-in { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ faq */
.faq { padding: 0 0 90px; }
.faq-in { display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(30px, 6vw, 90px); }
.faq-list details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq-list summary { cursor: pointer; padding: 14px 0; font-weight: 600; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; color: var(--pencil); font-size: 1.4rem; line-height: 1; }
.faq-list details[open] summary::after { content: "–"; }
.faq-list p { color: var(--muted); padding: 0 0 16px; max-width: 70ch; }
@media (max-width: 860px) { .faq-in { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ footer */
.foot { border-top: 1px solid var(--line); padding: 26px 0 36px; color: var(--muted); font-size: .9rem; }
.foot-in { display: flex; flex-wrap: wrap; gap: 10px 26px; }
.foot-in a { margin-inline-start: auto; color: var(--muted); }

/* ------------------------------------------------------------ journal details */
.extras { margin-top: 20px; border: 1px solid var(--line); border-radius: 10px; }
.extras summary { cursor: pointer; padding: 14px 16px; font-weight: 600; }
.extras .opt { font-weight: 400; color: var(--muted); font-size: .9rem; margin-inline-start: 6px; }
.extras-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 22px; padding: 4px 16px 18px; }
.field { display: grid; gap: 6px; align-content: start; }
.field > span { font-weight: 600; font-size: .95rem; }
.field small { color: var(--muted); font-size: .85rem; }
.field input[type="text"] { height: 42px; padding: 0 12px; font: 400 1rem var(--sans); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--paper); }
.field input[type="text"]:focus { outline: 2px solid var(--pencil); border-color: transparent; }
.logo-field { grid-column: 1 / -1; }
.logo-pick { display: flex; flex-wrap: wrap; gap: 14px; direction: ltr; }  /* left logo stays on the left in Arabic too */
.logo-slot { display: grid; gap: 4px; justify-items: start; }
.logo-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 210px; height: 74px;
  border: 2px dashed var(--line); border-radius: 10px; background: var(--desk); cursor: pointer; color: var(--muted); font-weight: 500; padding: 8px; }
.logo-btn:hover { border-color: var(--pencil); background: var(--pencil-wash); }
.logo-btn:focus-within { outline: 3px solid var(--pencil); outline-offset: 2px; }
.logo-btn img { max-height: 54px; max-width: 120px; object-fit: contain; }
.logo-btn.has { border-style: solid; border-color: var(--ok); background: var(--paper); }
.logo-x { font: 500 .85rem var(--sans); color: var(--mark); background: none; border: 0; cursor: pointer; padding: 2px 0; text-decoration: underline; }
.logo-own { margin: 0; grid-column: 1 / -1; }
@media (max-width: 640px) { .extras-grid { grid-template-columns: 1fr; } .logo-btn { width: 100%; } .logo-slot { width: 100%; justify-items: stretch; } }

/* ------------------------------------------------------------ home: templates teaser */
.home-templates { padding: 70px 0 80px; }
.ht-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin: 28px 0 26px; }
.ht { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; padding: 14px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); transition: border-color .15s; }
.ht:hover { border-color: var(--pencil); }
.ht img { width: 64px; aspect-ratio: 210 / 297; object-fit: cover; object-position: top; border: 1px solid var(--line); border-radius: 3px; background: #fff; }
.ht b { display: block; font-size: 1rem; }
.ht span { color: var(--muted); font-size: .86rem; line-height: 1.4; display: block; }

.pub-select { height: 44px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--paper); color: var(--ink);
  font: 500 .95rem var(--sans); padding: 0 10px; max-width: 100%; }
.pub-select:focus { outline: 2px solid var(--pencil); border-color: transparent; }

/* ------------------------------------------------------------ LaTeX output choice */
.out-choice { border: 0; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.out-choice legend { font-weight: 600; margin-bottom: 8px; }
.out-choice label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.out-choice label:has(input:checked) { border-color: var(--pencil); background: var(--pencil-wash); }
.out-choice input { margin-top: 4px; accent-color: var(--pencil); }
.out-choice span { display: grid; }
.out-choice small { color: var(--muted); }
.latex-hint { margin: 0 0 14px; padding: 10px 12px; background: var(--warn-bg); color: var(--warn); border-radius: 8px; }
.tag.tex { background: var(--tex-wash); color: var(--tex); font-weight: 600; }
.tag.tex code { font-family: var(--mono); font-weight: 500; }
.tag.gen { background: transparent; border: 1px dashed var(--line); }
.latex-sum { margin-top: 10px; color: var(--muted); font-size: .93rem; }


/* ------------------------------------------------------------ file kinds (Word / LaTeX) */
.kind { display: inline-flex; align-items: center; gap: 6px; font: 500 .85rem/1 var(--sans); padding: 6px 10px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--muted); }
.kind b { font: 600 .82rem/1 var(--mono); color: var(--ink); }
.kind-docx b { color: var(--pencil-ink); }
.kind-tex { border-color: color-mix(in srgb, var(--tex) 35%, var(--line)); background: var(--tex-wash); color: var(--tex); }
.kind-tex b { color: var(--tex); }
.eyebrow { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.drop-kinds { margin-inline-start: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.drop.has-file .drop-kinds { display: none; }

/* hero: LaTeX source sheet */
.code-sheet { position: absolute; inset: 0; margin: 0; padding: 9% 8%; font: 500 clamp(6.5px, .72vw, 9.5px)/1.55 var(--mono);
  color: var(--muted); white-space: pre; overflow: hidden; opacity: 0; transition: opacity .45s ease; background: var(--paper); }
.code-sheet .c { color: var(--tex); font-weight: 700; }
.sheet-before { position: relative; }
.morph.tex .code-sheet { opacity: 1; }
.morph-cap code { font: 600 .85em var(--mono); color: var(--tex); }

/* step 1: what JournalFit read from the LaTeX project */
.lx-read { margin-top: 16px; padding: 18px; border: 1px solid color-mix(in srgb, var(--tex) 30%, var(--line)); border-radius: 12px;
  background: linear-gradient(180deg, var(--tex-wash), transparent 70%); }
.lx-read-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lx-read-status { color: var(--muted); margin: 8px 0 0; font-size: .95rem; }
.lx-read-status.err { color: var(--mark); }
.lx-read-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 14px 0 0; }
.lx-read-grid div { background: var(--paper); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; min-width: 0; }
.lx-read-grid div.wide { grid-column: 1 / -1; }
.lx-read-grid dt { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
html[lang="ar"] .lx-read-grid dt { text-transform: none; letter-spacing: 0; }
.lx-read-grid dd { margin: 3px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.lx-read-grid dd code { font: 600 .95rem var(--mono); color: var(--tex); }
.lx-read-grid dd .no { color: var(--warn); font-weight: 500; }
.lx-read-grid dd small { display: block; font-weight: 400; color: var(--muted); font-size: .85rem; }

/* step 2: official-only toggle */
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; font-size: .95rem; min-height: 44px; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-ui { width: 40px; height: 24px; border-radius: 999px; background: var(--desk-2); border: 1px solid var(--line); position: relative;
  transition: background .2s; flex: none; }
.toggle-ui::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--paper); box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: inset-inline-start .2s; }
.toggle input:checked + .toggle-ui { background: var(--tex); border-color: var(--tex); }
.toggle input:checked + .toggle-ui::after { inset-inline-start: 18px; }
.toggle input:focus-visible + .toggle-ui { outline: 3px solid var(--pencil); outline-offset: 2px; }
.lx-step2 { margin: -4px 0 14px; color: var(--muted); font-size: .92rem; }
.tpl.official { border-color: color-mix(in srgb, var(--tex) 40%, var(--line)); }
.tpl.official[aria-checked="true"] { border-color: var(--pencil); }

/* step 3: output cards and flow line */
.out-choice { grid-template-columns: 1fr 1fr; }
.out-choice legend { grid-column: 1 / -1; }
.out-choice label { padding: 14px; align-items: center; }
.out-choice input { margin-top: 0; }
.oc-icon { width: 34px; color: var(--tex); flex: none; }
.out-choice label:last-child .oc-icon { color: var(--pencil); }
@media (max-width: 640px) { .out-choice { grid-template-columns: 1fr; } }
.flowline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; padding: 12px 14px;
  background: var(--desk); border-radius: 10px; font-size: .93rem; }
.flowline .fl-item { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 7px; min-width: 0; }
.flowline .fl-item code { font: 600 .85rem var(--mono); color: var(--tex); }
.flowline .fl-arrow { color: var(--muted); }
html[dir="rtl"] .flowline .fl-arrow { transform: scaleX(-1); display: inline-block; }

/* result: project tree and next steps */
.lx-result { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; margin-top: 18px; }
@media (max-width: 760px) { .lx-result { grid-template-columns: 1fr; } }
.lx-tree-box, .lx-next { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; background: var(--paper); }
.lx-next ol { margin: 10px 0 14px; padding-inline-start: 20px; display: grid; gap: 6px; color: var(--muted); }
.lx-tree, .lx-tree ul { list-style: none; margin: 0; padding: 0; }
.lx-tree { margin-top: 10px; font: 500 .9rem/1.5 var(--mono); max-height: 320px; overflow: auto; }
.lx-tree ul { padding-inline-start: 18px; border-inline-start: 1px dashed var(--line); margin-inline-start: 7px; }
.lx-tree li { padding: 2px 0 2px 22px; position: relative; overflow-wrap: anywhere; }
html[dir="rtl"] .lx-tree li { padding: 2px 22px 2px 0; }
.lx-tree li::before { content: ""; position: absolute; inset-inline-start: 2px; top: 6px; width: 13px; height: 15px; border-radius: 2px;
  border: 1.5px solid var(--muted); opacity: .7; }
.lx-tree li.dir::before, .lx-tree li.zip::before { border-radius: 2px 2px 3px 3px; background: var(--desk-2); }
.lx-tree li.tex::before { border-color: var(--tex); background: var(--tex-wash); opacity: 1; }
.lx-tree li.pdf::before { border-color: var(--mark); opacity: 1; }
.lx-tree li.cls::before { border-color: var(--pencil); background: var(--pencil-wash); opacity: 1; }
.lx-tree li small { font: 400 .82rem var(--sans); color: var(--muted); margin-inline-start: 6px; }
.lx-tree li.zip > b { font-weight: 600; }
.lx-tree li .badge { font: 600 .7rem var(--sans); color: var(--pencil-ink); background: var(--pencil-wash); padding: 1px 6px; border-radius: 4px; margin-inline-start: 6px; }

/* ------------------------------------------------------------ LaTeX section */
.latexsec { padding: clamp(56px, 7vw, 96px) 0; background: var(--paper); border-block: 1px solid var(--line); }
.lx-head { display: grid; justify-items: start; gap: 12px; }
.lx-head .section-lede { margin-top: 0; }
.lx-flow { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: none; }
.lx-flow li { position: relative; padding: 22px 22px 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--desk); }
.lx-flow li + li::before { content: ""; position: absolute; top: 38px; inset-inline-start: -17px; width: 18px; border-top: 2px dashed var(--line); }
.lx-n { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--tex); color: #fff;
  font: 700 .95rem var(--sans); margin-bottom: 12px; }
.lx-flow h3 { margin-bottom: 8px; }
.lx-flow p { color: var(--muted); font-size: .96rem; }
.lx-classes { margin-top: 12px !important; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.lx-classes span { width: 100%; font-size: .85rem; }
.lx-classes code, .lx-pane figcaption code, .lx-chip code { font: 500 .8rem var(--mono); background: var(--paper); border: 1px solid var(--line);
  padding: 2px 6px; border-radius: 5px; color: var(--ink); }
@media (max-width: 900px) { .lx-flow { grid-template-columns: 1fr; } .lx-flow li + li::before { display: none; } }

.lx-demo { margin-top: 28px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--desk); }
.lx-demo-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line);
  color: var(--muted); font-size: .95rem; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
.seg button { font: 600 .88rem/1 var(--sans); border: 0; background: transparent; color: var(--muted); padding: 9px 12px; border-radius: 7px; cursor: pointer; min-height: 36px; }
.seg button[aria-selected="true"] { background: var(--tex); color: #fff; }
.lx-panes { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; padding: 18px; direction: ltr; }
.lx-pane { margin: 0; background: var(--code-bg); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; min-width: 0; }
.lx-pane figcaption { padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: .85rem; color: var(--muted); display: flex; gap: 8px; align-items: center; background: var(--paper); }
html[dir="rtl"] .lx-pane figcaption { direction: rtl; justify-content: flex-end; }
.lx-pane-out { border-color: color-mix(in srgb, var(--tex) 45%, var(--line)); }
.lx-pane pre { margin: 0; padding: 14px; font: 500 .8rem/1.6 var(--mono); color: var(--ink); overflow: auto; min-height: 290px; white-space: pre; }
.lx-pane .k { color: var(--tex); font-weight: 700; }
.lx-pane .o { color: var(--muted); }
.lx-pane .hl { background: color-mix(in srgb, var(--tex) 14%, transparent); border-radius: 3px; }
.lx-arrow { width: 44px; color: var(--tex); }
@media (max-width: 860px) { .lx-panes { grid-template-columns: 1fr; } .lx-arrow { transform: rotate(90deg); justify-self: center; } }

.lx-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
@media (max-width: 860px) { .lx-two { grid-template-columns: 1fr; } }
.lx-card { border: 1px solid var(--line); border-radius: 14px; padding: 22px; background: var(--desk); }
.lx-card .lx-tree { max-height: none; }
.lx-sub { margin-top: 18px; }
.ticks { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .ticks { grid-template-columns: 1fr; } }
.ticks li { position: relative; padding-inline-start: 26px; font-size: .95rem; }
.ticks li::before { content: ""; position: absolute; inset-inline-start: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--ok-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.3l2.6 2.6L12 5.5' fill='none' stroke='%231e7b4f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat; }
.ticks.change li::before { background: var(--pencil-wash) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8h8M9 5l3 3-3 3' fill='none' stroke='%232453c7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat; }
html[dir="rtl"] .ticks.change li::before { transform: scaleX(-1); }

.lx-official { margin-top: 28px; }
.lx-official h3 { font-size: 1.35rem; }
.lx-official h3 #lxOffCount { color: var(--tex); }
.lx-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.lx-chip { display: inline-flex; align-items: center; gap: 8px; font: 500 .9rem/1.2 var(--sans); padding: 8px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--desk); color: var(--ink); cursor: pointer; min-height: 40px; }
.lx-chip:hover { border-color: var(--tex); background: var(--tex-wash); }
.lx-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 30px; }
.lx-cta .hint { margin: 0; }
.btn-tex { background: var(--tex); color: #fff; }

/* formats list: official LaTeX mark */
.fname .tex-mark { display: inline-block; margin-inline-start: 8px; font: 600 .7rem/1 var(--sans); padding: 3px 6px; border-radius: 4px;
  background: var(--tex-wash); color: var(--tex); vertical-align: 2px; }
.lx-more { background: var(--paper); color: var(--tex); font-weight: 600; border-style: dashed; }
.lx-next .btn { margin-top: 4px; }
html[dir="rtl"] .lx-tree li > small, html[dir="rtl"] .lx-tree li > b { unicode-bidi: isolate; }
.lx-tree { direction: ltr; text-align: left; }
.lx-tree small { direction: auto; }
@media (max-width: 520px) { .lx-read-grid { grid-template-columns: 1fr 1fr; } .lx-read { padding: 14px; } }

/* ------------------------------------------------------------ account control in the top bar */
.acct-nav { position: relative; display: flex; align-items: center; }
.acct-signin { font: 600 .95rem/1 var(--sans); color: var(--pencil-ink); text-decoration: none; padding: 10px 14px;
  border-radius: 999px; border: 1px solid color-mix(in srgb, var(--pencil) 35%, var(--line)); background: var(--paper); }
.acct-signin:hover { background: var(--pencil-wash); }
.acct-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  border-radius: 999px; padding: 4px 12px 4px 4px; font: 600 .92rem/1 var(--sans); cursor: pointer; min-height: 40px; max-width: 220px; }
html[dir="rtl"] .acct-btn { padding: 4px 4px 4px 12px; }
.acct-btn:hover { border-color: var(--pencil); }
.acct-av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--pencil); color: #fff;
  font: 700 .78rem/1 var(--sans); flex: none; }
.acct-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-menu { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; min-width: 240px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sheet); padding: 6px; z-index: 50; display: grid; }
.acct-menu a, .acct-menu button { display: block; text-align: start; padding: 10px 12px; border-radius: 8px; color: var(--ink);
  text-decoration: none; font: 500 .95rem var(--sans); background: none; border: 0; cursor: pointer; }
.acct-menu a:hover, .acct-menu button:hover, .acct-menu a:focus-visible, .acct-menu button:focus-visible { background: var(--desk); }
.acct-who { display: grid; gap: 2px; padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.acct-who span { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.role-badge { justify-self: start; margin-top: 4px; font: 600 .72rem/1 var(--sans) !important; padding: 4px 8px; border-radius: 999px;
  background: var(--desk); color: var(--muted) !important; }
.role-badge.role-admin { background: var(--pencil-wash); color: var(--pencil-ink) !important; }
.role-badge.role-superadmin { background: var(--warn-bg); color: var(--warn) !important; }
@media (max-width: 760px) { .acct-name { display: none; } .acct-btn { padding: 4px; } .lang { margin-inline-start: 8px; } .acct-nav { margin-inline-start: auto; } }
.alert a { color: inherit; font-weight: 700; }

/* ---------------------------------------------------------------- shared by every page: cards, forms, dialogs */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sheet); }
.muted { color: var(--muted); }
.card-pad { padding: clamp(20px, 3vw, 30px); }
/* forms */
.form { display: grid; gap: 16px; }
.fld { display: grid; gap: 6px; }
.fld > span { font-weight: 600; font-size: .95rem; }
.fld small { color: var(--muted); font-size: .85rem; }
.inp { height: 46px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--paper); color: var(--ink);
  font: 400 1rem var(--sans); padding: 0 12px; width: 100%; }
.inp:focus { outline: 2px solid var(--pencil); border-color: transparent; }
select.inp { padding: 0 8px; }
.pw-wrap { position: relative; }
.pw-wrap .inp { padding-inline-end: 72px; }
.pw-toggle { position: absolute; inset-inline-end: 6px; top: 50%; translate: 0 -50%; border: 0; background: none; color: var(--pencil-ink);
  font: 600 .85rem var(--sans); padding: 8px; cursor: pointer; border-radius: 6px; }
.chk { display: flex; gap: 10px; align-items: center; font-size: .95rem; cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: var(--pencil); }
.msg { padding: 10px 12px; border-radius: 8px; font-size: .95rem; }
.msg.err { background: var(--mark-bg); color: var(--mark); }
.msg.ok { background: var(--ok-bg); color: var(--ok); }
.msg.info { background: var(--pencil-wash); color: var(--pencil-ink); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: .9rem; border-radius: 8px; }
.btn-danger { background: var(--paper); color: var(--mark); border-color: color-mix(in srgb, var(--mark) 40%, var(--line)); }
.btn-danger:hover { background: var(--mark-bg); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--pencil-ink); font: 600 .95rem var(--sans); cursor: pointer; text-decoration: underline; }

/* dialog */
dialog.dlg { border: 0; border-radius: 14px; padding: 0; width: min(520px, calc(100% - 32px)); background: var(--paper); color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.45); }
dialog.dlg::backdrop { background: rgba(10, 16, 26, .45); }
.dlg-in { padding: 24px; display: grid; gap: 14px; }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.inp.ta { height: auto; min-height: 120px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.dlg-title { font-size: 1.35rem; }

/* footer links (every page) */
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-inline-start: auto; align-items: center; }
.foot-in .foot-links a { margin: 0; }
.foot-links a, .foot-contact { color: var(--muted); font: inherit; text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--muted) 40%, transparent); }
.foot-contact { background: none; border: 0; padding: 0; cursor: pointer; }
.foot-links a:hover, .foot-contact:hover { color: var(--pencil-ink); }

/* contact form */
.fb-attached { background: var(--desk); border-radius: 8px; padding: 8px 12px; font-size: .9rem; color: var(--muted); }
.fb-done { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 12px 0; }
.fb-done svg { width: 48px; height: 48px; }
.fb-done p { font-size: 1.05rem; }
.report-link { margin-top: 14px; font-size: .92rem; }

/* "confirm your email" bar */
.verify-bar { background: var(--warn-bg); color: var(--warn); border-bottom: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); }
.verify-in { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 10px 0; font-size: .93rem; font-weight: 500; }
.verify-bar .linkbtn { color: inherit; }
.vf-msg { font-weight: 400; }

/* sign-in gate on the formatter */
.gate { display: grid; grid-template-columns: auto 1fr auto; gap: 18px 22px; align-items: center; background: var(--paper);
  border: 1px solid var(--line); border-inline-start: 4px solid var(--pencil); border-radius: 12px; padding: 20px 22px;
  margin-bottom: 22px; box-shadow: var(--shadow-sheet); }
.gate-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--pencil-wash); color: var(--pencil-ink); display: grid; place-items: center; }
.gate-icon svg { width: 22px; height: 22px; }
.gate h3 { font-size: 1.25rem; }
.gate p { color: var(--muted); margin: 4px 0 0; max-width: 62ch; }
.gate-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.gate.verify { border-inline-start-color: var(--warn); }
.gate.verify .gate-icon { background: var(--warn-bg); color: var(--warn); }
@media (max-width: 760px) { .gate { grid-template-columns: 1fr; padding: 18px; } .gate-icon { display: none; } .gate-actions { flex-direction: column; } .gate-actions .btn { width: 100%; } }
.acct-signin { white-space: nowrap; }
.workspace.locked .drop { cursor: pointer; }

/* privacy, terms, confirm and error pages */
.doc-page { padding: clamp(28px, 5vw, 56px) 0 80px; }
.legal { max-width: 760px; margin-inline: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-sheet); padding: clamp(22px, 5vw, 56px); }
.legal h1 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.6rem); }
.legal .updated { color: var(--muted); margin: 8px 0 26px; font-size: .92rem; }
.legal h2 { font-size: 1.3rem; margin: 30px 0 10px; }
.legal p, .legal li { max-width: 68ch; }
.legal ul { padding-inline-start: 22px; }
.legal li { margin: 6px 0; }
.legal .summary { background: var(--pencil-wash); border-radius: 10px; padding: 16px 18px; margin: 0 0 8px; }
.legal .summary ul { margin: 6px 0 0; }
.legal table { width: 100%; border-collapse: collapse; font-size: .93rem; margin: 10px 0; }
.legal th, .legal td { text-align: start; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal th { background: var(--desk); font-weight: 600; }
.legal .tbl-scroll { overflow-x: auto; }
html[lang="ar"] .lang-en, html:not([lang="ar"]) .lang-ar { display: none !important; }
.center-card { max-width: 480px; margin: clamp(20px, 8vh, 80px) auto 0; text-align: center; }
.center-card .state-icon { width: 64px; height: 64px; margin: 0 auto 16px; }
.center-card h1 { font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2.2rem); }
.center-card p { color: var(--muted); margin: 12px auto 0; max-width: 42ch; }
.center-card .form { text-align: start; margin-top: 22px; }
.center-card .acts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }
.err-code { font: 700 clamp(4rem, 3rem + 6vw, 7rem)/1 var(--serif); color: var(--pencil); letter-spacing: -.02em; }

/* sign-in box on the formatter */
.login-dlg { width: min(440px, calc(100% - 32px)); }
.ld-head { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; }
.ld-x { border: 0; background: none; font-size: 1.6rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; border-radius: 6px; }
.ld-x:hover { color: var(--ink); }
.ld-seg { display: flex; }
.ld-seg .seg-b { flex: 1; }
.seg { display: inline-flex; background: var(--desk-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg-b { border: 0; background: none; padding: 8px 14px; border-radius: 8px; font: 600 .9rem var(--sans); color: var(--muted); cursor: pointer; }
.seg-b[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(23,33,46,.1); }
.small.center { text-align: center; }
.chk.agree { align-items: flex-start; line-height: 1.5; }
.chk.agree input { margin-top: 3px; flex: none; }
.sent-box { text-align: center; justify-items: center; }
.sent-box svg { width: 64px; height: 64px; }
.sent-box p { margin: 0; max-width: 40ch; }

/* privacy section */
.vault { padding: 90px 0; background: #111a27; color: #e8edf3; --vline: rgba(255,255,255,.12); }
.vault .section-lede { color: #a9b5c4; max-width: 62ch; }
.vault-head { max-width: 760px; }
.vault-badge { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: rgba(125,162,255,.14); color: #9db8ff; margin-bottom: 18px; }
.vault-badge svg { width: 28px; height: 28px; }
.eyebrow-s { font: 600 .8rem var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #9db8ff; margin: 0 0 8px; }
html[lang="ar"] .eyebrow-s { letter-spacing: 0; }
.vault h2 { font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.8rem); color: #fff; }
.vault-flow { list-style: none; counter-reset: v; margin: 42px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; position: relative; }
.vault-flow::before { content: ""; position: absolute; top: 15px; inset-inline: 10% 10%; height: 2px; background: linear-gradient(90deg, #7da2ff, #5fd3b0); opacity: .55; }
.vault-flow li { counter-increment: v; position: relative; padding: 46px 14px 0; text-align: center; display: grid; gap: 6px; align-content: start; }
.vault-flow li::before { content: counter(v); position: absolute; top: 0; inset-inline-start: 50%; translate: -50% 0; width: 32px; height: 32px; border-radius: 50%;
  background: #111a27; border: 2px solid #7da2ff; color: #fff; font: 700 .9rem/28px var(--sans); }
html[dir="rtl"] .vault-flow li::before { translate: 50% 0; }
.vault-flow li:last-child::before { border-color: #5fd3b0; }
.vault-flow b { color: #fff; font-size: 1rem; }
.vault-flow span { color: #a9b5c4; font-size: .9rem; line-height: 1.5; }
.vault-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 48px; }
.vault-card { border: 1px solid var(--vline); border-radius: 14px; padding: 20px; background: rgba(255,255,255,.03); }
.vault-card h3 { font: 600 1.05rem var(--sans); color: #fff; margin-bottom: 8px; }
.vault-card p { color: #a9b5c4; font-size: .92rem; line-height: 1.6; margin: 0; }
.vault-more { margin-top: 26px; }
.vault-more a { color: #9db8ff; font-weight: 600; }
@media (max-width: 980px) {
  .vault-flow { grid-template-columns: 1fr; gap: 18px; }
  .vault-flow::before { top: 0; bottom: 0; inset-inline: 15px auto; width: 2px; height: auto; background: linear-gradient(180deg, #7da2ff, #5fd3b0); }
  .vault-flow li { padding: 4px 0 0; padding-inline-start: 50px; text-align: start; }
  .vault-flow li::before { inset-inline-start: 0; translate: none; }
  html[dir="rtl"] .vault-flow li::before { translate: none; }
  .vault-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) { .vault-grid { grid-template-columns: 1fr; } }
.trust-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 12px 0 0; font-size: .88rem; color: var(--ok); }
.trust-line svg { width: 15px; height: 15px; flex: none; }
.trust-line a { color: var(--muted); }
.btn-del { color: var(--mark); }
.btn-del:hover { border-color: var(--mark); color: var(--mark); }

/* pricing */
.pr-head { max-width: 680px; margin: 0 auto 40px; text-align: center; }
.eyebrow-p { font: 600 .8rem var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--pencil-ink); margin: 0 0 10px; }
html[lang="ar"] .eyebrow-p { letter-spacing: 0; }
.pr-head h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.2rem); }
.pr-lede { color: var(--muted); font-size: 1.1rem; margin-top: 14px; }
.pr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; max-width: 980px; margin: 0 auto; }
.pr-grid:has(.pr-plans[hidden]) { max-width: 460px; }
.pr-plans { display: contents; }
.pr-card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow-sheet); display: grid; gap: 16px; align-content: start; }
.pr-free { border: 2px solid var(--pencil); }
.pr-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pr-top h2 { font-size: 1.5rem; }
.pr-price { margin: 0; color: var(--muted); }
.pr-price b { font: 700 2.6rem/1 var(--serif); color: var(--ink); }
.pr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pr-list li { position: relative; padding-inline-start: 28px; }
.pr-list li::before { content: ""; position: absolute; inset-inline-start: 0; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--ok-bg);
  -webkit-mask: none; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 30%, transparent); }
.pr-list li::after { content: ""; position: absolute; inset-inline-start: 6px; top: 7px; width: 5px; height: 9px; border: solid var(--ok); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.pr-pay { max-width: 680px; margin: 48px auto 0; text-align: center; background: var(--ok-bg); color: var(--ok); border-radius: 14px; padding: 20px 24px; }
.pr-pay h2 { font-size: 1.15rem; color: inherit; }
.pr-pay p { margin: 6px 0 0; }
.pr-faq { max-width: 680px; margin: 36px auto 0; display: grid; gap: 10px; }
.pr-faq details { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; }
.pr-faq summary { font-weight: 600; cursor: pointer; }
.pr-faq p { color: var(--muted); margin: 10px 0 0; }
.analysis.is-latex thead, .analysis.is-latex > .hint { display: none; }
.ltpl-note { color: var(--muted); font-size: .9rem; }
.pr-top .pill { display: inline-block; font: 600 .75rem/1 var(--sans); padding: 6px 10px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); white-space: nowrap; }

.find-hint { margin-top: 4px; font-size: .92rem; }

/* ------------------------------------------------------------ submission files */
.sub-extras { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 16px; margin: 0 0 18px; }
.sub-extras legend { font-weight: 600; padding: 0 6px; font-size: .95rem; }
.sx-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sx { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); cursor: pointer; transition: border-color .15s, background .15s; }
.sx:hover { border-color: var(--pencil); }
.sx:has(input:checked) { border-color: var(--pencil); background: var(--pencil-wash); }
.sx input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--pencil); flex: none; }
.sx span { display: grid; gap: 2px; }
.sx small { color: var(--muted); font-size: .84rem; line-height: 1.4; }
.sx-editor { margin-top: 12px; max-width: 420px; }
@media (max-width: 760px) { .sx-grid { grid-template-columns: 1fr; } }
.sub-files { margin-top: 22px; }
.sub-files h4 { font-size: 1.05rem; margin-bottom: 10px; }
.sub-files ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sub-files li { display: flex; gap: 14px; justify-content: space-between; align-items: center; flex-wrap: wrap;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--desk); }
.sub-files li > div:first-child { display: grid; gap: 2px; min-width: 0; flex: 1 1 260px; }
.sub-files li small { color: var(--muted); font-size: .86rem; }
.sf-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.sf-dl { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--paper); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .9rem; }
.sf-dl:hover { border-color: var(--pencil); color: var(--pencil-ink); }
.sf-dl svg { width: 16px; height: 16px; }
