/*
 * tpland — the site's own stylesheet. Plain CSS, served as it is: the server
 * cannot run a CSS build, and none is needed. Colours follow lumnon's theme
 * (blue #1f6feb / #3b9eff, cyan, amber); light by default, dark when the
 * visitor chooses it (html[data-theme="dark"]) or their device asks for it
 * and they have not chosen.
 */

:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #eef2f9;
  --border: #e2e8f2;
  --text: #0d1424;
  --muted: #566176;
  --primary: #1f6feb;
  --primary-hover: #1a5fd0;
  --primary-soft: #e8f1ff;
  --on-primary: #ffffff;
  --org: #1f6feb;  --org-bg: #e8f1ff;
  --opt: #b45309;  --opt-bg: #fff3df;
  --cnv: #0e7490;  --cnv-bg: #dff6fa;
  --sec: #c2364a;  --sec-bg: #fde8eb;
  --edt: #6d28d9;  --edt-bg: #f1eafe;
  --ok: #157347;   --ok-bg: #e3f6ec;
  --shadow: 0 1px 2px rgba(13, 20, 36, .05), 0 6px 20px rgba(13, 20, 36, .06);
  --glow: rgba(31, 111, 235, .10);
  --radius: 18px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0a0e1a;
  --surface: #121826;
  --surface-2: #1a2236;
  --border: rgba(255, 255, 255, .09);
  --text: #edf1f7;
  --muted: #8b96aa;
  --primary: #3b9eff;
  --primary-hover: #62b1ff;
  --primary-soft: rgba(59, 158, 255, .14);
  --on-primary: #06132a;
  --org: #3b9eff;  --org-bg: rgba(59, 158, 255, .14);
  --opt: #f5a524;  --opt-bg: rgba(245, 165, 36, .14);
  --cnv: #22d3ee;  --cnv-bg: rgba(34, 211, 238, .12);
  --sec: #f45b69;  --sec-bg: rgba(244, 91, 105, .14);
  --edt: #a78bfa;  --edt-bg: rgba(167, 139, 250, .14);
  --ok: #4ade80;   --ok-bg: rgba(74, 222, 128, .12);
  --shadow: 0 6px 20px rgba(0, 0, 0, .45);
  --glow: rgba(59, 158, 255, .16);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
/* `hidden` must win over the display rules below (.drop, .card…). */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: "Space Grotesk", Inter, system-ui, sans-serif;
  letter-spacing: -.02em;
  line-height: 1.15;
  margin: 0;
}

a { color: var(--primary); }
a:hover { color: var(--primary-hover); }
img, svg { max-width: 100%; }
p { margin: 0; }
.muted { color: var(--muted); }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 860px; margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--surface); padding: 8px 14px; border-radius: 10px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 12px; border: 0;
  background: var(--primary); color: var(--on-primary) !important;
  font: 600 15px Inter, system-ui, sans-serif; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--primary-hover); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-lg { min-height: 58px; font-size: 18px; border-radius: 14px; padding: 0 28px; }
.btn-xl { min-height: 62px; font-size: 19px; border-radius: 16px; padding: 0 40px; box-shadow: 0 10px 30px var(--glow); }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 14px; border-radius: 12px; border: 0; background: transparent;
  color: var(--text) !important; font: 500 15px Inter, system-ui, sans-serif; text-decoration: none; cursor: pointer;
}
.btn-ghost:hover { background: var(--surface-2); }
.btn-line { border: 1px solid var(--border); }
.btn-danger { color: var(--sec) !important; }
.btn-block { width: 100%; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); display: inline-grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }

/* ---------- Header ---------- */

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: relative; z-index: 20; }
.site-header .bar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 12px 24px; max-width: 1440px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text) !important; }
.brand-name { font: 700 23px/1 "Space Grotesk", sans-serif; letter-spacing: -.03em; }
.brand-logo { display: block; height: 50px; width: auto; }
html[data-theme="dark"] .brand-logo { background: #fff; border-radius: 12px; padding: 2px 8px; height: 46px; }
.foot-about .brand-logo { height: 64px; }
.foot-text { margin-top: 12px; font-size: 14px; line-height: 1.6; max-width: 380px; }
.brand-name b { color: var(--primary); font-weight: 700; }
.brand-tag { display: block; font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin-top: 3px; }
.main-nav { display: flex; gap: 2px; flex-wrap: wrap; }
.nav-link {
  color: var(--text) !important; text-decoration: none; font-weight: 500; font-size: 15px;
  padding: 10px 12px; border-radius: 10px; display: inline-flex; align-items: center; gap: 6px;
}
.nav-link:hover { background: var(--surface-2); }
.nav-link[aria-current="page"] { background: var(--primary-soft); color: var(--primary) !important; }
.nav-soon { font-size: 11px; font-weight: 600; color: var(--muted); background: var(--surface-2); padding: 2px 7px; border-radius: 999px; }
.header-end { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.menu-toggle { display: none; }
.show-sm { display: none !important; }

@media (max-width: 860px) {
  .menu-toggle { display: inline-grid; }
  .main-nav { display: none; order: 10; width: 100%; flex-direction: column; padding-top: 6px; }
  .main-nav.open { display: flex; }
  .hide-sm { display: none !important; }
  .show-sm { display: inline-flex !important; }
  .hero h1 br { display: none; }
  .add-tile { min-height: 180px; }
  .site-header .bar { padding: 10px 16px; }
}

/* ---------- Footer ---------- */

.site-footer { background: var(--surface); border-top: 1px solid var(--border); margin-top: 72px; }
.site-footer .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 28px; padding: 44px 24px 24px; max-width: 1280px; margin: 0 auto; }
.site-footer h3 { font-size: 15px; margin-bottom: 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--primary); }
.site-footer .legal { max-width: 1280px; margin: 0 auto; padding: 16px 24px 32px; color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; border-top: 1px solid var(--border); }

/* ---------- Hero ---------- */

.hero { padding: 64px 0 36px; text-align: center; background: radial-gradient(60% 80% at 50% 0%, var(--glow), transparent 70%); }
.hero .inner { max-width: 880px; margin: 0 auto; padding: 0 24px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 14px; font-weight: 600; }
.hero h1 { font-size: clamp(34px, 5.4vw, 62px); line-height: 1.05; font-weight: 700; }
.hero .lead { max-width: 660px; font-size: 19px; line-height: 1.55; color: var(--muted); }
.trust { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; color: var(--muted); font-size: 14px; }
.trust span { display: inline-flex; align-items: center; gap: 6px; }
.trust svg { color: var(--primary); }

/* ---------- Search ---------- */

.search { position: relative; width: 100%; max-width: 640px; margin-top: 6px; }
.search label {
  display: flex; align-items: center; gap: 12px; padding: 0 18px; min-height: 60px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.search label:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: 400 17px Inter, system-ui, sans-serif; height: 56px; }
.search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow); padding: 8px; text-align: left; z-index: 30; max-height: 360px; overflow-y: auto;
}
.search-results a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--text) !important; }
.search-results a:hover, .search-results a.active { background: var(--surface-2); }
.search-results .where { margin-left: auto; font-size: 13px; color: var(--muted); }
.search-results .empty { padding: 12px; color: var(--muted); }

/* ---------- Section tiles (welcome page) ---------- */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 28px; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  text-decoration: none; color: var(--text) !important; min-height: 230px; transition: transform .15s ease, border-color .15s ease;
}
a.tile:hover { transform: translateY(-3px); border-color: var(--primary); }
.tile .mark { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; }
.tile h2 { font-size: 26px; }
.tile p { color: var(--muted); font-size: 16px; }
.tile .go { margin-top: auto; font-weight: 600; color: var(--primary); display: inline-flex; align-items: center; gap: 6px; }
.tile.soon { opacity: .9; }
.tile .badge { position: absolute; top: 20px; right: 20px; }
.badge { display: inline-flex; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.badge-primary { background: var(--primary); color: var(--on-primary); }
.badge-ok { background: var(--ok-bg); color: var(--ok); }

/* ---------- Tool cards ---------- */

.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 26px; }
.chip {
  min-height: 40px; padding: 0 16px; border-radius: 999px; font: 500 14px Inter, system-ui, sans-serif; cursor: pointer;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
}
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.card {
  display: flex; flex-direction: column; gap: 10px; padding: 22px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: var(--text) !important;
  box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--primary); }
.card .title { font: 600 19px "Space Grotesk", sans-serif; }
.card .text { color: var(--muted); font-size: 15px; line-height: 1.5; }
.card[hidden] { display: none; }

.ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; }
.ico-sm { width: 40px; height: 40px; border-radius: 12px; }
.ico svg { width: 24px; height: 24px; }
.ico-sm svg { width: 20px; height: 20px; }
.c-organise { background: var(--org-bg); color: var(--org); }
.c-optimise { background: var(--opt-bg); color: var(--opt); }
.c-convert  { background: var(--cnv-bg); color: var(--cnv); }
.c-security { background: var(--sec-bg); color: var(--sec); }
.c-edit     { background: var(--edt-bg); color: var(--edt); }
.c-image    { background: var(--cnv-bg); color: var(--cnv); }
.c-ai       { background: var(--edt-bg); color: var(--edt); }

/* ---------- Sections ---------- */

.band { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section { padding: 72px 0; }
.section-head { text-align: center; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 38px); font-weight: 700; margin-bottom: 8px; }
.section-head p { color: var(--muted); font-size: 17px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.step { display: flex; flex-direction: column; gap: 12px; padding: 26px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--border); }
.step .num { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); font: 700 18px "Space Grotesk", sans-serif; }
.step h3 { font-size: 20px; font-weight: 600; }
.step p { color: var(--muted); font-size: 15px; }

/* ---------- Pricing ---------- */

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 20px; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; gap: 18px; padding: 30px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); }
.plan.best { border: 2px solid var(--primary); box-shadow: 0 10px 40px var(--glow); }
.plan .flag { position: absolute; top: -14px; left: 30px; }
.plan h3 { font-size: 22px; font-weight: 600; }
.plan .price { font: 700 44px/1 "Space Grotesk", sans-serif; }
.plan .price small { font: 500 17px Inter, sans-serif; color: var(--muted); }
.plan ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.plan li { display: flex; gap: 10px; align-items: flex-start; }
.plan li svg { color: var(--primary); flex-shrink: 0; margin-top: 3px; }
.plan .cta { margin-top: auto; }

/* ---------- Tool page ---------- */

.tool-layout { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; padding-top: 32px; }
.tool-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.tool-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.tool-title { display: flex; align-items: center; gap: 16px; }
.tool-title h1 { font-size: 34px; font-weight: 700; }
.tool-title p { color: var(--muted); margin-top: 4px; }
.panel { padding: 22px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.panel h2 { font-size: 20px; font-weight: 600; margin-bottom: 14px; }

.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center;
  min-height: 320px; padding: 32px 20px; border-radius: 20px; border: 2px dashed var(--border); background: var(--surface);
  transition: border-color .15s ease, background .15s ease; cursor: pointer;
}
.drop:hover, .drop.over { border-color: var(--primary); background: var(--primary-soft); }
.drop .big { font: 700 24px "Space Grotesk", sans-serif; }
.drop .plus { width: 64px; height: 64px; border-radius: 999px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; }

.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.file {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 16px;
  background: var(--bg); border: 1px solid var(--border); cursor: grab; user-select: none;
}
.file.dragging { opacity: .4; }
.file.drop-before { box-shadow: -4px 0 0 var(--primary); }
.file .top { display: flex; justify-content: space-between; align-items: center; }
.file .pos { min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-size: 13px; font-weight: 600; display: grid; place-items: center; }
.file .thumb { aspect-ratio: 3 / 4; border-radius: 10px; background: #fff; border: 1px solid #e2e8f2; display: grid; place-items: center; overflow: hidden; }
.file .thumb canvas, .file .thumb img { max-width: 100%; max-height: 100%; display: block; }
.file .thumb .ext { font: 700 16px "Space Grotesk", sans-serif; color: #566176; }
.file .name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file .meta { color: var(--muted); font-size: 13px; }
.x-btn { width: 32px; height: 32px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.x-btn:hover { color: var(--sec); border-color: var(--sec); }
.add-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 240px;
  border-radius: 16px; border: 2px dashed var(--border); background: transparent; color: var(--primary); cursor: pointer;
  font: 600 15px Inter, system-ui, sans-serif;
}
.add-tile:hover { border-color: var(--primary); background: var(--primary-soft); }

/* Page picker (Organise, Rotate, Remove, Extract) */
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.page {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px; border-radius: 14px;
  background: var(--bg); border: 2px solid transparent; cursor: pointer; user-select: none;
}
.page .sheet { width: 100%; aspect-ratio: 3 / 4; display: grid; place-items: center; background: #fff; border-radius: 8px; border: 1px solid #e2e8f2; overflow: hidden; }
.page canvas { max-width: 100%; max-height: 100%; transition: transform .2s ease; }
.page .no { font-size: 13px; color: var(--muted); font-weight: 600; }
.page.picked { border-color: var(--primary); background: var(--primary-soft); }
.page.picked::after {
  content: "✓"; position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 999px;
  background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font-size: 14px; font-weight: 700;
}
.picker-remove .page.picked { border-color: var(--sec); background: var(--sec-bg); }
.picker-remove .page.picked::after { content: "✕"; background: var(--sec); }
.page .tools { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.page .tools button { width: 30px; height: 30px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; display: grid; place-items: center; }
.page.dragging { opacity: .4; }

/* Options */
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.field > span, .field legend { font-weight: 600; font-size: 15px; }
.field .hint { color: var(--muted); font-size: 13px; }
fieldset.field { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.input, select.input {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font: 400 16px Inter, system-ui, sans-serif;
}
.input:focus { border-color: var(--primary); outline: 0; box-shadow: 0 0 0 4px var(--primary-soft); }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice span {
  display: flex; flex-direction: column; gap: 2px; min-height: 46px; justify-content: center; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--bg); cursor: pointer; font-size: 14px; font-weight: 500;
}
.choice span small { color: var(--muted); font-weight: 400; font-size: 12px; }
.choice input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.choice input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 2px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--primary); }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat { padding: 12px 6px; border-radius: 12px; background: var(--bg); text-align: center; }
.stat b { display: block; font: 700 22px "Space Grotesk", sans-serif; }
.stat span { font-size: 13px; color: var(--muted); }
.meter { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.limit-line { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }

.notice { padding: 14px 16px; border-radius: 14px; font-size: 15px; line-height: 1.5; }
.notice-error { background: var(--sec-bg); color: var(--text); border: 1px solid var(--sec); }
.notice-info { background: var(--primary-soft); color: var(--text); }
.notice-ok { background: var(--ok-bg); color: var(--text); }

.progress { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--primary); transition: width .2s ease; }
.progress.busy i { width: 35% !important; animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
@media (prefers-reduced-motion: reduce) { .progress.busy i { animation: none; width: 100% !important; opacity: .5; } .card, .tile { transition: none; } }

/* How-to and FAQ under a tool */
.howto { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.faq details { border-bottom: 1px solid var(--border); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 16px; }
.faq details p { margin-top: 8px; color: var(--muted); }

/* ---------- Job (download) page ---------- */

.done { padding: 56px 0 24px; background: radial-gradient(55% 70% at 50% 0%, var(--glow), transparent 70%); }
.done .inner { max-width: 760px; margin: 0 auto; padding: 0 24px; display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; }
.done h1 { font-size: clamp(30px, 4vw, 42px); font-weight: 700; }
.tick { width: 76px; height: 76px; border-radius: 999px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; box-shadow: 0 0 0 10px var(--primary-soft); }
.tick.fail { background: var(--sec); box-shadow: 0 0 0 10px var(--sec-bg); }
.result {
  width: 100%; max-width: 560px; display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); text-align: left;
}
.result .kind { width: 48px; height: 58px; border-radius: 8px; background: var(--sec-bg); color: var(--sec); display: grid; place-items: center; font: 700 13px "Space Grotesk", sans-serif; flex-shrink: 0; text-transform: uppercase; }
.result .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.next-tools a {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--border); text-decoration: none; color: var(--text) !important; font-weight: 600;
}
.next-tools a:hover { border-color: var(--primary); }
.ad-slot { margin: 28px auto 0; min-height: 100px; max-width: 970px; display: grid; place-items: center; }

/* ---------- Account pages ---------- */

.auth { max-width: 460px; margin: 48px auto 0; padding: 0 16px; }
.auth .panel { padding: 30px; }
.auth h1 { font-size: 30px; margin-bottom: 6px; }
.table-box { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 15px; }
table.list th, table.list td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.list th { color: var(--muted); font-weight: 600; font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }

/* Legal pages and long text */
.prose { max-width: 760px; margin: 0 auto; padding: 40px 24px 0; }
.prose h1 { font-size: 36px; margin-bottom: 12px; }
.prose h2 { font-size: 22px; margin: 28px 0 10px; }
.prose p, .prose li { color: var(--text); line-height: 1.7; margin-bottom: 10px; }

/* ---------- Editor (Edit PDF, Sign PDF) ---------- */

.ed { margin-top: 20px; }
.ed-bar {
  position: sticky; top: 0; z-index: 15; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  padding: 8px; border-radius: 16px 16px 0 0; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.ed-tools { display: flex; gap: 4px; flex-wrap: wrap; }
.ed-tool {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 56px; min-height: 52px;
  padding: 4px 8px; border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--text);
  font: 500 12px Inter, system-ui, sans-serif; cursor: pointer;
}
.ed-tool:hover { background: var(--surface-2); }
.ed-tool[aria-pressed="true"] { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.ed-props {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-height: 52px; padding: 8px 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-top: 0; border-radius: 0 0 16px 16px;
}
.ed-hint { color: var(--muted); font-size: 14px; }
.ed-group { display: inline-flex; align-items: center; gap: 6px; }
.ed-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.ed-swatch { width: 26px; height: 26px; border-radius: 999px; border: 2px solid var(--border); cursor: pointer; padding: 0; position: relative; }
.ed-swatch.on { box-shadow: 0 0 0 3px var(--primary); }
.ed-swatch-pick { background: conic-gradient(#f43, #fb0, #3c5, #29f, #a3f, #f43); overflow: hidden; }
.ed-swatch-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ed-select { min-height: 36px; padding: 4px 8px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 500 14px Inter, sans-serif; }
.ed-toggle { min-height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 500 14px Inter, sans-serif; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.ed-toggle[aria-pressed="true"] { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.ed-danger { color: var(--sec); }
.ed-body { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; margin-top: 18px; }
.ed-pages { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 16px 0; background: var(--surface-2); border-radius: 18px; overflow-x: auto; }
.ed-side { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 140px; }
.ed-tips ul { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.ed-tips kbd { font: 600 12px Inter, sans-serif; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.ed-page { position: relative; flex-shrink: 0; background: #fff; box-shadow: 0 2px 10px rgba(13, 20, 36, .18); }
.ed-page canvas { display: block; }
.ed-page-no { position: absolute; left: 0; bottom: -20px; font-size: 12px; color: var(--muted); }
.ed-layer { position: absolute; inset: 0; touch-action: none; }
.ed-pages[data-tool="select"] .ed-layer { cursor: default; }
.ed-pages:not([data-tool="select"]) .ed-layer { cursor: crosshair; }
.ed-pages[data-tool="text"] .ed-layer, .ed-pages[data-tool="date"] .ed-layer { cursor: text; }
.ed-vec { position: absolute; inset: 0; overflow: visible; }
.ed-obj { cursor: move; }
.ed-text { position: absolute; white-space: pre; padding: 0; margin: 0; min-width: 4px; outline: none; user-select: none; }
.ed-text.editing { cursor: text; user-select: text; outline: 1px dashed #1f6feb; background: rgba(255, 255, 255, .6); }
.ed-img { position: absolute; user-select: none; }
.ed-sel { position: absolute; border: 1.5px dashed #1f6feb; border-radius: 4px; pointer-events: none; }
.ed-handle { position: absolute; width: 14px; height: 14px; border-radius: 999px; background: #fff; border: 2px solid #1f6feb; cursor: nwse-resize; touch-action: none; }
.ed-dialog { border: 0; padding: 0; border-radius: 20px; width: min(680px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.ed-dialog::backdrop { background: rgba(10, 14, 26, .55); }
.ed-dialog-inner { padding: 24px; }
.ed-dialog h2 { font-size: 24px; }
.ed-sign-pad, .ed-sign-preview { width: 100%; aspect-ratio: 3 / 1; border-radius: 14px; border: 2px dashed var(--border); background: #fff; touch-action: none; cursor: crosshair; display: block; }
.ed-sign-fonts { display: grid; gap: 8px; }
.ed-sign-fonts .choice span { min-height: 64px; color: #111; background: #fff; }
@media (max-width: 860px) {
  .ed-tool span:not(.sr-only) { display: none; }
  .ed-tool { min-width: 44px; min-height: 44px; }
  .ed-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
  .ed-tools { flex-wrap: nowrap; }
  .ed-side { position: static; }
}

/* ---------- Footer with the About box (1.2) ---------- */
.site-footer .cols { grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(150px, 1fr)); }
@media (max-width: 860px) { .site-footer .cols { grid-template-columns: 1fr 1fr; } .foot-about { grid-column: 1 / -1; } }

/* ---------- Help page (1.2) ---------- */
.help h3 { font-size: 18px; margin: 18px 0 8px; }
.help ul, .help ol { padding-left: 22px; }
.help-toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 8px; }
.help-toc a { padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; font-size: 14px; font-weight: 500; }
.help-toc a:hover { border-color: var(--primary); }
.help h2 { scroll-margin-top: 16px; }
.help table.list td, .help table.list th { white-space: normal; }
.help kbd { font: 600 12px Inter, sans-serif; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); }

/* ---------- Dashboard and My files (1.3) ---------- */
.dash-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 20px; }
.dash-card { display: flex; flex-direction: column; gap: 6px; }
.dash-label { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.dash-big { font: 700 28px "Space Grotesk", sans-serif; }
.dash-big small { font: 500 15px Inter, sans-serif; color: var(--muted); }
.dash-link { font-size: 14px; font-weight: 600; color: var(--primary); text-decoration: none; margin-top: auto; }
.files-table td { vertical-align: middle; }
.file-name strong { display: block; max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
.file-name .muted { font-size: 13px; }
.file-actions { white-space: nowrap; text-align: right; }
.file-actions > .btn { vertical-align: middle; }
.file-more { position: relative; display: inline-block; vertical-align: middle; margin-left: 6px; text-align: left; }
.file-more summary { list-style: none; cursor: pointer; }
.file-more summary::-webkit-details-marker { display: none; }
.file-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; width: 260px; display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); white-space: normal; }
.file-menu a { padding: 6px 8px; border-radius: 8px; text-decoration: none; font-size: 14px; }
.file-menu a:hover { background: var(--surface-2); }
.file-rename { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); margin-top: 6px; }
#files .table-box { overflow: visible; }
@media (max-width: 1000px) { table.list.files-table th:nth-child(3), table.list.files-table td:nth-child(3) { display: none; } }
@media (max-width: 760px) {
  .files-table thead { display: none; }
  .files-table, .files-table tbody { display: block; }
  .files-table tr { display: grid; grid-template-columns: 30px 1fr auto; grid-template-areas: "c n n" ". s d" ". a a"; row-gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--border); }
  .files-table tr { position: relative; }
  table.list.files-table td { display: block; padding: 0; border: 0; font-size: 13px; white-space: normal; }
  .files-table td:nth-child(1) { grid-area: c; }
  .files-table td:nth-child(2) { grid-area: n; font-size: 15px; min-width: 0; }
  table.list.files-table td:nth-child(3) { display: none; }
  .files-table td:nth-child(4) { grid-area: s; color: var(--muted); }
  .files-table td:nth-child(5) { grid-area: d; color: var(--muted); }
  .files-table td:nth-child(5)::before { content: "Deleted in "; }
  .files-table td:nth-child(6) { grid-area: a; text-align: left; }
  .file-name strong { max-width: 100%; }
  .file-more { margin-left: 4px; position: static; }
  .file-menu { left: 30px; right: 0; width: auto; top: auto; margin-top: 6px; }
}

/* ---------- Account menu, tabs and dashboard (1.4) ---------- */
.account-menu { position: relative; }
.account-menu summary { list-style: none; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu[open] summary { background: var(--surface-2); }
.caret { width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); margin-left: 2px; opacity: .7; }
.account-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: 240px; display: flex; flex-direction: column; padding: 8px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.account-pop a, .account-pop button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 9px; border: 0; background: none; color: var(--text) !important; font: 500 15px Inter, system-ui, sans-serif; text-decoration: none; cursor: pointer; }
.account-pop a:hover, .account-pop button:hover { background: var(--surface-2); }
.account-pop a[aria-current="page"] { background: var(--primary-soft); color: var(--primary) !important; }
.account-pop hr { border: 0; border-top: 1px solid var(--border); margin: 6px 4px; }
.account-who { display: block; padding: 6px 12px 8px; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-group { padding: 12px 12px 2px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.nav-sub { padding-left: 22px !important; }
.nav-button { border: 0; background: none; cursor: pointer; width: 100%; text-align: left; font-family: inherit; }
.account-tabs { display: flex; gap: 4px; margin-bottom: 22px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.account-tabs::-webkit-scrollbar { display: none; }
.account-tabs a { flex: none; padding: 10px 14px; font-weight: 500; font-size: 15px; color: var(--muted) !important; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.account-tabs a:hover { color: var(--text) !important; }
.account-tabs a[aria-current="page"] { color: var(--primary) !important; border-bottom-color: var(--primary); font-weight: 600; }
.dash-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dash-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.dash-head h2 { margin: 0; }
.dash-head .dash-link { margin: 0; }
.dash-list { list-style: none; margin: 0; padding: 0; }
.dash-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.dash-list li:last-child { border-bottom: 0; }
.dash-item { display: flex; flex-direction: column; min-width: 0; }
.dash-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-item .muted { font-size: 13px; }
@media (max-width: 860px) { .dash-pair { grid-template-columns: 1fr; } }

/* ---------- Image tools (1.5) ---------- */
.drop.drop-small { min-height: 0; padding: 18px; flex-direction: row; flex-wrap: wrap; gap: 12px; }
.drop.drop-small .plus { width: 40px; height: 40px; }
.drop.drop-small .big { display: none; }
.drop.drop-small .muted { display: none; }
.drop.drop-small .btn-lg { min-height: 44px; font-size: 15px; padding: 0 18px; }
.img-card { cursor: default; }
.img-card .img-thumb { aspect-ratio: 1 / 1; background: repeating-conic-gradient(#eef1f6 0% 25%, #fff 0% 50%) 50% / 16px 16px; }
.img-card .img-thumb canvas { transition: transform .2s ease; }
.img-after { color: var(--primary); font-weight: 600; min-height: 1em; }
.img-stage { padding: 14px; }
.stage-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; font-size: 14px; }
.crop-wrap { max-height: 70vh; min-height: 260px; background: repeating-conic-gradient(#eef1f6 0% 25%, #fff 0% 50%) 50% / 16px 16px; border-radius: 12px; overflow: hidden; }
.crop-wrap img { display: block; max-width: 100%; }
.crop-circle .cropper-view-box, .crop-circle .cropper-face { border-radius: 50%; }
.wm-preview { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 10px; background: repeating-conic-gradient(#eef1f6 0% 25%, #fff 0% 50%) 50% / 16px 16px; }
.wm-grid { display: grid; grid-template-columns: repeat(3, 52px); gap: 6px; }
.wm-grid .choice span { min-height: 44px; align-items: center; font-size: 18px; padding: 0; }
input[type="range"] { width: 100%; accent-color: var(--primary); }
.result-preview { display: block; max-width: min(100%, 520px); max-height: 360px; margin: 0 auto; border-radius: 14px; border: 1px solid var(--border); background: repeating-conic-gradient(#eef1f6 0% 25%, #fff 0% 50%) 50% / 16px 16px; object-fit: contain; }

/* ---------- Passport guide and photo editor (1.6) ---------- */
.crop-passport .cropper-view-box::after { content: ""; position: absolute; left: 20%; right: 20%; top: 9%; bottom: 20%; border: 2px dashed rgba(255,255,255,.95); border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.25); pointer-events: none; }
.pe { display: flex; flex-direction: column; gap: 12px; }
.pe-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); }
.pe-tabs::-webkit-scrollbar { display: none; }
.pe-tabs button { flex: none; padding: 10px 14px; border: 0; background: none; color: var(--muted); font: 500 15px Inter, system-ui, sans-serif; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.pe-tabs button[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.pe-panel { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; min-height: 48px; }
.pe-panel[hidden] { display: none; }
.pe-slider { display: flex; flex-direction: column; gap: 4px; min-width: 150px; flex: 1 1 150px; font-size: 13px; font-weight: 600; }
.pe-slider span { display: flex; justify-content: space-between; }
.pe-slider output { color: var(--muted); font-weight: 500; }
.pe-chip { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: 500 14px Inter, system-ui, sans-serif; cursor: pointer; }
.pe-chip[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.pe-emoji { font-size: 26px; line-height: 1; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); cursor: pointer; }
.pe-canvas { display: flex; justify-content: center; background: repeating-conic-gradient(#eef1f6 0% 25%, #fff 0% 50%) 50% / 16px 16px; border-radius: 12px; padding: 8px; overflow: hidden; }
.pe-canvas .canvas-container { max-width: 100%; }
.pe-field { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.pe-field select, .pe-field input[type="number"] { min-height: 38px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.pe-field input[type="color"] { width: 40px; height: 36px; border: 1px solid var(--border); border-radius: 10px; background: none; }
.pe-hint { font-size: 13px; color: var(--muted); width: 100%; }
