:root {
  --ink: #14202b; --ink-2: #4a5a6a; --paper: #f3f5f8; --surface: #ffffff; --line: #d8dfe7;
  --accent: #2b4bff; --accent-ink: #ffffff; --accent-soft: #e8edff; --ok: #12813a; --warn: #a45f00; --bad: #c4321f;
  --c-pdf: #d64545; --c-convert: #2b4bff; --c-image: #0e9384; --c-ocr: #7a4de0; --c-office: #1e6fd9; --c-data: #b46f00; --c-cad: #46566a;
  --radius: 10px; --shadow: 0 1px 2px rgba(20,32,43,.08), 0 6px 20px rgba(20,32,43,.06);
  --font: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
:root[data-theme="dark"] {
  --ink: #e8eef5; --ink-2: #9fb0c2; --paper: #0f161d; --surface: #17212b; --line: #2a3846;
  --accent: #6f88ff; --accent-ink: #0b1220; --accent-soft: #1e2a55; --ok: #4cc47a; --warn: #f0a63a; --bad: #ff7a66;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e8eef5; --ink-2: #9fb0c2; --paper: #0f161d; --surface: #17212b; --line: #2a3846;
    --accent: #6f88ff; --accent-ink: #0b1220; --accent-soft: #1e2a55; --ok: #4cc47a; --warn: #f0a63a; --bad: #ff7a66;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 16px/1.5 var(--font); color: var(--ink); background: var(--paper); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 1.9rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1rem; }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; height: 60px; display: flex; align-items: center; gap: 14px; padding: 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.15rem; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.search { position: relative; flex: 1; max-width: 560px; }
.search input { width: 100%; height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); }
.search-results { position: absolute; top: 46px; left: 0; right: 0; margin: 0; padding: 6px; list-style: none; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); max-height: 60vh; overflow: auto; }
.search-results li a { display: flex; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.search-results li a:hover, .search-results li a.on { background: var(--accent-soft); }
.search-results small { color: var(--ink-2); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.usage { font-size: .85rem; color: var(--ink-2); white-space: nowrap; }
.auth-area { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 1.15rem; }
.menu-btn { display: none; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-weight: 600; text-decoration: none; color: var(--ink); }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.big { min-height: 48px; padding: 0 24px; font-size: 1.05rem; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .82rem; font-weight: 700; text-decoration: none; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 290px 1fr; min-height: calc(100vh - 60px); }
.sidebar { position: sticky; top: 60px; align-self: start; height: calc(100vh - 60px); overflow: auto; padding: 14px 10px 30px; background: var(--surface); border-right: 1px solid var(--line); }
.main { padding: 26px clamp(16px, 3vw, 40px) 60px; min-width: 0; outline: none; }
.scrim { display: none; }
.side-link { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; color: var(--ink); text-decoration: none; font-weight: 600; }
.side-link:hover { background: var(--paper); }
.side-link.on { background: var(--accent-soft); color: var(--accent); }
.side-h { margin: 18px 12px 6px; font-size: .8rem; font-weight: 700; color: var(--ink-2); }
details.cat { margin: 2px 0; }
details.cat > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 9px; font-weight: 700; }
details.cat > summary::-webkit-details-marker { display: none; }
details.cat > summary:hover { background: var(--paper); }
details.cat > summary::after { content: "\25B8"; margin-left: auto; color: var(--ink-2); transition: transform .15s; }
details.cat[open] > summary::after { transform: rotate(90deg); }
.dot { width: 10px; height: 10px; border-radius: 3px; background: var(--dot, var(--accent)); flex: none; }
.cat-count { color: var(--ink-2); font-weight: 500; font-size: .85rem; }
.tool-link { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 12px 6px 32px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: .93rem; }
.tool-link:hover { background: var(--paper); }
.tool-link.on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.lock { font-size: .72rem; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; white-space: nowrap; }

/* ---------- home ---------- */
.notice { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 10px 14px; margin-bottom: 20px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); background: var(--surface); font-size: .93rem; }
.hero { display: grid; gap: 8px; margin-bottom: 18px; }
.hero p { margin: 0; color: var(--ink-2); max-width: 62ch; }
.drop { display: grid; place-items: center; text-align: center; gap: 10px; padding: 40px 20px; border: 2px dashed var(--line); border-radius: 16px; background: var(--surface); transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop strong { font-size: 1.25rem; }
.drop small { color: var(--ink-2); }
.section { margin-top: 30px; }
.section > h2 { margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px 14px 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--ink); min-height: 92px; }
.card::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--dot, var(--accent)); }
.card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.card b { font-size: 1rem; }
.card span { color: var(--ink-2); font-size: .88rem; }
.card .lock { position: absolute; right: 10px; top: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.suggest { padding: 18px; background: var(--surface); border: 1px solid var(--accent); border-radius: 14px; margin-top: 18px; }
.filelist { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 6px; }
.filelist li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.filelist .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filelist small { color: var(--ink-2); }
.mini { min-width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }

/* ---------- tool page ---------- */
.crumbs { font-size: .88rem; color: var(--ink-2); margin-bottom: 8px; }
.crumbs a { color: var(--ink-2); }
.tool { max-width: 860px; }
.tool > p { color: var(--ink-2); margin: 6px 0 18px; max-width: 65ch; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 16px; }
.panel > h3 { margin-bottom: 10px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; font-size: .93rem; }
.field input[type=text], .field input[type=number], .field input[type=password], .field input[type=email], .field select {
  width: 100%; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.field input[type=range] { width: 100%; }
.field .hint { color: var(--ink-2); font-size: .82rem; margin-top: 3px; }
.field.check label { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.runbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.progress { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; flex: 1; min-width: 160px; }
.progress > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.status { display: flex; gap: 10px; align-items: center; color: var(--ink-2); }
.spin { width: 18px; height: 18px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 3s; } * { transition: none !important; } }
.result { border: 1px solid var(--ok); }
.result h3 { color: var(--ok); }
.error-box { border: 1px solid var(--bad); }
.error-box h3 { color: var(--bad); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.badge { padding: 2px 9px; border-radius: 99px; font-size: .78rem; font-weight: 700; background: var(--paper); border: 1px solid var(--line); }
.badge.done { color: var(--ok); } .badge.failed { color: var(--bad); } .badge.running, .badge.queued { color: var(--warn); }
.empty { padding: 30px; text-align: center; color: var(--ink-2); border: 1px dashed var(--line); border-radius: 12px; }

/* ---------- dialog / toasts / cookie ---------- */
.dialog { border: 1px solid var(--line); border-radius: 16px; padding: 24px; width: min(420px, 92vw); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.dialog::backdrop { background: rgba(10,18,28,.55); }
.tabs { display: flex; gap: 6px; margin: 12px 0 16px; padding: 4px; background: var(--paper); border-radius: 10px; }
.tabs button { flex: 1; height: 36px; border: 0; border-radius: 8px; background: transparent; font-weight: 700; cursor: pointer; }
.tabs button[aria-selected=true] { background: var(--surface); box-shadow: var(--shadow); }
.form-error { color: var(--bad); min-height: 1.3em; font-size: .9rem; margin: 8px 0 0; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 60; }
.toast { padding: 12px 16px; border-radius: 10px; background: var(--ink); color: var(--paper); max-width: 360px; box-shadow: var(--shadow); }
.toast.error { background: var(--bad); color: #fff; } .toast.ok { background: var(--ok); color: #fff; }
.cookie-bar .btn { white-space: nowrap; }
.cookie-bar { position: fixed; left: 16px; bottom: 16px; z-index: 50; display: flex; gap: 14px; align-items: center; max-width: 560px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); font-size: .9rem; }

/* ---------- PDF organizer ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; position: sticky; top: 68px; z-index: 5; }
.toolbar .sep { width: 1px; height: 26px; background: var(--line); margin: 0 4px; }
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 16px; }
.pg { display: flex; flex-direction: column; gap: 6px; padding: 8px; background: var(--surface); border: 2px solid var(--line); border-radius: 10px; cursor: grab; user-select: none; }
.pg.sel { border-color: var(--accent); background: var(--accent-soft); }
.pg canvas { width: 100%; height: 170px; object-fit: contain; background: #fff; border-radius: 4px; border: 1px solid var(--line); }
.pg .meta { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; color: var(--ink-2); gap: 4px; }
.pg .meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg .acts { display: flex; gap: 4px; }
.pg .acts button { width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.sortable-ghost { opacity: .35; }

/* ---------- CAD ---------- */
.cad { display: grid; grid-template-columns: 1fr 240px; gap: 12px; margin-top: 12px; }
.cad-stage { position: relative; height: min(68vh, 640px); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; touch-action: none; }
.cad-stage canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }
.cad-status { position: absolute; left: 10px; bottom: 8px; padding: 3px 9px; border-radius: 6px; background: rgba(20,32,43,.78); color: #fff; font-size: .8rem; font-variant-numeric: tabular-nums; }
.layers { max-height: min(68vh, 640px); overflow: auto; }
.layers label { display: flex; gap: 8px; align-items: center; padding: 4px 0; font-size: .9rem; }
.swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .menu-btn { display: inline-block; }
  .sidebar { position: fixed; z-index: 40; top: 60px; left: 0; width: min(320px, 86vw); transform: translateX(-102%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 60px 0 0 0; background: rgba(10,18,28,.45); z-index: 35; }
  .brand-name, .usage { display: none; }
  .cad { grid-template-columns: 1fr; }
}

.topbar .btn { white-space: nowrap; }
.search { min-width: 0; }
@media (max-width: 700px) {
  .topbar { gap: 8px; padding: 0 10px; }
  #themeBtn, .auth-area .chip, .auth-area .usage { display: none; }
  .auth-area .btn.primary { display: none; }   /* the Log in button opens the same dialog, which has a Sign up tab */
}

.lock.local { color: var(--ok); border-color: var(--ok); }

/* ---------- PDF editor ---------- */
.ed .howto { margin: 6px 0 14px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.ed .howto summary { cursor: pointer; font-weight: 700; }
.ed .howto ol { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; color: var(--ink-2); }
.ed .howto b { color: var(--ink); }
.ed-sticky { position: sticky; top: 60px; z-index: 6; margin-top: 8px; display: grid; gap: 6px; }
.ed-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.ed-props { background: var(--paper); }
.ed-btn { min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; font-weight: 600; white-space: nowrap; }
.ed-btn:hover { border-color: var(--accent); }
.ed-btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.ed-btn[disabled] { opacity: .4; cursor: not-allowed; }
.ed-btn.danger { color: var(--bad); }
.ed-mini { min-width: 32px; padding: 0 8px; }
.ed-sel, .ed-num { height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 0 8px; }
.ed-num { width: 72px; }
.ed-color { width: 40px; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.ed-sep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
.ed-spacer { flex: 1; }
.ed-group { display: inline-flex; gap: 4px; }
.ed-zoom { min-width: 48px; text-align: center; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.ed-props-group { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ed-detected { color: var(--ink-2); font-size: .82rem; margin-left: 6px; }
.ed-scroll { margin-top: 10px; height: calc(100vh - 230px); min-height: 420px; overflow: auto; padding: 18px; background: #dfe4ea; border-radius: 12px; border: 1px solid var(--line); }
:root[data-theme="dark"] .ed-scroll { background: #0b1117; }
.ed-scroll.panning, .tool-hand .ed-scroll { cursor: grab; } .ed-scroll.panning { cursor: grabbing; }
.ed-wrap { width: max-content; margin: 0 auto 18px; }
.ed-pagebar { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
.ed-pnum { font-size: 1.5rem; color: var(--accent); min-width: 28px; }
.ed-pbtns { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.ed-pbtns .ed-btn { border: 0; border-radius: 0; border-right: 1px solid var(--line); }
.ed-page { position: relative; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.25); }
.ed-page canvas { display: block; }
.ov { position: absolute; inset: 0; }
.tool-text .ov { cursor: text; } .tool-hand .ov { cursor: grab; } .tool-white .ov, .tool-hl .ov, .tool-link .ov, .tool-shape .ov, .tool-pen .ov { cursor: crosshair; }
.ed:not(.tool-text) .obj, .ed:not(.tool-text) .objwrap { pointer-events: none; }
.runhint { position: absolute; border: 1.5px dashed var(--accent); background: rgba(43,75,255,.06); pointer-events: none; border-radius: 2px; }
.obj { position: absolute; }
.objwrap { position: absolute; }
.objwrap > .obj { position: absolute; }
.obj.sel { outline: 2px solid var(--accent); outline-offset: 1px; }
.obj.link { border: 1.5px dashed #2563eb; background: rgba(37,99,235,.08); }
.obj.drawing { position: absolute; pointer-events: none; }
.tobj { min-height: 1em; white-space: pre; outline: 1px dashed rgba(43,75,255,.55); outline-offset: 0; cursor: text; caret-color: currentColor; padding: 0; margin: 0; }
.tobj:focus, .tobj.sel { outline: 2px solid var(--accent); }
.twrap .mv { position: absolute; left: -2px; top: -20px; width: 22px; height: 20px; display: none; place-items: center; background: var(--accent); color: #fff; border-radius: 5px 5px 0 0; font-size: 13px; cursor: move; user-select: none; line-height: 1; font-family: sans-serif; font-style: normal; font-weight: 400; }
.twrap .rz, .objwrap .rz { position: absolute; right: -6px; bottom: -6px; width: 12px; height: 12px; background: var(--accent); border: 2px solid #fff; border-radius: 3px; cursor: nwse-resize; display: none; }
.twrap .rz { top: 50%; bottom: auto; margin-top: -6px; cursor: ew-resize; }
.twrap:has(.tobj.sel) .mv, .twrap:has(.tobj:focus) .mv { display: grid; }
.twrap:has(.tobj.sel) .rz, .twrap:has(.tobj:focus) .rz { display: block; }
.twrap > .tobj { position: relative; }
.objwrap:has(.obj.sel) .rz { display: block; }
.ed-locked { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255,255,255,.55); text-align: center; padding: 20px; font-weight: 600; color: #333; }
.sign-pad { width: 100%; max-width: 480px; border: 1px dashed var(--line); border-radius: 10px; background: #fff; touch-action: none; cursor: crosshair; }
@media (max-width: 700px) { .ed-sticky { position: static; } .ed-scroll { height: 70vh; padding: 8px; } }

/* ---------- file cards ---------- */
.fgrid { display: flex; gap: 14px; align-items: flex-start; margin-top: 4px; }
.fgrid.empty .fcards { display: none; }
.fcards { display: flex; flex-wrap: wrap; gap: 14px; flex: 1; }
.fcard { position: relative; width: 170px; padding: 10px 10px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-align: center; cursor: grab; box-shadow: var(--shadow); }
.fthumbbox { height: 190px; display: grid; place-items: center; overflow: hidden; }
.fthumb { max-width: 100%; max-height: 190px; object-fit: contain; border-radius: 3px; }
.fpdf { position: relative; display: grid; place-items: center; }
.fpdf canvas { max-width: 100%; max-height: 190px; box-shadow: 0 1px 6px rgba(0,0,0,.25); }
.fpages { position: absolute; bottom: 4px; right: 4px; padding: 1px 7px; font-size: .72rem; background: rgba(20,32,43,.8); color: #fff; border-radius: 99px; }
.ftile { width: 110px; height: 140px; display: grid; place-items: center; border-radius: 10px; background: color-mix(in srgb, var(--c) 12%, var(--surface)); border: 2px solid var(--c); color: var(--c); font-size: 1.4rem; }
.fname { margin-top: 8px; font-size: .88rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsize { font-size: .78rem; color: var(--ink-2); }
.fx { position: absolute; top: 6px; right: 6px; z-index: 2; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; opacity: .85; }
.fx:hover { color: var(--bad); border-color: var(--bad); opacity: 1; }
.fside { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.fadd { position: relative; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--bad); color: #fff; font-size: 2rem; line-height: 1; cursor: pointer; box-shadow: var(--shadow); }
.fadd:hover { filter: brightness(1.08); }
.fbadge { position: absolute; top: -6px; left: -6px; min-width: 22px; height: 22px; border-radius: 99px; background: var(--ink); color: var(--paper); font-size: .8rem; display: grid; place-items: center; padding: 0 5px; font-weight: 700; }
.fsort { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 700; box-shadow: var(--shadow); }
.fgrid.empty .fside { flex-direction: row; }

/* ---------- tool cards with icons ---------- */
.card { padding: 16px 16px 16px 16px; min-height: 130px; gap: 6px; }
.card::before { display: none; }
.card .ticon { margin-bottom: 4px; }
.card b { font-size: 1.05rem; }
.card .corner { position: absolute; right: 10px; top: 10px; color: var(--ink-2); font-size: .8rem; }
.tabs-cat { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 14px; }
.tabs-cat button { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 6px 16px; cursor: pointer; font-weight: 600; }
.tabs-cat button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.steps3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 14px; }
.steps3 div { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.steps3 i { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-style: normal; font-weight: 800; display: grid; place-items: center; }
.howto { margin: 0 0 16px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; }
.howto summary { cursor: pointer; font-weight: 700; }
.howto ol { margin: 8px 0 0; padding-left: 22px; display: grid; gap: 4px; }
.howto .hint { margin: 8px 0 0; color: var(--ink-2); font-size: .9rem; }
.offer { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; padding: 14px 16px; margin-bottom: 18px; border-radius: 14px; background: linear-gradient(100deg, var(--accent-soft), var(--surface)); border: 1px solid var(--accent); }
.offer b { font-size: 1.05rem; }
.offer .sp { flex: 1; min-width: 160px; color: var(--ink-2); }
.otp-input { letter-spacing: .5em; font-size: 1.4rem !important; text-align: center; }
