/* ================================================================ tokens */
:root {
  --brand: #e5322d;
  --brand-600: #c9231e;
  --brand-50: #fdecec;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f3f8;
  --text: #1d2130;
  --muted: #69708a;
  --border: #e1e4ee;
  --focus: #3b82f6;
  --ok: #2e9e44;
  --danger: #d63031;
  --shadow: 0 1px 2px rgba(20, 24, 40, .06), 0 4px 16px rgba(20, 24, 40, .06);
  --shadow-lg: 0 10px 40px rgba(20, 24, 40, .18);
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12141b;
    --surface: #1b1e27;
    --surface-2: #232734;
    --text: #e8eaf2;
    --muted: #9aa1b8;
    --border: #2e3342;
    --brand-50: #3a1d1f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12141b; --surface: #1b1e27; --surface-2: #232734; --text: #e8eaf2; --muted: #9aa1b8; --border: #2e3342; --brand-50: #3a1d1f;
  color-scheme: dark;
}

/* ================================================================ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.55; color: var(--text); background: var(--bg); }
img, svg, canvas { max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

/* ================================================================ buttons & inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: 15px; font-weight: 600; padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
  text-decoration: none; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn-lg { font-size: 17px; padding: 13px 26px; border-radius: 10px; }
.btn-sm { font-size: 13px; padding: 6px 10px; font-weight: 500; }
.btn-danger { color: var(--danger); }
.link-btn { background: none; border: 0; color: var(--brand); font: inherit; cursor: pointer; padding: 4px; }
.icon-btn { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; width: 30px; height: 30px; border-radius: 6px; flex: none; }
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.input {
  width: 100%; font: inherit; font-size: 15px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
}
.input:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px rgba(59, 130, 246, .2); }
.input-sm { font-size: 13px; padding: 5px 8px; width: auto; }
.input.num, .input-sm.num { width: 80px; }
textarea.input { resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
input[type="color"] { width: 44px; height: 34px; padding: 2px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); cursor: pointer; }
input[type="range"] { width: 100%; accent-color: var(--brand); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); }
.check { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; font-size: 15px; }
.check input { margin-top: 4px; flex: none; }

/* ================================================================ header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; gap: 24px; height: 60px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; color: var(--text); letter-spacing: -.02em; }
.logo:hover { text-decoration: none; }
.main-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.main-nav > a, .mega-btn { color: var(--text); font-weight: 500; font-size: 15px; padding: 8px 12px; border-radius: 8px; }
.main-nav > a:hover, .mega-btn:hover { background: var(--surface-2); text-decoration: none; }
.mega-btn { background: none; border: 0; font: inherit; font-weight: 600; cursor: pointer; }
.mega { position: relative; }
.mega-panel {
  position: absolute; top: calc(100% + 8px); left: 0; width: min(1100px, 94vw); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 20px;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px 20px; max-height: 80vh; overflow: auto;
}
.mega-col a { display: block; color: var(--text); font-size: 14px; padding: 3px 0; }
.mega-col a:hover { color: var(--brand); }
.mega-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--c); margin-bottom: 4px; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--border); border-radius: 8px; font-size: 20px; width: 42px; height: 38px; cursor: pointer; color: var(--text); }

/* ================================================================ home */
.hero { text-align: center; padding: 56px 0 28px; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); letter-spacing: -.03em; font-weight: 800; }
.hero p { color: var(--muted); font-size: 18px; max-width: 720px; margin: 0 auto 24px; }
.search-box { max-width: 560px; margin: 0 auto 18px; }
.search-box input { width: 100%; font: inherit; font-size: 17px; padding: 14px 18px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.search-box input:focus { outline: none; border-color: var(--brand); }
.hero-quick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tools-home { padding-bottom: 20px; }
.cat-block { margin: 30px 0; scroll-margin-top: 80px; }
.cat-title { font-size: 20px; display: flex; align-items: center; gap: 10px; }
.cat-title::before { content: ""; width: 6px; height: 22px; border-radius: 3px; background: var(--c); }
.cat-title small { color: var(--muted); font-weight: 500; font-size: 14px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tool-card {
  display: flex; gap: 14px; align-items: flex-start; padding: 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); transition: transform .12s, box-shadow .12s, border-color .12s;
}
.tool-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: transparent; text-decoration: none; }
.tool-icon { flex: none; width: 44px; height: 44px; border-radius: 12px; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); display: grid; place-items: center; transition: background .15s, color .15s; }
.tool-icon .ic { width: 22px; height: 22px; }
.tool-card:hover .tool-icon { background: var(--c); color: #fff; }
.tool-text strong { display: block; font-size: 16px; margin-bottom: 2px; }
.tool-text span { color: var(--muted); font-size: 14px; line-height: 1.4; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; padding: 30px 16px 50px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.feature h3 { font-size: 17px; }
.feature p { color: var(--muted); margin: 0; font-size: 15px; }

/* ================================================================ tool page */
.tool-hero { text-align: center; padding: 34px 0 18px; }
.tool-hero h1 { font-size: clamp(28px, 4.5vw, 40px); letter-spacing: -.02em; font-weight: 800; }
.tool-hero p { color: var(--muted); font-size: 18px; margin: 0; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.tool-root { min-height: 300px; margin-bottom: 40px; position: relative; }
.stage { animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.dropzone {
  max-width: 760px; margin: 0 auto; background: var(--surface); border: 2px dashed var(--border); border-radius: 18px;
  padding: 46px 20px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, body.dragging .dropzone { border-color: var(--brand); background: var(--brand-50); }
.drop-icon { width: 76px; height: 76px; margin: 0 auto; border-radius: 20px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; }
.drop-icon .ic { width: 38px; height: 38px; stroke-width: 1.7; }
.drop-private { display: inline-flex; align-items: center; gap: 6px; }
.dropzone .btn { margin: 12px 0 8px; }
.dropzone p { margin: 4px 0; }
.drop-private { font-size: 13px; color: var(--ok); margin-top: 12px !important; }

.work-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.work-main { min-width: 0; }
.work-side {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; position: sticky; top: 76px;
  max-height: calc(100vh - 92px); overflow: auto; box-shadow: var(--shadow);
}
.side-title { font-size: 16px; margin-bottom: 12px; }
.btn-run { width: 100%; margin-top: 14px; }
.stage-work.wide .work-grid { grid-template-columns: 1fr; }
.stage-work.wide .work-side { position: static; max-height: none; order: -1; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.stage-work.wide .side-title { display: none; }
.stage-work.wide .options { flex: 1; display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: flex-end; }
.stage-work.wide .options .opt { margin: 0; min-width: 180px; }
.stage-work.wide .options .opt-note { margin: 0; }
.stage-work.wide .btn-run { width: auto; margin: 0; }

.file-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.file-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.file-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; }
.file-row.sortable-ghost { opacity: .4; }
.drag-handle { color: var(--muted); cursor: grab; letter-spacing: -2px; user-select: none; }
.file-thumb { width: 44px; height: 56px; flex: none; display: grid; place-items: center; background: var(--surface-2); border-radius: 4px; overflow: hidden; font-size: 11px; font-weight: 700; color: var(--muted); }
.file-thumb img, .file-thumb canvas { max-width: 100%; max-height: 100%; object-fit: contain; }
.file-info { min-width: 0; flex: 1; }
.file-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { font-size: 13px; }
.file-range-wrap { display: flex; flex-direction: column; font-size: 12px; }
.file-range { width: 120px; }

/* options */
.options .opt { margin-bottom: 14px; }
.opt-label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 5px; }
.opt-label output { font-weight: 500; color: var(--muted); }
.opt-heading { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 4px; }
.opt-note { font-size: 13px; color: var(--muted); background: var(--surface-2); padding: 10px 12px; border-radius: var(--radius-sm); margin: 0; }
.opt-help { font-size: 12.5px; color: var(--muted); margin: 5px 0 0; }
.with-unit { display: flex; align-items: center; gap: 6px; }
.with-unit span { color: var(--muted); font-size: 14px; }
.segmented { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { padding: 7px 12px; font-size: 14px; cursor: pointer; border-right: 1px solid var(--border); user-select: none; }
.segmented label:last-child { border-right: 0; }
.segmented input:checked + label { background: var(--brand); color: #fff; }
.segmented input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: -2px; }
.pos-grid { display: grid; grid-template-columns: repeat(3, 34px); gap: 4px; padding: 6px; background: var(--surface-2); border-radius: var(--radius-sm); width: max-content; }
.pos-grid input { position: absolute; opacity: 0; pointer-events: none; }
.pos-grid label { width: 34px; height: 26px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); cursor: pointer; }
.pos-grid label.disabled { visibility: hidden; }
.pos-grid input:checked + label { background: var(--brand); border-color: var(--brand); }
.pos-grid input:focus-visible + label { outline: 2px solid var(--focus); }

/* progress */
.progress-overlay { position: fixed; inset: 0; background: rgba(15, 18, 30, .45); display: grid; place-items: center; z-index: 90; backdrop-filter: blur(2px); }
.progress-box { background: var(--surface); border-radius: 16px; padding: 28px 30px; width: min(420px, 90vw); text-align: center; box-shadow: var(--shadow-lg); }
.progress-msg { font-weight: 600; margin: 12px 0; word-break: break-word; }
.progress-bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-bottom: 16px; }
.progress-fill { height: 100%; width: 0; background: var(--brand); transition: width .25s; }
.spinner { width: 38px; height: 38px; border: 4px solid var(--surface-2); border-top-color: var(--brand); border-radius: 50%; margin: 0 auto; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* result */
.stage-result { scroll-margin-top: 80px; max-width: 720px; margin: 0 auto; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 34px 20px; box-shadow: var(--shadow); }
.result-check { width: 56px; height: 56px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 30px; display: grid; place-items: center; margin: 0 auto 12px; }
.result-note { color: var(--muted); }
.result-actions { margin: 14px 0 18px; }
.result-list { text-align: left; max-height: 300px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 16px; }
.result-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.result-row:last-child { border-bottom: 0; }
.result-row .file-name { flex: 1; font-weight: 500; }
.result-more { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.result-more select { width: auto; min-width: 240px; }

/* ================================================================ page grid */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.panel h3 { font-size: 16px; }
.pg-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.pg-hint { font-size: 13px; }
.pg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.pg-item { position: relative; background: var(--surface); border: 2px solid var(--border); border-radius: 10px; padding: 8px; cursor: pointer; user-select: none; }
.pg-item:hover { border-color: #c5cad8; }
.pg-item.selected { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(59, 130, 246, .2); }
.sel-delete .pg-item.selected { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(214, 48, 49, .2); }
.sel-delete .pg-item.selected .pg-thumb::after { content: ""; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d63031' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E") center / 56px no-repeat, rgba(255, 255, 255, .55); }
.sel-extract .pg-item.selected .pg-thumb::after { content: ""; position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; background: 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' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 16px no-repeat, var(--focus); }
.pg-item.sortable-ghost { opacity: .35; }
.pg-thumb { position: relative; aspect-ratio: 1 / 1; display: grid; place-items: center; overflow: hidden; }
.pg-rot { width: 100%; height: 100%; display: grid; place-items: center; transition: transform .2s; }
.pg-rot canvas { max-width: 100%; max-height: 100%; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); background: #fff; }
.pg-blank { width: 70%; aspect-ratio: 1 / 1.414; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); display: grid; place-items: center; color: #999; font-size: 13px; }
.pg-loading { width: 70%; aspect-ratio: 1 / 1.414; background: linear-gradient(90deg, var(--surface-2), var(--border), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 3px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.pg-label { text-align: center; font-size: 13px; color: var(--muted); margin-top: 6px; display: flex; gap: 6px; justify-content: center; align-items: center; }
.pg-file { color: #fff; font-size: 11px; font-weight: 700; border-radius: 4px; padding: 0 5px; }
.pg-tools { position: absolute; top: 6px; right: 6px; display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.pg-item:hover .pg-tools, .pg-item:focus-within .pg-tools { opacity: 1; }
.pg-tools button { width: 28px; height: 28px; border: 0; border-radius: 6px; background: rgba(20, 24, 40, .8); color: #fff; cursor: pointer; font-size: 14px; }
.pg-tools button:hover { background: var(--brand); }
@media (hover: none) { .pg-tools { opacity: 1; } }

/* ================================================================ editor */
.editor { position: relative; }
.ed-bars { position: sticky; top: 60px; z-index: 20; background: var(--bg); padding: 8px 0; }
.ed-toolbar { display: flex; flex-wrap: wrap; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px; box-shadow: var(--shadow); }
.ed-tool { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 64px; padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; font: inherit; }
.ed-tool:hover { background: var(--surface-2); }
.ed-tool.active { background: var(--brand-50); color: var(--brand); }
.ed-ico { font-size: 18px; line-height: 1.2; font-weight: 700; }
.ed-lbl { font-size: 11.5px; white-space: nowrap; }
.ed-props { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; min-height: 44px; padding: 8px 10px; margin-top: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; }
.ed-prop { display: flex; align-items: center; gap: 6px; }
.ed-prop .wide { width: 260px; }
.ed-pages { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0; }
.ed-page-wrap { display: flex; flex-direction: column; align-items: center; }
.ed-page { position: relative; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); touch-action: pan-y; }
.ed-canvas { position: absolute; inset: 0; display: grid; place-items: center; }
.ed-canvas .pg-loading { width: 100%; height: 100%; aspect-ratio: auto; }
.ed-page-num { font-size: 12px; color: var(--muted); margin: 6px 0 14px; }
.ed-layer { position: absolute; inset: 0; }
.editor.mode-create .ed-layer { cursor: crosshair; touch-action: none; }
.ed-obj { position: absolute; box-sizing: border-box; cursor: move; touch-action: none; }
.ed-obj.sel { outline: 2px dashed var(--focus); outline-offset: 1px; }
.ed-text { white-space: pre; line-height: 1.2; padding: 0; min-width: 4px; min-height: 1em; }
.ed-text.editing { cursor: text; outline: 2px solid var(--focus); background: rgba(59, 130, 246, .06); }
.ed-whiteout { box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.ed-highlight { opacity: .4; mix-blend-mode: multiply; }
.ed-ellipse { border-radius: 50%; }
.ed-image img { width: 100%; height: 100%; display: block; pointer-events: none; }
.ed-obj svg { width: 100%; height: 100%; overflow: visible; display: block; pointer-events: none; }
.ed-draw.preview { pointer-events: none; }
.ed-handle { position: absolute; right: -6px; bottom: -6px; width: 12px; height: 12px; background: var(--focus); border: 2px solid #fff; border-radius: 3px; cursor: nwse-resize; display: none; }
.ed-obj.sel .ed-handle { display: block; }
.ed-ghost { position: absolute; border: 2px dashed var(--brand); background: rgba(229, 50, 45, .06); pointer-events: none; }
.ed-find { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 6px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--focus); border-radius: var(--radius-sm); font-size: 13px; }
.ed-find .input-sm { width: 190px; }
.ed-find .check { font-size: 13px; align-items: center; }
.ed-find .check input { margin-top: 0; }
.ed-find-count { min-width: 70px; }
.ed-hit { position: absolute; background: rgba(255, 200, 0, .45); outline: 1px solid rgba(230, 160, 0, .9); pointer-events: none; border-radius: 2px; mix-blend-mode: multiply; }
.ed-hit.current { background: rgba(255, 120, 0, .55); outline: 2px solid #e8590c; }
.ed-tl { position: absolute; cursor: text; border-radius: 2px; display: none; }
.editor.mode-edittext .ed-tl { display: block; }
.editor.mode-edittext .ed-tl:hover { background: rgba(59, 130, 246, .15); outline: 1px solid rgba(59, 130, 246, .6); }
[class*="ed-field-"].ed-obj, .ed-obj[class*=" ed-field"] { background: rgba(59, 130, 246, .12); border: 1px solid #3b82f6; }
.ed-obj[data-name]::after { content: attr(data-name); position: absolute; left: 0; top: -17px; font-size: 11px; background: #3b82f6; color: #fff; padding: 0 4px; border-radius: 3px; white-space: nowrap; }
.ed-field-checkbox.ed-obj, .ed-field-radio.ed-obj { border-radius: 3px; }
.ed-field-radio.ed-obj { border-radius: 50%; }
.ed-field { position: absolute; border: 1px solid rgba(59, 130, 246, .7); background: rgba(232, 240, 254, .92); color: #000; font: 12px Helvetica, Arial, sans-serif; padding: 1px 3px; border-radius: 2px; }
textarea.ed-field { resize: none; }
.ed-field:focus { outline: 2px solid var(--focus); background: #fff; }
.ed-field-check { margin: 0; padding: 0; accent-color: #1f4fd6; }

/* ================================================================ modal & toasts */
.modal-back { position: fixed; inset: 0; background: rgba(15, 18, 30, .5); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: var(--surface); border-radius: 14px; padding: 22px; width: min(440px, 100%); box-shadow: var(--shadow-lg); max-height: 90vh; overflow: auto; }
.modal-wide { width: min(640px, 100%); }
.modal .input { margin: 6px 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.error-text { color: var(--danger); font-size: 14px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.tab { border: 0; background: none; font: inherit; padding: 8px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.sig-canvas { width: 100%; height: auto; aspect-ratio: 3 / 1; border: 1px dashed var(--border); border-radius: 8px; background: #fff; touch-action: none; cursor: crosshair; }
.sig-saved { display: block; max-height: 120px; margin: 10px auto; background: #fff; padding: 8px; border-radius: 6px; }
.sig-upload-preview { margin-top: 8px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.row .input { flex: 1; min-width: 160px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; width: max-content; max-width: 92vw; }
.toast { background: #1d2130; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow-lg); transition: opacity .4s, transform .4s; }
.toast.error { background: var(--danger); }
.toast.hide { opacity: 0; transform: translateY(8px); }

/* ================================================================ tool specific */
.crop-panel { text-align: center; }
.crop-stage { position: relative; display: inline-block; line-height: 0; user-select: none; touch-action: none; }
.crop-stage canvas { box-shadow: 0 2px 10px rgba(0, 0, 0, .2); }
.crop-rect { position: absolute; border: 2px solid var(--brand); cursor: move; box-shadow: 0 0 0 9999px rgba(15, 18, 30, .45); }
.crop-stage { overflow: hidden; }
.crop-h { position: absolute; width: 14px; height: 14px; background: #fff; border: 2px solid var(--brand); border-radius: 3px; }
.crop-nw { left: -8px; top: -8px; cursor: nwse-resize; } .crop-ne { right: -8px; top: -8px; cursor: nesw-resize; }
.crop-sw { left: -8px; bottom: -8px; cursor: nesw-resize; } .crop-se { right: -8px; bottom: -8px; cursor: nwse-resize; }
.crop-n { left: calc(50% - 7px); top: -8px; cursor: ns-resize; } .crop-s { left: calc(50% - 7px); bottom: -8px; cursor: ns-resize; }
.crop-e { right: -8px; top: calc(50% - 7px); cursor: ew-resize; } .crop-w { left: -8px; top: calc(50% - 7px); cursor: ew-resize; }
.bm-list { display: flex; flex-direction: column; gap: 6px; }
.bm-row { display: flex; align-items: center; gap: 8px; }
.bm-title { flex: 1; min-width: 120px; }
.bm-page { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.wf-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.wf-step { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.wf-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.wf-num { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.wf-desc { font-size: 13px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-actions { display: flex; }
.wf-body { padding: 4px 14px 10px 48px; border-top: 1px solid var(--border); }
.wf-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 16px; padding-top: 10px; }
.wf-add select { max-width: 320px; }
.render-frame { position: fixed; left: -10000px; top: 0; height: 100px; border: 0; background: #fff; }
.notice { background: var(--brand-50); padding: 12px 16px; border-radius: var(--radius-sm); }

/* ================================================================ info / seo */
.tool-info { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 30px; padding-bottom: 50px; }
.info-main h2 { font-size: 22px; margin-top: 26px; }
.steps { padding-left: 20px; }
.steps li { margin-bottom: 8px; }
.faq { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 8px; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq p { margin: 8px 0 0; color: var(--muted); }
.info-side { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; align-self: start; margin-top: 26px; }
.info-side h3 { font-size: 16px; }
.side-link { display: block; padding: 6px 0; color: var(--text); border-bottom: 1px solid var(--border); font-size: 15px; }
.side-link.all { color: var(--brand); border-bottom: 0; font-weight: 600; }
.prose { max-width: 760px; padding-top: 40px; padding-bottom: 60px; }

/* ================================================================ footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 36px 0 20px; }
.footer-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.footer-grid .mega-col a { color: var(--muted); font-size: 13.5px; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; border-top: 1px solid var(--border); margin-top: 26px; padding-top: 16px; font-size: 13px; color: var(--muted); }

/* ================================================================ responsive */
@media (max-width: 960px) {
  .work-grid { grid-template-columns: 1fr; }
  .work-side { position: static; max-height: none; }
  .tool-info { grid-template-columns: 1fr; }
  .mega-panel { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .main-nav { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--border); flex-direction: column; align-items: stretch; padding: 8px 16px 14px; box-shadow: var(--shadow); }
  .main-nav.open { display: flex; }
  .mega-panel { position: static; width: 100%; box-shadow: none; grid-template-columns: repeat(2, 1fr); padding: 10px 0; border: 0; max-height: 60vh; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { padding-top: 34px; }
  .tool-grid { grid-template-columns: 1fr; }
  .pg-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
  .ed-tool { min-width: 50px; padding: 5px; }
  .ed-lbl { display: none; }
  .ed-bars { top: 60px; }
  .file-row { flex-wrap: wrap; }
  .file-range-wrap { width: 100%; flex-direction: row; align-items: center; gap: 8px; }
  .stage-work.wide .work-side { flex-direction: column; align-items: stretch; }
  .stage-work.wide .btn-run { width: 100%; }
  .wf-body { padding-left: 14px; }
}
body.busy { overflow: hidden; }

/* ================================================================ icons */
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.ic-sm { width: .95em; height: .95em; }
.ic-xs { width: .8em; height: .8em; opacity: .6; }
.icon-btn { display: inline-grid; place-items: center; }
.icon-btn .ic { width: 17px; height: 17px; }
.btn .ic { width: 18px; height: 18px; }
.btn-sm .ic { width: 15px; height: 15px; }
.main-nav > a, .mega-btn { display: inline-flex; align-items: center; gap: 7px; }
.main-nav > a .ic, .mega-btn .ic { width: 17px; height: 17px; color: var(--muted); }
.main-nav > a:hover .ic { color: var(--brand); }
.nav-toggle { display: none; place-items: center; }
.nav-toggle .ic { width: 22px; height: 22px; }
.mega-col a { display: flex; align-items: center; gap: 8px; }
.mi { width: 24px; height: 24px; border-radius: 7px; display: inline-grid; place-items: center; background: color-mix(in srgb, var(--c) 13%, transparent); color: var(--c); flex: none; }
.mi .ic { width: 14px; height: 14px; }
.drag-handle .ic { width: 18px; height: 18px; }
.pg-tools button { display: grid; place-items: center; }
.pg-tools .ic { width: 15px; height: 15px; }
.ed-ico .ic { width: 20px; height: 20px; }
.ed-find .btn { gap: 5px; }
.result-check .ic { width: 30px; height: 30px; stroke-width: 3; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.wf-icon { color: var(--brand); display: inline-grid; }
.crumbs { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.faq summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq-chev { transition: transform .2s; color: var(--muted); }
.faq[open] .faq-chev { transform: rotate(180deg); }

/* ================================================================ landing sections */
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--brand); background: var(--brand-50); padding: 6px 14px; border-radius: 99px; margin-bottom: 16px; }
.search-box { position: relative; }
.search-box > .ic { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 20px; height: 20px; }
.search-box input { padding-left: 48px; }
.trust { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; padding: 0; margin: 22px 0 0; color: var(--muted); font-size: 14px; font-weight: 500; }
.trust li { display: inline-flex; align-items: center; gap: 6px; }
.trust .ic { color: var(--ok); }
.cat-title { gap: 12px; }
.cat-title::before { display: none; }
.cat-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--c); color: #fff; display: inline-grid; place-items: center; }
.cat-icon .ic { width: 19px; height: 19px; }
.tool-hero { padding-top: 26px; }
.hero-icon { width: 68px; height: 68px; border-radius: 18px; margin: 14px auto 14px; background: var(--c, var(--brand)); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 26px -8px var(--c, var(--brand)); }
.hero-icon .ic { width: 34px; height: 34px; }
.tool-hero p { max-width: 760px; margin: 0 auto; font-size: 17px; }

.section-title { text-align: center; font-size: clamp(24px, 3.4vw, 32px); letter-spacing: -.02em; font-weight: 800; margin-bottom: 8px; }
.section-sub { text-align: center; color: var(--muted); margin-bottom: 34px; }
.howto, .feats, .faq-wrap, .related { padding: 56px 0; }
.howto { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.howto-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 48px; }
.howto-step { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; align-items: center; }
.howto-step:nth-child(even) .howto-text { order: 2; }
.step-num { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--brand); color: #fff; font-weight: 800; font-size: 18px; margin-bottom: 14px; }
.howto-text h3 { font-size: 22px; }
.howto-text p { color: var(--muted); font-size: 16.5px; margin: 0; }
.howto-fig { margin: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-lg); background: var(--bg); }
.howto-fig img { display: block; width: 100%; height: auto; }
.step-illus { aspect-ratio: 16 / 10; display: grid; place-items: center; color: var(--brand); background: linear-gradient(135deg, var(--brand-50), var(--surface-2)); }
.step-illus .ic { width: 72px; height: 72px; stroke-width: 1.4; }
.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 30px; }
.feat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.feat h3 { font-size: 17px; margin: 12px 0 6px; }
.feat p { color: var(--muted); font-size: 15px; margin: 0; }
.feat-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }
.feat-icon .ic { width: 22px; height: 22px; }
.faq-wrap { background: var(--surface); border-top: 1px solid var(--border); }
.faq-wrap .section-title { margin-bottom: 26px; }
.narrow { max-width: 820px; }
.related .tool-grid { margin: 26px 0 22px; }
.cta-band { background: linear-gradient(135deg, var(--c, var(--brand)), color-mix(in srgb, var(--c, var(--brand)) 60%, #1d2130)); color: #fff; text-align: center; padding: 54px 0; }
.cta-band h2 { font-size: clamp(24px, 3.4vw, 32px); font-weight: 800; }
.cta-band p { opacity: .9; margin-bottom: 22px; }
.btn-light { background: #fff; color: #1d2130; border-color: #fff; }
.btn-light:hover { background: #f1f3f8; }
.result-continue-title { margin: 6px 0 8px; font-size: 14px; }
.result-continue { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 18px; }
.chip { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 14px; font-weight: 600; padding: 7px 13px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.chip .ic { color: var(--c); width: 16px; height: 16px; }
.chip:hover { border-color: var(--c); }
.footer-brand { margin-bottom: 26px; }
.footer-brand p { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 8px 0 0; font-size: 14px; }
.footer-links { display: flex; gap: 16px; }
.site-footer .mega-col a { display: block; }
@media (max-width: 960px) {
  .feat-grid { grid-template-columns: repeat(2, 1fr); }
  .howto-step { grid-template-columns: 1fr; gap: 18px; }
  .howto-step:nth-child(even) .howto-text { order: 0; }
}
@media (max-width: 760px) {
  .nav-toggle { display: grid; }
  .feat-grid { grid-template-columns: 1fr; }
  .howto, .feats, .faq-wrap, .related { padding: 40px 0; }
  .howto-steps { gap: 34px; }
}
.stage-work.wide .work-side:has(.options:empty) { background: transparent; border: 0; box-shadow: none; padding: 0; justify-content: flex-end; }
.howto-step:nth-child(even) { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
@media (max-width: 960px) { .howto-step:nth-child(even) { grid-template-columns: 1fr; } }

/* ================================================================ running card + ads */
.stage-running { scroll-margin-top: 80px; }
.running-card { max-width: 720px; margin: 0 auto; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 34px 24px; box-shadow: var(--shadow); }
.running-card h2 { font-size: 22px; margin: 14px 0 4px; }
.running-card .progress-bar { max-width: 420px; margin: 14px auto; }
.running-note { display: flex; justify-content: center; align-items: center; gap: 6px; font-size: 13px; }
/* Ad cards: framed, labeled and with reserved height (no layout jump when the ad loads) */
.ad { margin: 0 auto; }
.ad-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px 12px; }
.ad-label { display: flex; align-items: center; gap: 8px; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 2px 8px; }
.ad-label::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.ad-body { display: flex; justify-content: center; overflow: hidden; border-radius: 6px; }
.ad-body ins.adsbygoogle { width: 100%; }
.ad-ph { width: 100%; display: grid; place-items: center; border: 2px dashed var(--border); border-radius: 6px; color: var(--muted); font-size: 13px; background: var(--surface-2); }
.ad-banner { max-width: 970px; }
.ad-banner ins.adsbygoogle, .ad-banner .ad-ph { min-height: 90px; }
.ad-box ins.adsbygoogle, .ad-box .ad-ph { min-height: 250px; }
.ad-band { padding: 28px 0; }
/* download-time ad: always well below the Download button (AdSense: no ads next to buttons) */
.ad-download { max-width: 760px; margin-top: 44px; }
.ad-homeTools { margin: 8px auto 30px; }
/* side rail: only in the empty margin of very wide screens, never over content */
.ad-rail { display: none; }
@media (min-width: 1600px) {
  .ad-rail { display: block; position: fixed; z-index: 5; top: 84px; width: 176px; right: calc((100vw - 1200px) / 2 - 196px); }
  .ad-rail .ad-card { padding: 6px 8px 8px; }
  .ad-rail ins.adsbygoogle, .ad-rail .ad-ph { width: 160px; height: 600px; min-height: 0; }
}
@media (min-width: 1960px) {
  .ad-rail { width: 316px; right: calc((100vw - 1200px) / 2 - 340px); }
  .ad-rail ins.adsbygoogle, .ad-rail .ad-ph { width: 300px; }
}
@media (max-width: 760px) {
  .ad-card { padding: 6px 8px 8px; }
  .ad-band { padding: 20px 0; }
}

/* ================================================================ footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 52px 0 22px; font-size: 14.5px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--brand); text-decoration: none; }
.footer-top { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 32px; padding-bottom: 36px; border-bottom: 1px solid var(--border); }
.footer-brand { margin: 0; }
.footer-brand .logo { color: var(--text); }
.footer-brand p { color: var(--muted); margin: 14px 0 16px; max-width: 380px; line-height: 1.6; }
.footer-badges { display: grid; gap: 8px; }
.footer-badges li { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 500; font-size: 13.5px; }
.footer-badges .ic { color: var(--ok); }
.fhead { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text); margin-bottom: 14px; }
.fcol li { margin-bottom: 9px; }
.footer-all { padding: 30px 0 26px; border-bottom: 1px solid var(--border); }
.footer-cats { columns: 4 200px; column-gap: 32px; }
.fcat { break-inside: avoid; margin-bottom: 20px; }
.fcat summary { list-style: none; display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); margin-bottom: 8px; cursor: default; }
.fcat summary::-webkit-details-marker { display: none; }
.fcat-icon { width: 24px; height: 24px; border-radius: 7px; display: inline-grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); }
.fcat-icon .ic { width: 14px; height: 14px; }
.fcat-chev { display: none; margin-left: auto; color: var(--muted); transition: transform .2s; }
.fcat li { margin: 0 0 6px 32px; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding-top: 20px; margin-top: 0; border-top: 0; color: var(--muted); font-size: 13.5px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; }
.to-top { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
@media (min-width: 761px) { .fcat summary { pointer-events: none; } }
@media (max-width: 960px) {
  .footer-top { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .site-footer { padding-top: 38px; }
  .footer-top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 20px; }
  .footer-top .fcol:last-child { grid-column: 1 / -1; }
  .footer-top .fcol:last-child ul { display: flex; flex-wrap: wrap; gap: 4px 18px; }
  .footer-cats { columns: 1; }
  .fcat { margin: 0; border-bottom: 1px solid var(--border); }
  .fcat summary { cursor: pointer; padding: 12px 0; margin: 0; }
  .fcat-chev { display: inline; }
  .fcat[open] .fcat-chev { transform: rotate(180deg); }
  .fcat ul { padding-bottom: 10px; }
  .footer-bottom { flex-direction: column-reverse; align-items: flex-start; }
}

/* ================================================================ legal pages + sitemap */
.doc-hero { text-align: center; padding: 30px 0 34px; background: var(--surface); border-bottom: 1px solid var(--border); }
.doc-hero h1 { font-size: clamp(30px, 4.5vw, 42px); letter-spacing: -.02em; font-weight: 800; margin-bottom: 8px; }
.doc-updated { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; margin: 0; }
.doc-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 44px; padding-top: 38px; padding-bottom: 64px; align-items: start; }
.doc-toc { position: sticky; top: 80px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; font-size: 14px; max-height: calc(100vh - 100px); overflow: auto; }
.doc-toc summary { list-style: none; display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; cursor: pointer; }
.doc-toc summary::-webkit-details-marker { display: none; }
.doc-toc ol { margin: 10px 0 0; padding-left: 20px; color: var(--muted); }
.doc-toc li { margin: 6px 0; }
.doc-toc a { color: var(--text); }
.doc-toc a:hover { color: var(--brand); }
.doc-article.prose { max-width: 820px; padding: 0; }
.doc-intro { font-size: 17.5px; line-height: 1.7; color: var(--text); }
.keypoints { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 22px 0 34px; }
.keypoint { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.keypoint .feat-icon { flex: none; width: 38px; height: 38px; }
.keypoint strong { display: block; margin-bottom: 2px; }
.keypoint p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.doc-section { scroll-margin-top: 80px; padding-top: 8px; margin-bottom: 26px; }
.doc-section h2 { display: flex; align-items: center; gap: 10px; font-size: 21px; margin: 18px 0 10px; }
.doc-num { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--brand-50); color: var(--brand); font-size: 14px; font-weight: 800; }
.doc-section p, .doc-section li { line-height: 1.7; }
.doc-section ul { padding-left: 22px; }
.doc-section li { margin-bottom: 6px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.lic-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.lic-table th, .lic-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.lic-table th { background: var(--surface-2); font-weight: 700; }
.lic-table tr:last-child td { border-bottom: 0; }
.sitemap { padding-top: 36px; padding-bottom: 64px; }
.sm-title { display: flex; align-items: center; gap: 10px; font-size: 18px; margin-bottom: 12px; }
.sm-title small { color: var(--muted); font-weight: 500; font-size: 13px; }
.sm-pages { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 26px; }
.sm-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 26px; }
.sm-grid { columns: 3 320px; column-gap: 22px; }
.sm-cat { break-inside: avoid; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 18px 10px; margin-bottom: 22px; }
.sm-cat .cat-icon { background: var(--c); }
.sm-cat ul { list-style: none; margin: 0; padding: 0; }
.sm-cat li a { display: flex; gap: 10px; align-items: flex-start; padding: 8px 6px; border-radius: 8px; color: var(--text); }
.sm-cat li a:hover { background: var(--surface-2); text-decoration: none; }
.sm-cat .mi { margin-top: 1px; }
.sm-cat strong { display: block; font-size: 14.5px; }
.sm-cat small { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; }
@media (max-width: 960px) {
  .doc-layout { grid-template-columns: 1fr; gap: 20px; }
  .doc-toc { position: static; max-height: none; }
}
@media (max-width: 760px) {
  .keypoints { grid-template-columns: 1fr; }
  .doc-intro { font-size: 16.5px; }
}

/* ================================================================ AI Content Checker report */
.stage-result:has(.aic) { max-width: 960px; }
.aic { text-align: left; display: grid; gap: 14px; margin: 18px 0 6px; }
.aic-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; min-width: 0; }
.aic-card h3 { font-size: 17px; margin: 0 0 10px; }
.aic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.aic-summary { display: flex; gap: 22px; align-items: center; background: var(--surface-2); }
.aic-sum-text { min-width: 0; }
.aic-sum-text p { margin: 0 0 6px; }
.aic-kicker { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.aic-verdict { font-size: 22px; margin: 2px 0 4px; }
.aic-card .aic-verdict { font-size: 20px; }
.aic-ai { color: var(--danger); }
.aic-mid { color: #d9480f; }
.aic-human { color: var(--ok); }
.aic-disclaimer { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: flex-start; }
.aic-disclaimer .ic { flex: none; margin-top: 3px; width: 15px; height: 15px; }
.aic-gauge { --p: 0; --gc: var(--brand); flex: none; width: 128px; height: 128px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--gc) calc(var(--p) * 1%), var(--border) 0); }
.aic-gauge-in { width: 76%; height: 76%; border-radius: 50%; background: var(--surface); display: grid; place-content: center; text-align: center; }
.aic-gauge-in strong { font-size: 28px; line-height: 1; }
.aic-gauge-in span { font-size: 12px; color: var(--muted); }
.aic-gauge-sm { width: 88px; height: 88px; }
.aic-gauge-sm .aic-gauge-in strong { font-size: 20px; }
.aic-reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14.5px; }
.aic-reasons li { display: flex; gap: 10px; align-items: flex-start; }
.aic-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 7px; background: var(--muted); }
.aic-r-ai .aic-dot { background: var(--danger); }
.aic-r-human .aic-dot { background: var(--ok); }
.aic-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 0; }
.aic-stats div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 10px; }
.aic-stats dt { font-size: 12.5px; color: var(--muted); }
.aic-stats dd { margin: 0; font-weight: 600; }
.aic-deep { border-color: var(--ok); }
.aic-deep-head { display: flex; gap: 14px; align-items: flex-start; }
.aic-deep-head .feat-icon { flex: none; }
.aic-deep-head p { margin: 0; }
.aic-deep-result { display: flex; gap: 18px; align-items: center; margin: 14px 0 4px; }
.aic-deep-result p { margin: 0; }
.aic-quota { display: flex; gap: 6px; align-items: center; font-weight: 500; margin: 14px 0 10px; }
.aic-error { color: var(--danger); margin: 0 0 10px; }
.aic-privacy { font-size: 13px; display: flex; gap: 6px; align-items: center; margin: 10px 0 0; }
.aic-text-head { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.aic-text-head h3 { margin: 0; }
.aic-legend { font-size: 13px; margin: 0 0 10px; }
.aic-text { max-height: 520px; overflow: auto; font-size: 15px; line-height: 1.75; padding-right: 6px; }
.aic-text p { margin: 0 0 12px; }
.aic-text .aic-heading { font-weight: 700; }
.aic-s { border-radius: 3px; padding: 1px 0; }
.aic-s.aic-hi { background: rgba(214, 48, 49, .2); color: inherit; }
.aic-s.aic-mid { background: rgba(240, 140, 0, .22); color: inherit; }
.aic-legend .aic-s { padding: 1px 6px; margin-right: 6px; }
.aic-text .aic-s[title]:hover { outline: 1px solid var(--border); }
@media (max-width: 760px) {
  .aic-grid { grid-template-columns: 1fr; }
  .aic-summary, .aic-deep-result { flex-direction: column; text-align: center; }
  .aic-disclaimer { text-align: left; }
  .aic-gauge { width: 112px; height: 112px; }
}
