/* One brand theme (navy + blue + gold) for every visitor: the dot field is
   drawn white on navy, so there is no light variant on purpose. */
:root {
  --bg: #071431;
  --bg-2: #0b1d45;
  --surface: rgba(16, 36, 82, .72);
  --surface-solid: #10234f;
  --surface-2: rgba(255, 255, 255, .05);
  --text: #eef3ff;
  --muted: #9fb0d4;
  --border: rgba(160, 185, 240, .16);
  --accent: #2f6bff;
  --accent-ink: #ffffff;
  --accent-soft: rgba(47, 107, 255, .16);
  --gold: #e6b84f;
  --gold-2: #f6d78b;
  --ok: #3ddc97;
  --ok-soft: rgba(61, 220, 151, .12);
  --warn: #f5c45e;
  --warn-soft: rgba(245, 196, 94, .12);
  --err: #ff7a7a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 12px 36px rgba(0, 0, 0, .28);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--text); min-height: 100vh;
  background: radial-gradient(1200px 600px at 50% -10%, #133070 0%, transparent 60%), linear-gradient(180deg, var(--bg-2), var(--bg) 480px);
  background-color: var(--bg);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
#dots { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.top, main, .foot { position: relative; z-index: 1; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ── Header ── */
.top { background: rgba(7, 20, 49, .86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; }
/* The gold line under the navigation. */
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: linear-gradient(90deg, transparent, var(--gold) 15%, var(--gold-2) 50%, var(--gold) 85%, transparent); }
.top-in { display: flex; align-items: center; gap: 24px; min-height: 60px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; color: var(--text); font-size: 19px; letter-spacing: -.01em; }
.logo:hover { text-decoration: none; }
.logo-b { color: var(--gold); }
.logo-icon { display: block; width: 30px; height: 30px; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav-group { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.nav-cat { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.nav-group a { color: var(--text); }
.nav-group a:hover { color: var(--gold-2); text-decoration: none; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 4px 10px; font-size: 18px; cursor: pointer; }
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 62px; background: var(--surface-solid); border-bottom: 1px solid var(--border); flex-direction: column; gap: 14px; padding: 16px; }
  .nav.open { display: flex; }
  .nav-group { flex-wrap: wrap; }
}

/* ── Hero ── */
.hero { padding: 48px 0 24px; text-align: center; }
.hero h1 { font-size: clamp(30px, 5.2vw, 46px); margin: 0 0 12px; font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--gold); }
.lead { color: var(--muted); max-width: 640px; margin: 0 auto; font-size: 17px; }
.badge { display: inline-flex; align-items: center; gap: 8px; margin: 16px 0 0; padding: 6px 12px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-size: 13px; font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }

/* ── Tool card ── */
.tool { background: rgba(14, 32, 74, .9); border: 1px solid var(--border); border-top: 2px solid rgba(230, 184, 79, .55); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border: 2px dashed var(--border); border-radius: 12px; padding: 36px 16px; text-align: center;
  cursor: pointer; background: var(--surface-2); transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop strong { font-size: 18px; }
.drop .muted { font-size: 14px; }
.drop.compact { padding: 14px; flex-direction: row; }
.drop input { display: none; }

.opts { display: flex; flex-wrap: wrap; gap: 14px 20px; margin: 18px 0 4px; align-items: flex-end; }
.opt { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.opt select, .opt input[type=number], .opt input[type=text] {
  font: inherit; font-size: 15px; font-weight: 400; color: var(--text); background: var(--surface-solid);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; min-width: 130px;
}
.opt input[type=range] { width: 180px; accent-color: var(--accent); }
.opt output { color: var(--text); font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 15px; border-radius: 10px; padding: 10px 18px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; align-items: center; }
.icon-btn { background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 8px; width: 32px; height: 32px; cursor: pointer; font-size: 14px; }
.icon-btn:hover { color: var(--text); border-color: var(--accent); }

/* ── File list ── */
.files { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.file {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2);
}
.file.dragging { opacity: .4; }
.file.drop-target { border-color: var(--accent); }
.thumb { width: 44px; height: 44px; border-radius: 8px; background: var(--surface-2); object-fit: cover; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--muted); }
.fname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmeta { font-size: 13px; color: var(--muted); }
.fmeta .gain { color: var(--ok); font-weight: 600; }
.fmeta .loss { color: var(--warn); font-weight: 600; }
.fmeta .bad { color: var(--err); font-weight: 600; }
.fright { display: flex; gap: 6px; align-items: center; }
.handle { cursor: grab; color: var(--muted); user-select: none; padding: 0 4px; }

.summary { margin-top: 14px; font-size: 14px; color: var(--muted); }
.note { margin-top: 14px; padding: 10px 12px; border-radius: 10px; font-size: 14px; background: var(--surface-2); }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.err { background: color-mix(in srgb, var(--err) 12%, transparent); color: var(--err); }
.note.ok { background: var(--ok-soft); color: var(--ok); }

.progress { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 14px; }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.prog-text { font-size: 14px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.seg label { padding: 8px 14px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted); border-right: 1px solid var(--border); }
.seg label:last-child { border-right: 0; }
.seg input { display: none; }
.seg label:has(input:checked) { background: var(--accent-soft); color: var(--accent); }

/* ── Edit PDF ── */
.ed-bar { position: sticky; top: 62px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px; margin: -6px -6px 12px; background: var(--surface-solid); border: 1px solid var(--border); border-radius: 12px; }
.ed-sep { width: 1px; height: 26px; background: var(--border); margin: 0 2px; }
.ed-grow { flex: 1; }
.ed-ctl { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.ed-ctl select, .ed-ctl input[type=number] { font: inherit; font-size: 14px; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; }
.ed-ctl input[type=number] { width: 64px; }
.ed-ctl input[type=color] { width: 34px; height: 32px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); cursor: pointer; }
.ed-b[aria-pressed=true] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.ed-hint { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.ed-pages { display: flex; flex-direction: column; align-items: center; gap: 18px; overflow-x: auto; padding-bottom: 4px; }
.ed-page { position: relative; background: #fff; box-shadow: 0 4px 24px rgba(0, 0, 0, .35); flex: none; }
.ed-canvas { display: block; }
.ed-layer { position: absolute; inset: 0; }
.ed-item { position: absolute; white-space: pre; cursor: text; border-radius: 2px; color: transparent; outline-offset: 1px; }
.ed-item:hover { outline: 1px dashed rgba(47, 107, 255, .8); background: rgba(47, 107, 255, .06); }
.ed-item.changed { outline: 1px solid rgba(230, 184, 79, .7); }
.ed-item.on, .ed-add:focus { outline: 2px solid var(--gold); background-clip: padding-box; }
.ed-item.on:focus, .ed-add:focus { box-shadow: 0 0 0 4px rgba(230, 184, 79, .25); }
.adding .ed-page { cursor: crosshair; }
.adding .ed-item { pointer-events: none; }
.ed-add-wrap { position: absolute; }
.ed-add { position: relative; min-width: 24px; white-space: pre; outline: 1px dashed rgba(47, 107, 255, .8); cursor: text; padding: 0 1px; }
.ed-add:empty::before { content: "Type…"; color: #9aa6bf; }
.ed-handle { position: absolute; left: -20px; top: 50%; transform: translateY(-50%); width: 18px; height: 22px; display: flex; align-items: center; justify-content: center; font-size: 14px; color: #fff; background: var(--accent); border-radius: 5px; cursor: move; touch-action: none; user-select: none; }

/* ── Content ── */
.info, .related, .hub-cat { margin-top: 36px; }
.info h2, .related h2, .hub-cat h2 { font-size: 22px; margin: 28px 0 12px; }
.steps { padding-left: 22px; margin: 0; }
.steps li { margin: 6px 0; }
.faq details { background: var(--surface); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; margin-bottom: 8px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 8px 0 0; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.cards.three { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; color: var(--text); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: border-color .15s, transform .15s, box-shadow .15s; }
a.card:hover { border-color: rgba(230, 184, 79, .6); text-decoration: none; box-shadow: var(--shadow); transform: translateY(-2px); }
a.card strong::after { content: " →"; color: var(--gold); opacity: 0; transition: opacity .15s; }
a.card:hover strong::after { opacity: 1; }
.card span { font-size: 14px; color: var(--muted); }

.ad-slot { margin: 28px 0; min-height: 100px; }
.ad-slot.ad-off { min-height: 0; margin: 0; }

.foot { margin-top: 56px; padding: 28px 0; border-top: 1px solid var(--border); font-size: 14px; background: rgba(7, 20, 49, .8); }
.foot p { margin: 4px 0; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 !important; }
.foot-links a { color: var(--muted); }
.foot-links a:hover { color: var(--gold-2); }

/* Text pages (privacy, about, contact) */
.prose { max-width: 720px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 28px 24px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.prose h2 { font-size: 20px; margin: 26px 0 8px; }
.prose p, .prose li { color: #cdd8f0; }
.prose ul { padding-left: 22px; }
.prose li { margin: 6px 0; }
.contact-mail { margin: 22px 0 8px; }
@media (max-width: 560px) { .prose { padding: 4px 16px 18px; } }

@media (max-width: 560px) {
  .tool { padding: 14px; }
  .hero { padding-top: 28px; }
  .file { grid-template-columns: 40px 1fr; }
  .fright { grid-column: 1 / -1; justify-content: flex-end; }
  .opt input[type=range] { width: 100%; }
  .opt { flex: 1 1 140px; }
}
