/* Layout: sticky top bar, centred hero with search, category sections of tool cards; tool pages put inputs beside live results. */
:root {
  --bg: #f6f6fb;
  --surface: #ffffff;
  --surface-2: #f0f0f8;
  --text: #16172b;
  --muted: #5c5e7a;
  --border: #e3e3ef;
  --primary: #5b4bf5;
  --danger: #c92a3a;
  --success: #12804c;
  --warn: #b25e00;
  --c2: #d9dbe8;
  --shadow: 0 1px 2px rgba(20, 20, 50, .05), 0 6px 20px rgba(20, 20, 50, .05);
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Consolas", "SF Mono", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0f1d; --surface: #171930; --surface-2: #20233f; --text: #ececf7; --muted: #a2a4c2; --border: #2c2f4f;
    --primary: #8b7fff; --danger: #ff7685; --success: #4ad693; --warn: #ffb35c; --c2: #343858;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0f1d; --surface: #171930; --surface-2: #20233f; --text: #ececf7; --muted: #a2a4c2; --border: #2c2f4f;
  --primary: #8b7fff; --danger: #ff7685; --success: #4ad693; --warn: #ffb35c; --c2: #343858;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; -webkit-text-size-adjust: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { text-wrap: balance; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
main { flex: 1; padding-bottom: 56px; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.panel, .results, .cat { scroll-margin-top: 76px; }
.center { text-align: center; }
:focus-visible { outline: 2px solid var(--accent, var(--primary)); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation-duration: .01ms !important; scroll-behavior: auto !important; } }

/* Top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar-inner { display: flex; align-items: center; gap: 12px; height: 60px; }
.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 800; font-size: 19px; letter-spacing: -.02em; flex-shrink: 0; }
.logo svg { width: 28px; height: 28px; }
.topnav { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; min-width: 0; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; padding: 7px 11px; border-radius: 8px; white-space: nowrap; }
.topnav a:hover, .topnav a.active { background: var(--surface-2); color: var(--text); }
.top-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; flex-shrink: 0; padding: 0; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover:not(:disabled) { border-color: var(--accent, var(--primary)); }
.icon-btn:disabled { opacity: .35; cursor: default; }
@media (max-width: 760px) { .topnav { display: none; } .logo { flex: 1; } }

/* Hero */
.hero { text-align: center; padding: 44px 0 20px; }
.hero h1 { font-size: clamp(28px, 4.6vw, 46px); line-height: 1.12; letter-spacing: -.03em; margin: 0 0 12px; }
.hero p { color: var(--muted); font-size: clamp(15px, 2vw, 18px); margin: 0 auto; max-width: 660px; }
.search { position: relative; max-width: 560px; margin: 24px auto 0; }
.search svg { position: absolute; left: 16px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search input { width: 100%; padding: 15px 18px 15px 48px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); font-size: 16px; box-shadow: var(--shadow); }
.search input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.badge { font-size: 12.5px; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 10px 0 8px; }
.chips.left { justify-content: flex-start; margin: 0 0 16px; }
.chip { border: 1px solid var(--border); background: var(--surface); padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: 13.5px; cursor: pointer; color: var(--muted); }
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Sections & cards */
.cat { margin-top: 36px; }
.cat-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 14px; }
.cat-head h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.cat-head span { color: var(--muted); font-size: 14px; }
.found { color: var(--muted); margin: 28px 0 14px; text-align: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.grid.small { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.card {
  display: flex; gap: 14px; align-items: flex-start; text-decoration: none; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; transition: transform .15s, border-color .15s, box-shadow .15s;
}
.card:hover, .card:focus-visible { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow); outline: none; }
.card h3 { margin: 0 0 3px; font-size: 15.5px; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Tool page */
.tool-head { text-align: center; padding: 32px 0 22px; }
.tool-head .icon { margin: 0 auto 12px; width: 56px; height: 56px; }
.tool-head .icon svg { width: 30px; height: 30px; }
.tool-head h1 { margin: 0 0 6px; font-size: clamp(26px, 4vw, 36px); letter-spacing: -.03em; }
.tool-head p { margin: 0 auto; color: var(--muted); max-width: 600px; }
.loading { display: flex; gap: 10px; justify-content: center; align-items: center; color: var(--muted); padding: 40px 0; }
.related { margin-top: 48px; border-top: 1px solid var(--border); padding-top: 28px; }
.related h2 { font-size: 17px; margin: 0 0 12px; }
.back { display: inline-block; margin-top: 22px; color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; }
.back:hover { color: var(--text); }

.drop {
  border: 2px dashed var(--border); border-radius: 18px; background: var(--surface); text-align: center;
  padding: 40px 16px; cursor: pointer; transition: border-color .15s, background .15s; max-width: 780px; margin: 0 auto;
}
.drop:hover, .drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.drop.compact { padding: 16px; }
.drop strong { display: block; font-size: 17px; margin-top: 12px; }
.drop .sub { color: var(--muted); font-size: 13.5px; }
.drop.compact strong { margin-top: 0; font-size: 15px; }
.drop.compact .btn { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer;
  background: var(--accent, var(--primary)); color: #fff; font-weight: 700; font-size: 15.5px;
  padding: 13px 26px; border-radius: 12px; text-decoration: none; transition: filter .15s, transform .1s; text-align: center;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn.small { padding: 8px 14px; font-size: 13.5px; border-radius: 9px; }
.btn.small svg { width: 15px; height: 15px; }

.workspace { max-width: 980px; margin: 22px auto 0; display: grid; gap: 18px; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.file { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 9px; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.file.clear-all { justify-content: center; align-items: center; cursor: pointer; color: var(--muted); font-weight: 600; border-style: dashed; min-height: 80px; }
.file.clear-all:hover { color: var(--danger); border-color: var(--danger); }
.thumb { aspect-ratio: 3 / 4; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; color: var(--muted); font-size: 12px; font-weight: 700; }
.thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.fname { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fmeta { font-size: 11.5px; color: var(--muted); margin-top: -5px; }
.order { position: absolute; top: 13px; left: 13px; background: var(--text); color: var(--bg); font-size: 12px; font-weight: 700; min-width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; padding: 0 6px; }
.fctl { display: flex; gap: 4px; }
.fctl button { flex: 1; border: 1px solid var(--border); background: var(--surface-2); border-radius: 7px; padding: 4px 0; cursor: pointer; font-size: 14px; line-height: 1.2; }
.fctl button:hover:not(:disabled) { border-color: var(--accent); }
.fctl button:disabled { opacity: .35; cursor: default; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; min-width: 0; }
.panel h2 { margin: 0 0 14px; font-size: 16px; }
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.options.one { grid-template-columns: 1fr; }
.full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.inline { flex-direction: row; align-items: center; gap: 10px; }
.field.inline input { width: 130px; }
.field-label { font-size: 13px; font-weight: 700; }
.field input, .field select, .field textarea, .bigtext, .sigbox input, .cbox, .cfield select {
  border: 1px solid var(--border); background: var(--bg); border-radius: 10px; padding: 9px 11px; width: 100%; min-width: 0;
}
.field textarea, .bigtext { resize: vertical; line-height: 1.5; }
.field input[type="color"] { padding: 3px; height: 42px; }
.field input[type="file"] { padding: 7px; }
.field input:focus, .field select:focus, .field textarea:focus, .bigtext:focus, .sigbox input:focus, .cfield select:focus { outline: 2px solid var(--accent, var(--primary)); outline-offset: 1px; }
.hint { font-size: 12.5px; color: var(--muted); }
.note { font-size: 13px; color: var(--muted); background: var(--surface-2); border-radius: 10px; padding: 10px 12px; margin: 14px 0 0; }
.options .note { margin: 0; }
.check { display: flex; gap: 9px; align-items: center; font-size: 14.5px; margin: 10px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent, var(--primary)); }

.actions { display: flex; justify-content: center; }
.status { text-align: center; color: var(--muted); font-size: 14px; min-height: 21px; margin: 0; }
.status.error { color: var(--danger); font-weight: 600; }
.status.left { text-align: left; }

.results { text-align: center; }
.results h2 { font-size: 22px; margin: 0 0 4px; letter-spacing: -.02em; }
.results > p { color: var(--muted); margin: 0 0 16px; font-size: 14px; }
.outlist { display: grid; gap: 8px; max-width: 640px; margin: 0 auto 16px; text-align: left; max-height: 360px; overflow-y: auto; }
.out { display: flex; align-items: center; gap: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; }
.out .oname { flex: 1; min-width: 0; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.out .osize { font-size: 12px; color: var(--muted); text-align: right; }
.out a { font-size: 13px; font-weight: 700; color: var(--accent); text-decoration: none; white-space: nowrap; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.good { color: var(--success) !important; font-weight: 700; }
.warn { color: var(--warn); }
.bad { color: var(--danger); }

/* Signature */
.sigbox { display: grid; gap: 10px; }
.sig-tabs { display: flex; gap: 8px; }
.sigpad { width: 100%; height: 170px; border: 1px dashed var(--border); border-radius: 12px; background: #fff; touch-action: none; cursor: crosshair; display: block; }
.sig-row { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.sig-typed { margin-top: 10px; background: #fff; border-radius: 12px; border: 1px dashed var(--border); padding: 14px 18px; font-size: 40px; min-height: 80px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* Calculators */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 820px) { .calc { grid-template-columns: 1fr; } }
.calc-in { display: grid; gap: 18px; }
.cfield { display: grid; gap: 6px; }
.cfield > label { font-size: 13.5px; font-weight: 700; }
.crow { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.crow label { font-size: 13.5px; font-weight: 700; }
.cbox { display: flex; align-items: center; gap: 4px; width: auto; max-width: 210px; padding: 0 10px; }
.cbox span { color: var(--muted); font-size: 13.5px; white-space: nowrap; }
.cbox input { border: 0; background: transparent; padding: 8px 0; width: 120px; min-width: 0; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.cbox input:focus { outline: none; }
.cbox:focus-within { outline: 2px solid var(--accent, var(--primary)); outline-offset: 1px; }
.cbox:has(input[aria-invalid="true"]) { border-color: var(--danger); }
.cbox input::-webkit-outer-spin-button, .cbox input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="range"] { width: 100%; accent-color: var(--accent, var(--primary)); margin: 2px 0 0; }
.cwords { text-align: right; font-size: 12px; font-weight: 600; color: var(--muted); min-height: 1.2em; margin-top: 2px; }
.cscale { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.calc-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 14px; }
.calc-out { display: grid; gap: 14px; position: sticky; top: 76px; }
@media (max-width: 820px) { .calc-out { position: static; } }
.big { display: grid; gap: 2px; }
.big span { font-size: 13.5px; color: var(--muted); font-weight: 600; }
.big b { font-size: clamp(30px, 5vw, 42px); line-height: 1.1; letter-spacing: -.02em; color: var(--accent, var(--primary)); overflow-wrap: anywhere; }
.big small { color: var(--muted); font-size: 13.5px; }
.donut-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.donut { width: 120px; height: 120px; transform: rotate(-90deg); flex-shrink: 0; }
.donut circle { fill: none; stroke-width: 16; }
.donut .d1 { stroke: var(--accent, var(--primary)); }
.donut .d2 { stroke: var(--c2); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; flex: 1; min-width: 180px; }
.legend li { display: grid; grid-template-columns: 12px 1fr auto; column-gap: 8px; align-items: center; font-size: 13.5px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; }
.legend .k1 { background: var(--accent, var(--primary)); }
.legend .k2 { background: var(--c2); }
.legend b { font-variant-numeric: tabular-nums; }
.legend small { grid-column: 2; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 0; }
.stats div { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.stats dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.stats dd { margin: 2px 0 0; font-weight: 700; font-size: 15.5px; overflow-wrap: anywhere; }
.calc-actions { display: flex; gap: 8px; }
.calc-table { margin-top: 16px; }
.table-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.table-head h2 { margin: 0; }
.scroll { overflow-x: auto; max-height: 460px; overflow-y: auto; border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { position: sticky; top: 0; background: var(--surface-2); font-size: 12.5px; color: var(--muted); }
td.num { text-align: right; }
th:not(:first-child) { text-align: right; }
.info { margin-top: 16px; color: var(--muted); font-size: 14px; }
.info p { margin: 0; }

/* Two-column tool layouts */
.two { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 820px) { .two { grid-template-columns: 1fr; } }
.two > .panel { display: grid; gap: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.bigtext { min-height: 220px; font-size: 15px; }
.row-end { display: flex; justify-content: flex-end; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn-row.end { justify-content: flex-end; }
.inline-2 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 480px) { .inline-2 { grid-template-columns: 1fr 1fr; } }
.pc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pc-out { margin-top: 12px; font-size: 15px; min-height: 24px; }
.pc-out b { font-size: 18px; color: var(--accent); }
.pwlist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.pwlist li { display: flex; gap: 10px; align-items: center; background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.pwlist code { flex: 1; font-family: var(--mono); font-size: 15px; overflow-wrap: anywhere; min-width: 0; }
.conv td { white-space: normal; }
.conv td:last-child { width: 1%; }

/* Builders */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 960px) { .builder { grid-template-columns: 1fr; } }
.b-form { display: grid; gap: 14px; }
.b-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.b-bar-btns { display: flex; gap: 8px; }
.b-fields { display: grid; gap: 14px; }
.b-side { position: sticky; top: 76px; display: grid; gap: 10px; }
@media (max-width: 960px) { .b-side { position: static; } }
.b-actions { display: flex; gap: 8px; }
.b-actions .btn { flex: 1; }
.b-preview-wrap { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; max-height: calc(100vh - 170px); overflow: auto; }
@media (max-width: 960px) { .b-preview-wrap { max-height: none; } }
.items { display: grid; gap: 10px; }
.item { display: grid; grid-template-columns: 24px minmax(0, 3fr) repeat(4, minmax(0, 1fr)) auto auto; gap: 8px; align-items: end; padding-bottom: 10px; border-bottom: 1px dashed var(--border); }
.item-n { font-weight: 700; color: var(--muted); padding-bottom: 10px; }
.item-amt { display: flex; flex-direction: column; gap: 5px; min-width: 90px; }
.item-amt b { padding: 9px 0; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  .item { grid-template-columns: 1fr 1fr; }
  .item .grow { grid-column: 1 / -1; }
  .item-n { grid-column: 1 / -1; padding: 0; }
}
.entry { border-bottom: 1px dashed var(--border); padding-bottom: 14px; margin-bottom: 14px; }
.entry-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.entry-btns { display: flex; gap: 6px; }
.img-row { display: flex; align-items: center; gap: 12px; }
.logo-thumb { max-height: 48px; max-width: 140px; border-radius: 6px; background: #fff; border: 1px solid var(--border); }
.logo-thumb.round { border-radius: 50%; width: 48px; height: 48px; object-fit: cover; }

/* Paper previews are always light, like printed paper */
.paper { background: #fff; color: #1a1a22; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.12); padding: 28px; font-size: 11.5px; line-height: 1.45; min-height: 420px; overflow-wrap: anywhere; }
.paper .pre { white-space: pre-line; }
.paper .right { text-align: right; }
.paper .lbl { display: block; font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #707385; margin-top: 8px; }
.inv-top { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid #d5d6de; color: #555867; }
.inv-logo { max-height: 40px; max-width: 120px; display: block; margin-bottom: 6px; }
.inv-seller { display: block; font-size: 15px; color: #1a1a22; }
.inv-title { display: block; font-size: 16px; color: #0f766e; letter-spacing: .02em; margin-bottom: 4px; }
.inv-bill { padding: 10px 0; color: #555867; }
.inv-bill b { display: block; color: #1a1a22; font-size: 12.5px; }
.inv-table th, .inv-table td { padding: 5px 6px; font-size: 10.5px; white-space: normal; color: #1a1a22; border-color: #e3e4ea; }
.inv-table th { background: #eef4f4; color: #1a1a22; position: static; }
.inv-table td:nth-child(n+4), .inv-table th:nth-child(n+4) { text-align: right; }
.inv-table td:nth-child(2) { text-align: left; }
.inv-sum { display: flex; justify-content: flex-end; margin-top: 8px; }
.inv-sum table { width: auto; min-width: 55%; }
.inv-sum td { padding: 3px 6px; border: 0; font-size: 11px; color: #1a1a22; }
.inv-sum td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.inv-sum .tot td { background: #eef4f4; font-weight: 700; font-size: 13px; }
.inv-sum .tot td:last-child { color: #0f766e; }
.inv-words { font-style: italic; margin-top: 8px; color: #555867; }
.inv-foot { display: flex; justify-content: space-between; gap: 16px; margin-top: 12px; color: #444755; }
.inv-foot .sig { font-weight: 600; white-space: nowrap; }
.cv { --cv: #1d4ed8; }
.cv-head { display: flex; gap: 14px; align-items: center; border-bottom: 2px solid var(--cv); padding-bottom: 10px; }
.cv-photo { width: 64px; height: 78px; object-fit: cover; border-radius: 4px; }
.cv h3 { margin: 0; font-size: 21px; color: var(--cv); line-height: 1.15; }
.cv-title { font-size: 13px; }
.cv-contact { color: #5d6070; font-size: 10.5px; margin-top: 2px; overflow-wrap: anywhere; }
.cv h4 { margin: 14px 0 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--cv); border-bottom: 1px solid #dddfe6; padding-bottom: 3px; }
.cv p { margin: 0; }
.cv-item { margin-bottom: 8px; }
.cv-row { display: flex; justify-content: space-between; gap: 10px; }
.cv-row span { color: #5d6070; white-space: nowrap; }
.cv i { color: #5d6070; }
.cv ul { margin: 3px 0 0; padding-left: 16px; }

/* Footer */
.footer { border-top: 1px solid var(--border); background: var(--surface); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 32px; padding-top: 22px; padding-bottom: max(22px, env(safe-area-inset-bottom, 0px)); font-size: 13px; color: var(--muted); }
.privacy-note { max-width: 560px; }

.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Navigation & SEO text */
.skip { position: absolute; left: -999px; top: 8px; background: var(--text); color: var(--bg); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.crumbs { font-size: 13px; color: var(--muted); padding-top: 14px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.chips a.chip { text-decoration: none; }
.chip[aria-current="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.seo-text { max-width: 760px; margin: 40px auto 0; color: var(--muted); font-size: 15px; }
.seo-text h2 { color: var(--text); font-size: 19px; margin: 26px 0 8px; letter-spacing: -.01em; }
.seo-text p, .seo-text li { line-height: 1.6; }
.seo-text ol { padding-left: 22px; }
.seo-text details { border-bottom: 1px solid var(--border); padding: 10px 0; }
.seo-text summary { cursor: pointer; font-weight: 600; color: var(--text); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.seo-text summary::after { content: '+'; color: var(--muted); font-weight: 400; }
.seo-text details[open] summary::after { content: '−'; }
.seo-text details p { margin: 8px 0 0; }
.footlinks { display: flex; flex-wrap: wrap; gap: 4px 6px; align-self: center; }
.footlinks a { color: var(--muted); text-decoration: none; font-weight: 600; }
.footlinks a:hover { color: var(--text); }
.footinfo { flex-basis: 100%; padding-top: 10px; border-top: 1px solid var(--border); }
.footnote { flex-basis: 100%; margin: 0; font-size: 12px; }
.info-page h2 { margin-top: 22px; }
.info-page h2:first-child { margin-top: 0; }
.info-page ul { padding-left: 20px; }
.info-page li { margin: 4px 0; }
#app > .hero + .cat { margin-top: 20px; }

/* Builder extras */
.tips { list-style: none; margin: 0; padding: 10px 14px; background: color-mix(in srgb, var(--warn) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--border)); border-radius: 10px; font-size: 13px; color: var(--text); display: grid; gap: 6px; }
.tips li::before { content: '•  '; color: var(--warn); font-weight: 700; }
.with-btn { display: flex; gap: 6px; align-items: stretch; }
.with-btn input { flex: 1; }
.with-btn .btn, .with-btn .icon-btn { flex-shrink: 0; height: auto; }
.inline-fields { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; }
.inline-fields .field.inline { flex-direction: column; align-items: flex-start; gap: 5px; }
.inline-fields .field.inline input, .inline-fields .field.inline select { width: 150px; }
.check span small.block { display: block; font-weight: 400; margin-top: 2px; }
.skill-row { grid-template-columns: minmax(140px, 1fr) minmax(0, 2.2fr); margin-bottom: 10px; }
.skill-row .grow { grid-column: auto; }
@media (max-width: 520px) { .skill-row { grid-template-columns: 1fr; } }
.items .item { grid-template-columns: 24px minmax(0, 3fr) repeat(6, minmax(0, 1fr)) auto auto; }
.items.no-tax .item { grid-template-columns: 24px minmax(0, 3fr) repeat(5, minmax(0, 1fr)) auto auto; }
@media (max-width: 900px) {
  .items .item, .items.no-tax .item { grid-template-columns: 1fr 1fr 1fr; }
  .item .grow { grid-column: 1 / -1; }
  .item-n { grid-column: 1 / -1; padding: 0; }
}
@media (max-width: 480px) { .items .item, .items.no-tax .item { grid-template-columns: 1fr 1fr; } }

/* Invoice preview extras */
.inv { position: relative; }
.inv-copy { position: absolute; top: 10px; right: 14px; font-size: 8.5px; color: #707385; letter-spacing: .04em; }
.inv-parties { display: flex; gap: 16px; padding: 10px 0; color: #555867; }
.inv-parties > div { flex: 1; min-width: 0; }
.inv-parties b { display: block; color: #1a1a22; font-size: 12.5px; }
.inv-bottom { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-top: 8px; }
.inv-left { flex: 1; min-width: 0; }
.inv-taxsum { width: auto; margin-bottom: 8px; }
.inv-taxsum th, .inv-taxsum td { padding: 3px 8px; font-size: 9.5px; white-space: nowrap; color: #1a1a22; border-color: #e3e4ea; }
.inv-taxsum th { background: #eef4f4; position: static; text-align: left; }
.inv-note { font-style: italic; color: #555867; margin-top: 8px; font-size: 10.5px; }
.inv-sign { display: block; max-height: 40px; max-width: 140px; margin: 6px 0 2px auto; }
.inv-foot .sigline { border-top: 1px solid #d5d6de; padding-top: 4px; font-weight: 400; color: #555867; margin-top: 4px; }

/* Resume preview templates */
.cv-times { font-family: Georgia, "Times New Roman", serif; }
.cv-compact { font-size: 10.5px; line-height: 1.35; }
.cv-compact h4 { margin-top: 10px; }
.cv-classic .cv-head { flex-direction: row-reverse; justify-content: space-between; text-align: center; }
.cv-classic .cv-head-text { flex: 1; }
.cv-elegant .cv-head { flex-direction: row-reverse; justify-content: space-between; text-align: center; border-bottom: 3px double #111827; }
.cv-elegant .cv-head-text { flex: 1; }
.cv-elegant h3 { color: #111827; text-transform: uppercase; letter-spacing: .08em; font-size: 18px; }
.cv-elegant .cv-title { font-style: italic; }
.cv-elegant h4 { color: #111827; text-align: center; border: 0; position: relative; }
.cv-elegant h4::before, .cv-elegant h4::after { content: ''; position: absolute; top: 55%; width: 32%; border-top: 1px solid #dddfe6; }
.cv-elegant h4::before { left: 0; } .cv-elegant h4::after { right: 0; }
.cv-modern .cv-head { border-bottom: 1px solid #dddfe6; border-left: 3px solid var(--cv); padding-left: 10px; }
.cv-modern h4 { border-bottom-color: #dddfe6; }
.cv-skills { width: 100%; border-collapse: collapse; }
.cv-skills th { text-align: left; white-space: nowrap; padding: 1px 10px 1px 0; vertical-align: top; width: 1%; font-size: inherit; background: none; position: static; color: inherit; border: 0; }
.cv-skills td { padding: 1px 0; border: 0; white-space: normal; color: inherit; }
.cv-decl { display: flex; justify-content: space-between; margin-top: 16px; color: #5d6070; }
.cv-decl span:last-child { color: #1a1a22; font-weight: 700; border-top: 1px solid #dddfe6; padding-top: 3px; }
.cv ul li { margin-bottom: 1px; }

/* ---- resume template gallery ---- */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tpl-card { display: flex; flex-direction: column; align-items: stretch; gap: 5px; padding: 8px; border: 2px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.tpl-card:hover { border-color: color-mix(in srgb, var(--primary) 50%, var(--border)); }
.tpl-card.on { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
.tpl-thumb { display: block; position: relative; width: 132px; height: 187px; margin: 0 auto; overflow: hidden; border-radius: 6px; background: #fff; border: 1px solid var(--border); }
.tpl-thumb .paper { position: absolute; left: 0; top: 0; width: 600px; min-height: 849px; transform: scale(.22); transform-origin: 0 0; pointer-events: none; box-shadow: none; border-radius: 0; }
.tpl-name { font-size: 13.5px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.tpl-name b { display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 11px; }
.tpl-card:not(.on) .tpl-name b { background: var(--muted); }
.tpl-desc { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
@media (max-width: 520px) {   /* phones: two templates per row */
  .tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tpl-card { padding: 6px; }
  .tpl-thumb { width: 104px; height: 147px; }
  .tpl-thumb .paper { transform: scale(.1733); }
  .tpl-name { font-size: 12.5px; } .tpl-desc { font-size: 11px; }
}
.color-row { display: flex; gap: 8px; align-items: center; }
.color-row select { flex: 1; }
.color-row input[type="color"] { width: 44px; height: 40px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; }

/* ---- resume templates (preview; the PDF draws the same layouts) ---- */
.cv-photo.round { border-radius: 50%; width: 70px; height: 70px; }
.cv-size-small { font-size: 10.6px; } .cv-size-large { font-size: 12.6px; }
.cv-relaxed { line-height: 1.62; } .cv-relaxed h4 { margin-top: 18px; }
.cv-sec-body > p + p { margin-top: 2px; }
/* minimal */
.cv-minimal .cv-head { display: flex; border-bottom: 1px solid #e3e4ea; }
.cv-minimal h3 { color: #1a1a22; font-weight: 400; font-size: 25px; }
.cv-minimal .cv-title { color: var(--cv); }
.cv-minimal .cv-sec { display: grid; grid-template-columns: 104px 1fr; gap: 14px; margin-top: 12px; }
.cv-minimal h4 { margin: 2px 0 0; border: 0; padding: 0; font-size: 9.5px; }
/* executive */
.cv-band { display: flex; justify-content: space-between; align-items: center; gap: 14px; background: var(--cv); color: #fff; margin: -28px -28px 8px; padding: 24px 28px 18px; }
.cv-band h3 { color: #fff; font-size: 23px; } .cv-band .cv-contact { color: rgba(255, 255, 255, .86); }
.cv-executive h4 { color: #1a1a22; border: 0; font-size: 12px; padding-bottom: 0; }
.cv-executive h4::after { content: ''; display: block; width: 34px; height: 2px; background: var(--cv); margin-top: 3px; }
.cv-executive .cv-sec-summary p { border-left: 3px solid var(--cv); padding-left: 9px; }
/* sidebar */
.cv-sidebar.paper { padding: 0; }
.cv-cols { display: grid; grid-template-columns: 32% 1fr; min-height: 420px; }
.cv-sidebar .cv-aside { background: color-mix(in srgb, var(--cv) 10%, #fff); padding: 24px 16px; }
.cv-sidebar .cv-main { padding: 24px 22px; min-width: 0; }
.cv-sidebar .cv-head { border-bottom: 1px solid #dddfe6; }
.cv-aside h4 { border: 0; font-size: 10px; margin-top: 12px; padding: 0; }
.cv-aside p { margin: 0 0 3px; font-size: .92em; overflow-wrap: anywhere; }
.cv-aside .cv-photo { display: block; margin: 0 auto 8px; width: 92px; height: 92px; object-fit: cover; }
.cv-glabel { display: block; font-size: .9em; margin-top: 4px; }
.cv-kv { margin-bottom: 4px; } .cv-kv small { display: block; color: #6b6e7d; font-size: .82em; }
/* corporate */
.cv-cols-r { grid-template-columns: 1fr 30%; gap: 16px; min-height: 0; }
.cv-corporate .cv-head { border-bottom: 2px solid var(--cv); }
.cv-corporate h3 { color: #1a1a22; } .cv-corporate .cv-title { color: var(--cv); font-weight: 700; }
.cv-corporate .cv-aside { border-left: 1px solid #dddfe6; padding-left: 14px; min-width: 0; }
.cv-corporate .cv-aside h4 { color: #1a1a22; } .cv-corporate .cv-aside h4::after { content: ''; display: block; width: 26px; height: 2px; background: var(--cv); margin-top: 2px; }
.cv-corporate .cv-main { min-width: 0; }
/* timeline */
.cv-timeline .cv-head { border-bottom: 1px solid #dddfe6; }
.cv-tl { display: grid; grid-template-columns: 74px 1fr; gap: 12px; margin-bottom: 0; }
.cv-tl-date { text-align: right; color: #6b6e7d; font-size: .86em; font-weight: 700; padding-top: 1px; }
.cv-tl-body { border-left: 1.5px solid color-mix(in srgb, var(--cv) 30%, #fff); padding: 0 0 8px 13px; position: relative; }
.cv-tl-body::before { content: ''; position: absolute; left: -6px; top: 3px; width: 7px; height: 7px; border-radius: 50%; background: #fff; border: 2px solid var(--cv); }
.cv-tl-body i { display: block; }
.cv-timeline h4, .cv-timeline .cv-sec-body > p, .cv-timeline .cv-sec-body > ul, .cv-timeline .cv-sec-body > table, .cv-timeline .cv-decl { margin-left: 86px; }
.cv-timeline h4 { border: 0; }
/* creative */
.cv-creative .cv-head { border: 0; padding-bottom: 4px; }
.cv-badge { flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 10px; background: var(--cv); color: #fff; font-weight: 800; font-size: 20px; }
.cv-creative h3 { color: #1a1a22; font-size: 23px; } .cv-creative .cv-title { color: var(--cv); font-weight: 700; }
.cv-creative h4 { display: inline-block; background: var(--cv); color: #fff; border: 0; padding: 2px 8px; border-radius: 3px; font-size: 9.5px; }
.cv-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0 6px; }
.cv-tags span { background: color-mix(in srgb, var(--cv) 12%, #fff); border-radius: 4px; padding: 1px 7px; font-size: .9em; }
/* biodata (India) */
.cv-bio-title { text-align: center; font-weight: 800; font-size: 16px; text-decoration: underline; letter-spacing: .08em; margin-bottom: 10px; }
.cv-bio-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.cv-bio-name h3 { font-size: 18px; }
.cv-bio-photo { flex: none; display: grid; place-items: center; width: 84px; height: 104px; border: 1px solid #9a9caa; color: #888; font-size: 9px; text-align: center; padding: 4px; }
.cv-bio-photo img { width: 100%; height: 100%; object-fit: cover; }
.cv-grid { width: 100%; border-collapse: collapse; margin-top: 4px; font-size: .95em; }
.cv-grid th, .cv-grid td { border: 1px solid #c9cbd4; padding: 3px 6px; text-align: left; vertical-align: top; position: static; color: inherit; font-size: inherit; white-space: normal; }
.cv-grid th { background: color-mix(in srgb, var(--cv) 10%, #fff); font-weight: 700; }
.cv-bio-pd th { width: 34%; }
.cv-biodata h4 { background: color-mix(in srgb, var(--cv) 12%, #fff); color: #1a1a22; border: 0; padding: 3px 6px; }

/* Page editor (Crop / Redact / Edit) */
.ed-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.ed-sp { flex: 1; }
.ed-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-file { cursor: pointer; }
.ed-ctl { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.ed-ctl input { border: 1px solid var(--border); background: var(--bg); border-radius: 8px; padding: 5px 8px; }
.ed-ctl input[type=color] { padding: 2px; width: 40px; height: 32px; }
.ed-text { border: 1px solid var(--border); background: var(--bg); border-radius: 8px; padding: 7px 10px; min-width: 160px; flex: 1; }
.ed-nav { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 6px 0 10px; }
.ed-pgin { width: 54px; border: 1px solid var(--border); background: var(--bg); border-radius: 8px; padding: 5px; text-align: center; }
.ed-stage { position: relative; display: inline-block; max-width: 100%; margin: 0 auto; box-shadow: var(--shadow); line-height: 0; }
.ed-stage canvas { display: block; max-width: 100%; }
.ed-over { position: absolute; left: 0; top: 0; touch-action: none; cursor: crosshair; }
#editor { text-align: center; }
.ed-hint { text-align: center; margin-top: 10px; }
/* Scan */
.scan { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 820px) { .scan { grid-template-columns: 1fr; } }
.scan-cam { display: grid; gap: 12px; text-align: center; }
.scan-video { width: 100%; border-radius: 10px; background: #000; max-height: 70vh; object-fit: contain; }
.scan-off { display: grid; gap: 10px; justify-items: center; padding: 30px 10px; }
.scan-ctl { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
/* Compare */
.cmp-text { white-space: pre-wrap; line-height: 1.7; font-size: 14px; }
mark.ins { background: color-mix(in srgb, var(--success) 25%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }
mark.del { background: color-mix(in srgb, var(--danger) 22%, transparent); color: inherit; text-decoration: line-through; border-radius: 3px; padding: 0 2px; }
.cmp details { border-top: 1px solid var(--border); padding: 8px 0; }
.cmp summary { cursor: pointer; font-weight: 600; }
.bad { color: var(--danger); }

/* ---------- Phones: bigger touch targets, no iOS auto-zoom, readable small text ---------- */
@media (max-width: 760px), (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { font-size: 16px !important; }
  .btn.small, .chip, .lang-btn { min-height: 44px; }
  .btn.small { padding-left: 16px; padding-right: 16px; }
  .icon-btn { width: 44px; height: 44px; }
  .lang-btn { height: 44px; }
  .fctl button, .org-ctl button { min-height: 40px; font-size: 16px; }
  .spec-row input, .mk-row input { min-height: 44px; }
  .spec-row input { width: 78px; }
  .check { min-height: 40px; }
  .check input { width: 22px; height: 22px; }
  input[type=range] { height: 28px; }
  .cscale, .fmeta, .stats dt, .legend small, .order, .org-n small, .hint, .crumbs { font-size: 12.5px; }
  .topbar-inner { height: 60px; }
}
@media (max-width: 480px) {
  .hero { padding-top: 26px; }
  .hero h1 { font-size: 25px; }
  .hero h1 br { display: none; }
  .hero p { font-size: 15px; }
  .tool-head { padding-top: 18px; }
  .tool-head h1 { font-size: 24px; }
}

/* Offline */
.badge-offline, .offline-chip { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--success); border-color: color-mix(in srgb, var(--success) 40%, var(--border)); font-weight: 700; }
.badge-offline svg, .offline-chip svg, .offline-banner svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.offline-chip { margin-top: 12px; font-size: 13px; padding: 5px 12px; border: 1px solid color-mix(in srgb, var(--success) 40%, var(--border)); border-radius: 999px; background: color-mix(in srgb, var(--success) 8%, var(--surface)); }
.offline-banner { position: sticky; top: 0; z-index: 30; display: flex; justify-content: center; align-items: center; gap: 8px; background: var(--success); color: #fff; font-weight: 700; font-size: 14px; padding: 8px 16px; }
.offline-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; max-width: 980px; margin: 0 auto; }
.steps { padding-left: 20px; display: grid; gap: 10px; margin: 0 0 16px; line-height: 1.55; }

/* Popular landing-page links */
.pop-links { margin: 26px 0 6px; }
.pop-links h2 { font-size: 17px; margin: 0 0 10px; }
.chip-links { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-links .chip { text-decoration: none; color: var(--text); background: var(--surface); }
.chip-links .chip:hover { border-color: var(--primary); }
.hero + .pop-links { margin-top: 6px; text-align: center; }
.hero + .pop-links .chip-links { justify-content: center; }

/* Tagline bar (top of every page) */
.tagline-bar { background: var(--text); color: var(--bg); font-size: 13.5px; line-height: 1.4; text-align: center; padding-block: 8px; }
.tagline-bar q { font-style: italic; opacity: .85; quotes: "“" "”"; }
.tagline-bar b { font-weight: 700; }
@media (max-width: 600px) { .tagline-bar { font-size: 12.5px; padding-block: 7px; } .tagline-bar q, .tagline-bar b { display: block; } }

/* Language button */
.lang-btn { display: inline-grid; place-items: center; height: 36px; min-width: 52px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); font-weight: 700; font-size: 13.5px; text-decoration: none; white-space: nowrap; }
.lang-btn:hover { border-color: var(--primary); }

/* Exam photo & signature maker */
.exam-pick { margin-bottom: 14px; }
.exam-docs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 14px; }
.exam-doc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.exam-doc-head h2 { margin: 0; }
.spec-row { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 10px 0 12px; font-size: 13px; font-weight: 600; }
.spec-row label { display: inline-flex; align-items: center; gap: 5px; }
.spec-row input { width: 72px; border: 1px solid var(--border); background: var(--bg); border-radius: 8px; padding: 6px 7px; font-variant-numeric: tabular-nums; }
.exam-body { display: grid; gap: 12px; }
.exam-crop .drop { margin: 0; }
label.drop { display: block; }
label.drop .sub { display: block; margin-top: 2px; }
.exam-opts { display: grid; gap: 4px; }
.exam-opts .btn { justify-self: start; margin-top: 6px; }
.exam-result { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 10px; padding: 10px; border: 1px dashed var(--border); border-radius: 10px; }
.exam-result img { border: 1px solid var(--border); background: #fff; height: auto; }
.exam-result > div { display: grid; gap: 6px; }
.crop-wrap { display: flex; justify-content: center; }
.crop-canvas { touch-action: none; cursor: grab; border-radius: 6px; box-shadow: var(--shadow); background: #fff; max-width: 100%; }
.crop-canvas:active { cursor: grabbing; }
.crop-ctl { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.spec-table { min-width: 420px; margin: 6px 0; }
.spec-table th:not(:first-child), .spec-table td:not(:first-child) { text-align: left; }

/* Visual page organizer */
.org-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.org-bar .hint { flex: 1; min-width: 200px; }
.org-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-bottom: 16px; }
.org-page { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px; display: grid; gap: 6px; cursor: grab; transition: border-color .15s, opacity .15s; }
.org-page.dragging { opacity: .4; }
.org-page.drop-target { border-color: var(--accent, var(--primary)); box-shadow: 0 0 0 2px var(--accent, var(--primary)); }
.org-thumb { aspect-ratio: 3 / 4; display: grid; place-items: center; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.org-thumb img { max-width: 100%; max-height: 100%; transform: rotate(var(--rot)); transition: transform .2s; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.org-n { font-size: 12.5px; font-weight: 700; text-align: center; }
.org-n small { color: var(--muted); font-weight: 500; }
.org-ctl { display: flex; gap: 3px; }
.org-ctl button { flex: 1; border: 1px solid var(--border); background: var(--surface-2); border-radius: 6px; padding: 3px 0; cursor: pointer; font-size: 13px; }
.org-ctl button:hover:not(:disabled) { border-color: var(--accent, var(--primary)); }
.org-ctl button:disabled { opacity: .35; }

/* CGPA marks rows */
.mk-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto minmax(0, 1fr) auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.mk-row input { border: 1px solid var(--border); background: var(--bg); border-radius: 8px; padding: 7px 8px; min-width: 0; }

/* Passport sheet */
.pp-prev img { max-width: 100%; border: 1px solid var(--border); box-shadow: var(--shadow); }

/* Typing test */
.ty-src { font-size: 17px; line-height: 1.9; padding: 14px; background: var(--surface-2); border-radius: 10px; margin: 12px 0; max-height: 240px; overflow: auto; user-select: none; }
.ty-src .ok { color: var(--success); }
.ty-src .bad { color: var(--danger); text-decoration: underline; }
.ty-src .cur { background: color-mix(in srgb, var(--accent, var(--primary)) 25%, transparent); border-radius: 4px; }
.ty-in { font-size: 17px; }
.ty-timer { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .lang-btn { min-width: 44px; } }
