/* ILX PDF (web). Tokens and chrome follow the other ILX product sites (ILX Drawings / Calcs / Connection site.css:
   blue #1a70ff, light #f4f6f9, dark #080d18, system fonts, frosted sticky nav). Light / dark follows the system unless
   the visitor picks one with the toggle (html[data-theme], js/theme.js). No external fonts or CDNs. */
*, *::before, *::after { box-sizing: border-box; }
:root {
  --blue: #1a70ff; --blue-2: #1559d6; --blue-dim: #0d4bb5; --blue-soft: rgba(26,112,255,0.10);
  --bg: #f4f6f9; --bg2: #ffffff; --bg3: #eef1f6;
  --text: #243044; --heading: #0f172a; --muted: #4f5d6e; --faint: #6b7787;
  --border: rgba(15,23,42,0.12); --border-2: rgba(26,112,255,0.35);
  --green: #15803d; --green-bg: rgba(21,128,61,0.10); --red: #b42318; --red-bg: rgba(180,35,24,0.08);
  --amber: #92400e; --amber-bg: #fef3c7;
  --nav-bg: rgba(244,246,249,0.86);
  --shadow: 0 1px 2px rgba(15,23,42,0.05), 0 10px 30px rgba(15,23,42,0.06);
  --shadow-lg: 0 12px 40px rgba(15,23,42,0.22);
  --page: #ffffff;
  --maxw: 1100px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --blue-2: #60a5fa; --blue-soft: rgba(96,165,250,0.14); --bg: #080d18; --bg2: #0d1525; --bg3: #111e35;
    --text: #e2e8f0; --heading: #ffffff; --muted: #a3b1c4; --faint: #8090a6;
    --border: rgba(255,255,255,0.10); --border-2: rgba(96,165,250,0.35);
    --green: #4ade80; --green-bg: rgba(74,222,128,0.12); --red: #f87171; --red-bg: rgba(248,113,113,0.12);
    --amber: #fcd34d; --amber-bg: rgba(252,211,77,0.12);
    --nav-bg: rgba(8,13,24,0.85); --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 10px 30px rgba(0,0,0,0.25);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --blue-2: #60a5fa; --blue-soft: rgba(96,165,250,0.14); --bg: #080d18; --bg2: #0d1525; --bg3: #111e35;
  --text: #e2e8f0; --heading: #ffffff; --muted: #a3b1c4; --faint: #8090a6;
  --border: rgba(255,255,255,0.10); --border-2: rgba(96,165,250,0.35);
  --green: #4ade80; --green-bg: rgba(74,222,128,0.12); --red: #f87171; --red-bg: rgba(248,113,113,0.12);
  --amber: #fcd34d; --amber-bg: rgba(252,211,77,0.12);
  --nav-bg: rgba(8,13,24,0.85); --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 10px 30px rgba(0,0,0,0.25);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.55);
  color-scheme: dark;
}

html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
body {
  margin: 0; background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  line-height: 1.55; -webkit-font-smoothing: antialiased;
}
main { flex: 1 0 auto; outline: none; }
h1, h2, h3, h4 { color: var(--heading); line-height: 1.25; margin: 0 0 0.6rem; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); letter-spacing: -0.02em; }
h2 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }
a { color: var(--blue-2); text-decoration: none; }
a:hover { color: var(--blue); text-decoration: underline; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
img, svg { max-width: 100%; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.tiny { font-size: 0.78rem; }
.warn { color: var(--amber); background: var(--amber-bg); padding: 0.45rem 0.7rem; border-radius: 8px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--blue); color: #fff; padding: 0.5rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; top: 0.5rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------------- Nav ---------------- */
.site-nav {
  position: sticky; top: 0; z-index: 60; background: var(--nav-bg);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.site-nav .bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.55rem 1.5rem; max-width: 1280px; margin: 0 auto; position: relative; }
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--heading); font-weight: 700; letter-spacing: 0.01em; white-space: nowrap; }
.brand:hover { color: var(--heading); text-decoration: none; }
.brand img { width: 30px; height: 30px; display: block; }
.brand b { color: var(--blue-2); font-weight: 700; }
.nav-right { display: flex; align-items: center; gap: 1rem; }
.nav-links { display: flex; gap: 1.25rem; align-items: center; font-size: 0.92rem; }
.nav-links a { color: var(--muted); white-space: nowrap; }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--heading); text-decoration: none; }
.nav-links a[aria-current] { font-weight: 600; }
.nav-actions { display: flex; gap: 0.5rem; align-items: center; }
.account { display: flex; gap: 0.5rem; align-items: center; }
.account .acct-email { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 8px;
  background: var(--bg3); border: 1px solid var(--border); color: var(--muted); cursor: pointer; padding: 0; flex: none;
}
.icon-btn:hover:not(:disabled) { color: var(--heading); border-color: var(--border-2); }
.icon-btn:disabled { opacity: 0.4; cursor: default; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.sm svg { width: 16px; height: 16px; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}
.nav-toggle { display: none; }
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg2); border-bottom: 1px solid var(--border); padding: 0.5rem 1.25rem 1rem; box-shadow: var(--shadow); display: none;
  }
  .site-nav.open .nav-links { display: flex; }
  .nav-links a { padding: 0.75rem 0.25rem; border-bottom: 1px solid var(--border); }
  .nav-links a:last-child { border-bottom: none; }
  .account .acct-email { display: none; }
}
@media (max-width: 560px) { .site-nav .bar, .wrap { padding-left: 1rem; padding-right: 1rem; } }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; padding: 0.65rem 1.25rem;
  border-radius: 8px; font-size: 0.92rem; font-weight: 600; cursor: pointer; border: 1px solid transparent;
  text-align: center; line-height: 1.3; font-family: inherit; color: var(--heading); background: var(--bg3);
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn.primary:hover:not(:disabled) { background: #1560e0; color: #fff; }
.btn.ghost { background: transparent; color: var(--heading); border-color: var(--border); }
.btn.ghost:hover:not(:disabled) { border-color: var(--blue); }
.btn.sm { padding: 0.4rem 0.75rem; font-size: 0.84rem; }
.btn.big { padding: 0.85rem 1.6rem; font-size: 1rem; width: 100%; }
.btn:disabled, .btn.disabled { opacity: 0.55; cursor: not-allowed; }
.ic { display: inline-flex; width: 20px; height: 20px; flex: none; }
.ic svg, .tool-ic svg, .dz-ic svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic.inline { width: 1.05em; height: 1.05em; vertical-align: -0.15em; color: var(--green); }

/* ---------------- Home ---------------- */
.hero { padding: 2.75rem 0 1.25rem; text-align: center; }
.hero h1 { font-size: clamp(2rem, 6vw, 3rem); margin-bottom: 0.4rem; }
.hero .accent { color: var(--blue-2); }
.hero .lead { font-size: 1.08rem; color: var(--muted); max-width: 44rem; margin: 0 auto 0.9rem; }
.privacy-line { color: var(--muted); }
.hero .privacy-line {
  display: inline-block; background: var(--green-bg); color: var(--text); border-radius: 999px; padding: 0.45rem 1rem;
  font-size: 0.9rem; max-width: 100%;
}
.tools-section { padding-top: 1rem; padding-bottom: 1.5rem; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.9rem; }
.tool-card {
  display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto 1fr; column-gap: 0.85rem; row-gap: 0.15rem;
  padding: 1.05rem 1.1rem; background: var(--bg2); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); color: var(--text); transition: border-color .15s, transform .15s;
}
.tool-card:hover { border-color: var(--border-2); transform: translateY(-2px); text-decoration: none; color: var(--text); }
.tool-card .tool-ic { grid-row: 1 / span 2; }
.tool-card.featured { grid-column: span 2; background: linear-gradient(135deg, var(--bg2), var(--blue-soft)); }
@media (max-width: 560px) { .tool-card.featured { grid-column: auto; } }
.tool-ic {
  display: inline-flex; width: 44px; height: 44px; padding: 10px; border-radius: 10px; background: var(--blue-soft); color: var(--blue-2);
  flex: none;
}
.tool-name { font-weight: 700; color: var(--heading); }
.tool-desc { font-size: 0.86rem; color: var(--muted); line-height: 1.4; }
.how { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem 2rem; padding-top: 0.5rem; padding-bottom: 2.5rem; }
.how-step { display: flex; align-items: center; gap: 0.5rem; color: var(--muted); }
.how-step b { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; align-items: center; justify-content: center; background: var(--blue); color: #fff; font-size: 0.85rem; }
.how-note { width: 100%; text-align: center; margin: 0.4rem 0 0; }

/* ---------------- Tool page ---------------- */
.tool { padding-top: 1.25rem; padding-bottom: 2.5rem; }
.tool.wide { max-width: 1280px; }
.tool-head { margin-bottom: 1.1rem; }
.back { font-size: 0.88rem; color: var(--muted); }
.tool-title { display: flex; gap: 0.9rem; align-items: center; margin-top: 0.4rem; }
.tool-title h1 { margin: 0; font-size: clamp(1.4rem, 3.4vw, 1.9rem); }
.tool-title p { margin: 0.1rem 0 0; }
.tool-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.1rem; align-items: start; }
@media (max-width: 820px) { .tool-layout { grid-template-columns: 1fr; } }
.panel, .card { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 1.1rem; box-shadow: var(--shadow); }
.options-panel { position: sticky; top: 72px; display: grid; gap: 0.8rem; }
@media (max-width: 820px) { .options-panel { position: static; } }
.panel-title { font-size: 1rem; margin: 0; }
.options { display: grid; gap: 0.75rem; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.35rem; text-align: center;
  min-height: 200px; padding: 1.5rem 1rem; border: 2px dashed var(--border-2); border-radius: 12px; background: var(--blue-soft);
  cursor: pointer; transition: background .15s, border-color .15s; color: var(--text);
}
.dropzone:hover, .dropzone.over, body.drop-over .dropzone { border-color: var(--blue); background: rgba(26,112,255,0.16); }
.dropzone:focus-within { outline: 3px solid var(--blue); outline-offset: 2px; }
.dropzone .dz-ic { width: 40px; height: 40px; color: var(--blue-2); }
.dz-main { font-weight: 600; color: var(--heading); }
.dz-link { color: var(--blue-2); text-decoration: underline; }
.dz-sub { font-size: 0.82rem; color: var(--muted); }
.dropzone.compact { min-height: 0; flex-direction: row; padding: 0.7rem 1rem; gap: 0.6rem; }
.dropzone.compact .dz-ic { width: 22px; height: 22px; }
.dropzone.compact .dz-main { font-weight: 500; font-size: 0.92rem; }

.file-list { list-style: none; margin: 0.8rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.file-row {
  display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.6rem; border: 1px solid var(--border);
  border-radius: 10px; background: var(--bg); user-select: none;
}
.file-row.dragging { opacity: 0.35; }
.file-row.drop-before { box-shadow: 0 -3px 0 var(--blue); }
.file-row.drop-after { box-shadow: 0 3px 0 var(--blue); }
.drag-handle { display: inline-flex; width: 20px; height: 28px; color: var(--faint); cursor: grab; touch-action: none; flex: none; }
.drag-handle svg { width: 100%; height: 100%; fill: currentColor; }
.file-thumb { width: 44px; height: 52px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--page); border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.file-thumb canvas, .file-thumb img { max-width: 100%; max-height: 100%; display: block; object-fit: contain; }
.file-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.file-name { font-weight: 600; color: var(--heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-btns { display: flex; gap: 0.25rem; }
.hint { text-align: center; padding: 0.2rem; }

.field { display: grid; gap: 0.3rem; font-size: 0.9rem; }
.field > span { font-weight: 600; color: var(--heading); }
.field small { font-size: 0.78rem; }
.field input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), .field select, .range-in, .size-sel {
  width: 100%; font: inherit; font-size: 0.95rem; padding: 0.55rem 0.7rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text);
}
.field input:focus, .field select:focus, .range-in:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px var(--blue-soft); }
.field input[type=color] { width: 64px; height: 36px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.field input[type=range] { width: 100%; accent-color: var(--blue); }
.check { display: flex; gap: 0.55rem; align-items: center; font-size: 0.92rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); }
.radio-cards { border: 0; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.radio-card {
  display: grid; grid-template-columns: auto 1fr; column-gap: 0.6rem; align-items: center; padding: 0.6rem 0.75rem;
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer; background: var(--bg);
}
.radio-card:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.radio-card input { accent-color: var(--blue); grid-row: span 2; width: 18px; height: 18px; }
.rc-label { font-weight: 600; color: var(--heading); font-size: 0.93rem; }
.rc-sub { grid-column: 2; font-size: 0.8rem; color: var(--muted); }

.status { display: grid; gap: 0.4rem; }
.status .bar { height: 8px; border-radius: 99px; background: var(--bg3); overflow: hidden; position: relative; }
.status .bar-fill { height: 100%; width: 0; background: var(--blue); transition: width .2s; }
.status.indeterminate .bar-fill { width: 35% !important; animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
.status-text { font-size: 0.88rem; color: var(--muted); }
.error-box { background: var(--red-bg); color: var(--red); border: 1px solid currentColor; border-radius: 10px; padding: 0.7rem 0.9rem; font-size: 0.92rem; }

.result { display: grid; gap: 0.6rem; border-color: var(--green); }
.result-head { display: flex; gap: 0.7rem; align-items: center; }
.result-head .ic.ok { width: 34px; height: 34px; padding: 6px; border-radius: 50%; background: var(--green-bg); color: var(--green); }
.result-name { font-weight: 700; color: var(--heading); word-break: break-all; }
.result-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.result-actions .btn.big { flex: 1 1 12rem; width: auto; }
.sizes { margin: 0; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 1.05rem; }
.sizes .was { color: var(--muted); text-decoration: line-through; }
.pill { font-size: 0.78rem; padding: 0.15rem 0.55rem; border-radius: 999px; background: var(--bg3); color: var(--muted); font-weight: 600; }
.pill.good { background: var(--green-bg); color: var(--green); }
.after-dl { margin: 0; }
.out:empty { display: none; }

/* ---------------- Organize ---------------- */
.organize { display: grid; gap: 0.8rem; }
.org-empty { text-align: center; }
.org-toolbar {
  position: sticky; top: 56px; z-index: 20; display: flex; flex-wrap: wrap; gap: 0.5rem 0.9rem; align-items: center;
  justify-content: space-between; padding: 0.55rem 0.65rem; background: var(--nav-bg); -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
}
.tb-group { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.tb-group.end { margin-left: auto; }
.tb-btn {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.42rem 0.6rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg2); color: var(--heading); font: inherit; font-size: 0.84rem; cursor: pointer;
}
.tb-btn:hover:not(:disabled) { border-color: var(--blue); }
.tb-btn:disabled { opacity: 0.45; cursor: default; }
.tb-btn .ic { width: 18px; height: 18px; }
.sel-info { font-size: 0.84rem; color: var(--muted); min-width: 7.5rem; }
.range-form { display: flex; gap: 0.3rem; }
.range-in { width: 8.5rem !important; padding: 0.4rem 0.55rem !important; font-size: 0.85rem !important; }
.size-sel { width: auto !important; padding: 0.4rem 0.5rem !important; font-size: 0.85rem !important; }
@media (max-width: 1100px) { .tb-label { display: none; } .tb-btn { padding: 0.45rem; } }
@media (max-width: 640px) {
  .org-toolbar { top: 52px; gap: 0.45rem; }
  .tb-group.end { margin-left: 0; width: 100%; }
  .tb-group.end .btn { flex: 1; }
  .sel-group .range-form { flex: 1; }
  .range-in { width: 100% !important; }
}
.page-grid:not(.multi) .file-dot { display: none; }
.file-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; }
.file-legend:empty { display: none; }
.legend-item { display: inline-flex; align-items: center; gap: 0.35rem; max-width: 100%; }
.legend-item .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 16rem; }
.file-dot {
  display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 5px;
  background: var(--file-color, var(--blue)); color: #fff; font-size: 0.7rem; font-weight: 700; flex: none;
}

.page-grid {
  --thumb: 150px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(var(--thumb) + 22px), 1fr)); gap: 0.8rem;
  padding: 0.25rem; user-select: none; -webkit-user-select: none;
}
@media (max-width: 480px) { .page-grid { grid-template-columns: repeat(auto-fill, minmax(min(calc(var(--thumb) + 10px), 46%), 1fr)); gap: 0.55rem; } }
.page-card {
  position: relative; display: grid; gap: 0.35rem; padding: 10px 10px 6px; border-radius: 12px; border: 2px solid transparent;
  background: var(--bg2); box-shadow: var(--shadow); cursor: pointer; transition: border-color .12s, transform .12s, opacity .12s;
  -webkit-touch-callout: none; touch-action: manipulation;
}
.page-card:hover { border-color: var(--border-2); }
.page-card.selected { border-color: var(--blue); background: var(--blue-soft); }
.page-card.dragging { opacity: 0.3; }
.page-card.drop-before::before, .page-card.drop-after::after {
  content: ""; position: absolute; top: 6px; bottom: 6px; width: 4px; border-radius: 4px; background: var(--blue);
}
.page-card.drop-before::before { left: -8px; }
.page-card.drop-after::after { right: -8px; }
.thumb-box { aspect-ratio: 1 / 1.08; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.thumb {
  max-width: 100%; max-height: 100%; display: flex; align-items: center; justify-content: center;
  transition: transform .18s ease; width: 100%; height: 100%;
}
.thumb canvas {
  display: block; max-width: 100%; max-height: 100%; object-fit: contain; background: var(--page);
  box-shadow: 0 1px 3px rgba(0,0,0,0.25); border-radius: 2px;
}
.page-card[data-rot="90"] .thumb { transform: rotate(90deg); }
.page-card[data-rot="180"] .thumb { transform: rotate(180deg); }
.page-card[data-rot="270"] .thumb { transform: rotate(270deg); }
.page-card[data-rot="90"] .thumb canvas, .page-card[data-rot="270"] .thumb canvas { max-width: 92%; max-height: 92%; }
.blank-page {
  width: 77%; height: 100%; background: var(--page); border: 1px dashed var(--faint); border-radius: 2px; display: flex;
  align-items: center; justify-content: center; color: #8a94a6; font-size: 0.8rem;
}
.page-foot { display: flex; align-items: center; justify-content: center; gap: 0.4rem; min-height: 20px; }
.page-no { font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.page-card.selected .page-no { color: var(--blue-2); }
.card-btns { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .12s; }
.page-card:hover .card-btns, .page-card:focus-within .card-btns, .page-card.selected .card-btns { opacity: 1; }
@media (hover: none) { .card-btns { opacity: 1; } }
.mini {
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px;
  border: 1px solid var(--border); background: var(--bg2); color: var(--heading); cursor: pointer; padding: 5px;
  box-shadow: var(--shadow);
}
.mini:hover { border-color: var(--blue); color: var(--blue-2); }
.mini svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.drag-ghost {
  position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; opacity: 0.92; box-shadow: var(--shadow-lg);
  border-color: var(--blue) !important; transform-origin: 0 0; margin: 0; list-style: none;
}
.drag-count {
  position: absolute; top: -10px; right: -10px; min-width: 26px; height: 26px; border-radius: 13px; background: var(--blue);
  color: #fff; font-weight: 700; font-size: 0.85rem; display: flex; align-items: center; justify-content: center; padding: 0 6px;
}
body.is-dragging, body.is-dragging * { cursor: grabbing !important; }
.org-out { display: grid; gap: 0.6rem; max-width: 34rem; margin: 0 auto; width: 100%; }
.org-out .result { box-shadow: var(--shadow-lg); }

/* ---------------- Sign-in, dialog, toast ---------------- */
.signin-card { max-width: 26rem; margin: 1rem auto; }
.signin-form { display: grid; gap: 0.75rem; }
.signin-form .links { display: flex; gap: 1rem; flex-wrap: wrap; margin: 0; }
.dialog { border: 1px solid var(--border); border-radius: 14px; padding: 1.3rem; background: var(--bg2); color: var(--text); box-shadow: var(--shadow-lg); width: min(26rem, calc(100vw - 2rem)); }
.dialog::backdrop { background: rgba(5, 9, 18, 0.55); }
.dialog form { display: grid; gap: 0.7rem; }
.dialog h2 { margin: 0; }
.dialog p { margin: 0; }
.pw-name { font-weight: 600; word-break: break-all; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 0.5rem; }
.toast {
  position: fixed; left: 50%; bottom: 1.25rem; transform: translate(-50%, 150%); z-index: 2000; max-width: min(34rem, calc(100vw - 2rem));
  background: var(--heading); color: var(--bg); padding: 0.7rem 1rem; border-radius: 10px; box-shadow: var(--shadow-lg);
  font-size: 0.92rem; transition: transform .2s, opacity .2s; pointer-events: none; opacity: 0; visibility: hidden;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.toast.error { background: var(--red); color: #fff; }
.loading { padding: 3rem 1.5rem; text-align: center; }

/* ---------------- Privacy page ---------------- */
.prose { max-width: 46rem; padding-top: 2rem; padding-bottom: 3rem; }
.prose .lead { font-size: 1.08rem; background: var(--green-bg); padding: 0.8rem 1rem; border-radius: 10px; color: var(--text); }
.prose h2 { margin-top: 1.6rem; }
.prose li { margin-bottom: 0.35rem; }

/* ---------------- Footer ---------------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg2); padding: 2.25rem 0 1.75rem; font-size: 0.9rem; margin-top: auto; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 1.5rem; }
@media (max-width: 800px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .foot-grid { grid-template-columns: 1fr; } }
.site-footer h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); margin-bottom: 0.6rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.15rem; font-size: 0.9rem; line-height: 1.4; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--heading); }
.site-footer .brand { margin-bottom: 0.5rem; }
.site-footer .brand span { color: var(--heading); }
.foot-notes { margin-top: 1.5rem; padding-top: 1.1rem; border-top: 1px solid var(--border); color: var(--faint); font-size: 0.82rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.3rem 1rem; }

@media print { .site-nav, .site-footer, .ilx-family, .skip { display: none !important; } }
