:root {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --surface-2: #f3f3f1;
  --text: #16181d;
  --muted: #646a76;
  --line: #e4e4e0;
  --accent: #2f5bea;
  --accent-soft: #e8eeff;
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --warn: #a15c07;
  --warn-soft: #fdf3e2;
  --err: #c0262d;
  --err-soft: #fdecec;
  --radius: 12px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --surface: #181b21;
    --surface-2: #20242b;
    --text: #eceef2;
    --muted: #9aa1ad;
    --line: #2c3139;
    --accent: #7c9bff;
    --accent-soft: #1f2a4a;
    --ok: #4ade80;
    --ok-soft: #13301f;
    --warn: #fbbf24;
    --warn-soft: #33270d;
    --err: #f87171;
    --err-soft: #3a1717;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
code, pre { font-family: var(--mono); font-size: .88em; }
code { background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }
pre { background: var(--surface-2); padding: 14px 16px; border-radius: 10px; overflow-x: auto; line-height: 1.5; margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

.container { width: min(1200px, 100% - 32px); margin: 0 auto; }

.topbar { border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.topbar__inner { display: flex; align-items: center; gap: 20px; height: 58px; }
.logo { font-weight: 800; font-size: 1.1rem; color: var(--text); display: flex; align-items: center; gap: 8px; }
.logo:hover { text-decoration: none; }
.logo span { font-family: var(--mono); color: var(--accent); }
.topbar nav { margin-left: auto; display: flex; gap: 18px; align-items: center; }
.topbar nav a { color: var(--muted); font-weight: 500; }
.topbar nav a.active, .topbar nav a:hover { color: var(--text); text-decoration: none; }
.topbar nav a.btn { color: #fff; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font: inherit; font-weight: 600; padding: .55em 1.1em; border-radius: 9px; cursor: pointer; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn--danger { background: transparent; color: var(--err); border-color: var(--line); }
.btn--small { padding: .3em .8em; font-size: .85rem; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.pad { padding: 20px; }

.hero { padding: 56px 0 32px; }
.hero p { font-size: 1.1rem; color: var(--muted); max-width: 680px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }

.tcard { overflow: hidden; display: flex; flex-direction: column; color: var(--text); transition: transform .15s, box-shadow .15s; }
.tcard:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0, 0, 0, .08); }
.thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.thumb iframe { position: absolute; top: 0; left: 0; width: 400%; height: 400%; border: 0; transform: scale(.25); transform-origin: 0 0; pointer-events: none; background: #fff; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.tcard__body { padding: 16px 18px 18px; }
.tcard__body p { color: var(--muted); font-size: .9rem; margin: 0 0 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: .75rem; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }

.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; text-transform: uppercase; letter-spacing: .03em; }
.badge--pending { background: var(--warn-soft); color: var(--warn); }
.badge--approved { background: var(--ok-soft); color: var(--ok); }
.badge--rejected { background: var(--err-soft); color: var(--err); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 8px 0 40px; }
.step { padding: 18px 20px; }
.step b { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: .85rem; margin-bottom: 8px; }
.step p { margin: 0; color: var(--muted); font-size: .92rem; }

.report { margin-top: 16px; }
.report ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.report li { padding: 8px 12px; border-radius: 8px; font-size: .9rem; }
.report li code { background: transparent; padding: 0; font-weight: 600; }
.report .e { background: var(--err-soft); color: var(--err); }
.report .w { background: var(--warn-soft); color: var(--warn); }
.report .ok { background: var(--ok-soft); color: var(--ok); }
.stats { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .85rem; color: var(--muted); margin: 10px 0; }

label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
input[type=text], input[type=email], textarea { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: .6em .8em; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.field { margin-bottom: 16px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 36px 20px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop input { display: none; }
.drop strong { display: block; font-size: 1.05rem; }

.split { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: start; }
.tree { font-family: var(--mono); font-size: .85rem; line-height: 1.7; white-space: pre; }

.footer { border-top: 1px solid var(--line); margin-top: 64px; padding: 24px 0; color: var(--muted); font-size: .85rem; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }

@media (max-width: 860px) {
  .split, .steps { grid-template-columns: 1fr; }
  .topbar nav { gap: 12px; }
}
