:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --text: #17202d;
  --muted: #647083;
  --border: #dce2e9;
  --brand: #635b9e;
  --brand-strong: #4d467f;
  --brand-soft: #eeeafd;
  --success: #287b5f;
  --success-soft: #e8f7f1;
  --warning: #9a6428;
  --warning-soft: #fff4e5;
  --danger: #a23f46;
  --danger-soft: #fcecef;
  --shadow: 0 12px 36px rgba(20, 31, 49, .08);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --max: 1180px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1628;
  --surface: #142238;
  --surface-2: #1b2b43;
  --text: #f2f4f7;
  --muted: #aab7c4;
  --border: #2d405b;
  --brand: #aaa2e8;
  --brand-strong: #c2bcf5;
  --brand-soft: #29264a;
  --success: #67c7a5;
  --success-soft: #17372f;
  --warning: #e7b86e;
  --warning-soft: #3b3020;
  --danger: #ee969d;
  --danger-soft: #40242a;
  --shadow: 0 18px 48px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; }
a { color: inherit; }
img, svg { display: block; }
button { cursor: pointer; }

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 999;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
}
.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  min-height: 68px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  text-decoration: none;
  letter-spacing: -.02em;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #0b1628;
  color: #aaa2e8;
  font-weight: 900;
}
.header-actions { display: flex; align-items: center; gap: 8px; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a,
.icon-button,
.lang-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
}
.site-nav a { padding: 8px 12px; }
.site-nav a:hover,
.site-nav a[aria-current="page"],
.icon-button:hover,
.lang-link:hover { background: var(--surface-2); color: var(--text); }
.icon-button { width: 40px; }
.icon-button svg { width: 20px; height: 20px; }
.lang-link { padding: 8px 10px; font-weight: 700; font-size: .9rem; }

main { min-height: calc(100vh - 180px); }
.container { width: min(calc(100% - 48px), var(--max)); margin-inline: auto; }
.narrow { width: min(calc(100% - 48px), 820px); margin-inline: auto; }
.section { padding: 72px 0; }
.section.compact { padding: 48px 0; }
.section-header { margin-bottom: 28px; }
.section-header h2 { margin: 0 0 8px; font-size: clamp(1.6rem, 3vw, 2.25rem); line-height: 1.2; letter-spacing: -.035em; }
.section-header p { margin: 0; color: var(--muted); }

.hero { padding: 92px 0 72px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(310px, .85fr); gap: 52px; align-items: center; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--brand-strong);
  font-weight: 800;
  font-size: .82rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 24px; height: 2px; background: var(--brand); }
.hero h1 { margin: 0; max-width: 760px; font-size: clamp(2.6rem, 7vw, 5.5rem); line-height: .98; letter-spacing: -.065em; }
.hero-copy { margin: 24px 0 0; max-width: 700px; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.25rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.button {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 750;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(0,0,0,.03);
}
.button:hover { border-color: color-mix(in srgb, var(--brand) 55%, var(--border)); transform: translateY(-1px); }
.button.primary { border-color: var(--brand); background: var(--brand); color: #fff; }
html[data-theme="dark"] .button.primary { color: #17152b; }
.button.ghost { background: transparent; box-shadow: none; }
.button.danger { color: var(--danger); }
.button.small { min-height: 36px; padding: 7px 11px; font-size: .9rem; }

.promise-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.promise-top { padding: 28px; border-bottom: 1px solid var(--border); }
.promise-top strong { display: block; font-size: 1.2rem; margin-bottom: 6px; }
.promise-top p { margin: 0; color: var(--muted); }
.promise-list { list-style: none; padding: 10px; margin: 0; }
.promise-list li { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 16px; border-radius: 12px; }
.promise-list li:hover { background: var(--surface-2); }
.promise-list span { color: var(--muted); font-size: .92rem; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 5px var(--success-soft); flex: 0 0 auto; }

.search-box { position: relative; max-width: 680px; }
.search-box input {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px 12px 46px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}
.search-box input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.search-box svg { position: absolute; left: 16px; top: 16px; width: 20px; height: 20px; color: var(--muted); }

.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tool-card {
  min-height: 190px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.tool-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); box-shadow: var(--shadow); }
.tool-card .category { color: var(--brand-strong); font-weight: 800; font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; }
.tool-card h3 { margin: 14px 0 8px; font-size: 1.2rem; line-height: 1.25; letter-spacing: -.02em; }
.tool-card p { margin: 0; color: var(--muted); }
.tool-card .card-link { margin-top: auto; padding-top: 20px; color: var(--brand-strong); font-weight: 800; }

.feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.feature { padding: 20px; border-top: 2px solid var(--border); }
.feature strong { display: block; margin-bottom: 7px; }
.feature p { margin: 0; color: var(--muted); font-size: .95rem; }

.page-hero { padding: 64px 0 34px; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 20px; color: var(--muted); font-size: .92rem; }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }
.page-hero h1 { margin: 0; font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1.05; letter-spacing: -.055em; }
.page-hero .lede { margin: 18px 0 0; max-width: 760px; color: var(--muted); font-size: 1.12rem; }
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.badge { padding: 6px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .86rem; font-weight: 750; }
.badge.safe { color: var(--success); background: var(--success-soft); }

.tool-shell { margin: 20px auto 64px; }
.tool-panel { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.tool-panel-header { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.tool-panel-header h2 { margin: 0; font-size: 1rem; }
.tool-panel-body { padding: 22px; }
.tool-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.tool-layout.single { grid-template-columns: 1fr; }
.tool-layout.asymmetric { grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr); }
.field { display: grid; gap: 7px; }
.field + .field { margin-top: 14px; }
.field label, .field-label { font-weight: 750; font-size: .92rem; }
.field-help { color: var(--muted); font-size: .84rem; }
textarea,
.text-input,
.select-input,
.number-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  outline: none;
}
textarea { min-height: 290px; resize: vertical; padding: 14px; font-family: var(--mono); line-height: 1.55; font-size: .92rem; }
textarea.compact { min-height: 180px; }
.text-input, .select-input, .number-input { min-height: 44px; padding: 9px 11px; }
textarea:focus, .text-input:focus, .select-input:focus, .number-input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.control-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.checkbox, .radio { display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: .92rem; }
.checkbox input, .radio input { margin-top: 4px; accent-color: var(--brand); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.dropzone { border: 1px dashed color-mix(in srgb, var(--brand) 55%, var(--border)); border-radius: 14px; padding: 20px; background: var(--brand-soft); text-align: center; }
.dropzone input { max-width: 100%; }
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.stat { padding: 8px 11px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: .86rem; }
.stat strong { color: var(--text); }
.notice { margin-top: 16px; padding: 12px 14px; border-radius: 11px; background: var(--surface-2); color: var(--muted); font-size: .9rem; }
.notice.success { background: var(--success-soft); color: var(--success); }
.notice.error { background: var(--danger-soft); color: var(--danger); }
.notice.warning { background: var(--warning-soft); color: var(--warning); }
.hidden { display: none !important; }

.result-table-wrap { margin-top: 18px; overflow: auto; border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 620px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; font-size: .9rem; vertical-align: top; }
th { background: var(--surface-2); color: var(--muted); font-weight: 800; }
tr:last-child td { border-bottom: 0; }
.code-output { min-height: 280px; white-space: pre; overflow: auto; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 48px; align-items: start; }
.prose { min-width: 0; }
.prose h2 { margin: 48px 0 12px; font-size: 1.7rem; letter-spacing: -.035em; line-height: 1.2; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 28px 0 8px; }
.prose p, .prose li { color: var(--muted); }
.prose code { font-family: var(--mono); background: var(--surface-2); padding: 2px 5px; border-radius: 5px; color: var(--text); }
.prose pre { overflow: auto; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); }
.prose pre code { background: transparent; padding: 0; }
.prose details { border-top: 1px solid var(--border); padding: 16px 0; }
.prose details:last-child { border-bottom: 1px solid var(--border); }
.prose summary { cursor: pointer; font-weight: 750; color: var(--text); }
.prose details p { margin-bottom: 0; }
.side-nav { position: sticky; top: 92px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.side-nav strong { display: block; margin-bottom: 8px; }
.side-nav a { display: block; padding: 7px 8px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: .92rem; }
.side-nav a:hover { background: var(--surface-2); color: var(--text); }

.empty-state { display: none; margin-top: 18px; padding: 28px; border: 1px dashed var(--border); border-radius: 14px; color: var(--muted); text-align: center; }
.empty-state.visible { display: block; }

.site-footer { margin-top: 72px; border-top: 1px solid var(--border); }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 32px 24px; display: flex; justify-content: space-between; gap: 24px; color: var(--muted); font-size: .9rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--text); }

@media (max-width: 900px) {
  .hero-grid, .content-grid { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .side-nav { display: none; }
}

@media (max-width: 700px) {
  .header-inner { padding: 0 16px; }
  .site-nav { display: none; }
  .container, .narrow { width: min(calc(100% - 28px), var(--max)); }
  .hero { padding-top: 58px; }
  .hero-grid { gap: 34px; }
  .hero h1 { font-size: clamp(2.6rem, 14vw, 4.5rem); }
  .tool-grid, .feature-grid, .tool-layout, .tool-layout.asymmetric, .control-grid { grid-template-columns: 1fr; }
  .tool-card { min-height: 166px; }
  .page-hero { padding-top: 42px; }
  .tool-panel-body { padding: 16px; }
  .tool-panel-header { padding: 15px 16px; align-items: flex-start; flex-direction: column; }
  textarea { min-height: 220px; }
  .footer-inner { flex-direction: column; padding-inline: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

.file-list { display: grid; gap: 8px; margin: 14px 0; }
.file-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-muted, var(--surface)); }
.file-row span { overflow-wrap: anywhere; }
.file-row small { color: var(--text-muted); white-space: nowrap; }
.status[data-type="success"] { color: var(--success, #16805c); }
.status[data-type="error"] { color: var(--danger, #b42318); }

/* PDF suite */
.field > input[type="text"],
.field > input[type="number"],
.field > input[type="color"],
.field > select,
.control-grid input[type="text"],
.control-grid input[type="number"],
.control-grid input[type="color"],
.control-grid select,
.studio-loaders select,
.studio-export input {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}
.field > input[type="color"], .control-grid input[type="color"] { padding: 5px; min-width: 72px; }
.field > input:focus, .field > select:focus,
.control-grid input:focus, .control-grid select:focus,
.studio-loaders select:focus, .studio-export input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}
.field input[type="file"] { width: 100%; color: var(--muted); }
.field input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}
.status { min-height: 24px; margin-top: 14px; color: var(--muted); }
.status[data-type="warning"] { color: var(--warning, #946200); }
.button.danger, .button.ghost.danger { color: var(--danger); }
.button:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.checkbox.inline { align-items: center; }
.checkbox.inline input { margin-top: 0; }
.file-button { position: relative; overflow: hidden; cursor: pointer; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.toolbar-spacer { flex: 1 1 auto; }

.studio-loaders,
.studio-toolbar,
.studio-export {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.studio-loaders { padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.studio-loaders select { width: auto; min-width: 110px; }
.studio-toolbar {
  position: sticky;
  top: 76px;
  z-index: 5;
  margin: 16px 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(11,22,40,.06);
}
.studio-toolbar .button { min-height: 38px; padding: 7px 10px; font-size: .87rem; }
.studio-grid {
  min-height: 320px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 14px;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: 15px;
  background: var(--surface-2);
}
.studio-grid.empty { display: grid; place-items: center; }
.studio-empty { display: grid; gap: 6px; color: var(--muted); text-align: center; }
.studio-empty strong { color: var(--text); }
.studio-page {
  position: relative;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(11,22,40,.05);
  cursor: grab;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.studio-page:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(11,22,40,.09); }
.studio-page.selected { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.studio-page.dragging { opacity: .45; }
.studio-thumb {
  aspect-ratio: .72;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--border);
}
.studio-thumb img { width: 100%; height: 100%; object-fit: contain; }
.studio-thumb.blank span { font-size: 2.4rem; color: var(--muted); }
.studio-page-meta { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: center; margin-top: 8px; }
.studio-select { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; font-size: .82rem; }
.studio-select input { accent-color: var(--brand); }
.studio-source { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .76rem; }
.studio-page-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 7px; }
.studio-page-actions button {
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}
.studio-page-actions button:hover { border-color: var(--brand); }
.studio-export { justify-content: flex-end; margin-top: 16px; }
.studio-export .field { flex: 1 1 280px; margin: 0; }
.studio-export .button { min-width: 160px; }

@media (max-width: 700px) {
  .studio-toolbar { position: static; }
  .toolbar-spacer { display: none; }
  .studio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; gap: 10px; }
  .studio-loaders > *, .studio-toolbar > .button { flex: 1 1 auto; }
  .studio-export { align-items: stretch; }
  .studio-export .button { width: 100%; }
}
.tool-categories { display: grid; gap: 48px; margin-top: 30px; }
.tool-category .section-header { margin-bottom: 16px; }
.tool-category .section-header h2 { font-size: 1.35rem; }

/* v1.0.1 interface refinement */
body {
  background:
    radial-gradient(circle at 8% -10%, color-mix(in srgb, var(--brand-soft) 70%, transparent) 0, transparent 28rem),
    var(--bg);
}
.site-header { box-shadow: 0 1px 0 rgba(20,31,49,.02); }
.header-inner { min-height: 72px; }
.brand-mark {
  background: linear-gradient(145deg, #0b1628, #263956);
  box-shadow: 0 6px 18px rgba(11,22,40,.18);
}
.site-nav a[aria-current="page"] {
  color: var(--brand-strong);
  background: var(--brand-soft);
  font-weight: 800;
}
.button, .tool-card, .contact-card, .category-nav a, .icon-button, .lang-link, .site-nav a {
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background-color .16s ease, color .16s ease;
}
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 64%, transparent);
}
.hero::after {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  right: -180px;
  top: 30px;
  border-radius: 50%;
  background: var(--brand-soft);
  filter: blur(1px);
  opacity: .54;
  z-index: -1;
}
.promise-panel { box-shadow: 0 20px 55px rgba(20,31,49,.10); }
.promise-top { background: linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--brand-soft) 28%, var(--surface))); }
.search-box { max-width: none; }
.search-box input { box-shadow: 0 8px 24px rgba(20,31,49,.04); }
.tool-card { position: relative; overflow: hidden; }
.tool-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--brand);
  opacity: 0;
  transition: opacity .16s ease;
}
.tool-card:hover::before { opacity: 1; }
.tool-card:hover .card-link { transform: translateX(3px); }
.tool-card .card-link { display: inline-block; transition: transform .16s ease; }
.page-hero { border-bottom: 1px solid color-mix(in srgb, var(--border) 58%, transparent); }
.tool-page-hero { padding: 40px 0 24px; }
.tool-page-hero h1 { font-size: clamp(2rem, 4vw, 3.25rem); }
.tool-page-hero .lede { margin-top: 12px; }
.tool-page-hero .badge-row { margin-top: 16px; }
.tool-shell { margin-top: 28px; }
.tool-panel { box-shadow: 0 16px 45px rgba(20,31,49,.08); }
.tool-panel-header { background: color-mix(in srgb, var(--surface-2) 48%, var(--surface)); }

.category-nav {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 14px 0 4px;
  scrollbar-width: thin;
  scroll-padding-inline: 12px;
}
.category-nav a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 750;
}
.category-nav a:hover { color: var(--text); border-color: var(--brand); transform: translateY(-1px); }
.category-nav small {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--text);
  font-size: .74rem;
}
.category-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.category-heading > div { min-width: 0; }
.back-to-top { color: var(--muted); font-size: .84rem; text-decoration: none; white-space: nowrap; }
.back-to-top:hover { color: var(--brand-strong); }
.tool-category { scroll-margin-top: 96px; }

.contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.contact-card {
  min-width: 0;
  min-height: 180px;
  padding: 24px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(20,31,49,.05);
}
.contact-card:hover { transform: translateY(-3px); border-color: var(--brand); box-shadow: var(--shadow); }
.contact-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 1.35rem;
  font-weight: 900;
}
.contact-icon.threads { background: var(--text); color: var(--bg); }
.contact-content { min-width: 0; display: grid; gap: 7px; }
.contact-content .category { color: var(--brand-strong); font-size: .78rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.contact-content strong { overflow-wrap: anywhere; font-size: 1.13rem; line-height: 1.25; }
.contact-content > span:last-child { color: var(--muted); font-size: .92rem; }
.contact-arrow { color: var(--muted); font-size: 1.25rem; }
.contact-note {
  margin-top: 20px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.contact-note strong { display: block; margin-bottom: 4px; }
.contact-note p { margin: 0; color: var(--muted); }

@media (max-width: 760px) {
  .site-header { position: sticky; }
  .header-inner { min-height: auto; padding: 10px 14px; flex-wrap: wrap; gap: 8px 12px; }
  .brand { flex: 1 1 auto; }
  .brand > span:last-child { font-size: .94rem; }
  .header-actions { flex: 0 0 auto; }
  .site-nav {
    order: 3;
    flex: 1 0 100%;
    overflow-x: auto;
    padding-top: 4px;
    border-top: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
    scrollbar-width: none;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { flex: 0 0 auto; min-height: 36px; padding: 6px 10px; font-size: .86rem; }
  .header-actions { display: contents; }
  .lang-link, .icon-button { order: 2; }
  .hero { padding-top: 54px; }
  .tool-page-hero { padding-top: 30px; }
  .category-heading { align-items: start; }
  .back-to-top { display: none; }
  .contact-grid { grid-template-columns: 1fr; }
  .contact-card { min-height: 150px; padding: 20px; }
}

@media (max-width: 430px) {
  .brand-mark { width: 31px; height: 31px; border-radius: 9px; }
  .lang-link, .icon-button { min-height: 36px; }
  .contact-card { grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; }
  .contact-icon { width: 42px; height: 42px; border-radius: 12px; }
}
@media (max-width: 760px) { .site-nav { display: flex; } }
