:root {
  --bg: #f2f4f1;
  --bg-2: #e6eae4;
  --card: #fdfefc;
  --ink: #142a33;
  --ink-2: #485b63;
  --ink-3: #84949a;
  --line: #dfe4dd;
  --line-2: #cbd3cb;
  --cl: #0e7c86;           /* clean */
  --cl-soft: #d8eeee;
  --raw: #9a4a8c;          /* messy, before */
  --raw-soft: #f3e4ef;
  --dr: #2f6fa8;           /* debit */
  --dr-soft: #e1ebf6;
  --cr: #b8612a;           /* credit */
  --cr-soft: #f8e7da;
  --ok: #2f8f4e;
  --ok-soft: #e1f2e5;
  --warn: #c2452d;
  --warn-soft: #f9e1da;
  --look: #b9800f;
  --look-soft: #fbefd2;
  --focus: #1f6fd1;
  --shadow: 0 1px 2px rgba(20, 42, 51, .05), 0 6px 24px rgba(20, 42, 51, .07);
  --radius: 14px;
  --sans: "Hanken Grotesk Variable", "Mutabaqa Arabic", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Bricolage Grotesque Variable", "Hanken Grotesk Variable", "Mutabaqa Arabic", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono Variable", "Mutabaqa Arabic", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1518; --bg-2: #122024; --card: #15262b; --ink: #e6eef0; --ink-2: #a6b8bd; --ink-3: #75878c;
    --line: #21363c; --line-2: #2c454c;
    --cl: #3cc4c8; --cl-soft: #10343a; --raw: #d58bc6; --raw-soft: #351a30;
    --dr: #7aa7e6; --dr-soft: #172a42; --cr: #ee9a5c; --cr-soft: #3a2415;
    --ok: #5cc27a; --ok-soft: #15301f; --warn: #f07a5e; --warn-soft: #3a1c15; --look: #e7b545; --look-soft: #352a10;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 28px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, .brand-name, .tile .n { font-family: var(--display); }
:root:lang(ar) body { line-height: 1.6; }
:root:lang(ar) * { letter-spacing: 0 !important; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.hidden { display: none !important; }

/* ---------- header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; padding: 18px clamp(16px, 4vw, 40px); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.brand-name em { font-style: normal; font-weight: 500; color: var(--ink-3); margin-inline-start: 4px; }
/* the logo: a crooked row above two straight ones, and a spark */
.logo { position: relative; width: 30px; height: 24px; display: inline-block; flex: none; }
.logo i { position: absolute; left: 1px; top: 3px; width: 17px; height: 5px; border-radius: 3px; background: var(--raw); transform: rotate(-11deg); transition: transform .4s cubic-bezier(.2,.8,.2,1); }
.logo b { position: absolute; left: 1px; top: 11px; width: 24px; height: 5px; border-radius: 3px; background: var(--cl); box-shadow: 0 8px 0 var(--cl); }
.logo::after { content: ""; position: absolute; right: 0; top: 0; width: 9px; height: 9px; background: var(--look);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: twinkle 3.2s ease-in-out infinite; }
.brand:hover .logo i { transform: rotate(0) translateY(0); }
@keyframes twinkle { 0%, 70%, 100% { transform: scale(.55) rotate(0); opacity: .6; } 80% { transform: scale(1.15) rotate(45deg); opacity: 1; } }
.lang { border: 1px solid var(--line-2); background: var(--card); border-radius: 999px; min-width: 40px; height: 36px; padding: 0 12px; font-weight: 600; }
.lang:hover { border-color: var(--ink-3); }
main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 48px; }
.foot { text-align: center; color: var(--ink-3); font-size: 13px; padding: 18px 16px 28px; }
.top-right { display: flex; align-items: center; gap: 14px; }
.by { color: var(--ink-3); font-size: 12px; letter-spacing: .26em; text-decoration: none; white-space: nowrap; }
[dir=rtl] .by { letter-spacing: 0; font-size: 13px; }
.by:hover { color: var(--ink); }
.beta { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--cl); background: var(--cl-soft); border-radius: 999px; padding: 2px 8px; }
.foot p { margin: 0 0 8px; }
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; }
.foot a { color: var(--ink-3); }
.foot a:hover { color: var(--ink); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--card); padding: 10px 16px; font-weight: 600; text-decoration: none; color: var(--ink);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.primary:hover { box-shadow: 0 6px 18px rgba(20, 42, 51, .22); }
.btn.big { padding: 14px 28px; font-size: 17px; border-radius: 14px; position: relative; overflow: hidden; }
.btn.big.primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.28) 50%, transparent 65%);
  transform: translateX(-120%); animation: shine 3.4s ease-in-out 1.2s infinite; }
.btn.big[disabled]::after { display: none; }
@keyframes shine { 0%, 60% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
.btn.small { padding: 5px 11px; font-size: 13px; border-radius: 9px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { color: var(--ink); border-color: var(--line-2); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.link:hover { text-decoration-color: var(--ink); }

/* ---------- home ---------- */
.hero { text-align: center; padding: clamp(24px, 6vh, 60px) 0 24px; }
.hero h1 { font-size: clamp(30px, 5vw, 52px); line-height: 1.12; letter-spacing: -.025em; margin: 0 auto 14px; max-width: 19ch; font-weight: 600; }
.hero h1 .raw { color: var(--raw); display: inline-block; animation: jitter 2.6s steps(1) infinite; }
.hero h1 .cl { color: var(--cl); position: relative; display: inline-block; }
.hero h1 .cl::after { content: ""; position: absolute; left: 0; right: 0; bottom: .06em; height: .09em; border-radius: 1em; background: var(--cl);
  transform: scaleX(0); transform-origin: left; animation: underline .9s cubic-bezier(.2,.8,.2,1) .9s forwards; opacity: .5; }
[dir=rtl] .hero h1 .cl::after { transform-origin: right; }
@keyframes underline { to { transform: scaleX(1); } }
@keyframes jitter { 0%, 88%, 100% { transform: none; } 90% { transform: translate(1px, -1px) skewX(-6deg); } 93% { transform: translate(-1px, 1px) skewX(4deg); } 96% { transform: translate(1px, 0); } }
.hero p { margin: 0 auto; max-width: 62ch; color: var(--ink-2); font-size: 17px; }
.drop {
  display: block; cursor: pointer; position: relative; margin: 26px auto 0; max-width: 760px; border: 2px dashed var(--line-2); border-radius: 22px;
  background: var(--card); padding: 30px 24px 28px; text-align: center; box-shadow: var(--shadow);
  transition: border-color .15s, background .15s, transform .15s;
}
.drop.over { border-color: var(--cl); background: var(--cl-soft); transform: scale(1.01); }
.drop h2 { margin: 14px 0 4px; font-size: 21px; }
.drop p { margin: 0; color: var(--ink-2); }
.drop .actions { margin-top: 18px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; align-items: center; }
.drop input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.files { list-style: none; padding: 0; margin: 16px auto 0; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.files li { background: var(--bg-2); border-radius: 999px; padding: 4px 12px; font-size: 14px; }
.privacy { text-align: center; color: var(--ink-3); font-size: 13.5px; margin-top: 16px; }
.privacy a { color: var(--ink-3); }
.privacy .limits { color: var(--ink-2); font-weight: 500; }
.error { margin: 16px auto 0; max-width: 760px; background: var(--warn-soft); color: var(--ink); border-radius: 12px; padding: 12px 16px; border-inline-start: 4px solid var(--warn); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* the little sheet on the drop box: crooked cells straighten as a light sweeps across */
.sheet-art { position: relative; display: inline-grid; grid-template-columns: 34px 52px 40px; gap: 5px; padding: 8px; border-radius: 12px; background: var(--bg-2); direction: ltr; }
.sheet-art span { height: 11px; border-radius: 4px; background: var(--raw-soft); box-shadow: inset 0 0 0 1.5px var(--raw);
  transform: translate(var(--x), var(--y)) rotate(var(--r)); animation: tidy 4.2s cubic-bezier(.2,.8,.2,1) infinite; animation-delay: calc(var(--c) * .32s); }
.sheet-art span:nth-child(3n+2) { width: 70%; justify-self: start; }
.sheet-art::after { content: ""; position: absolute; top: -6px; bottom: -6px; width: 3px; left: 0; border-radius: 2px; background: var(--cl);
  box-shadow: 0 0 12px 3px color-mix(in srgb, var(--cl) 60%, transparent); animation: sweep 4.2s cubic-bezier(.45,0,.55,1) infinite; opacity: 0; }
@keyframes sweep { 0% { left: 0; opacity: 0; } 4% { opacity: 1; } 34% { left: 100%; opacity: 1; } 40%, 100% { left: 100%; opacity: 0; } }
@keyframes tidy {
  0%, 8% { transform: translate(var(--x), var(--y)) rotate(var(--r)); background: var(--raw-soft); box-shadow: inset 0 0 0 1.5px var(--raw); }
  16%, 82% { transform: none; background: var(--cl-soft); box-shadow: inset 0 0 0 1.5px var(--cl); }
  94%, 100% { transform: translate(var(--x), var(--y)) rotate(var(--r)); background: var(--raw-soft); box-shadow: inset 0 0 0 1.5px var(--raw); }
}

.answers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 40px auto 0; max-width: 1040px; }
.answers div { padding: 18px; border-radius: var(--radius); background: var(--bg-2); position: relative; overflow: hidden; }
.answers b { display: block; margin: 8px 0 4px; }
.answers span { color: var(--ink-2); font-size: 14.5px; }
.answers .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--card); font-size: 17px; font-weight: 700; }
.answers div:nth-child(1) .ico { color: var(--raw); }
.answers div:nth-child(2) .ico { color: var(--dr); }
.answers div:nth-child(3) .ico { color: var(--cl); }
.answers div:nth-child(4) .ico { color: var(--cr); }
.next-step { margin: 18px auto 0; text-align: center; color: var(--ink-2); font-size: 14.5px; }
.next-step a { color: var(--cl); font-weight: 600; }

/* ---------- setup ---------- */
.setup-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 18px 0 18px; flex-wrap: wrap; }
.setup-head h1 { margin: 0; font-size: 28px; letter-spacing: -.02em; }
.setup-head p { margin: 4px 0 0; color: var(--ink-2); }
.sheet-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; border-top: 5px solid var(--cl); min-width: 0; }
.sheet-card h2 { margin: 0 0 2px; font-size: 21px; overflow-wrap: anywhere; }
.sheet-card .meta { color: var(--ink-2); font-size: 14px; }
.sheet-card select.table-pick { margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; background: var(--bg-2); padding: 3px 10px; font-size: 13px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chip.missing { background: var(--warn-soft); }
.chip.enc { background: var(--raw-soft); color: color-mix(in srgb, var(--raw) 75%, var(--ink)); }
select { border: 1px solid var(--line-2); border-radius: 10px; padding: 7px 10px; background: var(--card); max-width: 100%; min-width: 0; }

/* what we found */
.found { margin-top: 16px; }
.found h3 { margin: 0 0 8px; font-size: 14px; color: var(--ink-2); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.found-list { display: flex; flex-wrap: wrap; gap: 8px; }
.fnd { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 8px; border-radius: 12px; background: var(--bg-2); font-size: 14px;
  animation: pop .45s cubic-bezier(.2,.9,.3,1.3) both; }
[dir=rtl] .fnd { padding: 7px 8px 7px 12px; }
.fnd i { font-style: normal; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--card); }
.fnd b { font-family: var(--mono); font-weight: 600; }
.fnd.t i { color: var(--raw); } .fnd.n i { color: var(--dr); } .fnd.d i { color: var(--cl); } .fnd.r i { color: var(--cr); } .fnd.a i { color: var(--ink); }
.fnd.k { background: var(--look-soft); } .fnd.k i { color: var(--look); }
.fnd.ok { background: var(--ok-soft); } .fnd.ok i { color: var(--ok); }
.fnd.none { background: var(--ok-soft); color: var(--ok); }
@keyframes pop { from { opacity: 0; transform: scale(.85) translateY(6px); } }
.found.stale .found-list { opacity: .5; transition: opacity .2s; }

/* column types above the preview */
.preview { margin-top: 16px; overflow: auto; max-height: 340px; border: 1px solid var(--line); border-radius: 10px; }
.preview table { border-collapse: collapse; font-size: 12.5px; width: max-content; min-width: 100%; }
.preview th, .preview td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: start; white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.preview thead th { position: sticky; top: 0; background: var(--bg-2); font-weight: 600; z-index: 1; vertical-align: bottom; }
.preview td.t-drop, .preview th.t-drop .h { color: var(--ink-3); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink-3) 60%, transparent); }
.typesel { display: block; margin-bottom: 5px; font-size: 12px; font-weight: 600; padding: 3px 6px; border-radius: 7px; width: 100%; min-width: 96px;
  border: 1px solid transparent; background: var(--card); }
.typesel.k-date { color: var(--cl); border-color: color-mix(in srgb, var(--cl) 45%, transparent); }
.typesel.k-debit { color: var(--dr); border-color: color-mix(in srgb, var(--dr) 45%, transparent); }
.typesel.k-credit { color: var(--cr); border-color: color-mix(in srgb, var(--cr) 45%, transparent); }
.typesel.k-amount, .typesel.k-balance, .typesel.k-number { color: var(--ink); border-color: var(--line-2); }
.typesel.k-dc { color: var(--raw); border-color: color-mix(in srgb, var(--raw) 45%, transparent); }
.typesel.k-text, .typesel.k-code { color: var(--ink-2); border-color: var(--line); }
.typesel.k-drop { color: var(--ink-3); border-style: dashed; border-color: var(--line-2); }

/* options */
.opts { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; }
.opt { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; min-width: 0; }
.opt h3 { margin: 0 0 10px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.opt h3 i { font-style: normal; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: var(--bg-2); font-size: 13px; }
.opt .row { margin-top: 10px; }
.opt .row > small { display: block; color: var(--ink-2); font-size: 12.5px; margin-bottom: 5px; }
.opt .note { color: var(--ink-3); font-size: 12.5px; margin: 8px 0 0; }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--bg-2); border-radius: 11px; padding: 3px; gap: 2px; position: relative; max-width: 100%; }
.seg button { border: 0; background: transparent; border-radius: 8px; padding: 6px 11px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); transition: background .2s, color .2s, box-shadow .2s; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg button[disabled] { opacity: .4; cursor: not-allowed; }
.seg button .num { font-size: 12.5px; }
.toggle { display: flex; align-items: flex-start; gap: 10px; margin-top: 9px; cursor: pointer; font-size: 14px; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle .sw { flex: none; width: 34px; height: 20px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .2s; margin-top: 1px; }
.toggle .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .25s cubic-bezier(.2,.8,.2,1.2); }
.toggle input:checked + .sw { background: var(--cl); }
.toggle input:checked + .sw::after { transform: translateX(14px); }
[dir=rtl] .toggle .sw::after { left: auto; right: 2px; }
[dir=rtl] .toggle input:checked + .sw::after { transform: translateX(-14px); }
.toggle input:focus-visible + .sw { outline: 2px solid var(--focus); outline-offset: 2px; }
.toggle small { display: block; color: var(--ink-3); font-size: 12.5px; }
.hint-tag { display: inline-block; font-size: 11.5px; font-weight: 700; color: var(--look); background: var(--look-soft); border-radius: 999px; padding: 0 8px; margin-inline-start: 6px; }
.go { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 28px 0 8px; }
.go small { color: var(--ink-3); }

/* ---------- working (animation) ---------- */
.work { position: relative; margin: 6px 0 0; height: min(70vh, 640px); min-height: 480px; border-radius: 24px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, var(--card) 0%, var(--bg-2) 78%); box-shadow: var(--shadow); }
.work::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .45;
  background-image: linear-gradient(to right, color-mix(in srgb, var(--line) 80%, transparent) 1px, transparent 1px),
                    linear-gradient(to bottom, color-mix(in srgb, var(--line) 80%, transparent) 1px, transparent 1px);
  background-size: 64px 32px; }
.work canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.work .caption { position: absolute; left: 0; right: 0; top: 20px; text-align: center; padding: 0 16px; pointer-events: none; }
.work .caption h2 { margin: 0; font-size: clamp(19px, 2.6vw, 26px); letter-spacing: -.01em; }
.work .caption p { margin: 6px 0 0; color: var(--ink-2); min-height: 1.5em; transition: opacity .3s; }
.stages { list-style: none; margin: 18px auto 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 6px; max-width: 980px; }
.stages li { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 5px 11px; border-radius: 999px; background: var(--bg-2); color: var(--ink-3); transition: background .3s, color .3s; }
.stages li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .5; }
.stages li.active { background: var(--ink); color: var(--bg); }
.stages li.active::before { opacity: 1; animation: blink .8s ease-in-out infinite; }
.stages li.done { background: var(--ok-soft); color: var(--ok); }
.stages li.done::before { opacity: 1; }
@keyframes blink { 50% { opacity: .2; } }

/* ---------- report ---------- */
.rep-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin: 10px 0 18px; }
.rep-head h1 { margin: 0; font-size: clamp(22px, 3vw, 30px); letter-spacing: -.02em; overflow-wrap: anywhere; }
.rep-head p { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }
.rep-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tile { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 16px 14px; text-align: start; border: 2px solid transparent;
  position: relative; overflow: hidden; min-width: 0; animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
.tile .k { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.tile .k i { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-style: normal; font-size: 12px; background: var(--bg-2); font-weight: 700; }
.tile .n { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .s { color: var(--ink-3); font-size: 12.5px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile.t-text .n, .tile.t-text .k i { color: var(--raw); } .tile.t-num .n, .tile.t-num .k i { color: var(--dr); }
.tile.t-date .n, .tile.t-date .k i { color: var(--cl); } .tile.t-rows .n, .tile.t-rows .k i { color: var(--cr); }
.tile .bar-in { position: absolute; left: 0; bottom: 0; height: 4px; width: 0; background: currentColor; transition: width 1.1s cubic-bezier(.2,.8,.2,1); }
.tile.t-text .bar-in { color: var(--raw); } .tile.t-num .bar-in { color: var(--dr); } .tile.t-date .bar-in { color: var(--cl); } .tile.t-rows .bar-in { color: var(--cr); }
[dir=rtl] .tile .bar-in { left: auto; right: 0; }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, color-mix(in srgb, var(--card) 70%, #fff) 50%, transparent 70%);
  transform: translateX(-110%); animation: glint 1.2s ease .6s 1 both; pointer-events: none; opacity: .55; }
@keyframes glint { to { transform: translateX(110%); } }

/* before / after */
.compare { margin-top: 18px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 14px 14px 10px; min-width: 0; }
.cmp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 2px 4px 10px; }
.cmp-head h2 { margin: 0; font-size: 17px; }
.cmp-head .legend { display: flex; gap: 12px; flex-wrap: wrap; color: var(--ink-2); font-size: 12.5px; }
.cmp-head .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }
.cmp-scroll { overflow: auto; max-height: 460px; border: 1px solid var(--line); border-radius: 12px; position: relative; }
.cmp-inner { display: grid; position: relative; width: max-content; min-width: 100%; }
.cmp-inner > .layer { grid-area: 1 / 1; min-width: 100%; }
.cmp-inner table { border-collapse: collapse; font-size: 12.5px; width: 100%; }
.cmp-inner th, .cmp-inner td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: start; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; height: 31px; }
.cmp-inner thead th { position: sticky; top: 0; background: var(--bg-2); font-weight: 600; z-index: 2; }
.cmp-inner td.rn, .cmp-inner th.rn { color: var(--ink-3); font-family: var(--mono); font-size: 11.5px; width: 1%; position: sticky; inset-inline-start: 0; background: var(--card); z-index: 1; }
.cmp-inner thead th.rn { background: var(--bg-2); z-index: 3; }
.layer.before { background: var(--card); }
.layer.after { background: var(--card); }
.layer.before tr.gone td:not(.rn) { color: var(--ink-3); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--warn) 55%, transparent); background: color-mix(in srgb, var(--warn-soft) 55%, transparent); }
.layer.before tr.gone td.rn { box-shadow: inset 3px 0 0 var(--warn); }
[dir=rtl] .layer.before tr.gone td.rn { box-shadow: inset -3px 0 0 var(--warn); }
.layer.before td.messy { color: var(--raw); }
.why-gone { display: inline-block; font-size: 11px; font-weight: 700; color: var(--warn); background: var(--warn-soft); border-radius: 999px; padding: 0 8px; margin-inline-start: 6px; text-decoration: none; }
.layer.after td.c { background: color-mix(in srgb, var(--cl-soft) 75%, transparent); position: relative; }
.layer.after td.c::before { content: ""; position: absolute; top: 4px; inset-inline-end: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--cl); }
.layer.after td.k { background: var(--look-soft); }
.layer.after th.new { color: var(--cl); }
.layer.after td.m { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: end; direction: ltr; }
.layer.after td.d { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.layer.after.lit tbody tr { animation: rowIn .45s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rowIn { from { opacity: 0; transform: translateY(4px); } }
.beam { position: absolute; top: 0; bottom: 0; width: 3px; margin-inline-start: -1px; z-index: 5; pointer-events: none; opacity: 0;
  background: var(--cl); box-shadow: 0 0 18px 6px color-mix(in srgb, var(--cl) 45%, transparent), 0 0 3px 1px var(--cl); }
.beam::before { content: ""; position: absolute; top: 0; bottom: 0; width: 90px; inset-inline-end: 3px;
  background: linear-gradient(to left, color-mix(in srgb, var(--cl) 18%, transparent), transparent); }
[dir=rtl] .beam::before { background: linear-gradient(to right, color-mix(in srgb, var(--cl) 18%, transparent), transparent); }
.cmp-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 4px 2px; color: var(--ink-3); font-size: 12.5px; }

.tabs { display: flex; gap: 4px; margin: 26px 0 0; border-bottom: 1px solid var(--line-2); overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--ink-2); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--ink); }
.tabs button .cnt { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--bg-2); font-size: 12px; margin-inline-start: 6px; text-align: center; }
.pane { animation: paneIn .35s cubic-bezier(.2,.8,.2,1) both; padding-top: 14px; }
@keyframes paneIn { from { opacity: 0; transform: translateY(10px); } }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; }
.card h3 { margin: 0 0 4px; font-size: 16px; }
.lead { margin: 0 0 12px; color: var(--ink-2); font-size: 14px; }
.empty { text-align: center; padding: 36px; color: var(--ink-3); background: var(--card); border-radius: 12px; margin: 0; }

/* what changed */
.groups { display: grid; gap: 18px; }
.group h3 { margin: 0 0 8px; font-size: 14px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.group h3 i { font-style: normal; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: var(--card); font-size: 12px; font-weight: 700; box-shadow: var(--shadow); }
.changes { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; }
.chg { background: var(--card); border-radius: 12px; box-shadow: var(--shadow); padding: 12px 14px; animation: rise .45s cubic-bezier(.2,.8,.2,1) both; min-width: 0; border-inline-start: 4px solid var(--line-2); }
.chg.g-text { border-inline-start-color: var(--raw); } .chg.g-num { border-inline-start-color: var(--dr); }
.chg.g-date { border-inline-start-color: var(--cl); } .chg.g-amt { border-inline-start-color: var(--cr); }
.chg .h { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.chg .h b { font-size: 14px; }
.chg .h .n { font-family: var(--mono); font-weight: 700; color: var(--ink-2); }
.ex { margin-top: 8px; display: grid; gap: 5px; }
.ex div { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; font-size: 12.5px; }
.ex .b, .ex .a { padding: 3px 8px; border-radius: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; unicode-bidi: plaintext; }
.ex .b { background: var(--raw-soft); color: color-mix(in srgb, var(--raw) 70%, var(--ink)); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--raw) 40%, transparent); }
.ex .a { background: var(--cl-soft); color: color-mix(in srgb, var(--cl) 60%, var(--ink)); font-weight: 600; }
.ex .ar { color: var(--ink-3); }
.ex .vis { font-family: var(--mono); }

/* removed rows, to check, balance */
.rows { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); font-size: 13.5px; }
.rows th, .rows td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: start; }
.rows th { background: var(--bg-2); font-size: 12.5px; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.rows td.t { max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows td.e { text-align: end; white-space: nowrap; }
.tbl-wrap { overflow-x: auto; border-radius: 12px; box-shadow: var(--shadow); }
.tbl-wrap .rows { box-shadow: none; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 12px; }
.filter { border: 1px solid var(--line-2); background: var(--card); border-radius: 999px; padding: 5px 12px; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.filter .c { color: var(--ink-3); font-size: 12px; }
.filter.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.filter.on .c { color: inherit; opacity: .7; }
.reason { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 1px 9px; background: var(--bg-2); color: var(--ink-2); white-space: nowrap; }
.reason.r-total, .reason.r-balance_line { background: var(--cr-soft); color: color-mix(in srgb, var(--cr) 75%, var(--ink)); }
.reason.r-joined { background: var(--cl-soft); color: color-mix(in srgb, var(--cl) 70%, var(--ink)); }
.reason.r-page_text, .reason.r-repeated_header { background: var(--raw-soft); color: color-mix(in srgb, var(--raw) 70%, var(--ink)); }
.verdict { display: flex; gap: 16px; align-items: center; padding: 18px 20px; border-radius: var(--radius); background: var(--ok-soft); margin-bottom: 12px; }
.verdict.look { background: var(--look-soft); } .verdict.fix { background: var(--warn-soft); }
.verdict .seal { width: 54px; height: 54px; flex: none; }
.verdict b { display: block; font-size: 19px; font-family: var(--display); }
.verdict span { color: var(--ink-2); font-size: 14px; }
.seal circle.ring-d { stroke-dasharray: 160; stroke-dashoffset: 160; animation: draw 1s cubic-bezier(.2,.8,.2,1) .1s forwards; }
.seal path.tick { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .5s ease .7s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chain { display: flex; gap: 2px; height: 26px; align-items: flex-end; margin: 4px 0 14px; }
.chain span { flex: 1; min-width: 1px; border-radius: 2px 2px 0 0; background: var(--ok); opacity: .7; height: 40%; transform-origin: bottom; animation: grow .6s cubic-bezier(.2,.8,.2,1) both; }
.chain span.bad { background: var(--warn); opacity: 1; height: 100%; }
@keyframes grow { from { transform: scaleY(0); } }

.feedback { margin-top: 18px; }
.feedback h3 { margin: 0 0 10px; }
.fb-choices { display: flex; gap: 10px; flex-wrap: wrap; }
.fb-choices .btn.on { border-color: var(--ink); background: var(--bg-2); }
.fb-label { display: block; margin: 14px 0 6px; font-size: 14px; color: var(--ink-2); }
.feedback textarea, .feedback input { width: 100%; border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px; background: var(--card); resize: vertical; }
.feedback input { display: block; max-width: 420px; }
[dir=rtl] .feedback input { text-align: right; }
.fb-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.fb-actions small { flex-basis: 100%; }
.feedback .error { margin: 12px 0 0; }
.feedback.done p { margin: 0; color: var(--ok); font-weight: 600; }
.promo { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; border-inline-start: 4px solid var(--cl); }
.promo h3 { margin: 0 0 2px; font-size: 16px; }
.promo p { margin: 0; color: var(--ink-2); font-size: 14px; max-width: 70ch; }
.promo.match { background: linear-gradient(100deg, var(--card) 55%, color-mix(in srgb, var(--cl-soft) 70%, var(--card))); }
.promo .pair { display: inline-flex; gap: 4px; margin-inline-end: 6px; vertical-align: -3px; }
.promo .pair i { width: 11px; height: 15px; border-radius: 3px; background: #0f8a8a; }
.promo .pair i + i { background: #e39b2d; }

.fade-in { animation: fadeIn .5s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } }
.stagger > * { animation: rise .45s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* questions under the home screen */
.faq { width: 100%; max-width: 960px; margin: 0 auto; padding: 8px clamp(16px, 4vw, 40px) 56px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 32px; }
.faq h2 { grid-column: 1 / -1; font-size: 22px; margin: 0 0 8px; }
.faq h3 { font-family: var(--sans); font-size: 16px; margin: 16px 0 6px; }
.faq p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.faq[hidden] { display: none; }

@media (max-width: 900px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .answers { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .faq { grid-template-columns: 1fr; }
  .answers { grid-template-columns: 1fr; }
  .tile .n { font-size: 24px; }
  .changes { grid-template-columns: 1fr; }
  .opts { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .by { display: none; }
  .brand-name em { display: none; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tile { padding: 12px; }
  .work { min-height: 440px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
