/* ==========================================================
   ToolsHub – shared stylesheet
   Category colours:
     Exam & Photo  #1D70B8 / #EBF4FC
     PDF           #DB2777 / #FCE7F3  (magenta / pink)
     Image         #0F9D8A / #E6F6F4
     Calc & QR     #7B5CE6 / #F2EEFC
   ========================================================== */
:root {
  /* category palette */
  --exam: #1D70B8; --exam-soft: #EBF4FC; --exam-border: #C6DDF1;
  --pdf:  #DB2777; --pdf-soft:  #FCE7F3; --pdf-border:  #F9A8D4;
  --img:  #0F9D8A; --img-soft:  #E6F6F4; --img-border:  #B4E2DB;
  --calc: #7B5CE6; --calc-soft: #F2EEFC; --calc-border: #D6CCF8;

  /* page accent (overridden per tool page by .theme-*) */
  --primary: var(--exam);
  --primary-dark: #155A94;
  --primary-soft: var(--exam-soft);
  --primary-border: var(--exam-border);
  --ring: rgba(29, 112, 184, .18);

  --success: #16a34a;
  --success-soft: #ecfdf3;
  --accent: #f97316;
  --bg: #FFFBED; /* light cream: #FFEDA5 from the palette mixed ~80% with white */
  --card: #ffffff;
  --text: #0f172a;
  --muted: #1E2B4A;
  --border: #e2e8f0;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 2px 10px rgba(15, 23, 42, .04);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}
.theme-exam { --primary: var(--exam); --primary-dark: #155A94; --primary-soft: var(--exam-soft); --primary-border: var(--exam-border); --ring: rgba(29, 112, 184, .18); }
.theme-pdf  { --primary: var(--pdf);  --primary-dark: #BE185D; --primary-soft: var(--pdf-soft);  --primary-border: var(--pdf-border);  --ring: rgba(219, 39, 119, .18); }
.theme-img  { --primary: var(--img);  --primary-dark: #0B7D6E; --primary-soft: var(--img-soft);  --primary-border: var(--img-border);  --ring: rgba(15, 157, 138, .18); }
.theme-calc { --primary: var(--calc); --primary-dark: #6344CF; --primary-soft: var(--calc-soft); --primary-border: var(--calc-border); --ring: rgba(123, 92, 230, .18); }

/* category scopes used by cards, sections, badges */
.cat-exam { --c: var(--exam); --c-soft: var(--exam-soft); --c-border: var(--exam-border); }
.cat-pdf  { --c: var(--pdf);  --c-soft: var(--pdf-soft);  --c-border: var(--pdf-border); }
.cat-img  { --c: var(--img);  --c-soft: var(--img-soft);  --c-border: var(--img-border); }
.cat-calc { --c: var(--calc); --c-soft: var(--calc-soft); --c-border: var(--calc-border); }

/* Pastel card themes (homepage sections use .cat-*, related-tool cards use .b-*) */
.cat-exam, .b-exam { --card-bg: #E6F0FE; --card-border: #93C5FD; --card-hover: #3B82F6; --pill-bg: #BFDBFE; --pill-text: #1E40AF; }
.cat-img,  .b-img  { --card-bg: #DFFCED; --card-border: #6EE7B7; --card-hover: #10B981; --pill-bg: #A7F3D0; --pill-text: #065F46; }
.cat-pdf,  .b-pdf  { --card-bg: #FDEEF7; --card-border: #F472B6; --card-hover: #DB2777; --pill-bg: #FBCFE8; --pill-text: #9D174D; }
.cat-calc, .b-calc { --card-bg: #F2F0FE; --card-border: #C4B5FD; --card-hover: #8B5CF6; --pill-bg: #DDD6FE; --pill-text: #5B21B6; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ---------- Navbar ---------- */
.navbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 20px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.3rem; letter-spacing: -.02em; color: var(--text); white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo-mark { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; }
.logo-mark svg { width: 32px; height: 32px; display: block; }
.logo span.accent { color: #1D70B8; }
.nav-search { order: 3; flex: 0 1 240px; min-width: 150px; position: relative; }
.nav-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.nav-search input {
  width: 100%; height: 40px; padding: 0 14px 0 38px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg);
  font: inherit; font-size: .95rem; color: var(--text); outline: none; transition: border-color .2s, box-shadow .2s;
}
.nav-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); background: #fff; }
.nav-links { order: 2; display: flex; gap: 2px; margin-left: auto; }
.nav-links a { display: flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 8px; color: var(--text); font-weight: 500; font-size: .92rem; white-space: nowrap; }
.nav-links a .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, #94a3b8); }
.nav-links a:hover { background: #eef2f7; text-decoration: none; }
/* category links always show their colour; hover/active = solid */
/* navbar pills: ~20% deeper fill and darker, bolder text than the page-level soft colours */
.nav-links a.cat-exam { --nav-bg: #D3E6F7; --nav-fg: #155A94; }
.nav-links a.cat-img  { --nav-bg: #C9EDE7; --nav-fg: #0B7D6E; }
.nav-links a.cat-pdf  { --nav-bg: #F9D0E6; --nav-fg: #BE185D; }
.nav-links a.cat-calc { --nav-bg: #E2D9FA; --nav-fg: #6344CF; }
.nav-links a[class*="cat-"] { background: var(--nav-bg, var(--c-soft)); color: var(--nav-fg, var(--c)); font-weight: 700; }
.nav-links a[class*="cat-"] .dot { background: var(--nav-fg, var(--c)); }
.nav-links a[class*="cat-"]:hover, .nav-links a[class*="cat-"].active { background: var(--c); color: #fff; }
.nav-links a[class*="cat-"]:hover .dot, .nav-links a[class*="cat-"].active .dot { background: #fff; }
/* "All Tools" = master tab in the site's own cream-yellow (#FFEDA5, the colour the page background is made from),
   styled like the category pills: soft fill + deep text, solid when active */
.nav-links a[data-nav="all"] { background: #FFE27A; color: #5E4500; font-weight: 700; box-shadow: inset 0 0 0 1px #EBC54A; }
.nav-links a[data-nav="all"]:hover, .nav-links a[data-nav="all"].active { background: #F0B400; color: #2B2000; box-shadow: none; text-decoration: none; }
/* every tab (including the selected one) reacts to the cursor: small lift + coloured shadow */
.nav-links a { transition: background-color .15s, color .15s, transform .15s, box-shadow .15s; }
.nav-links a:hover { transform: translateY(-1px); }
.nav-links a[class*="cat-"]:hover { box-shadow: 0 4px 12px -4px var(--c); }
.nav-links a[data-nav="all"]:hover { box-shadow: 0 4px 12px -4px #C99400; }
.nav-links a.active:hover { filter: brightness(1.06); }
@media (prefers-reduced-motion: reduce) { .nav-links a:hover { transform: none; } }
.nav-links a.active:not([class*="cat-"]):not([data-nav="all"]) { background: #0f172a; color: #fff; }
@media (min-width: 1021px) { .nav-links { gap: 6px; } }
.menu-toggle { display: none; margin-left: auto; background: none; border: 0; padding: 8px; cursor: pointer; color: var(--text); }
.menu-toggle svg { width: 24px; height: 24px; }

@media (max-width: 1020px) {
  .nav-inner { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 10px; }
  .menu-toggle { display: block; }
  .nav-search { order: 3; flex-basis: 100%; max-width: none; }
  .nav-links { display: none; order: 4; flex-basis: 100%; flex-direction: column; margin: 0; }
  .nav-links.open { display: flex; }
}

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 34px 0 10px; }
.hero h1 { margin-bottom: .35em; }
.hero h1 { font-size: clamp(1.9rem, 4.8vw, 3rem); font-weight: 800; letter-spacing: -.02em; color: #0B1F44; }
.hero h1 .grad { color: var(--exam); }
.hero p { color: var(--muted); font-size: 1.1rem; max-width: 780px; margin: 0 auto 14px; text-wrap: balance; }
#toolsTop { height: 14px; scroll-margin-top: 76px; }
.trust { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 22px; margin-top: 10px; color: var(--muted); font-size: 1rem; }
.trust span::before { content: "✓ "; color: var(--success); font-weight: 700; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 8px 0 30px; }
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); background: #fff; color: var(--text);
  padding: 9px 18px; border-radius: 999px; font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; transition: all .2s;
}
.tab .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, #0f172a); }
.tab:hover { border-color: var(--c, #0f172a); color: var(--c, #0f172a); }
.tab[class*="cat-"] { background: var(--c-soft); border-color: var(--c-border); color: var(--c); }
.tab[class*="cat-"]:hover { border-color: var(--c); }
.tab[class*="cat-"].active { background: var(--c); border-color: var(--c); color: #fff; }
.tab.active { background: var(--c, #0f172a); border-color: var(--c, #0f172a); color: #fff; }
.tab.active .dot { background: #fff; }

/* ---------- Category sections ---------- */
.cat-section { margin-bottom: 26px; }
.cat-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cat-head .ico.lg { width: 44px; height: 44px; }
.cat-head .ico.lg svg { width: 22px; height: 22px; }
.cat-head h2 { font-size: 1.3rem; margin: 0; color: var(--c, #0B1F44); }
.cat-head p { margin: 0; color: var(--muted); font-size: 1rem; }
.cat-head .count { margin-left: auto; font-size: .8rem; font-weight: 700; color: var(--c); background: var(--c-soft); border: 1px solid var(--c-border); padding: 4px 12px; border-radius: 999px; white-space: nowrap; }

/* solid round icon badge */
.ico { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--c, var(--primary)); color: #fff; flex-shrink: 0; box-shadow: 0 4px 12px -4px var(--c, var(--primary)); }
.ico svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico.lg { width: 54px; height: 54px; }
.ico.lg svg { width: 26px; height: 26px; }
.b-exam { --c: var(--exam); --c-soft: var(--exam-soft); --c-border: var(--exam-border); }
.b-pdf  { --c: var(--pdf);  --c-soft: var(--pdf-soft);  --c-border: var(--pdf-border); }
.b-img  { --c: var(--img);  --c-soft: var(--img-soft);  --c-border: var(--img-border); }
.b-calc { --c: var(--calc); --c-soft: var(--calc-soft); --c-border: var(--calc-border); }

/* ---------- Tool cards ---------- */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.tool-card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  background: var(--card-bg, #fff); border: 2px solid var(--card-border, var(--border)); border-radius: var(--radius);
  padding: 22px 22px 18px; color: #0F172A; box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s ease, border-color .25s ease;
}
a.tool-card:hover, a.tool-card:focus-visible {
  transform: translateY(-4px); border-color: var(--card-hover, var(--primary)); text-decoration: none; outline: none;
  box-shadow: 0 12px 24px -14px var(--card-hover, var(--primary)), 0 4px 10px rgba(15, 23, 42, .05);
}
a.tool-card:hover .ico { transform: scale(1.06) rotate(-4deg); }
.tool-card .ico { transition: transform .25s ease; }
/* tool names take their category colour (deep shade for readability) */
.tool-card h3 { font-size: 1.05rem; margin: 4px 0 0; color: var(--pill-text, #0F172A); }
.tool-card p { margin: 0; color: #1E2B4A; font-size: 1rem; line-height: 1.5; flex: 1; }
.best { display: block; margin-top: 6px; padding: 7px 12px; border-radius: 10px; background: var(--pill-bg, var(--bg)); color: var(--pill-text, #1E2B4A); font-size: .82rem; font-weight: 600; text-align: center; }
.best b { color: var(--pill-text, var(--text)); font-weight: 700; }
/* "Soon" cards keep their full pastel colours (no fading); only the badge is subdued */
.tool-card.soon { cursor: default; opacity: 1; filter: none; background: var(--card-bg, #fff); }
.badge { position: absolute; top: 16px; right: 16px; font-size: .7rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.badge.soon { background: rgba(255, 255, 255, .75); color: var(--pill-text, var(--muted)); border: 1px solid var(--card-border, var(--border)); font-weight: 600; opacity: .85; }
.badge.hot { background: var(--c, var(--accent)); color: #fff; }
.badge.new { background: #fff; color: var(--pill-text, var(--c)); border: 1px solid var(--card-hover, var(--c-border)); }
/* ---------- Homepage: compact 6-column grid ---------- */
.home .container { max-width: 1540px; }
/* header & footer: same width on every page so the logo and menu never jump */
.navbar .container, .footer .container { max-width: 1540px; }
.tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 700px) { .tools-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } }
@media (min-width: 1200px) { .tools-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
/* icon + title side by side, then description, then "Best for" */
.tools-grid .tool-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto 1fr auto;
  align-items: center; column-gap: 10px; row-gap: 8px; padding: 18px 14px 12px; border-radius: 14px;
}
.tools-grid .tool-card .ico { grid-column: 1; grid-row: 1; width: 38px; height: 38px; border-radius: 11px; }
.tools-grid .tool-card .ico svg { width: 19px; height: 19px; }
.tools-grid .tool-card h3 { grid-column: 2; grid-row: 1; margin: 0; font-size: .95rem; line-height: 1.25; }
.tools-grid .tool-card p { grid-column: 1 / -1; grid-row: 2; align-self: start; font-size: 1rem; line-height: 1.45; }
.tools-grid .tool-card .best { grid-column: 1 / -1; grid-row: 3; margin-top: 2px; padding: 5px 6px; font-size: .76rem; border-radius: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1199px) { .tools-grid .tool-card .best { white-space: normal; } }
/* badge sits on the top edge like a tab, so it never covers the title */
.tools-grid .tool-card .badge { top: -9px; right: 10px; font-size: .62rem; padding: 2px 7px; }
.tools-grid .tool-card .badge.new { background: #fff; }
@media (max-width: 420px) {
  .tools-grid .tool-card { padding: 16px 10px 10px; column-gap: 8px; }
  .tools-grid .tool-card .ico { width: 32px; height: 32px; }
  .tools-grid .tool-card h3 { font-size: .88rem; }
}
.no-results { text-align: center; color: var(--muted); padding: 30px 0 60px; display: none; }
.section-title { font-size: 1.5rem; text-align: center; margin: 12px 0 6px; }

/* ---------- Features strip ---------- */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; padding: 8px 0 56px; }
.feature { background: var(--card-bg, #fff); border: 1px solid var(--card-border, var(--border)); border-radius: var(--radius); padding: 22px; }
.feature h3 { font-size: 1.02rem; color: var(--c, var(--text)); }
.feature p { color: var(--muted); margin: 0; font-size: 1rem; }

/* ---------- Tool page ---------- */
.tool-hero { padding: 24px 0 14px; text-align: center; }
.breadcrumb { font-size: 1rem; color: #1E2B4A; margin: 0 0 8px 6px; }
.breadcrumb a { color: #1E2B4A; }
.tool-hero h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 800; letter-spacing: -.01em; color: var(--primary, #0B1F44); }
.tool-hero p { color: #1E2B4A; max-width: 80%; margin: 0 auto; text-wrap: balance; }
@media (max-width: 760px) { .tool-hero p { max-width: 100%; } }
.tool-box { background: #fff; border: 1.5px solid var(--primary-border); border-radius: 20px; box-shadow: var(--shadow); padding: 24px; margin-bottom: 28px; }
.grid-2 { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } .tool-box { padding: 16px; } }

.dropzone {
  border: 2px dashed var(--primary-border); border-radius: var(--radius); background: var(--primary-soft);
  padding: 40px 20px; text-align: center; cursor: pointer; transition: background .2s, border-color .2s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: #fff; }
.dropzone .up-ico { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; background: var(--primary); display: grid; place-items: center; color: #fff; box-shadow: 0 6px 16px -6px var(--primary); }
.dropzone strong { display: block; font-size: 1.05rem; }
.dropzone small { color: var(--muted); }
.dropzone input { display: none; }
.dropzone.compact { padding: 18px; }
.dropzone.compact .up-ico { width: 40px; height: 40px; margin-bottom: 6px; }

.panel h3 { font-size: 1rem; margin-bottom: 12px; }
.field { margin-bottom: 14px; }
.field label, .label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; }
.field input[type=number], .field input[type=text], .field input[type=url], .field input[type=date], .field select, .field textarea, .field input[type=color] {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px;
  font: inherit; font-size: .95rem; background: #fff; color: var(--text); outline: none;
}
.field textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
.field input[type=color] { padding: 4px; cursor: pointer; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
input[type=range] { width: 100%; accent-color: var(--primary); }
.check { display: flex; align-items: center; gap: 8px; font-size: .92rem; cursor: pointer; }
.check input { accent-color: var(--primary); width: 16px; height: 16px; }

.seg { display: inline-flex; flex-wrap: wrap; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 3px; margin-bottom: 14px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 8px; font: inherit; font-weight: 600; font-size: .88rem; color: var(--muted); cursor: pointer; }
.seg button.active { background: var(--primary); color: #fff; box-shadow: 0 2px 8px -2px var(--primary); }

.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.preset-btn {
  border: 1px solid var(--border); background: #fff; border-radius: 10px; padding: 8px 12px; cursor: pointer;
  font: inherit; font-size: .85rem; font-weight: 600; color: var(--text); text-align: left; line-height: 1.3; transition: all .15s;
}
.preset-btn small { display: block; font-weight: 400; color: var(--muted); font-size: .75rem; }
.preset-btn:hover { border-color: var(--primary); }
.preset-btn.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; transition: all .2s; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-outline { background: #fff; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

.preview-wrap {
  background-color: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px;
  display: grid; place-items: center; min-height: 220px;
  background-image: linear-gradient(45deg, #f1f5f9 25%, transparent 25%), linear-gradient(-45deg, #f1f5f9 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f1f5f9 75%), linear-gradient(-45deg, transparent 75%, #f1f5f9 75%);
  background-size: 18px 18px; background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}
.preview-wrap img, .preview-wrap canvas { max-height: 340px; width: auto; max-width: 100%; object-fit: contain; box-shadow: 0 2px 10px rgba(0, 0, 0, .1); }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .compare, .row-3 { grid-template-columns: 1fr; } }
.compare .preview-wrap { min-height: 180px; }
.compare .preview-wrap img { max-height: 240px; }
.cap { display: flex; justify-content: space-between; font-size: .85rem; margin: 8px 2px 0; color: var(--muted); }
.cap b { color: var(--text); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 14px 0; }
.stat { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.stat span { display: block; font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.stat b { font-size: 1.05rem; }
.stat.good { background: var(--success-soft); border-color: #bbf7d0; }
.stat.good b { color: var(--success); }
.stat.accent { background: var(--primary-soft); border-color: var(--primary-border); }
.stat.accent b { color: var(--primary); }

.alert { padding: 10px 14px; border-radius: 10px; font-size: .9rem; margin: 10px 0; }
.alert.ok { background: var(--success-soft); color: #166534; border: 1px solid #bbf7d0; }
.alert.warn { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.alert.err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.hidden { display: none !important; }

/* file lists (converter, merge, jpg-to-pdf) */
.file-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.file-item { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: #fff; transition: border-color .15s, box-shadow .15s, opacity .15s; }
.file-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: var(--bg); flex-shrink: 0; }
.file-item .meta { flex: 1; min-width: 0; }
.file-item .meta b { display: block; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-item .meta small { color: var(--muted); }
.file-item .btn { height: 38px; padding: 0 14px; font-size: .85rem; }
.file-item[draggable=true] { cursor: grab; }
.file-item.dragging { opacity: .4; }
.file-item.drop-target { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.file-item .num { width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; font-size: .8rem; font-weight: 700; display: grid; place-items: center; flex-shrink: 0; }
.file-item .handle { color: #94a3b8; font-size: 1.1rem; line-height: 1; letter-spacing: -2px; user-select: none; }
.file-item .pdf-thumb { width: 44px; height: 56px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: .7rem; font-weight: 800; flex-shrink: 0; border: 1px solid var(--primary-border); }
.icon-btns { display: flex; gap: 4px; }
.icon-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--text); display: grid; place-items: center; cursor: pointer; transition: all .15s; }
.icon-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.icon-btn.del:hover { border-color: #dc2626; color: #dc2626; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 480px) { .file-item .handle { display: none; } .file-item img { width: 44px; height: 44px; } }

/* ---------- PDF page tools (split, delete/extract, rotate, organize) ---------- */
.privacy-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 14px 0 0; padding: 8px 14px; border-radius: 10px; background: var(--success-soft); border: 1px solid #bbf7d0; color: #166534; font-size: .86rem; font-weight: 600; text-align: center; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 0 0 18px; padding: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--primary-soft); border: 1px solid var(--primary-border); font-size: .86rem; color: #1E2B4A; line-height: 1.35; }
.steps li::before { content: counter(step); flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; font-size: .8rem; display: grid; place-items: center; }

.file-chip { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--primary-soft); border: 1px solid var(--primary-border); }
.file-chip .pdf-thumb { width: 38px; height: 48px; border-radius: 6px; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: .66rem; font-weight: 800; flex-shrink: 0; }
.file-chip .meta { flex: 1; min-width: 0; }
.file-chip .meta b { display: block; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-chip .meta small { color: var(--muted); }
.btn-sm { height: 36px; padding: 0 12px; font-size: .85rem; border-radius: 8px; gap: 6px; }
.btn-sm svg { width: 16px; height: 16px; }

.opt-panel { margin-top: 16px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.opt-panel .field { margin-bottom: 10px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0 4px; }
.toolbar .label { margin: 0 4px 0 0; font-size: .85rem; color: var(--muted); }
.toolbar .sp { flex: 1; }
.toolbar .btn-outline.active, .toolbar .btn-outline.active:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.inline-field { display: flex; gap: 8px; }
.inline-field input { flex: 1; min-width: 0; }

.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 14px; margin-top: 14px; }
@media (max-width: 480px) { .page-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.pg { position: relative; background: #fff; border: 2px solid var(--border); border-radius: 14px; padding: 8px 8px 6px; cursor: pointer; user-select: none; -webkit-user-select: none; transition: border-color .15s, box-shadow .15s, opacity .15s, transform .15s; outline: none; }
.pg:hover { border-color: var(--primary-border); }
.pg:focus-visible { box-shadow: 0 0 0 3px var(--ring); }
.pg-box { position: relative; aspect-ratio: 1 / 1; border-radius: 8px; background: #f1f5f9; overflow: hidden; }
.pg-box canvas { position: absolute; inset: 0; margin: auto; max-width: 84%; max-height: 84%; background: #fff; box-shadow: 0 1px 6px rgba(15, 23, 42, .18); transition: transform .3s ease; }
.pg-box canvas.pending { opacity: .55; }
.pg-num { display: block; text-align: center; margin-top: 6px; font-size: .8rem; font-weight: 700; color: #1E2B4A; }
.pg-tools { position: absolute; top: 12px; right: 12px; display: flex; gap: 4px; z-index: 2; }
.pg-tools button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: rgba(255, 255, 255, .95); color: #1E2B4A; display: grid; place-items: center; cursor: pointer; padding: 0; transition: all .15s; }
.pg-tools button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pg-tools button.del:hover { border-color: #dc2626; color: #dc2626; }
.pg-tools button:disabled { opacity: .35; cursor: default; }
.pg-tools svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pg-badge { position: absolute; top: 12px; left: 12px; z-index: 2; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px; display: grid; place-items: center; font-size: .72rem; font-weight: 800; color: #fff; background: var(--primary); box-shadow: 0 2px 6px rgba(15, 23, 42, .2); }
/* selected (extract) */
.pg.sel { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.pg .tick { position: absolute; top: 12px; left: 12px; z-index: 2; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #cbd5e1; background: #fff; display: grid; place-items: center; }
.pg .tick svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.pg.sel .tick { background: var(--primary); border-color: var(--primary); }
.pg.sel .tick svg { opacity: 1; }
/* marked for deletion */
.pg.del-mark { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, .15); }
.pg.del-mark .tick { display: none; }
.pg.del-mark .pg-box::after { content: ""; position: absolute; inset: 0; background: rgba(220, 38, 38, .14) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='2.6' stroke-linecap='round'%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3C/svg%3E") center / 42% no-repeat; }
.pg.del-mark .pg-num { color: #dc2626; text-decoration: line-through; }
.pg.dim { opacity: .4; }
/* split groups: each output file gets its own colour */
.pg.grp { border-color: var(--g); box-shadow: inset 0 0 0 1px var(--g); }
.pg.grp .pg-badge { background: var(--g); }
.pg.grp .pg-box { background: var(--g-soft); }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; color: var(--g); background: var(--g-soft); border: 1px solid var(--g); }
/* rotated indicator */
.pg.rotated { border-color: var(--primary); }
.pg.rotated .pg-num { color: var(--primary); }
/* drag & drop (organize) */
.pg[draggable=true] { cursor: grab; }
.pg.dragging { opacity: .35; }
.pg.drop-target { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); transform: scale(1.03); }

/* "sheet" thumbnails: exact page shape + SVG preview overlay (page numbers, watermark, signature) */
.pg-sheet { position: absolute; inset: 0; margin: auto; background: #fff; box-shadow: 0 1px 6px rgba(15, 23, 42, .18); overflow: hidden; }
.pg-sheet canvas { position: static; display: block; width: 100% !important; height: 100% !important; max-width: none; max-height: none; box-shadow: none; }
.pg-sheet svg.ov { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* Full-page preview button on every page card */
.pg-zoom { position: absolute; right: 6px; bottom: 6px; z-index: 3; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: rgba(255, 255, 255, .95); color: #1E2B4A; display: grid; place-items: center; cursor: zoom-in; padding: 0; transition: all .15s; }
.pg-zoom:hover { border-color: var(--primary); color: var(--primary); }
.pg-zoom svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.thumb-strip .pg-zoom { width: 24px; height: 24px; right: 4px; bottom: 4px; }
.pg.del-mark .pg-tools button { border-color: #dc2626; color: #dc2626; }
/* File cards (merge, JPG to PDF): same big previews as the page grid */
.file-list.card-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 14px; }
@media (max-width: 480px) { .file-list.card-list { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.file-card .pg-box img { position: absolute; inset: 0; margin: auto; max-width: 84%; max-height: 84%; object-fit: contain; background: #fff; box-shadow: 0 1px 6px rgba(15, 23, 42, .18); }
.file-card .pg-box .pdf-thumb { position: absolute; inset: 0; margin: auto; width: 56%; height: 72%; border-radius: 6px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: .9rem; font-weight: 800; border: 1px solid var(--primary-border); }
.file-card[draggable=true] { cursor: grab; }
.fc-meta { margin-top: 6px; text-align: center; min-width: 0; }
.fc-meta b { display: block; font-size: .8rem; color: #1E2B4A; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-meta small { display: block; color: var(--muted); white-space: pre-line; line-height: 1.35; }

/* Full-page viewer (lightbox) */
.pv { position: fixed; inset: 0; z-index: 1000; background: rgba(15, 23, 42, .94); display: flex; flex-direction: column; color: #fff; }
.pv-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; flex-wrap: wrap; }
.pv-title { font-size: .95rem; font-weight: 700; margin-right: auto; }
.pv-acts, .pv-foot { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pv-foot { justify-content: center; padding: 10px 16px 14px; min-height: 8px; }
.pv-hint { font-size: .85rem; opacity: .85; flex-basis: 100%; text-align: center; }
.pv-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .1); color: #fff; font: inherit; font-size: .88rem; font-weight: 700; cursor: pointer; }
.pv-btn:hover { background: rgba(255, 255, 255, .2); }
.pv-btn.primary { background: var(--primary); border-color: var(--primary); }
.pv-btn.danger { background: #dc2626; border-color: #dc2626; }
.pv-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pv-x { width: 38px; height: 38px; border-radius: 10px; border: 0; background: rgba(255, 255, 255, .12); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.pv-x:hover { background: rgba(255, 255, 255, .25); }
.pv-x svg, .pv-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pv-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 64px; }
.pv-page { position: relative; line-height: 0; }
.pv-media { display: block; width: auto; height: auto; max-width: calc(100vw - 140px); max-height: calc(100vh - 130px); background: #fff; box-shadow: 0 8px 30px rgba(0, 0, 0, .5); }
.pv-ov { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pv-load { line-height: 1.4; padding: 40px; font-size: .95rem; opacity: .8; }
.pv-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; z-index: 2; }
.pv-nav:hover:not(:disabled) { background: rgba(255, 255, 255, .28); }
.pv-nav:disabled { opacity: .25; cursor: default; }
.pv-prev { left: 10px; }
.pv-next { right: 10px; }
.pv.cropping .pv-page { touch-action: none; cursor: crosshair; }
.pv.cropping .pv-nav { visibility: hidden; }
.pv-cropwrap { position: absolute; inset: 0; pointer-events: none; }
.pv-shade { position: absolute; background: rgba(15, 23, 42, .6); }
.pv-crop { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(15, 23, 42, .5); }
.pv-crop.edit { pointer-events: auto; cursor: move; border-style: dashed; }
.pv-h { position: absolute; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--primary); box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.pv-h.nw { left: -12px; top: -12px; cursor: nwse-resize; }
.pv-h.ne { right: -12px; top: -12px; cursor: nesw-resize; }
.pv-h.sw { left: -12px; bottom: -12px; cursor: nesw-resize; }
.pv-h.se { right: -12px; bottom: -12px; cursor: nwse-resize; }
@media (max-width: 640px) {
  .pv-stage { padding: 0 16px; }
  .pv-media { max-width: calc(100vw - 32px); max-height: calc(100vh - 170px); }
  .pv-nav { width: 38px; height: 38px; background: rgba(15, 23, 42, .7); }
  .pv-prev { left: 4px; }
  .pv-next { right: 4px; }
  .pv-bar { padding: 8px 12px; }
}

/* position picker (page numbers) */
.pos-grid { display: grid; grid-template-columns: repeat(3, 44px); grid-template-rows: 30px 26px 30px; gap: 4px; padding: 6px; border: 1px solid var(--border); border-radius: 10px; width: max-content; background: #f8fafc; }
.pos-grid button { border: 1px solid var(--border); background: #fff; border-radius: 6px; cursor: pointer; padding: 0; position: relative; }
.pos-grid button::after { content: ""; position: absolute; width: 14px; height: 4px; border-radius: 2px; background: #cbd5e1; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.pos-grid button.active { border-color: var(--primary); background: var(--primary-soft); }
.pos-grid button.active::after { background: var(--primary); }
.pos-grid .mid { grid-column: 1 / -1; border-radius: 4px; background: repeating-linear-gradient(0deg, #e2e8f0 0 2px, transparent 2px 6px); opacity: .6; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 4px 16px; }
.range-row { display: flex; align-items: center; gap: 10px; }
.range-row input[type=range] { flex: 1; }
.range-row output { min-width: 46px; text-align: right; font-weight: 700; font-size: .88rem; color: var(--primary); }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.swatches button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border); cursor: pointer; padding: 0; }
.swatches button.active { box-shadow: 0 0 0 2px var(--primary); }
.text-style { margin-top: 8px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; display: grid; gap: 8px; }
.text-style .range-row { margin-top: 0; }
.ts-label { font-size: .85rem; font-weight: 600; color: var(--muted); min-width: 34px; }
/* rainbow "any colour" button (shows the picked colour in its centre once used) */
.swatches input[type=color] { -webkit-appearance: none; appearance: none; width: 30px !important; height: 30px !important; padding: 5px !important; border-radius: 50% !important; border: 2px solid #fff !important; box-shadow: 0 0 0 1px var(--border); background: conic-gradient(#ef4444, #f59e0b, #eab308, #22c55e, #06b6d4, #3b82f6, #a855f7, #ec4899, #ef4444) !important; cursor: pointer; }
.swatches input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.swatches input[type=color]::-webkit-color-swatch { border: 2px solid #fff; border-radius: 50%; opacity: 0; }
.swatches input[type=color]::-moz-color-swatch { border: 2px solid #fff; border-radius: 50%; opacity: 0; }
.swatches input[type=color].picked { box-shadow: 0 0 0 2px var(--primary); }
.swatches input[type=color].picked::-webkit-color-swatch { opacity: 1; }
.swatches input[type=color].picked::-moz-color-swatch { opacity: 1; }
/* number box next to every slider */
.range-num-wrap { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.range-num { width: 78px; height: 34px; padding: 0 4px 0 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: .9rem; font-weight: 600; text-align: left; color: var(--text); background: #fff; }
.range-num:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.range-unit { font-size: .82rem; font-weight: 600; color: var(--muted); min-width: 10px; }
output.range-out-hidden { display: none !important; }

/* signature maker + placement editor (Sign PDF) */
.sig-pad-wrap { position: relative; border: 2px dashed var(--primary-border); border-radius: 12px; background: #fff; touch-action: none; }
.sig-pad-wrap canvas { display: block; width: 100%; height: 190px; cursor: crosshair; touch-action: none; }
.sig-pad-wrap .base { position: absolute; left: 8%; right: 8%; bottom: 42px; border-bottom: 1px solid #cbd5e1; pointer-events: none; }
.sig-pad-wrap .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); pointer-events: none; font-size: .95rem; }
.font-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.font-choices button { height: 64px; border: 1px solid var(--border); border-radius: 10px; background: #fff; cursor: pointer; font-size: 1.7rem; color: #0f172a; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 10px; }
.font-choices button.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.sig-ready { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--success-soft); border: 1px solid #bbf7d0; }
.sig-ready img { height: 48px; max-width: 180px; object-fit: contain; background: #fff; border-radius: 6px; border: 1px solid #e2e8f0; padding: 2px 6px; }
.sig-ready span { flex: 1; font-size: .88rem; color: #166534; font-weight: 600; }
.editor-nav { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 16px 0 10px; flex-wrap: wrap; }
.editor-nav b { min-width: 110px; text-align: center; }
.editor { position: relative; margin: 0 auto; max-width: 720px; background: #fff; box-shadow: 0 4px 22px rgba(15, 23, 42, .18); user-select: none; -webkit-user-select: none; }
.editor canvas { display: block; width: 100%; height: auto; }
.editor .loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.place { position: absolute; border: 2px dashed var(--primary); background: rgba(219, 39, 119, .06); cursor: move; touch-action: none; }
.place img { display: block; width: 100%; height: 100%; pointer-events: none; }
.place .rm, .place .rs { position: absolute; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); touch-action: none; }
.place .rm { top: -13px; right: -13px; cursor: pointer; }
.place .rs { bottom: -13px; right: -13px; cursor: nwse-resize; }
.place .rm svg, .place .rs svg { width: 13px; height: 13px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; }
.thumb-strip .page-grid { grid-template-columns: repeat(auto-fill, minmax(122px, 1fr)); gap: 10px; }
.thumb-strip .pg-num { font-size: .72rem; }
.pg.current { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }

/* ---------- Image tools (cropper, resizer, rotate/flip, splitter) ---------- */
.img-work { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 22px; margin-top: 16px; align-items: start; }
@media (max-width: 860px) { .img-work { grid-template-columns: 1fr; } }
.stage-wrap { display: grid; place-items: center; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); min-height: 240px;
  background-color: #fff; background-image: linear-gradient(45deg, #f1f5f9 25%, transparent 25%), linear-gradient(-45deg, #f1f5f9 25%, transparent 25%),
  linear-gradient(45deg, transparent 75%, #f1f5f9 75%), linear-gradient(-45deg, transparent 75%, #f1f5f9 75%); background-size: 18px 18px; background-position: 0 0, 0 9px, 9px -9px, -9px 0; }
.stage-wrap > canvas { max-width: 100%; max-height: 62vh; width: auto; height: auto; box-shadow: 0 2px 12px rgba(0, 0, 0, .12); }
.crop-stage { position: relative; display: inline-block; max-width: 100%; line-height: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.crop-stage canvas.base { display: block; max-width: 100%; max-height: 62vh; width: auto; height: auto; }
.crop-box { position: absolute; box-shadow: 0 0 0 9999px rgba(15, 23, 42, .55); outline: 2px solid #fff; cursor: move; touch-action: none;
  background-image: linear-gradient(rgba(255,255,255,.45), rgba(255,255,255,.45)), linear-gradient(rgba(255,255,255,.45), rgba(255,255,255,.45)), linear-gradient(rgba(255,255,255,.45), rgba(255,255,255,.45)), linear-gradient(rgba(255,255,255,.45), rgba(255,255,255,.45));
  background-size: 1px 100%, 1px 100%, 100% 1px, 100% 1px; background-position: 33.33% 0, 66.66% 0, 0 33.33%, 0 66.66%; background-repeat: no-repeat; }
.crop-box.circle { border-radius: 50%; outline: none; border: 2px solid #fff; }
.crop-box .h { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; background: #fff; border: 3px solid var(--primary); border-radius: 50%; touch-action: none; }
.crop-box .h::before { content: ""; position: absolute; inset: -10px; } /* bigger touch target */
.crop-box .h[data-h=nw] { left: 0; top: 0; cursor: nwse-resize; } .crop-box .h[data-h=n] { left: 50%; top: 0; cursor: ns-resize; }
.crop-box .h[data-h=ne] { left: 100%; top: 0; cursor: nesw-resize; } .crop-box .h[data-h=e] { left: 100%; top: 50%; cursor: ew-resize; }
.crop-box .h[data-h=se] { left: 100%; top: 100%; cursor: nwse-resize; } .crop-box .h[data-h=s] { left: 50%; top: 100%; cursor: ns-resize; }
.crop-box .h[data-h=sw] { left: 0; top: 100%; cursor: nesw-resize; } .crop-box .h[data-h=w] { left: 0; top: 50%; cursor: ew-resize; }
.crop-stage canvas.lasso { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.out-preview { display: grid; place-items: center; min-height: 140px; padding: 10px; border: 1px solid var(--border); border-radius: 12px;
  background-color: #fff; background-image: linear-gradient(45deg, #f1f5f9 25%, transparent 25%), linear-gradient(-45deg, #f1f5f9 25%, transparent 25%),
  linear-gradient(45deg, transparent 75%, #f1f5f9 75%), linear-gradient(-45deg, transparent 75%, #f1f5f9 75%); background-size: 14px 14px; background-position: 0 0, 0 7px, 7px -7px, -7px 0; }
.out-preview canvas { max-width: 100%; height: auto; }
.out-info { margin: 8px 0 0; font-size: .86rem; font-weight: 600; color: var(--primary-dark); text-align: center; }
.out-info.bad { color: #b91c1c; }
.num-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.num-grid .field { margin: 0; }
.num-grid label { font-size: .75rem; color: var(--muted); }
.num-grid input { height: 36px !important; padding: 0 8px !important; }
.unit-input { position: relative; }
.unit-input span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .85rem; pointer-events: none; }
.unit-input input { padding-right: 40px !important; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1px solid var(--primary-border); background: var(--primary-soft); color: var(--primary-dark); border-radius: 999px; padding: 5px 11px; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; }
.chips button:hover, .chips button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.tool-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-row .btn { flex: 1 1 120px; }
.tiles { display: grid; gap: 6px; margin-top: 14px; }
.tile { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: #fff; line-height: 0; }
.tile canvas { width: 100%; height: auto; display: block; }
.tile-dl { position: absolute; right: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 8px; border-radius: 999px; border: 0; background: var(--primary); color: #fff; font: inherit; font-size: .75rem; font-weight: 800; cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); line-height: 1; }
.tile-dl svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Exam & Photo tools (joiner, passport sheet, signature maker) ---------- */
.dual-zones { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .dual-zones { grid-template-columns: 1fr; } }
.mini-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 150px; padding: 14px; text-align: center; cursor: pointer;
  border: 2px dashed var(--primary-border); border-radius: var(--radius); background: var(--primary-soft); transition: background .2s, border-color .2s; }
.mini-zone:hover, .mini-zone.drag { border-color: var(--primary); background: #fff; }
.mini-zone .num { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; display: grid; place-items: center; }
.mini-zone strong { font-size: .95rem; }
.mini-zone small, .mini-zone .zname { color: var(--muted); font-size: .78rem; word-break: break-all; }
.mini-zone { position: relative; }
.mini-zone:focus { outline: none; border-color: var(--primary); }
.mini-zone.filled { justify-content: space-between; gap: 4px; padding: 8px 14px; }
.mini-zone.filled canvas { max-height: 124px; max-width: 90%; }
.mini-zone:focus-visible { box-shadow: 0 0 0 3px var(--primary-border); }
.mini-zone .zname { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; word-break: normal; }
.zone-x { display: none; position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: #DC2626; color: #fff; font-size: 1.3rem; font-weight: 700; line-height: 1; cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.zone-x:hover { background: #B91C1C; }
.mini-zone.filled .zone-x { display: grid; place-items: center; }
.mini-zone canvas { display: none; max-width: 80%; max-height: 88px; border-radius: 6px; box-shadow: 0 1px 6px rgba(0, 0, 0, .15); }
.mini-zone.filled { border-style: solid; background: #fff; }
.mini-zone.filled canvas { display: block; }
.mini-zone.filled .hint-text { display: none; }
.mini-zone input { display: none; }
.frame-wrap { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.frame-wrap canvas { cursor: grab; touch-action: none; border-radius: 4px; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); background: #fff; }
.frame-wrap .frame-side { flex: 1; min-width: 180px; }

.action-bar { position: sticky; bottom: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 18px -24px -24px; padding: 14px 24px; background: rgba(255, 255, 255, .97); border-top: 1px solid var(--primary-border); border-radius: 0 0 20px 20px; box-shadow: 0 -6px 16px -12px rgba(15, 23, 42, .25); }
.action-bar .summary { flex: 1; min-width: 180px; font-size: .9rem; color: #1E2B4A; }
.action-bar .summary b { color: var(--primary); }
.action-bar .btn { min-width: 200px; }
@media (max-width: 820px) { .action-bar { margin: 16px -16px -16px; padding: 12px 16px; } .action-bar .btn { width: 100%; } }
.busy { position: relative; pointer-events: none; }
.hint code, .seo-content code { background: var(--primary-soft); color: var(--primary-dark); padding: 1px 6px; border-radius: 5px; font-size: .9em; }

/* result cards (age calculator) */
.big-result { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 6px 0 14px; }
.big-result div { background: var(--primary-soft); border: 1px solid var(--primary-border); border-radius: 14px; padding: 16px 8px; text-align: center; }
.big-result b { display: block; font-size: 2rem; line-height: 1.1; color: var(--primary); }
.big-result span { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.subcard { border: 1px solid var(--border); border-radius: 14px; padding: 18px; margin-top: 18px; background: #fff; }
.subcard h3 { display: flex; align-items: center; gap: 8px; }

/* ---------- Photo Resizer: live frame + simple result ---------- */
.frame-stage { display: grid; place-items: center; min-height: 260px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background-color: #fff; background-image: linear-gradient(45deg, #f1f5f9 25%, transparent 25%), linear-gradient(-45deg, #f1f5f9 25%, transparent 25%),
  linear-gradient(45deg, transparent 75%, #f1f5f9 75%), linear-gradient(-45deg, transparent 75%, #f1f5f9 75%); background-size: 18px 18px; background-position: 0 0, 0 9px, 9px -9px, -9px 0; }
.frame-stage canvas { display: block; box-shadow: 0 2px 12px rgba(15, 23, 42, .18); touch-action: none; border-radius: 2px; }
.zoom-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.zoom-row label { font-weight: 600; font-size: .88rem; }
.zoom-row input { flex: 1; }
.size-result { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; margin: 12px 0 0; padding: 12px; border-radius: 12px; background: var(--primary-soft); border: 1px solid var(--primary-border); font-size: .95rem; color: #1E2B4A; }
.size-result b { font-size: 1.15rem; color: var(--primary-dark); margin-left: 4px; }
.size-result .arrow { color: var(--primary); font-weight: 800; }
.kb-chips { margin-bottom: 10px; }
.kb-chips button { padding: 7px 14px; font-size: .88rem; }
.inline-kb { display: flex; align-items: center; gap: 10px; }
.inline-kb label { margin: 0; white-space: nowrap; font-weight: 500; color: var(--muted); }
.inline-kb .unit-input { max-width: 140px; }
/* collapsible advanced settings */
details.more-opts { margin-top: 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
details.more-opts > summary { cursor: pointer; padding: 10px 14px; font-weight: 600; font-size: .9rem; color: var(--primary-dark); list-style: none; display: flex; align-items: center; gap: 8px; }
details.more-opts > summary::-webkit-details-marker { display: none; }
details.more-opts > summary::before { content: "▸"; transition: transform .15s; }
details.more-opts[open] > summary::before { transform: rotate(90deg); }
details.more-opts > :not(summary) { margin-left: 14px; margin-right: 14px; }
details.more-opts[open] { padding-bottom: 6px; }

/* ---------- Compress PDF ---------- */
.info-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--primary-soft); border: 1px solid var(--primary-border); color: #1E2B4A; font-size: .86rem; line-height: 1.55; margin: 14px 0 0; }
.info-note svg { color: var(--primary); margin-top: 1px; }
.info-note b { color: var(--primary-dark); }
.pv-label { display: flex; justify-content: space-between; gap: 8px; font-size: .8rem; font-weight: 700; color: var(--primary-dark); margin: 0 2px 6px; }
.pv-label span { color: var(--muted); font-weight: 600; }
.compare .preview-wrap { min-height: 260px; }
.compare .preview-wrap img, .compare .preview-wrap canvas { max-height: 380px; }
.pv-empty { color: var(--muted); font-size: .88rem; text-align: center; padding: 0 10px; max-width: 220px; }

/* ---------- Calculators (percentage / CGPA / EMI) ---------- */
.tab-seg { display: flex; width: 100%; margin-bottom: 18px; }
.tab-seg button { flex: 1 1 auto; }
.pane .row-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.pane .subcard .res-main { padding: 14px; }
.pane .subcard .res-val { font-size: 1.7rem; }
.res-main { text-align: center; padding: 22px 16px; border-radius: 16px; background: var(--primary-soft); border: 1px solid var(--primary-border); }
.res-main .res-label { display: block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--primary-dark); }
.res-main .res-val { display: block; font-size: clamp(2rem, 6vw, 2.7rem); font-weight: 800; color: var(--primary); line-height: 1.15; margin: 4px 0; word-break: break-word; }
.res-main .res-sub { font-size: .9rem; color: #1E2B4A; }
.meter { height: 10px; border-radius: 999px; background: #fff; border: 1px solid var(--primary-border); overflow: hidden; margin: 12px auto 0; max-width: 320px; }
.meter i { display: block; height: 100%; width: 0; background: var(--primary); border-radius: 999px; transition: width .3s; }
.formula { margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: #fff; border: 1px dashed var(--primary-border); font-size: .86rem; color: #1E2B4A; text-align: center; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-word; }
.calc-rows { display: grid; gap: 8px; margin-bottom: 10px; }
.calc-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr) 34px; gap: 8px; align-items: center; }
.calc-row.two { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) 34px; }
.calc-row input { width: 100%; min-width: 0; height: 40px; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; font: inherit; font-size: .92rem; outline: none; background: #fff; color: var(--text); }
.calc-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.calc-row input.bad { border-color: #dc2626; background: #fef2f2; }
.calc-row.head { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.prefix-input { position: relative; }
.prefix-input span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; pointer-events: none; }
.prefix-input input { padding-left: 32px !important; }
.field .range-row { margin-top: 8px; }
.field-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.field-head .seg { margin: 0 0 6px; }
.field-head .seg button { padding: 4px 10px; font-size: .8rem; }
.donut-wrap { display: flex; align-items: center; justify-content: center; gap: 22px; flex-wrap: wrap; margin-top: 16px; }
.donut { width: 150px; height: 150px; }
.legend-list { display: grid; gap: 10px; font-size: .9rem; color: #1E2B4A; }
.legend-list div { display: flex; align-items: center; gap: 8px; }
.legend-list i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; flex-shrink: 0; }
.legend-list b { margin-left: auto; padding-left: 12px; color: #0B1F44; }
.ref-table.sched-table { min-width: 560px; table-layout: fixed; }
.ref-table.sched-table th, .ref-table.sched-table td { text-align: right; white-space: nowrap; padding: 9px 16px; font-variant-numeric: tabular-nums; }
.ref-table.sched-table th:first-child, .ref-table.sched-table td:first-child { text-align: left; width: 76px; }
.sched-scroll { max-height: 420px; overflow: auto; }
.sched-scroll .ref-table th { position: sticky; top: 0; z-index: 1; }

/* ---------- Colour polish: category-tinted inner boxes ---------- */
.stat { background: var(--primary-soft); border-color: var(--primary-border); }
.stat span { color: var(--primary-dark); opacity: .8; }
.stat b { color: #0B1F44; }
.seg { background: var(--primary-soft); border-color: var(--primary-border); }
.seg button { color: var(--primary-dark); }
.seo-content .faq details { background: var(--primary-soft); border: 1px solid var(--primary-border); border-left: 4px solid var(--primary); }
.seo-content .faq details[open] { background: #fff; border-color: var(--primary-border); border-left-color: var(--primary); box-shadow: 0 4px 14px -10px var(--primary); }
.faq summary { color: #0B1F44; }
.faq summary::marker { color: var(--primary); }
/* crisp rounded-square icon tiles (cards, section heads) */
.ico { border-radius: 14px; background: linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(11, 31, 68, .18)), var(--c, var(--primary)); }
.related .tool-card .ico { border-radius: 12px; }

/* ---------- Rich content section (below every tool) ---------- */
.rich h2 { font-size: 1.3rem; color: #0B1F44; margin: 1.6em 0 .7em; }
.rich .faq h2 { margin-top: 1.6em; }
.seo-content.rich li { margin-bottom: 0; }
.rich > h2:first-child, .rich-top h2 { margin-top: 0; }
.rich-top { display: grid; grid-template-columns: 1.5fr 1fr; gap: 28px; align-items: start; padding-bottom: 26px; border-bottom: 1px solid var(--border); }
.rich-top p { color: #1E2B4A; line-height: 1.75; }
.checks { list-style: none; margin: 0; padding: 18px 20px; display: grid; gap: 14px; border-radius: 14px; background: var(--primary-soft); border: 1px solid var(--primary-border); }
.checks li { position: relative; padding-left: 32px; color: #1e293b; font-weight: 600; font-size: .95rem; line-height: 1.45; margin: 0; }
.checks li::before { content: ""; position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: #16a34a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 13px no-repeat; }
.feat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 40px; margin: 28px 0 8px; }
.feat { display: flex; gap: 16px; align-items: flex-start; }
.feat-ico { flex-shrink: 0; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(11, 31, 68, .2)), var(--primary); box-shadow: 0 8px 18px -10px var(--primary); }
.feat:nth-child(even) .feat-ico { background: var(--primary-soft); color: var(--primary); box-shadow: inset 0 0 0 1.5px var(--primary-border); }
.feat-ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rich .feat h3 { margin: 2px 0 6px; font-size: 1.05rem; color: #0B1F44; }
.rich .feat p { margin: 0; color: #1E2B4A; font-size: .93rem; line-height: 1.65; }
.step-list { list-style: none; padding: 0; margin: 0; counter-reset: st; display: grid; gap: 10px; }
.step-list li { counter-increment: st; position: relative; padding: 12px 14px 12px 56px; border-radius: 12px; background: #fff; border: 1px solid var(--border); color: #1E2B4A; margin: 0; }
.step-list li::before { content: counter(st); position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; font-size: .85rem; display: grid; place-items: center; }
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--primary-border); }
.ref-table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 480px; }
/* phones: simple reference tables wrap to the screen instead of scrolling sideways */
@media (max-width: 560px) {
  .ref-table:not(.sched-table) { min-width: 0; font-size: .84rem; hyphens: auto; -webkit-hyphens: auto; }
  .ref-table:not(.sched-table) th, .ref-table:not(.sched-table) td { padding-left: 8px; padding-right: 8px; }
}
.ref-table th { background: var(--primary); color: #fff; text-align: left; padding: 10px 14px; font-weight: 700; }
.ref-table td { padding: 9px 14px; border-top: 1px solid var(--primary-border); color: #1E2B4A; }
.ref-table tbody tr:nth-child(even) td { background: var(--primary-soft); }
.table-note { font-size: .82rem; color: var(--muted); margin: 8px 2px 0; }
.tips { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.tips li { position: relative; padding: 2px 0 2px 30px; color: #1E2B4A; line-height: 1.7; margin: 0; }
.tips li::before { content: ""; position: absolute; left: 4px; top: 8px; width: 12px; height: 12px; border-radius: 4px; background: var(--primary); transform: rotate(45deg); }
@media (max-width: 760px) { .rich-top, .feat-grid { grid-template-columns: 1fr; } .seo-content { padding: 20px; } }

/* ---------- Ad slots (replace with AdSense code) ---------- */
.ad-slot { display: none; }
/* Shows automatically once real AdSense <ins> code is pasted inside the slot */
.ad-slot:has(ins) { display: block; margin: 0 auto 28px; text-align: center; }

/* ---------- SEO / content section ---------- */
.seo-content { background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 28px; margin-bottom: 40px; }
.seo-content h2 { font-size: 1.35rem; color: #0B1F44; }
.seo-content h3 { font-size: 1.05rem; margin-top: 1.4em; }
.seo-content p, .seo-content li { color: #1E2B4A; }
.seo-content ol { padding-left: 1.2em; }
.seo-content li { margin-bottom: 4px; }
.seo-content ol li::marker { color: var(--primary); font-weight: 700; }
.faq details { border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; margin-bottom: 10px; background: var(--bg); transition: border-color .2s; }
.faq details[open] { border-color: var(--primary-border); background: var(--primary-soft); }
.faq summary { font-weight: 600; cursor: pointer; }
.faq details p { margin: 8px 0 0; }
.related { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 40px; }
.related .tool-card { padding: 14px 16px; flex-direction: row; align-items: center; gap: 12px; }
.related .tool-card .ico { width: 40px; height: 40px; }
.related .tool-card .ico svg { width: 19px; height: 19px; }
.related .tool-card h3 { margin: 0; font-size: .95rem; }

/* ---------- Footer ---------- */
.footer { background: #0B1F44; color: #cbd5e1; padding: 44px 0 20px; margin-top: 20px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr; gap: 28px; }
.footer .logo { color: #fff; margin-bottom: 10px; }
.footer .logo span.accent { color: #7fb6e6; }
.footer p { font-size: .9rem; color: #94a3b8; margin: 0; }
.footer h4 { color: #fff; font-size: .95rem; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.footer h4 .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, #fff); }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 8px; }
.footer a { color: #cbd5e1; font-size: .9rem; }
.footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #1e3358; margin-top: 30px; padding-top: 18px; text-align: center; font-size: .85rem; color: #7c8db0; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > div:first-child { grid-column: 1 / -1; } }

/* ---------- Simple content page ---------- */
.page-content { max-width: 820px; margin: 32px auto 40px; }

/* ---------- Readable text on tool pages: nothing smaller than normal size (Word 12), dark navy ---------- */
.tool-box, .seo-content, .related { color: #1E2B4A; }
:is(.tool-box, .seo-content) :is(
  .steps li, .field label, .label, .hint, .check, .seg button, .preset-btn, .preset-btn small, .cap, .stat span,
  .alert, .file-item .meta b, .file-item .meta small, .file-item .btn, .file-chip .meta b, .file-chip .meta small,
  .btn, .btn-sm, .toolbar .label, .legend span, .range-row output, .ts-label, .range-num, .range-unit,
  .sig-pad-wrap .ph, .sig-ready span, .out-info, .num-grid label, .unit-input span, .chips button, .kb-chips button,
  .mini-zone strong, .mini-zone small, .mini-zone .zname, .action-bar .summary, .big-result span, .zoom-row label,
  .size-result, .inline-kb label, details.more-opts > summary, .info-note, .pv-label, .pv-empty,
  .res-main .res-label, .res-main .res-sub, .formula, .calc-row input, .calc-row.head, .field-head .seg button,
  .legend-list, .privacy-note, .dropzone small, .checks li, .rich .feat p, .ref-table, .table-note,
  input, select, textarea, p, li, small
) { font-size: 1rem; }
:is(.tool-box, .seo-content) :is(.steps li, .preset-btn small, .action-bar .summary, .size-result, .info-note,
  .res-main .res-sub, .formula, .legend-list, .rich .feat p, .checks li, .ref-table, .table-note, p, li, small):not(.privacy-note, .alert, .out-info, .sig-ready *, .alert *) { color: #1E2B4A; }
.related .tool-card p { font-size: 1rem; color: #1E2B4A; }
.tool-box :is(.stat span, .big-result span, .calc-row.head) { text-transform: none; letter-spacing: 0; }
@media (max-width: 560px) { .ref-table:not(.sched-table) { font-size: 1rem; } }
