:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --border: #dfe4ea;
  --text: #15202b;
  --muted: #5f6b7a;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-soft: #e8efff;
  --ok: #0f766e;
  --ok-soft: #e3f4f1;
  --warn: #92400e;
  --warn-soft: #fff5e0;
  --danger: #b91c1c;
  --danger-soft: #fdecec;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 18px rgba(16, 24, 40, .05);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 20px; }
a { color: var(--primary); }
code { font-family: var(--mono); font-size: .9em; background: #eef1f5; padding: 1px 5px; border-radius: 4px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 30; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid #93b4ff; outline-offset: 2px; }
button, select, input { font: inherit; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; }
.brand img { display: block; height: 52px; width: auto; }
@media (max-width: 680px) { .brand img { height: 40px; } }
.site-header nav { display: flex; align-items: center; gap: 16px; font-size: .95rem; }
.site-header nav a { color: var(--text); text-decoration: none; }
.site-header nav a:hover { color: var(--primary); }
.nav-cta { color: var(--primary) !important; font-weight: 600; }
.lang-switch { color: var(--muted) !important; font-size: .85rem; border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; }

/* Hero */
.hero { padding: 40px 0 20px; }
.eyebrow { margin: 0 0 8px; color: var(--ok); font-weight: 600; font-size: .9rem; }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 14px; max-width: 800px; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 740px; margin: 0 0 18px; }
.trust-list { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 8px 20px; font-weight: 600; font-size: .95rem; }
.trust-list li::before { content: "✓"; color: var(--ok); margin-right: 6px; }
.net-status { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 6px 12px; background: var(--ok-soft); color: var(--ok); border-radius: 999px; font-size: .875rem; font-weight: 500; }
.net-status .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.net-status.alert { background: var(--warn-soft); color: var(--warn); }

/* Stepper */
.stepper { display: flex; gap: 6px; margin: 18px 0 6px; padding: 0; list-style: none; counter-reset: s; }
.stepper li { flex: 1; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; background: #e9edf2; color: var(--muted); font-size: .85rem; font-weight: 600; }
.stepper li::before { counter-increment: s; content: counter(s); display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #cfd6df; color: #fff; font-size: .78rem; flex: none; }
.stepper li.active { background: var(--primary-soft); color: var(--primary); }
.stepper li.active::before { background: var(--primary); }
.stepper li.done { background: var(--ok-soft); color: var(--ok); }
.stepper li.done::before { background: var(--ok); content: "✓"; }

/* Cards */
.tool { padding-bottom: 8px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 18px; }
.card p { margin: 0 0 12px; }
.step-title { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; margin: 0 0 14px; }
.step-num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; font-size: .9rem; flex: none; }

/* Dropzone */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 16px; border: 2px dashed #b7c0cc; border-radius: var(--radius); background: #fafbfc; cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); background: var(--primary-soft); }
.dropzone:focus-within { outline: 3px solid #93b4ff; outline-offset: 2px; }
.dropzone svg { width: 40px; height: 40px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dz-main { font-weight: 600; }
.dz-main u { color: var(--primary); }
.dz-sub { color: var(--muted); font-size: .9rem; }
.try-row { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: .9rem; color: var(--muted); }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); text-decoration: underline; cursor: pointer; font-weight: 600; }

.file-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: #fafbfc; border: 1px solid var(--border); border-radius: var(--radius); }
.file-summary p { margin: 0; }
.file-name { font-weight: 600; word-break: break-all; }
.file-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.inline-select { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; }

/* Buttons & fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 8px; border: 1px solid transparent; font-size: .95rem; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.3; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { opacity: .6; cursor: progress; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: #a9b4c2; background: #f3f5f8; }
.btn-ghost[aria-pressed="true"] { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
select, input[type="text"] { font-size: .95rem; color: var(--text); background: var(--surface); border: 1px solid #c4ccd7; border-radius: 8px; padding: 8px 10px; }

/* Columns step */
.detect-banner { padding: 12px 14px; border-radius: 8px; background: var(--primary-soft); margin-bottom: 14px; font-size: .95rem; }
.detect-banner.none { background: #f1f3f6; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.presets .label { font-size: .85rem; color: var(--muted); margin-right: 4px; }
.rules-help { font-size: .92rem; margin-bottom: 12px; }
.rules-help summary { cursor: pointer; color: var(--primary); font-weight: 600; }
.rules-help dl { margin: 10px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; }
.rules-help dt { font-weight: 600; }
.rules-help dd { margin: 0; color: var(--muted); }

.columns-table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; max-height: 520px; margin-bottom: 10px; }
.columns-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.columns-table th { position: sticky; top: 0; background: #f3f5f8; text-align: left; font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border); z-index: 1; }
.columns-table td { padding: 9px 12px; border-bottom: 1px solid #eceff3; vertical-align: middle; }
.columns-table tr:last-child td { border-bottom: 0; }
.columns-table tr.is-sensitive td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.col-name { font-weight: 600; word-break: break-word; }
.tag { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: .78rem; font-weight: 600; }
.sample, .result { font-family: var(--mono); font-size: .85rem; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result.changed { color: var(--ok); }
.result.dropped { color: var(--muted); font-family: inherit; font-style: italic; }
.empty { color: #9aa4b2; font-style: italic; font-family: inherit; }

/* Risk panel */
.risk { margin-top: 14px; padding: 12px 14px; border-radius: 8px; border: 1px solid; font-size: .92rem; }
.risk.ok { background: var(--ok-soft); border-color: #b6e3da; color: var(--ok); }
.risk.warn { background: var(--warn-soft); border-color: #f3dfb0; color: var(--warn); }
.risk h3 { margin: 0 0 6px; font-size: .95rem; }
.risk ul { margin: 0; padding-left: 20px; }
.risk li { margin: 3px 0; }

/* Preview step */
.preview-toolbar p { margin: 0; }
.preview-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.toggle-group { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.toggle-group button { background: var(--surface); border: 0; padding: 7px 14px; cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--muted); }
.toggle-group button[aria-pressed="true"] { background: var(--primary); color: #fff; }
.preview-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; max-height: 360px; }
.preview { border-collapse: collapse; font-size: .84rem; font-family: var(--mono); min-width: 100%; }
.preview th { position: sticky; top: 0; background: #f3f5f8; text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); font-family: inherit; white-space: nowrap; }
.preview td { padding: 7px 10px; border-bottom: 1px solid #eceff3; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.preview td.changed { background: var(--ok-soft); color: var(--ok); }
.preview th.dropped, .preview td.dropped { color: #9aa4b2; text-decoration: line-through; background: #fafbfc; }

/* Key step */
.key-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.key-row input { flex: 1 1 280px; font-family: var(--mono); }
.hint { font-size: .875rem; color: var(--muted); min-height: 1.4em; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; font-size: .95rem; cursor: pointer; }
.check input { margin-top: 5px; flex: none; }
.callout { padding: 10px 14px; border-left: 3px solid var(--warn); background: var(--warn-soft); border-radius: 0 8px 8px 0; font-size: .92rem; margin-top: 14px !important; }

/* Export step */
.export-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; }
.export-row label { display: flex; flex-direction: column; gap: 4px; font-size: .875rem; color: var(--muted); }
.progress { margin-top: 16px; }
.progress-bar { height: 8px; background: #e7ebf0; border-radius: 999px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; background: var(--primary); transition: width .15s; }
.error { color: var(--danger); font-weight: 500; margin-top: 12px !important; }
.done { margin-top: 18px; padding: 18px; border-radius: var(--radius); background: var(--ok-soft); }
.done:focus { outline: none; }
.done-title { font-weight: 700; color: var(--ok); word-break: break-all; }
.done-files { list-style: none; padding: 0; margin: 0 0 10px; }
.done-files li { margin: 4px 0; font-family: var(--mono); font-size: .88rem; }
.next-step { margin-top: 14px; padding-top: 14px; border-top: 1px solid #b6e3da; }
.next-step .btn { margin-top: 6px; }

/* Editorial */
.content { padding: 24px 20px 40px; max-width: 800px; }
.content h2 { font-size: 1.4rem; line-height: 1.3; margin: 36px 0 12px; }
.content h3 { font-size: 1.1rem; margin: 22px 0 8px; }
.content p, .content li { color: #2b3645; }
.content ul, .content ol { padding-left: 22px; }
.content li { margin-bottom: 8px; }
.content details { border-bottom: 1px solid var(--border); padding: 12px 0; }
.content details summary { cursor: pointer; font-weight: 600; }
.content details p { margin: 10px 0 0; }
.use-cases { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; padding: 0; list-style: none; }
.use-cases li { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin: 0; }
.use-cases strong { display: block; margin-bottom: 4px; }
.cta-block { margin-top: 40px; padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.cta-block h2 { margin-top: 0; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 22px 0; font-size: .9rem; }
.site-footer p { margin: 4px 0; }

@media (max-width: 680px) {
  .card { padding: 18px; }
  .site-header nav a:not(.nav-cta):not(.lang-switch) { display: none; }
  .stepper li { font-size: 0; gap: 0; justify-content: center; }
  .stepper li::before { font-size: .78rem; }
  .columns-table-wrap { max-height: none; border: 0; }
  .columns-table thead { display: none; }
  .columns-table, .columns-table tbody, .columns-table tr, .columns-table td { display: block; width: 100%; }
  .columns-table tr { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; padding: 6px 0; }
  .columns-table tr.is-sensitive { box-shadow: inset 3px 0 0 var(--warn); }
  .columns-table tr.is-sensitive td:first-child { box-shadow: none; }
  .columns-table td { border: 0; padding: 4px 14px; }
  .columns-table td[data-label]:not(:first-child)::before { content: attr(data-label); display: block; font-size: .75rem; color: var(--muted); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
  .columns-table td select { width: 100%; }
  .sample, .result { max-width: none; white-space: normal; word-break: break-all; }
  .rules-help dl { grid-template-columns: 1fr; }
}
