@font-face { font-family: 'Thmanyah Sans'; src: url(assets/fonts/thmanyahsans-Regular.otf); font-weight: 400; }
@font-face { font-family: 'Thmanyah Sans'; src: url(assets/fonts/thmanyahsans-Medium.otf); font-weight: 500; }
@font-face { font-family: 'Thmanyah Sans'; src: url(assets/fonts/thmanyahsans-Bold.otf); font-weight: 700; }
@font-face { font-family: 'Thmanyah Sans'; src: url(assets/fonts/thmanyahsans-Black.otf); font-weight: 900; }
@font-face { font-family: 'Thmanyah Display'; src: url(assets/fonts/thmanyahserifdisplay-Black.otf); }

:root {
  --green: #004D45; --deep: #00352F; --night: #0E1614; --cream: #F5F5E8; --paper: #FBFBF6;
  --red: #C23B2C; --red-soft: #F07A6B; --ink: #1A1F1E; --muted: #5D6A66; --line: #DFE3DA; --sage: #B7C4BF;
  --ok: #0E7A5C; --warn: #B7791F;
  --radius: 18px; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,53,47,.07);
}
* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Thmanyah Sans', Tahoma, sans-serif; background: var(--cream); color: var(--ink); line-height: 1.6; font-size: 16px; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
img { display: block; max-width: 100%; }
.en, .code { font-family: 'Jost', 'Futura', 'Helvetica Neue', Arial, sans-serif; direction: ltr; unicode-bidi: isolate; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--deep); color: var(--cream); }
.top-in { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 28px; padding: 12px 24px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 40px; width: auto; }
.brand small { display: block; font-size: 12px; color: var(--sage); line-height: 1.2; }
.tabs { display: flex; gap: 4px; margin-inline-start: auto; flex-wrap: wrap; }
.tab { padding: 8px 16px; border-radius: 999px; color: var(--sage); font-weight: 500; font-size: 15px; transition: background .2s, color .2s; }
.tab:hover { color: var(--cream); background: rgba(245,245,232,.08); }
.tab[aria-selected="true"] { background: var(--cream); color: var(--deep); font-weight: 700; }

main { max-width: 1280px; margin: 0 auto; padding: 32px 24px 80px; }
.view { display: none; }
.view.on { display: block; animation: in .35s ease both; }
@keyframes in { from { opacity: 0; transform: translateY(8px); } }

h1, h2, .display { font-family: 'Thmanyah Display', 'Thmanyah Sans', serif; font-weight: 400; line-height: 1.25; }
h1 { font-size: clamp(30px, 4vw, 46px); }
h2 { font-size: 28px; }
h3 { font-size: 18px; font-weight: 700; }
.eyebrow { color: var(--red); font-weight: 700; font-size: 14px; letter-spacing: .02em; }
.lead { color: var(--muted); font-size: 17px; max-width: 760px; }
.head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 24px; }

/* ---------- cards & controls ---------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: 14px; font-weight: 700; transition: transform .15s, background .2s, opacity .2s; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: #A93224; }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-ghost { background: #E8ECE4; color: var(--deep); }
.btn-ghost:hover { background: #DDE3D8; }
.btn-dark { background: var(--deep); color: var(--cream); }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-weight: 500; transition: all .15s; }
.chip img { width: 26px; height: 26px; object-fit: contain; }
.chip[aria-pressed="true"] { border-color: var(--green); background: #E6F0EC; color: var(--deep); font-weight: 700; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.sev-high { background: #FBE3DF; color: #A93224; }
.sev-medium { background: #FCEFD6; color: #8A5A12; }
.sev-low { background: #E6EEE9; color: #2F5D50; }
.codetag { font-family: 'Jost', Arial, sans-serif; font-weight: 600; font-size: 12px; letter-spacing: .08em; color: var(--red); direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
:focus-visible { outline: 3px solid var(--red-soft); outline-offset: 2px; }

/* ---------- audit wizard ---------- */
.wizard { display: grid; grid-template-columns: 380px 1fr; gap: 24px; align-items: start; }
.steps { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 92px; }
.step-n { display: inline-flex; width: 26px; height: 26px; border-radius: 8px; background: var(--deep); color: var(--cream); align-items: center; justify-content: center; font-size: 14px; font-weight: 700; margin-inline-end: 8px; }
.step h3 { display: flex; align-items: center; margin-bottom: 12px; }
.drop { position: relative; border: 2px dashed #C9D2C9; border-radius: 16px; background: #fff; min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 18px; transition: border-color .2s, background .2s; overflow: hidden; }
.drop.over { border-color: var(--green); background: #EEF5F1; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop .preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #0E1614; }
.drop .swap { position: absolute; bottom: 10px; inset-inline-start: 10px; z-index: 2; }
.examples-mini { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.examples-mini button { font-size: 13px; padding: 6px 12px; border-radius: 10px; background: #E8ECE4; color: var(--deep); font-weight: 500; }
.domains { display: flex; flex-wrap: wrap; gap: 8px; }
textarea { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; resize: vertical; min-height: 64px; }

.checklist-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.counter { display: flex; gap: 10px; font-size: 14px; }
.counter span { padding: 4px 12px; border-radius: 999px; background: #EEF1EA; }
.counter .bad { background: #FBE3DF; color: #A93224; font-weight: 700; }
.rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.rule { background: #fff; border: 1.5px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 8px; transition: border-color .2s, box-shadow .2s; }
.rule.fail { border-color: var(--red); box-shadow: 0 0 0 4px rgba(194,59,44,.08); }
.rule.pass { border-color: #9CC7B4; }
.rule-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rule h4 { font-size: 16px; font-weight: 700; }
.rule .q { font-size: 15px; }
.rule .why { font-size: 13px; color: var(--muted); }
.verdict { display: flex; gap: 6px; margin-top: auto; }
.verdict button { flex: 1; padding: 8px; border-radius: 10px; background: #F1F3EE; font-size: 14px; font-weight: 500; }
.verdict button[data-v="fail"][aria-pressed="true"] { background: var(--red); color: #fff; }
.verdict button[data-v="pass"][aria-pressed="true"] { background: var(--ok); color: #fff; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty img { width: 120px; margin: 0 auto 12px; opacity: .9; }
.actionbar { position: sticky; bottom: 16px; margin-top: 20px; display: flex; gap: 12px; align-items: center; justify-content: space-between; background: var(--deep); color: var(--cream); border-radius: 18px; padding: 14px 18px; box-shadow: 0 16px 40px rgba(0,0,0,.25); flex-wrap: wrap; }
.actionbar .muted { color: var(--sage); }

/* ---------- progress & result ---------- */
.progress { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 48px 16px; text-align: center; }
.spinner { width: 54px; height: 54px; border-radius: 50%; border: 5px solid #E2E7E0; border-top-color: var(--red); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.stages { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.stages span { padding: 4px 12px; border-radius: 999px; background: #EEF1EA; font-size: 13px; color: var(--muted); }
.stages span.on { background: var(--deep); color: var(--cream); }
.stages span.done { background: #DCEDE5; color: var(--ok); }

.result { display: grid; grid-template-columns: 1.35fr 1fr; gap: 24px; align-items: start; }
.compare { position: relative; border-radius: 18px; overflow: hidden; background: #0E1614; user-select: none; touch-action: none; aspect-ratio: var(--ar, 4/5); }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.compare .after-wrap { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--cut, 50%)); }
.compare .handle { position: absolute; top: 0; bottom: 0; left: var(--cut, 50%); width: 3px; background: #fff; transform: translateX(-50%); }
.compare .handle::after { content: '⟷'; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 42px; height: 42px; border-radius: 50%; background: #fff; color: var(--deep); display: flex; align-items: center; justify-content: center; font-size: 18px; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.compare .lbl { position: absolute; top: 12px; padding: 4px 12px; border-radius: 10px; font-weight: 700; font-size: 13px; color: #fff; }
.compare .lbl.b { left: 12px; background: var(--red); }
.compare .lbl.a { right: 12px; background: var(--ok); }
.report h2 { margin-bottom: 6px; }
.score { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 14px; }
.score b { font-family: 'Jost', Arial, sans-serif; font-size: 46px; line-height: 1; color: var(--red); }
.fixlist { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.fix { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #fff; }
.fix .src { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- library ---------- */
.libbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.search { flex: 1; min-width: 240px; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 16px; background: #fff; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.stat { background: var(--deep); color: var(--cream); border-radius: 18px; padding: 18px; }
.stat b { display: block; font-family: 'Jost', Arial, sans-serif; font-size: 38px; line-height: 1.1; color: var(--red-soft); }
.libgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.libcard { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.libcard details { font-size: 14px; }
.libcard summary { cursor: pointer; color: var(--green); font-weight: 700; }
.libcard ul { padding-inline-start: 18px; margin-top: 6px; }
.cite { font-size: 12.5px; color: var(--muted); border-inline-start: 3px solid var(--line); padding-inline-start: 8px; }

/* ---------- examples ---------- */
.excase { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: center; margin-bottom: 36px; }
.excase:nth-child(even) .compare { order: 2; }
.excase .codes { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.excase .codes span { background: #FBE3DF; color: #A93224; border-radius: 10px; padding: 4px 10px; font-size: 13px; font-weight: 700; }

/* ---------- method ---------- */
.flow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 10px 0 28px; }
.flow div { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; position: relative; }
.flow div b { display: block; font-family: 'Jost', Arial, sans-serif; color: var(--red); font-size: 22px; }
.sources { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 12px; }
.source { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; font-size: 14px; }
.source b { display: block; font-size: 15px; margin-bottom: 2px; }
.note { background: #FFF7E8; border: 1px solid #F1DDB4; color: #6B4A12; border-radius: 14px; padding: 12px 16px; font-size: 14px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; z-index: 50; display: none; }

@media (max-width: 960px) {
  .wizard, .result, .excase { grid-template-columns: 1fr; }
  .steps { position: static; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .flow { grid-template-columns: 1fr 1fr; }
  .excase:nth-child(even) .compare { order: 0; }
  .tabs { margin-inline-start: 0; }
  .top-in { flex-wrap: wrap; }
}
@media print {
  .top, .steps, .actionbar, .row-btns, #view-library, #view-examples, #view-method { display: none !important; }
  body { background: #fff; }
  .result { grid-template-columns: 1fr 1fr; }
}

/* ---------- single-flow page ---------- */
main.solo { max-width: 1120px; }
.hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 24px auto 28px; }
.hero h1 { font-size: clamp(34px, 5vw, 56px); }
.hero .lead { text-align: center; max-width: 680px; }
.drop.big { max-width: 760px; margin: 0 auto; min-height: 360px; border-radius: 26px; background: var(--paper); box-shadow: var(--shadow); }
.drop.big.has { background: #0E1614; border-style: solid; border-color: transparent; }
.drop-icon { width: 76px; height: 76px; }
.go-row { display: flex; justify-content: center; margin-top: 22px; }
.btn-lg { font-size: 19px; padding: 16px 44px; border-radius: 18px; }
.center { text-align: center; margin-top: 8px; }
.finds { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.find { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.find-n { flex-shrink: 0; width: 28px; height: 28px; border-radius: 8px; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-family: 'Jost', Arial, sans-serif; }
.find p { color: var(--muted); font-size: 14.5px; }
.marked { margin: 4px 0 14px; }
.marked summary { cursor: pointer; color: var(--green); font-weight: 700; }
.marked img { margin-top: 10px; border-radius: 12px; }
.clean { display: grid; grid-template-columns: 320px 1fr; gap: 24px; align-items: center; }
.clean img { border-radius: 14px; }
@media (max-width: 960px) { .clean { grid-template-columns: 1fr; } }

[hidden] { display: none !important; }
