/* ============================================================
   PDFolia - design system
   A single stylesheet shared by the home page, every tool page
   and the editor. Tokens first, then layout, then components.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --red-50:#fff1f0;  --red-100:#ffe0dd; --red-500:#e5322d; --red-600:#d0231e;
  --red-700:#b01a16;
  --blue-50:#eef4ff;  --blue-500:#2f6bff;
  --green-50:#e9f9f0; --green-500:#129d5f;
  --amber-50:#fff5e6; --amber-500:#f59012;
  --violet-50:#f2eeff;--violet-500:#6d4aff;
  --slate-50:#eef1f6; --slate-500:#516079;

  --ink:#1b2430;
  --ink-2:#3d4a5c;
  --muted:#6b7889;
  --faint:#9aa5b4;
  --line:#e4e8ee;
  --line-2:#eef1f5;
  --bg:#ffffff;
  --bg-2:#f6f8fb;
  --bg-3:#eef2f7;

  --radius-sm:8px; --radius:12px; --radius-lg:18px; --radius-xl:26px;
  --shadow-xs:0 1px 2px rgba(20,30,45,.06);
  --shadow-sm:0 2px 8px rgba(20,30,45,.07);
  --shadow:0 6px 22px rgba(20,30,45,.09);
  --shadow-lg:0 18px 50px rgba(20,30,45,.14);
  --ring:0 0 0 3px rgba(229,50,45,.22);

  --header-h:68px;
  --font:"Inter","Segoe UI",Roboto,-apple-system,BlinkMacSystemFont,"Helvetica Neue",Arial,sans-serif;
}

*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0; font-family:var(--font); color:var(--ink); background:var(--bg-2);
  font-size:15px; line-height:1.6; -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4{margin:0; line-height:1.2; letter-spacing:-.02em; font-weight:700; color:var(--ink)}
h1{font-size:clamp(30px,4.6vw,48px)}
h2{font-size:clamp(22px,3vw,30px)}
h3{font-size:19px}
p{margin:0}
a{color:inherit; text-decoration:none}
img,svg{max-width:100%}
button,input,select,textarea{font:inherit; color:inherit}
:focus-visible{outline:none; box-shadow:var(--ring); border-radius:6px}

.wrap{width:100%; max-width:1180px; margin:0 auto; padding:0 24px}
.wrap-narrow{max-width:900px}
/* The tool grid earns more room than prose does: at 1180px four cards
   miss fitting by ten pixels and the row drops to three. */
.wrap-wide{max-width:1320px}
.center{text-align:center}
.muted{color:var(--muted)}
.small{font-size:13px}
.hide{display:none !important}
.stack{display:flex; flex-direction:column; gap:14px}
.row{display:flex; align-items:center; gap:12px}
.row-wrap{flex-wrap:wrap}
.spacer{flex:1}

/* ---------- Accent map ---------- */
.a-red{--accent:var(--red-500);   --accent-soft:var(--red-50)}
.a-blue{--accent:var(--blue-500); --accent-soft:var(--blue-50)}
.a-green{--accent:var(--green-500);--accent-soft:var(--green-50)}
.a-amber{--accent:var(--amber-500);--accent-soft:var(--amber-50)}
.a-violet{--accent:var(--violet-500);--accent-soft:var(--violet-50)}
.a-slate{--accent:var(--slate-500);--accent-soft:var(--slate-50)}

/* ---------- Header ---------- */
.site-header{
  position:sticky; top:0; z-index:60; height:var(--header-h);
  background:rgba(255,255,255,.92); backdrop-filter:saturate(180%) blur(12px);
  border-bottom:1px solid var(--line);
}
.site-header .wrap{height:100%; display:flex; align-items:center; gap:8px}
.brand{display:flex; align-items:center; gap:10px; font-weight:800; font-size:19px; letter-spacing:-.03em}
.brand-mark{
  width:32px; height:32px; border-radius:9px; display:grid; place-items:center;
  background:linear-gradient(150deg,var(--red-500),var(--red-700)); color:#fff;
  box-shadow:0 3px 10px rgba(229,50,45,.35);
}
.brand-mark svg{width:18px; height:18px}
.brand em{font-style:normal; color:var(--red-500)}

.nav{display:flex; align-items:center; gap:2px; margin-left:22px}
.nav a,.nav button,.has-menu > button{
  background:none; border:0; cursor:pointer; white-space:nowrap; padding:9px 13px; border-radius:9px;
  font-size:14.5px; font-weight:600; color:var(--ink-2); display:flex; align-items:center; gap:6px;
}
.nav a:hover,.nav button:hover,.has-menu > button:hover{background:var(--bg-2); color:var(--ink)}
.nav a.active{color:var(--red-500)}
/* The caret is what tells you the button opens something. It has to be
   sized explicitly -- the inline SVG has no intrinsic size of its own. */
.caret{
  display:inline-grid; place-items:center; width:14px; height:14px; flex:0 0 14px;
  opacity:.6; transition:transform .2s, opacity .2s;
}
.caret svg{width:14px; height:14px; stroke-width:2.6}
.has-menu > button:hover .caret{opacity:1}
.has-menu.open .caret{transform:rotate(180deg); opacity:1}
.has-menu.open > button{background:var(--bg-2); color:var(--ink)}

/* The panel is anchored to the header's content column rather than to the
   button, so it spans the page instead of hanging off the right edge. Using
   left/right against a known box avoids resolving a percentage against
   whichever ancestor happens to be positioned. */
.site-header .wrap{position:relative}
.has-menu{position:static; margin-left:2px}
.menu{
  position:absolute; top:calc(100% + 12px); left:0; right:0; width:auto;
  transform:translateY(-8px);
  max-height:min(76vh,700px); overflow:auto;
  background:#fff; border:1px solid var(--line); border-radius:var(--radius-xl);
  box-shadow:var(--shadow-lg); padding:24px 22px; display:none;
  columns:3; column-gap:30px;
  opacity:0; pointer-events:none; transition:opacity .16s, transform .16s;
}
.has-menu.open .menu{display:block; opacity:1; transform:translateY(0); pointer-events:auto}
.menu-group{padding:0 4px; break-inside:avoid; margin-bottom:20px}
.menu-group h4{
  font-size:11px; text-transform:uppercase; letter-spacing:.09em; color:var(--faint);
  margin-bottom:8px; padding:0 8px 8px; border-bottom:1px solid var(--line-2);
}
.menu-item{display:flex; align-items:center; gap:10px; padding:8px; border-radius:10px; font-size:14px; font-weight:500}
.menu-item:hover{background:var(--accent-soft,var(--bg-2)); color:var(--accent,var(--ink))}
.menu-item .ti{width:28px; height:28px; border-radius:8px; flex:0 0 28px}
.menu-item .ti svg{width:16px; height:16px}
@media (max-width:900px){ .menu{columns:2} }
@media (max-width:620px){ .menu{columns:1} }


/* ---------- Buttons ---------- */
.btn{
  --btn-bg:var(--red-500); --btn-fg:#fff;
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:12px 22px; border-radius:11px; border:1px solid transparent;
  background:var(--btn-bg); color:var(--btn-fg); font-weight:650; font-size:15px;
  cursor:pointer; white-space:nowrap; transition:transform .12s, box-shadow .18s, background .18s;
  box-shadow:0 2px 10px rgba(229,50,45,.28);
}
.btn:hover{background:var(--red-600); transform:translateY(-1px); box-shadow:0 6px 18px rgba(229,50,45,.32)}
.btn:active{transform:translateY(0)}
.btn:disabled{opacity:.5; cursor:not-allowed; transform:none; box-shadow:none}
.btn svg{width:17px; height:17px}
.btn-lg{padding:16px 34px; font-size:16.5px; border-radius:13px}
.btn-ghost{--btn-bg:transparent; --btn-fg:var(--ink-2); border-color:var(--line); box-shadow:none}
.btn-ghost:hover{background:var(--bg-2); color:var(--ink); box-shadow:none}
.btn-dark{--btn-bg:var(--ink); box-shadow:0 2px 10px rgba(27,36,48,.25)}
.btn-dark:hover{background:#0f1720; box-shadow:0 6px 18px rgba(27,36,48,.3)}
.btn-sm{padding:8px 14px; font-size:13.5px; border-radius:9px}
.icon-btn{
  width:36px; height:36px; display:grid; place-items:center; border-radius:9px;
  border:1px solid var(--line); background:#fff; cursor:pointer; color:var(--ink-2);
  transition:background .15s,border-color .15s;
}
.icon-btn:hover{background:var(--bg-2); border-color:var(--faint)}
.icon-btn svg{width:16px; height:16px}
.icon-btn.danger:hover{background:var(--red-50); border-color:var(--red-100); color:var(--red-600)}

/* ---------- Tool icon tile ---------- */
.ti{
  width:46px; height:46px; border-radius:12px; display:grid; place-items:center;
  background:var(--accent-soft,var(--red-50)); color:var(--accent,var(--red-500)); flex:0 0 46px;
}
.ti svg{width:24px; height:24px; stroke-width:1.8}
.ti-lg{width:62px; height:62px; border-radius:16px; flex-basis:62px}
.ti-lg svg{width:31px; height:31px}

/* ---------- Hero ---------- */
.hero{
  padding:76px 0 40px; text-align:center; position:relative; overflow:hidden;
  background:var(--bg);
  border-bottom:1px solid var(--line-2);
}
.hero::before{
  content:""; position:absolute; inset:-160px 0 auto; height:460px; z-index:0;
  background:
    radial-gradient(58% 100% at 50% 0%, rgba(229,50,45,.10), transparent 70%),
    radial-gradient(40% 80% at 12% 20%, rgba(109,74,255,.06), transparent 70%),
    radial-gradient(40% 80% at 88% 20%, rgba(47,107,255,.06), transparent 70%);
}
/* A faint grid behind the hero. Barely visible, but it gives the eye
   something to register as surface rather than blank paper. */
.hero::after{
  content:""; position:absolute; inset:0; z-index:0; pointer-events:none;
  background-image:
    linear-gradient(rgba(27,36,48,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(27,36,48,.028) 1px, transparent 1px);
  background-size:56px 56px;
  mask-image:radial-gradient(70% 70% at 50% 30%, #000, transparent 75%);
  -webkit-mask-image:radial-gradient(70% 70% at 50% 30%, #000, transparent 75%);
}
.hero .wrap{position:relative; z-index:1}
.eyebrow{
  display:inline-block; padding:7px 16px; border-radius:99px; margin-bottom:20px;
  background:#fff; border:1px solid var(--red-100); color:var(--red-600);
  font-size:12.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase;
  box-shadow:var(--shadow-xs);
}
.hero h1{margin-bottom:16px}
.hero h1 em{font-style:normal; color:var(--red-500)}
.hero p{font-size:17.5px; color:var(--muted); max-width:640px; margin:0 auto}
.hero-stats{
  display:flex; justify-content:center; gap:8px; margin:34px auto 0; flex-wrap:wrap;
  max-width:720px; background:#fff; border:1px solid var(--line);
  border-radius:var(--radius-lg); padding:20px 12px; box-shadow:var(--shadow-xs);
}
.hero-stats div{text-align:center; flex:1 1 130px; padding:0 10px}
.hero-stats div + div{border-left:1px solid var(--line-2)}
.hero-stats b{display:block; font-size:23px; letter-spacing:-.02em}
.hero-stats span{font-size:12.5px; color:var(--faint); text-transform:uppercase; letter-spacing:.07em}

/* ---------- Search ---------- */
.search{position:relative; max-width:480px; margin:28px auto 0}
.search svg{position:absolute; left:16px; top:50%; transform:translateY(-50%); width:18px; height:18px; color:var(--faint)}
.search input{
  width:100%; padding:14px 16px 14px 46px; border-radius:13px; border:1px solid var(--line);
  background:#fff; box-shadow:var(--shadow-xs); font-size:15px; transition:border-color .18s,box-shadow .18s;
}
.search input::placeholder{color:var(--faint)}
.search input:focus{outline:none; border-color:var(--red-500); box-shadow:var(--ring)}

/* ---------- Tool grid ---------- */
.section{padding:46px 0 14px}
.section-head{text-align:center; margin:0 auto 26px; max-width:620px}
.section-head h2{font-size:25px; margin-bottom:7px}
.section-head p{color:var(--muted); font-size:14.8px}
/* A hairline either side of the heading gives the grid a top edge to sit
   under, which is most of what stops a white page reading as empty. */
.section-head h2::after{
  content:""; display:block; width:46px; height:3px; border-radius:2px;
  margin:13px auto 0; background:var(--red-500); opacity:.85;
}

.grid{display:grid; gap:18px; grid-template-columns:repeat(auto-fill,minmax(272px,1fr))}
.card{
  position:relative; display:flex; flex-direction:column; background:#fff;
  border:1px solid var(--line); border-radius:var(--radius-lg); padding:24px 22px 22px;
  transition:transform .16s, box-shadow .2s, border-color .2s; height:100%; overflow:hidden;
}
/* A hairline of the tool's own colour along the top. It costs nothing and it
   is what stops twenty-six white rectangles reading as one grey block. */
.card::before{
  content:""; position:absolute; inset:0 0 auto; height:3px;
  background:var(--accent,var(--red-500)); opacity:0; transition:opacity .2s;
}
.card:hover{transform:translateY(-3px); box-shadow:var(--shadow); border-color:var(--line-2)}
.card:hover::before{opacity:1}
.card .ti{margin-bottom:15px}
.card h3{font-size:17px; margin-bottom:6px}
/* Lead line: the one-glance summary. Description: what it does and how. */
/* Two lines' worth of room whether the lead needs one or two, so the rule
   under it lands at the same height across a row. */
.card .lead{
  font-size:14.2px; color:var(--ink-2); font-weight:550; line-height:1.5;
  margin-bottom:11px; min-height:43px;
}
.card .desc{
  font-size:13.2px; color:var(--muted); line-height:1.62;
  padding-top:13px; border-top:1px solid var(--line-2);
}
.card .badge{
  position:absolute; top:20px; right:18px; font-size:10px; font-weight:700; letter-spacing:.06em;
  text-transform:uppercase; color:var(--accent); background:var(--accent-soft);
  padding:4px 9px; border-radius:99px;
}
.empty{padding:60px 0; text-align:center; color:var(--muted)}

/* ---------- Feature strip ---------- */
.features{background:var(--bg-2); margin-top:64px; padding:56px 0; border-top:1px solid var(--line-2)}
.features .grid{grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:28px}
.feature{display:flex; gap:14px; align-items:flex-start}
.feature .ti{width:40px; height:40px; flex-basis:40px; border-radius:11px; background:#fff; color:var(--red-500); box-shadow:var(--shadow-xs)}
.feature .ti svg{width:20px; height:20px}
.feature h3{font-size:15.5px; margin-bottom:3px}
.feature p{font-size:13.8px; color:var(--muted)}

/* ---------- Footer ---------- */
.site-footer{border-top:1px solid var(--line); padding:48px 0 34px; background:var(--bg)}
.footer-grid{display:grid; grid-template-columns:1.4fr repeat(3,1fr); gap:32px}
.footer-grid h4{font-size:12px; text-transform:uppercase; letter-spacing:.09em; color:var(--faint); margin-bottom:12px}
.footer-grid ul{list-style:none; margin:0; padding:0; display:grid; gap:8px}
.footer-grid a{font-size:14px; color:var(--ink-2)}
.footer-grid a:hover{color:var(--red-500)}
.footer-bottom{margin-top:34px; padding-top:20px; border-top:1px solid var(--line-2); display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; font-size:13px; color:var(--faint)}

/* ---------- Tool page ---------- */
.tool-head{
  padding:46px 0 30px; text-align:center; background:var(--bg);
  border-bottom:1px solid var(--line-2);
}
.tool-head .ti{margin:0 auto 18px}
.tool-head h1{font-size:clamp(27px,4vw,40px); margin-bottom:10px}
.tool-head p{color:var(--muted); font-size:16.5px; max-width:620px; margin:0 auto}
.crumbs{display:flex; justify-content:center; gap:7px; font-size:13px; color:var(--faint); margin-bottom:20px}
.crumbs a:hover{color:var(--red-500)}

.stage{padding-bottom:80px}
.panel{
  background:#fff; border:1px solid var(--line); border-radius:var(--radius-xl);
  box-shadow:var(--shadow-sm); padding:30px; margin:0 auto; max-width:860px;
}

/* Dropzone */
.drop{
  border:2px dashed var(--line); border-radius:var(--radius-xl); background:var(--bg);
  padding:56px 26px; text-align:center; cursor:pointer; box-shadow:var(--shadow-xs);
  transition:border-color .18s, background .18s, box-shadow .18s;
}
.drop:hover,.drop.over{border-color:var(--red-500); background:var(--red-50); box-shadow:var(--shadow-sm)}
.drop .ti{margin:0 auto 18px; background:var(--red-50); color:var(--red-500)}
.drop h3{font-size:19px; margin-bottom:6px}
.drop p{color:var(--muted); font-size:14px}
.drop .btn{margin-top:20px}
.drop .hint{margin-top:14px; font-size:12.5px; color:var(--faint)}

/* File list */
.files{list-style:none; margin:0 0 22px; padding:0; display:grid; gap:10px}
.file{
  display:flex; align-items:center; gap:13px; padding:13px 15px; border:1px solid var(--line);
  border-radius:var(--radius); background:#fff; transition:border-color .15s, box-shadow .15s;
}
.file.dragging{opacity:.45}
.file.over-top{box-shadow:inset 0 3px 0 var(--red-500)}
.file.over-bottom{box-shadow:inset 0 -3px 0 var(--red-500)}
.file .grip{color:var(--faint); cursor:grab; display:grid; place-items:center}
.file .grip svg{width:16px; height:16px}
.file .ti{width:36px; height:36px; flex-basis:36px; border-radius:9px; background:var(--red-50); color:var(--red-500)}
.file .ti svg{width:18px; height:18px}
.file .meta{min-width:0; flex:1}
.file .meta b{display:block; font-size:14.5px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.file .meta span{font-size:12.5px; color:var(--faint)}
.file .warn{color:var(--amber-500); font-weight:600}

/* Options */
.options{display:grid; gap:18px; margin-bottom:26px}
.opt-grid{display:grid; gap:16px; grid-template-columns:repeat(auto-fit,minmax(190px,1fr))}
.field{display:grid; gap:7px}
.field > label{font-size:13px; font-weight:650; color:var(--ink-2)}
.field .help{font-size:12.3px; color:var(--faint); line-height:1.45}
.input,select.input,textarea.input{
  width:100%; padding:11px 13px; border-radius:10px; border:1px solid var(--line);
  background:#fff; font-size:14.5px; transition:border-color .16s, box-shadow .16s;
}
.input:focus{outline:none; border-color:var(--red-500); box-shadow:var(--ring)}
select.input{appearance:none; background-image:url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7889' stroke-width='2.4' stroke-linecap='round'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e"); background-repeat:no-repeat; background-position:right 12px center; background-size:15px; padding-right:36px}
input[type=color].input{padding:4px; height:42px; cursor:pointer}
input[type=range]{width:100%; accent-color:var(--red-500)}

.choices{display:grid; gap:10px; grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}
.choice{
  display:flex; gap:11px; align-items:flex-start; padding:14px; border:1px solid var(--line);
  border-radius:var(--radius); cursor:pointer; transition:border-color .16s, background .16s;
}
.choice:hover{border-color:var(--faint)}
.choice input{margin-top:2px; accent-color:var(--red-500)}
.choice.sel{border-color:var(--red-500); background:var(--red-50)}
.choice b{display:block; font-size:14px; font-weight:650}
.choice span{font-size:12.4px; color:var(--muted)}

.toggle{display:flex; align-items:center; gap:10px; cursor:pointer; font-size:14px; font-weight:550}
.toggle input{width:0; height:0; opacity:0; position:absolute}
.toggle .track{width:40px; height:23px; border-radius:99px; background:var(--bg-3); position:relative; transition:background .18s; flex:0 0 40px}
.toggle .track::after{content:""; position:absolute; top:3px; left:3px; width:17px; height:17px; border-radius:50%; background:#fff; box-shadow:var(--shadow-xs); transition:transform .18s}
.toggle input:checked + .track{background:var(--red-500)}
.toggle input:checked + .track::after{transform:translateX(17px)}

.rot-group{display:flex; gap:8px; flex-wrap:wrap}
.rot-group button{
  flex:1; min-width:76px; padding:12px 8px; border-radius:10px; border:1px solid var(--line);
  background:#fff; cursor:pointer; font-weight:600; font-size:13.5px; transition:all .15s;
}
.rot-group button.sel{border-color:var(--red-500); background:var(--red-50); color:var(--red-600)}

.action-bar{display:flex; gap:12px; justify-content:center; align-items:center; flex-wrap:wrap; margin-top:6px}

/* Page organiser */
.pages-grid{
  display:grid; gap:14px; grid-template-columns:repeat(auto-fill,minmax(140px,1fr));
  max-height:520px; overflow:auto; padding:4px; margin-bottom:22px;
}
.pcard{
  position:relative; border:1px solid var(--line); border-radius:var(--radius); overflow:hidden;
  background:var(--bg-2); cursor:grab; transition:box-shadow .16s, border-color .16s, opacity .16s;
}
.pcard:hover{border-color:var(--red-500); box-shadow:var(--shadow-sm)}
.pcard.dragging{opacity:.4}
.pcard.dropped{opacity:.35; filter:grayscale(1)}
.pcard img{display:block; width:100%; transition:transform .25s}
.pcard .num{
  position:absolute; left:7px; bottom:7px; background:rgba(27,36,48,.82); color:#fff;
  font-size:11.5px; font-weight:650; padding:2px 8px; border-radius:99px;
}
.pcard .acts{position:absolute; right:6px; top:6px; display:flex; gap:5px; opacity:0; transition:opacity .15s}
.pcard:hover .acts{opacity:1}
.pcard .acts button{
  width:27px; height:27px; border-radius:7px; border:0; background:rgba(255,255,255,.94);
  cursor:pointer; display:grid; place-items:center; box-shadow:var(--shadow-xs); color:var(--ink-2);
}
.pcard .acts button:hover{background:#fff; color:var(--red-500)}
.pcard .acts svg{width:14px; height:14px}

/* Progress + result */
.progress-view{text-align:center; padding:52px 20px}
.spinner{
  width:52px; height:52px; margin:0 auto 22px; border-radius:50%;
  border:4px solid var(--red-100); border-top-color:var(--red-500); animation:spin .8s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}
.progress-view h3{margin-bottom:6px}
.bar{height:6px; border-radius:99px; background:var(--bg-3); overflow:hidden; max-width:340px; margin:22px auto 0}
.bar i{display:block; height:100%; width:35%; border-radius:99px; background:var(--red-500); animation:slide 1.3s ease-in-out infinite}
@keyframes slide{0%{transform:translateX(-100%)}100%{transform:translateX(340%)}}

.result{text-align:center; padding:44px 20px}
.result .tick{
  width:70px; height:70px; margin:0 auto 22px; border-radius:50%; display:grid; place-items:center;
  background:var(--green-50); color:var(--green-500);
}
.result .tick svg{width:34px; height:34px; stroke-width:2.5}
.result h2{margin-bottom:8px}
.result .summary{color:var(--muted); margin-bottom:26px}
.result .outs{display:grid; gap:9px; max-width:520px; margin:0 auto 26px; text-align:left; max-height:260px; overflow:auto}
.saving{color:var(--green-500); font-weight:650}

.alert{
  display:flex; gap:11px; padding:14px 16px; border-radius:var(--radius);
  background:var(--red-50); border:1px solid var(--red-100); color:var(--red-700);
  font-size:14px; margin-bottom:18px; align-items:flex-start;
}
.alert svg{width:18px; height:18px; flex:0 0 18px; margin-top:1px}
.alert.info{background:var(--blue-50); border-color:#d6e3ff; color:#1e46a8}
.alert.warn{background:var(--amber-50); border-color:#ffe2ba; color:#96560a}

/* Toast */
.toasts{position:fixed; right:22px; bottom:22px; z-index:200; display:grid; gap:10px; max-width:min(380px,90vw)}
.toast{
  display:flex; gap:10px; align-items:flex-start; padding:13px 16px; border-radius:var(--radius);
  background:var(--ink); color:#fff; font-size:14px; box-shadow:var(--shadow-lg);
  animation:pop .25s cubic-bezier(.2,.9,.3,1.3);
}
.toast.error{background:var(--red-600)}
.toast.warn{background:#a86a08}
.toast.ok{background:#0e7f4d}
@keyframes pop{from{opacity:0; transform:translateY(12px) scale(.96)}to{opacity:1; transform:none}}

/* ---------- Responsive ---------- */
@media (max-width:900px){
  .nav{display:none}
  .footer-grid{grid-template-columns:1fr 1fr}
}
@media (max-width:600px){
  .cta-label{display:none}
  .brand{font-size:17px}
  .has-menu > button{padding:9px 10px}
  /* The panel spans the header's content column at every width; the old
     right:-58px offset here was left over from the button-anchored menu and
     pushed it off the left edge of a phone screen. */
  .menu{padding:18px 14px}
}
@media (max-width:640px){
  /* One card per row, so there is no neighbour to align the rule with and
     the reserved second line is just a gap. */
  .card .lead{min-height:0}
  .wrap{padding:0 16px}
  .hero{padding:48px 0 24px}
  .panel{padding:22px 18px; border-radius:var(--radius-lg)}
  .drop{padding:40px 18px}
  .footer-grid{grid-template-columns:1fr}
  .hero-stats{gap:22px}
}

/* ============================================================
   Editor
   ============================================================ */
body.editor{overflow:hidden}
.editor-shell{display:flex; height:calc(100vh - var(--header-h)); min-height:520px}

.editor-side{
  width:286px; flex:0 0 286px; border-right:1px solid var(--line); background:#fff;
  overflow-y:auto; padding:18px; display:flex; flex-direction:column; gap:20px;
}
.side-block h4{
  font-size:11px; text-transform:uppercase; letter-spacing:.09em; color:var(--faint);
  margin-bottom:10px;
}
.tool-pad{display:grid; grid-template-columns:repeat(4,1fr); gap:7px}
.tool-pad button{
  aspect-ratio:1; border:1px solid var(--line); border-radius:10px; background:#fff;
  display:grid; place-items:center; cursor:pointer; color:var(--ink-2); transition:all .15s;
}
.tool-pad button svg{width:18px; height:18px}
.tool-pad button:hover{background:var(--bg-2); border-color:var(--faint)}
.tool-pad button.sel{background:var(--red-500); border-color:var(--red-500); color:#fff;
  box-shadow:0 3px 10px rgba(229,50,45,.32)}

.editor-main{flex:1; min-width:0; display:flex; flex-direction:column; overflow:hidden; background:var(--bg-2)}
.editor-scroll{flex:1; overflow:auto}
.editor-bar{
  flex:0 0 56px; z-index:20; height:56px; background:rgba(255,255,255,.94);
  backdrop-filter:blur(10px); border-bottom:1px solid var(--line);
  display:flex; align-items:center; gap:10px; padding:0 18px;
}
.editor-bar .name{font-weight:650; font-size:14.5px; max-width:280px; overflow:hidden;
  text-overflow:ellipsis; white-space:nowrap}
.editor-bar .chip{
  font-size:12px; font-weight:650; padding:4px 10px; border-radius:99px;
  background:var(--bg-3); color:var(--ink-2);
}
.editor-bar .chip.live{background:var(--red-50); color:var(--red-600)}

.canvas{padding:26px 20px 70px; display:flex; flex-direction:column; align-items:center; gap:22px}
.page{
  position:relative; background:#fff; box-shadow:var(--shadow); border-radius:4px;
  overflow:hidden; user-select:none;
}
.page > img{display:block; width:100%; height:100%; pointer-events:none}
.page .annotation-layer{position:absolute; inset:0; pointer-events:none; overflow:visible}

.hot{position:absolute; border-radius:3px; cursor:text; transition:background .12s, box-shadow .12s}
.hot:hover{background:rgba(47,107,255,.14); box-shadow:inset 0 0 0 1px rgba(47,107,255,.45)}
.hot.sel{background:rgba(229,50,45,.14); box-shadow:inset 0 0 0 1.5px var(--red-500)}
.hot.edited{box-shadow:inset 0 0 0 1.5px var(--green-500)}
.mode-annotate .hot{pointer-events:none}
.mode-annotate .page{cursor:crosshair}

/* Live preview of a text edit. overflow stays visible: the export
   autofits the replacement into the original line, and the preview
   applies the same rule, so clipping here would be a lie. */
.cover{position:absolute; pointer-events:none; display:flex; align-items:center;
  overflow:visible; white-space:pre; line-height:1}
.cover.pending{outline:1.5px dashed var(--red-500); outline-offset:1px}

/* Annotations become grabbable only while the Edit-text tool is active,
   so drawing a new mark never fights with moving an existing one. */
.ann{pointer-events:none}
body:not(.mode-annotate) .ann{pointer-events:auto; cursor:grab}
body:not(.mode-annotate) .ann:active{cursor:grabbing}
.ann.ghost{opacity:.75; pointer-events:none}
.ann-outline{
  stroke:var(--red-500); stroke-width:1.5; stroke-dasharray:5 4; rx:3;
  animation:annmarch 12s linear infinite;
}
@keyframes annmarch{to{stroke-dashoffset:-180}}
.ann-del{
  position:absolute; z-index:25; width:26px; height:26px; border-radius:8px;
  border:1px solid var(--line); background:#fff; color:var(--red-600); cursor:pointer;
  display:grid; place-items:center; box-shadow:var(--shadow-sm);
}
.ann-del:hover{background:var(--red-50); border-color:var(--red-100)}
.ann-del svg{width:14px; height:14px}

.pop{
  position:absolute; z-index:40; width:min(330px,86vw); background:#fff; border:1px solid var(--line);
  border-radius:var(--radius); box-shadow:var(--shadow-lg); padding:14px; display:grid; gap:10px;
}
.pop textarea{
  width:100%; min-height:76px; resize:vertical; padding:10px 11px; border-radius:9px;
  border:1px solid var(--line); font-size:14px; font-family:var(--font);
}
.pop textarea:focus{outline:none; border-color:var(--red-500); box-shadow:var(--ring)}
.pop .pop-row{display:flex; gap:8px; align-items:center}
.pop .pop-row .input{padding:8px 10px; font-size:13.5px}
.pop .meta{font-size:11.5px; color:var(--faint); line-height:1.4}
.pop .seg{display:flex; border:1px solid var(--line); border-radius:9px; overflow:hidden}
.pop .seg button{
  padding:8px 11px; border:0; background:#fff; cursor:pointer; font-size:13px; font-weight:650;
  border-right:1px solid var(--line);
}
.pop .seg button:last-child{border-right:0}
.pop .seg button.sel{background:var(--red-50); color:var(--red-600)}

.editor-empty{
  height:100%; display:grid; place-items:center; padding:40px 20px;
}
.editor-empty .panel{max-width:620px; width:100%}

@media (max-width:900px){
  .editor-shell{flex-direction:column; height:auto}
  .editor-side{width:100%; flex:none; border-right:0; border-bottom:1px solid var(--line)}
  body.editor{overflow:auto}
}

/* ---------- Changes panel ---------- */
.editor-changes{
  width:286px; flex:0 0 286px; border-left:1px solid var(--line); background:#fff;
  display:none; flex-direction:column; min-height:0;
}
body.show-changes .editor-changes{display:flex}

.changes-head{
  display:flex; align-items:center; gap:9px; padding:14px 16px;
  border-bottom:1px solid var(--line-2); flex:0 0 auto;
}
.changes-head h4{font-size:12px; text-transform:uppercase; letter-spacing:.09em; color:var(--faint)}
.changes-head .chip{background:var(--red-50); color:var(--red-600); font-size:12px; font-weight:700;
  padding:2px 9px; border-radius:99px}
.changes-head .icon-btn{width:28px; height:28px; border:0}

.changes-list{flex:1; overflow-y:auto; padding:10px; display:flex; flex-direction:column; gap:6px}
.changes-foot{flex:0 0 auto; padding:10px 16px 14px; border-top:1px solid var(--line-2); line-height:1.45}

.changes-empty{
  padding:34px 18px; text-align:center; color:var(--muted); font-size:14px;
  display:flex; flex-direction:column; align-items:center; gap:8px;
}
.changes-empty .ti{background:var(--bg-2); color:var(--faint)}
.changes-empty .small{font-size:12.5px; color:var(--faint); line-height:1.5}

.change{
  display:flex; align-items:center; gap:10px; padding:9px 10px; border-radius:10px;
  border:1px solid transparent; cursor:pointer; transition:background .14s, border-color .14s;
}
.change:hover{background:var(--bg-2)}
.change:focus-visible{box-shadow:var(--ring)}
.change.sel{background:var(--red-50); border-color:var(--red-100)}
.change-ti{
  width:30px; height:30px; flex:0 0 30px; border-radius:8px; display:grid; place-items:center;
  background:var(--bg-2); color:var(--ink-2);
}
.change-ti svg{width:16px; height:16px}
.change-body{min-width:0; flex:1}
.change-body b{display:block; font-size:13.5px; font-weight:650; white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis}
.change-meta{display:flex; align-items:center; gap:6px; font-size:11.5px; color:var(--faint);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.pagechip{background:var(--bg-3); color:var(--ink-2); border-radius:5px; padding:1px 5px;
  font-weight:650; font-size:10.5px; flex:0 0 auto}
.change-x{
  width:26px; height:26px; flex:0 0 26px; border-radius:7px; border:0; background:none;
  color:var(--faint); cursor:pointer; display:grid; place-items:center; opacity:0; transition:all .14s;
}
.change:hover .change-x,.change.sel .change-x,.change:focus-within .change-x{opacity:1}
.change-x:hover{background:var(--red-50); color:var(--red-600)}
.change-x svg{width:14px; height:14px}

/* Ring drawn on the page when a row is clicked. */
.flash-ring{
  position:absolute; z-index:18; pointer-events:none; border-radius:5px;
  border:2px solid var(--red-500); box-shadow:0 0 0 6px rgba(229,50,45,.14);
  animation:flashring 1.5s ease-out forwards;
}
@keyframes flashring{
  0%{opacity:0; transform:scale(1.08)}
  15%{opacity:1; transform:scale(1)}
  70%{opacity:1}
  100%{opacity:0}
}

@media (max-width:1180px){
  body.show-changes .editor-changes{
    position:fixed; right:0; top:var(--header-h); bottom:0; z-index:70;
    box-shadow:var(--shadow-lg);
  }
}
@media (max-width:900px){
  body.show-changes .editor-changes{width:min(320px,86vw); flex-basis:auto}
}

/* Keep toasts clear of the Changes panel. */
body.show-changes .toasts{right:308px}
@media (max-width:1180px){ body.show-changes .toasts{right:22px} }

.toggle-changes.on{background:var(--red-50); border-color:var(--red-100); color:var(--red-600)}

/* ============================================================
   Marketing sections
   ============================================================ */
.eyebrow{
  display:inline-block; font-size:12.5px; font-weight:700; letter-spacing:.06em;
  text-transform:uppercase; color:var(--red-600); background:var(--red-50);
  padding:6px 14px; border-radius:99px; margin-bottom:20px;
}
.hero-sub{font-size:17.5px; color:var(--muted); max-width:660px; margin:0 auto}
.hero-cta{display:flex; gap:12px; justify-content:center; margin-top:28px; flex-wrap:wrap}
.hero-stats b{font-variant-numeric:tabular-nums}

.band{padding:64px 0; border-top:1px solid var(--line-2); background:var(--bg)}
.band-trust{background:var(--bg); padding:44px 0}
/* Surfaces alternate down the page: white copy block, tinted band, white
   again. Set in one place so the rhythm is visible rather than emergent. */
/* Sections between bands keep the tinted ground, so the page alternates
   surface and ground instead of running as one flat sheet. */
.section{background:transparent}
.band-benefits{background:var(--bg-2)}
.band-faq{padding-top:52px; padding-bottom:56px; background:var(--bg)}
.band-cta{
  background:linear-gradient(160deg,#1b2430,#111a24); color:#fff; border-top:0;
}
.band-cta h2{color:#fff}
.band-cta p{color:#b8c2d0; margin-top:10px}
.band-cta .cta-row{display:flex; gap:12px; justify-content:center; margin-top:26px; flex-wrap:wrap}
.band-cta .btn-ghost{--btn-fg:#fff; border-color:rgba(255,255,255,.28)}
.band-cta .btn-ghost:hover{background:rgba(255,255,255,.1); color:#fff}

.band-head{margin:0 auto 30px; max-width:680px; text-align:center}
.band-head h2::after{
  content:""; display:block; width:46px; height:3px; border-radius:2px;
  margin:14px auto 0; background:var(--red-500); opacity:.85;
}
.band-cta .band-head h2::after, .band-cta h2::after{background:#fff; opacity:.6}
.band-head.center{margin-left:auto; margin-right:auto; text-align:center}
.band-head h2{margin-bottom:8px}
.band-head p{color:var(--muted); font-size:16px}

/* Trust row */
.trust-grid{display:grid; gap:26px; grid-template-columns:repeat(auto-fit,minmax(250px,1fr))}
.trust-item{display:flex; gap:13px; align-items:flex-start}
.trust-item .ti{
  width:40px; height:40px; flex-basis:40px; border-radius:11px;
  background:#fff; color:var(--red-500); box-shadow:var(--shadow-xs);
}
.trust-item .ti svg{width:20px; height:20px}
.trust-item h3{font-size:15.5px; margin-bottom:4px}
.trust-item p{font-size:13.8px; color:var(--muted); line-height:1.55}

/* Numbered steps */
.steps{list-style:none; margin:0; padding:0; display:grid; gap:22px;
  grid-template-columns:repeat(auto-fit,minmax(260px,1fr))}
.step{position:relative; padding-left:52px}
.step-n{
  position:absolute; left:0; top:0; width:36px; height:36px; border-radius:11px;
  display:grid; place-items:center; font-weight:800; font-size:15px;
  background:var(--red-50); color:var(--red-600);
}
.step h3{font-size:16px; margin-bottom:6px}
.step p{color:var(--muted); font-size:14.2px; line-height:1.6}
.steps-compact{grid-template-columns:1fr; gap:16px}
.steps-compact .step-n{width:30px; height:30px; border-radius:9px; font-size:13.5px}
.steps-compact .step{padding-left:44px}
.steps-compact .step p{font-size:14.5px; color:var(--ink-2)}

/* Benefits */
.benefit-grid{display:grid; gap:22px; grid-template-columns:repeat(auto-fit,minmax(290px,1fr))}
.benefit{background:#fff; border:1px solid var(--line); border-radius:var(--radius-lg); padding:24px}
.benefit .ti{margin-bottom:14px; background:var(--red-50); color:var(--red-500)}
.benefit h3{font-size:16.5px; margin-bottom:7px}
.benefit p{color:var(--muted); font-size:14.2px; line-height:1.65}

/* Regional use cases */
.uc-tabs{display:flex; gap:8px; margin-bottom:22px; flex-wrap:wrap}
.uc-tab{
  padding:10px 20px; border-radius:99px; border:1px solid var(--line); background:#fff;
  cursor:pointer; font-weight:650; font-size:14.5px; color:var(--ink-2); transition:all .16s;
}
.uc-tab:hover{border-color:var(--faint)}
.uc-tab.on{background:var(--red-500); border-color:var(--red-500); color:#fff;
  box-shadow:0 3px 12px rgba(229,50,45,.3)}
.uc-panel{display:none}
.uc-panel.on{display:block; animation:fadein .28s ease}
@keyframes fadein{from{opacity:0; transform:translateY(6px)}to{opacity:1; transform:none}}
.uc-panel h3{font-size:20px; margin-bottom:6px}
.uc-lead{color:var(--muted); margin-bottom:18px}
.uc-list{list-style:none; margin:0; padding:0; display:grid; gap:12px;
  grid-template-columns:repeat(auto-fit,minmax(320px,1fr))}
.uc-list li{
  position:relative; padding:14px 16px 14px 44px; background:#fff;
  border:1px solid var(--line); border-radius:var(--radius); font-size:14.3px;
  color:var(--ink-2); line-height:1.55;
}
.uc-list li::before{
  content:""; position:absolute; left:16px; top:18px; width:14px; height:14px;
  border-radius:50%; background:var(--red-50);
  box-shadow:inset 0 0 0 2px var(--red-500);
}

/* Tick lists */
.ticks{list-style:none; margin:0; padding:0; display:grid; gap:12px}
.ticks li{position:relative; padding-left:30px; font-size:14.5px; color:var(--ink-2); line-height:1.6}
.ticks li::before{
  content:""; position:absolute; left:0; top:6px; width:18px; height:18px; border-radius:50%;
  background:var(--green-50) url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23129d5f' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M20 6L9 17l-5-5'/%3e%3c/svg%3e") center/11px no-repeat;
}

/* Prose */
.prose h2{margin-bottom:14px}
/* A tool page alternates white copy blocks against the tinted ground so the
   page has a rhythm instead of one continuous sheet. */
.stage + .section, .band-faq + .section{background:var(--bg)}
.stage + .section{border-top:1px solid var(--line-2); padding-top:52px}
.prose p{font-size:16.5px; line-height:1.75; color:var(--ink-2)}

.split{display:grid; gap:38px; grid-template-columns:1fr 1fr; align-items:start}
.split h2{font-size:21px; margin-bottom:18px; text-align:left}

/* FAQ */
.faq-list{display:grid; gap:10px}
.faq{
  background:#fff; border:1px solid var(--line); border-radius:var(--radius);
  overflow:hidden; transition:border-color .16s, box-shadow .16s;
}
.faq[open]{border-color:var(--red-100); box-shadow:var(--shadow-xs)}
.faq summary{
  display:flex; align-items:center; gap:14px; padding:17px 20px; cursor:pointer;
  font-weight:650; font-size:15.5px; list-style:none;
}
.faq summary::-webkit-details-marker{display:none}
.faq summary span:first-child{flex:1}
.faq-mark{position:relative; width:14px; height:14px; flex:0 0 14px}
.faq-mark::before,.faq-mark::after{
  content:""; position:absolute; background:var(--red-500); border-radius:2px;
  transition:transform .2s;
}
.faq-mark::before{left:0; top:6px; width:14px; height:2px}
.faq-mark::after{left:6px; top:0; width:2px; height:14px}
.faq[open] .faq-mark::after{transform:scaleY(0)}
.faq-a{padding:0 20px 19px; color:var(--muted); font-size:14.8px; line-height:1.7}

/* Related tools */
.rel-grid{display:grid; gap:12px; grid-template-columns:repeat(auto-fit,minmax(240px,1fr))}
.rel-card{
  display:flex; align-items:center; gap:12px; padding:14px 16px; background:#fff;
  border:1px solid var(--line); border-radius:var(--radius); transition:all .16s;
}
.rel-card:hover{border-color:transparent; box-shadow:var(--shadow-sm); transform:translateY(-2px)}
.rel-card .ti{width:36px; height:36px; flex-basis:36px; border-radius:9px}
.rel-card .ti svg{width:18px; height:18px}
.rel-card b{display:block; font-size:14.5px}
.rel-card em{font-style:normal; font-size:12.6px; color:var(--faint)}

@media (max-width:760px){
  .split{grid-template-columns:1fr; gap:30px}
  .band{padding:48px 0}
  .uc-list{grid-template-columns:1fr}
}

/* Legal links sit on the bottom rule, where readers look for them. */
.footer-legal{display:flex; gap:16px; flex-wrap:wrap; justify-content:center}
.footer-legal a:hover{color:var(--ink-2)}
@media (max-width:640px){ .footer-legal{justify-content:flex-start} }

/* Footer: one column per category so every tool is one click away. */
.footer-grid{grid-template-columns:1.5fr repeat(3,1fr)}
.footer-brand p{max-width:320px; line-height:1.6}
.footer-badges{list-style:none; margin:14px 0 0; padding:0; display:flex; gap:7px; flex-wrap:wrap}
.footer-badges li{
  font-size:11px; font-weight:650; color:var(--ink-2); background:var(--bg-2);
  border:1px solid var(--line); border-radius:99px; padding:4px 9px; white-space:nowrap;
}
@media (min-width:1000px){ .footer-grid{grid-template-columns:2fr repeat(6,.85fr); gap:26px} }
@media (max-width:999px){ .footer-grid{grid-template-columns:1fr 1fr 1fr} }
@media (max-width:640px){ .footer-grid{grid-template-columns:1fr 1fr} }

/* Tool pages carry copy below the panel, so the panel needs less air under it. */
.stage{padding-bottom:56px}

/* ---------- Editor: reading mode before a document is opened ----------
   With no PDF loaded the page is a normal marketing page that scrolls.
   Once a document is open it becomes a fixed-height application shell. */
body.editor{overflow:auto}
body.editor .editor-shell{height:auto; min-height:440px}
body.editor.doc-open{overflow:hidden}
body.editor.doc-open .editor-shell{height:calc(100vh - var(--header-h))}
body.editor.doc-open #editor-hero,
body.editor.doc-open #editor-seo,
body.editor.doc-open #site-footer{display:none}
#editor-hero{padding:40px 0 22px}
#editor-hero h1{font-size:clamp(28px,4vw,42px)}

/* ============================================================
   Trust and legal pages (/about, /privacy, /security, /terms,
   /contact). Long-form reading, so the column is narrow and the
   type is a little larger than the marketing pages.
   ============================================================ */
.page-head{
  padding:44px 0 26px; border-bottom:1px solid var(--line-2);
  background:var(--bg);
}
.page-head .crumbs{justify-content:flex-start; margin-bottom:14px}
.page-head h1{font-size:clamp(27px,3.6vw,38px)}

.doc{padding:34px 0 64px; background:var(--bg)}
main:has(.doc){background:var(--bg)}
.doc-lead{
  font-size:18px; line-height:1.7; color:var(--ink-2); font-weight:500;
  padding-bottom:26px; margin-bottom:8px; border-bottom:1px solid var(--line-2);
}
.doc section{padding-top:30px}
.doc section h2{font-size:21px; margin-bottom:12px}
.doc section p{
  font-size:15.6px; line-height:1.78; color:var(--ink-2); margin-bottom:13px;
}
.doc section p:last-child{margin-bottom:0}
.doc strong{color:var(--ink); font-weight:650}
.doc a{color:var(--red-600); text-decoration:underline; text-underline-offset:2px}

/* The eight promises, shown on /about. Short cards rather than a wall of
   prose, because this is the block people skim before they upload. */
.promise-grid{
  display:grid; gap:12px; margin:30px 0 4px;
  grid-template-columns:repeat(auto-fit,minmax(268px,1fr));
}
.promise{
  background:var(--bg-2); border:1px solid var(--line);
  border-radius:var(--radius); padding:17px 18px;
}
.promise h3{font-size:15px; margin-bottom:7px}
.promise h3::before{
  content:""; display:inline-block; vertical-align:-2px; margin-right:8px;
  width:15px; height:15px;
  background:url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23129d5f' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M20 6L9 17l-5-5'/%3e%3c/svg%3e") center/15px no-repeat;
}
.promise p{font-size:13.9px; line-height:1.65; color:var(--muted)}

@media (max-width:640px){
  .page-head{padding:32px 0 20px}
  .doc{padding:26px 0 48px}
  .doc-lead{font-size:16.5px}
}

/* ============================================================
   Ad slots -- reserved space, empty for now
   ------------------------------------------------------------
   No ad code is loaded anywhere on this site yet. These rules
   exist so that when a unit is dropped in later it lands in a
   place that cannot be mistaken for the interface:

     .ad-slot          never inside a card, button or the result
                       panel; always separated by a labelled rule
     [data-ad="below-result"]   sits BELOW the download row with a
                       56px gap, so a mis-aimed click on the ad can
                       never be a click that was meant for Download
     [data-ad="in-content"]     between two prose sections
     [data-ad="sidebar"]        desktop only, after the FAQ column

   The slot collapses to nothing until it has a child, so an empty
   reservation never leaves a hole in the layout.
   ============================================================ */
.ad-slot{
  display:block; margin:0 auto; width:100%; text-align:center;
  overflow:hidden; clear:both;
}
.ad-slot:empty{display:none}
.ad-slot::before{
  content:"Advertisement"; display:block; margin-bottom:6px;
  font-size:10.5px; font-weight:650; letter-spacing:.09em;
  text-transform:uppercase; color:var(--faint);
}
.ad-slot:empty::before{display:none}

/* Distance is the safety mechanism. A unit under the result panel is
   pushed well clear of the download controls above it. */
.ad-slot[data-ad="below-result"]{
  margin-top:56px; padding-top:26px; border-top:1px solid var(--line-2);
  max-width:728px;
}
.ad-slot[data-ad="in-content"]{margin:44px auto; max-width:728px}
.ad-slot[data-ad="sidebar"]{display:none}
@media (min-width:1100px){
  .ad-slot[data-ad="sidebar"]:not(:empty){
    display:block; max-width:300px; margin:28px 0 0;
  }
}
/* Never let an ad sit inside interactive furniture. */
.btn .ad-slot, .card .ad-slot, .drop .ad-slot,
.result .ad-slot, .panel-actions .ad-slot{display:none !important}

/* Language switcher. Sits on the footer's bottom rule and is rendered by
   the server, so a crawler sees the link to every translation of the page
   it is on -- and only those that exist. */
.lang-switch{display:flex; gap:14px; flex-wrap:wrap; align-items:center}
.lang-switch a:hover{color:var(--ink-2)}
.lang-switch [aria-current]{color:var(--ink-2); font-weight:650}

/* On a localized home page, tools with no page in that language keep their
   English name and carry this marker, so nobody is dropped into English
   without warning. */
.card-lang{
  display:inline-block; vertical-align:2px; margin-left:7px; padding:1px 5px;
  font-size:9.5px; font-weight:700; letter-spacing:.06em; border-radius:4px;
  color:var(--faint); background:var(--bg-2); border:1px solid var(--line);
}

/* CJK text needs a little more line height and a font stack that will not
   fall back to a mismatched face for kanji and hangul. */
html[lang="ja"] body, html[lang="ko"] body{
  line-height:1.75;
  font-family:var(--font),"Hiragino Sans","Hiragino Kaku Gothic ProN",
    "Yu Gothic","Noto Sans JP","Noto Sans KR","Malgun Gothic",
    "Apple SD Gothic Neo",sans-serif;
}
html[lang="ja"] h1, html[lang="ko"] h1,
html[lang="ja"] h2, html[lang="ko"] h2{letter-spacing:-.01em; line-height:1.35}
