:root {
  color-scheme: light;
  --ink: #17202f;
  --muted: #566479;
  --faint: #eef2f7;
  --line: #dce3ec;
  --surface: #ffffff;
  --surface-soft: #f5f7fb;
  --primary: #2459dc;
  --primary-dark: #1743b3;
  --primary-soft: #eaf0ff;
  --success: #197a52;
  --shadow: 0 18px 50px rgba(21, 40, 75, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--surface-soft);
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.skip-link { position: fixed; top: -100px; left: 12px; z-index: 50; padding: 12px 18px; color: white; background: var(--primary-dark); border-radius: 10px; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 28px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.brand-mark {
  display: block;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
}
.header-actions { display: flex; align-items: center; gap: 22px; }
.header-nav { display: flex; gap: 24px; color: var(--muted); font-size: 0.94rem; white-space: nowrap; }
/* CJK: break Japanese at phrase boundaries and keep Korean words whole. */
/* Long words (German compounds, a Japanese phrase on a phone) hyphenate or wrap instead of overflowing. */
h1, h2, h3 { overflow-wrap: break-word; }
:lang(de) h1, :lang(de) h2, :lang(de) h3 { hyphens: auto; }
:lang(ja) h1, :lang(ja) h2, :lang(ja) h3 { word-break: auto-phrase; overflow-wrap: anywhere; }
:lang(ko) { word-break: keep-all; overflow-wrap: anywhere; }
.lang-button { display: grid; width: 38px; height: 38px; place-items: center; padding: 0; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 50%; }
.lang-button[hidden] { display: none; }
.lang-button:hover, .lang-button:focus-visible { color: var(--primary); border-color: #a8bff8; }
.lang-button svg { width: 19px; height: 19px; }
.lang-dialog { width: min(440px, calc(100% - 32px)); padding: 20px; color: var(--ink); background: var(--surface); border: 1px solid #b9c8e2; border-radius: 16px; box-shadow: 0 18px 55px rgba(21, 40, 75, .2); }
.lang-dialog::backdrop { background: rgba(23, 32, 47, .35); }
.lang-dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.lang-dialog h2 { margin: 0; font-size: 1.1rem; }
.lang-close { width: 36px; height: 36px; color: var(--muted); background: transparent; border: 0; border-radius: 50%; font-size: 1.4rem; line-height: 1; }
.lang-close:hover { color: var(--ink); background: var(--surface-soft); }
.lang-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.lang-list a { display: block; padding: 11px 14px; border: 1px solid var(--line); border-radius: 11px; font-weight: 600; }
.lang-list a:hover, .lang-list a:focus-visible { color: var(--primary); border-color: #a8bff8; }
.lang-list a[aria-current] { color: var(--primary-dark); background: var(--primary-soft); border-color: var(--primary); }
.lang-suggest, .lang-error { position: fixed; bottom: 18px; left: 50%; z-index: 19; display: flex; align-items: center; gap: 4px; max-width: calc(100% - 32px); padding: 5px 5px 5px 18px; color: #fff; background: var(--ink); border-radius: 999px; box-shadow: 0 14px 40px rgba(21, 40, 75, .28); font-size: .9rem; transform: translateX(-50%); }
.lang-suggest a { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lang-suggest button, .lang-error button { flex: none; width: 34px; height: 34px; color: #fff; background: transparent; border: 0; border-radius: 50%; font-size: 1.25rem; line-height: 1; }
.lang-suggest button:hover, .lang-error button:hover { background: rgba(255, 255, 255, .14); }
.legal-note { padding: 12px 16px; color: var(--ink); background: var(--primary-soft); border-radius: 12px; font-size: .92rem; }
.legal-note a { color: var(--primary-dark); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
html[lang="en"] .legal-note { display: none; }
.header-nav a:hover, .header-nav a:focus-visible { color: var(--primary); }

.hero, .page-wrap { max-width: 1180px; margin: 0 auto; padding: 44px 28px 84px; }
.hero { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 68px; align-items: center; min-height: 520px; }
.ad-rail-layout { display: grid; grid-template-columns: minmax(112px, 150px) minmax(0, 1180px) minmax(112px, 150px); gap: 18px; align-items: start; width: min(100%, 1516px); margin: 0 auto; }
.page-main { min-width: 0; }
.ad-rail { min-width: 0; padding-top: 48px; }
.ad-rail .ad-slot { position: sticky; top: 24px; min-height: 280px; margin: 0; padding: 12px 6px; text-align: center; overflow-wrap: anywhere; font-size: .67rem; }
.ad-rail .configured-ad { min-height: 280px; }
.eyebrow { color: var(--primary); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 18px; font-size: clamp(2.5rem, 6vw, 5.1rem); line-height: 0.99; letter-spacing: -0.065em; }
h2 { margin-bottom: 10px; font-size: clamp(1.65rem, 3vw, 2.2rem); letter-spacing: -0.04em; }
h3 { margin-bottom: 8px; font-size: 1.08rem; letter-spacing: -0.02em; }
.hero-copy { max-width: 620px; }
.hero-copy > p:not(.eyebrow) { max-width: 550px; margin-bottom: 26px; color: var(--muted); font-size: 1.1rem; }
.gradient-text { color: var(--primary); }
.hero-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.privacy-note { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.84rem; }
.privacy-note::before { content: "✓"; display: grid; width: 20px; height: 20px; place-items: center; color: var(--success); background: #ddf5e9; border-radius: 50%; font-weight: 800; }
.hero-art { position: relative; min-height: 360px; }
.hero-art::before { content: ""; position: absolute; inset: 6% 0 0 13%; background: radial-gradient(circle at 50% 42%, #dbe7ff, transparent 66%); }
.floating-card { position: absolute; display: flex; align-items: center; gap: 15px; padding: 18px; background: rgba(255,255,255,0.94); border: 1px solid rgba(220,227,236,0.9); border-radius: 18px; box-shadow: var(--shadow); }
.floating-card strong { display: block; font-size: 0.96rem; }
.floating-card small { color: var(--muted); }
.floating-card.one { top: 20px; left: 2%; transform: rotate(-5deg); }
.floating-card.two { top: 137px; right: 3%; transform: rotate(4deg); }
.floating-card.three { bottom: 12px; left: 22%; transform: rotate(-2deg); }
.mini-icon { display: grid; width: 44px; height: 44px; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 13px; font-size: 1.3rem; }

.search-panel { max-width: 1180px; margin: -8px auto 0; padding: 0 28px 36px; }
.search-box { display: flex; align-items: center; gap: 12px; padding: 13px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 12px 30px rgba(28, 52, 90, 0.05); }
.search-box span { color: var(--muted); font-size: 1.2rem; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.section { max-width: 1180px; margin: 0 auto; padding: 36px 28px 76px; }
.section-heading { display: flex; justify-content: space-between; gap: 18px; align-items: end; margin-bottom: 20px; }
.section-heading p { max-width: 600px; margin-bottom: 0; color: var(--muted); }
.category { margin-top: 34px; }
.category-title { display: flex; align-items: center; gap: 9px; margin-bottom: 15px; font-size: 0.87rem; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; }
.category-title span { color: var(--primary); }
.tool-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tool-card { position: relative; min-height: 154px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 17px; transition: 180ms ease; }
.tool-card:hover, .tool-card:focus-visible { border-color: #a8bff8; box-shadow: 0 12px 28px rgba(39, 84, 177, 0.1); transform: translateY(-2px); }
.tool-card p { margin-bottom: 0; color: var(--muted); font-size: 0.9rem; }
.tool-card .tool-icon { display: grid; width: 36px; height: 36px; margin-bottom: 15px; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 11px; }
.tool-card .soon { position: absolute; top: 18px; right: 18px; color: #8c6b17; background: #fff6d9; border-radius: 99px; padding: 3px 8px; font-size: 0.68rem; font-weight: 700; }
.feature-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding-top: 12px; }
.feature { padding: 22px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,0.7); }
.feature p { margin-bottom: 0; color: var(--muted); font-size: 0.91rem; }
.category-page-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.category-guide { margin-top: 30px; }
.category-guide dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 28px; margin: 0; }
.category-guide dt { margin-top: 12px; font-weight: 750; }
.category-guide dt a { color: var(--primary-dark); text-decoration: underline; text-underline-offset: 3px; }
.category-guide dd { margin: 0; }
.category-guide dd p { margin: 4px 0 0; }
.category-note { margin-top: 30px; padding: 22px; background: rgba(255,255,255,0.7); border: 1px solid var(--line); border-radius: 17px; }
.category-note p { margin-bottom: 0; color: var(--muted); }
.category-note a { text-decoration: underline; text-underline-offset: 3px; }

.page-wrap { padding-top: 28px; }
.breadcrumbs { margin-bottom: 28px; color: var(--muted); font-size: 0.86rem; }
.breadcrumbs a:hover { color: var(--primary); }
.tool-intro { max-width: 740px; margin-bottom: 28px; }
.tool-intro h1 { font-size: clamp(2.25rem, 5vw, 3.8rem); }
.tool-intro > p { color: var(--muted); font-size: 1.05rem; }
.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 22px; align-items: start; }
.tool-panel, .side-panel { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 8px 25px rgba(22, 42, 79, 0.04); }
.side-panel h3 { margin-bottom: 12px; }
.side-panel p { color: var(--muted); font-size: 0.88rem; }
.side-panel + .side-panel { margin-top: 16px; }
.dropzone { display: grid; min-height: 190px; place-items: center; padding: 26px; text-align: center; border: 1.5px dashed #aebdd2; border-radius: 16px; background: #fbfcfe; transition: 150ms ease; }
.dropzone.is-over { background: var(--primary-soft); border-color: var(--primary); }
.dropzone.has-file { min-height: 0; place-items: start; text-align: left; border-style: solid; }
.button.file-picker { position: relative; min-height: 46px; cursor: pointer; }
.file-picker input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-picker:focus-within { outline: 3px solid var(--primary); outline-offset: 3px; }
.file-picker:has(input:disabled) { opacity: 0.45; }
.file-picker input:disabled { cursor: not-allowed; }
.upload-symbol { display: grid; width: 48px; height: 48px; margin: 0 auto 12px; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 15px; font-size: 1.4rem; }
.dropzone strong { display: block; margin-bottom: 4px; }
.dropzone small { color: var(--muted); }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; padding: 0 17px; border: 1px solid transparent; border-radius: 11px; font-weight: 750; transition: 150ms ease; }
.button.primary { color: white; background: var(--primary); }
.button.primary:hover, .button.primary:focus-visible { background: var(--primary-dark); }
.button.secondary { color: var(--ink); background: white; border-color: var(--line); }
.button.secondary:hover, .button.secondary:focus-visible { border-color: #a9bad7; background: #f9fbff; }
.button.compact { padding: .35rem .65rem; font-size: .78rem; margin-left: .45rem; vertical-align: middle; }
.button:disabled { cursor: not-allowed; opacity: 0.45; }
.button.full { width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 20px; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 0.86rem; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; min-height: 43px; padding: 9px 11px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 10px; outline: none; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field textarea { min-height: 150px; resize: vertical; }
.field-help { color: var(--muted); font-size: 0.78rem; }
.toggle { display: inline-flex; align-items: center; gap: 9px; min-height: 43px; color: var(--muted); font-size: 0.87rem; }
.toggle input { width: 18px; height: 18px; accent-color: var(--primary); }
.action-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 20px; }
.status { min-height: 25px; margin-top: 14px; color: var(--muted); font-size: 0.86rem; }
.status.success { color: var(--success); }
.status.error { color: #b03939; }
.processing-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 20px; padding: 14px; background: var(--primary-soft); border-radius: 12px; }
.processing-bar progress { width: min(100%, 180px); }
.processing-bar span { flex: 1; min-width: 110px; }
.preview-card { margin-top: 20px; padding: 18px; background: #f8faff; border: 1px solid #dfe8fb; border-radius: 15px; }
.preview-card h3 { margin-bottom: 12px; }
.preview-frame { display: grid; min-height: 130px; place-items: center; padding: 14px; overflow: hidden; background: repeating-conic-gradient(#f0f3f8 0 25%, white 0 50%) 50% / 18px 18px; border-radius: 11px; }
.preview-frame canvas, .preview-frame img { display: block; max-width: 100%; max-height: 410px; object-fit: contain; }
.preview-frame svg { display: block; width: min(100%, 430px); height: auto; }
.crop-editor { margin-top: 1rem; }
.crop-stage { position: relative; width: fit-content; max-width: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #111827; touch-action: none; }
.crop-stage img { display: block; max-width: 100%; max-height: 56vh; width: auto; height: auto; }
.crop-selection { position: absolute; box-sizing: border-box; min-width: 8px; min-height: 8px; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(15, 23, 42, .48); cursor: move; touch-action: none; }
.crop-selection:focus-visible { outline: 3px solid #8db1ff; outline-offset: 3px; }
.crop-handle { position: absolute; right: 0; bottom: 0; width: 36px; height: 36px; max-width: 100%; max-height: 100%; cursor: nwse-resize; }
.crop-handle::after { content: ''; position: absolute; right: 2px; bottom: 2px; width: 16px; height: 16px; border: 2px solid #fff; border-radius: 50%; background: var(--primary); }
.audio-preview { display: block; width: 100%; margin: 14px 0; }
.metrics { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 14px; }
.metric strong { display: block; font-size: 1.1rem; }
.metric span { color: var(--muted); font-size: 0.78rem; }
.result-text { width: 100%; min-height: 180px; padding: 14px; color: #31405a; background: white; border: 1px solid var(--line); border-radius: 11px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; overflow-wrap: anywhere; }
.related { margin-top: 50px; }
.tool-guide { margin-top: 40px; padding: 25px; background: rgba(255,255,255,.72); border: 1px solid var(--line); border-radius: 17px; }
.tool-guide .section-heading { margin-bottom: 16px; }
.tool-guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tool-guide-grid > div { padding: 15px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.tool-guide-grid h3 { margin-bottom: 6px; font-size: .94rem; }
.tool-guide-grid p { margin-bottom: 0; color: var(--muted); font-size: .9rem; }
.related .tool-grid { grid-template-columns: repeat(3, 1fr); }
.faq-section { margin-top: 50px; }
.faq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.faq-grid details { padding: 15px 17px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.faq-grid summary { cursor: pointer; font-weight: 750; }
.faq-grid p { margin: 10px 0 0; color: var(--muted); font-size: .9rem; }
.ad-slot { display: grid; min-height: 90px; place-items: center; margin: 28px 0; color: #566479; border: 1px dashed #d5dce6; border-radius: 13px; font-size: 0.73rem; letter-spacing: 0.08em; text-transform: uppercase; }
.category > .ad-slot { min-height: 76px; margin: 22px 0 38px; }
.configured-ad { display: block; min-width: 0; padding: 8px 0; }
.configured-ad .ad-label { display: block; margin-bottom: 6px; text-align: center; color: #59677b; font-size: .67rem; }
/* Keep the label and reserved space; collapse only the empty ad, never its container. */
.configured-ad > ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }
.ad-rail .configured-ad { min-height: 600px; }
.notice { padding: 14px 16px; color: #645722; background: #fff9e5; border: 1px solid #f3e4a9; border-radius: 11px; font-size: 0.88rem; }
.coming-soon { padding: 42px 18px; text-align: center; }
.coming-soon .upload-symbol { margin-bottom: 18px; }
.coming-soon p { max-width: 470px; margin: 0 auto 20px; color: var(--muted); }
.qr-result { display: grid; grid-template-columns: 190px 1fr; gap: 22px; align-items: center; }
.qr-result img { width: 190px; height: 190px; padding: 10px; background: white; border-radius: 8px; }
.download-list { display: grid; gap: 9px; margin-top: 14px; }
.download-list a { color: var(--primary); font-weight: 700; font-size: 0.88rem; }
.download-list a:hover { text-decoration: underline; }
.download-item { display: flex; justify-content: space-between; gap: 16px; padding: 12px 13px; color: var(--ink) !important; background: white; border: 1px solid var(--line); border-radius: 10px; }
.download-item strong { color: var(--primary); }
.file-list { display: grid; gap: 9px; margin-top: 18px; }
.file-row { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 12px 13px; background: #f8faff; border: 1px solid var(--line); border-radius: 11px; }
.file-row strong, .file-row span { display: block; }
.file-row > div:not(.file-actions) { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.preview-card code, .download-item span { overflow-wrap: anywhere; }
.file-row span { margin-top: 3px; color: var(--muted); font-size: 0.78rem; }
.file-row[draggable="true"] { cursor: grab; }
.file-row[draggable="true"]:active { cursor: grabbing; }
.file-row.is-dragging { opacity: .5; }
.file-row.is-drag-over { border-color: var(--primary); background: var(--primary-soft); }
.file-drag-handle { flex-shrink: 0; touch-action: none; user-select: none; cursor: grab; }
.pdf-thumbnails-panel { margin-top: 1rem; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcff; }
.pdf-thumbnails-panel h3 { margin-bottom: 10px; font-size: .95rem; }
.pdf-thumbnails { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.pdf-thumbnail { min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.pdf-thumbnail canvas { display: block; width: 100%; height: auto; margin: 0 auto 7px; border: 1px solid #e4eaf4; }
.pdf-thumbnail-controls label, .pdf-thumbnail-controls span { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: .76rem; }
.pdf-thumbnail-controls select { min-width: 0; width: 100%; padding: 4px; font-size: .76rem; }
.file-actions { display: flex; flex-shrink: 0; gap: 5px; }
.icon-button { display: inline-grid; width: 44px; height: 44px; place-items: center; padding: 0; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.icon-button:hover, .icon-button:focus-visible { border-color: #a9bad7; background: #f9fbff; }
.icon-button:disabled { cursor: not-allowed; opacity: 0.35; }
.icon-button.danger { color: #b03939; }

.site-footer { display: flex; justify-content: space-between; gap: 20px; max-width: 1180px; margin: 0 auto; padding: 32px 28px 45px; color: var(--muted); border-top: 1px solid var(--line); font-size: 0.86rem; }
.footer-brand { color: var(--ink); font-size: 1.05rem; }
.footer-brand .brand-mark { width: 26px; height: 26px; }
.site-footer p { margin: 8px 0 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.footer-links a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.footer-links a:hover, .footer-links a:focus-visible { color: var(--primary); }
.footer-note { align-self: end; }
.legal-page { max-width: 880px; }
.legal-page .legal-lead { max-width: 720px; color: var(--muted); font-size: 1.05rem; }
.legal-page h2 { margin-top: 34px; font-size: 1.45rem; }
.legal-page p, .legal-page li { max-width: 760px; color: var(--muted); }
.legal-page ul { padding-left: 1.35rem; }
.legal-page li + li { margin-top: 8px; }
.legal-page .legal-link { display: inline-flex; margin: 4px 0 6px; color: var(--primary); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.contact-card, .consent-card { margin: 18px 0 26px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; }
.contact-card strong { display: block; margin-bottom: 4px; }
.contact-card a { color: var(--primary); font-weight: 750; overflow-wrap: anywhere; }
.consent-card h3 { margin-bottom: 6px; }
.consent-card p { margin-bottom: 14px; font-size: .92rem; }
.consent-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.consent-banner { position: fixed; right: 18px; bottom: 18px; z-index: 20; width: min(520px, calc(100% - 36px)); max-height: calc(100dvh - 36px); overflow-y: auto; padding: 19px; background: var(--surface); border: 1px solid #b9c8e2; border-radius: 16px; box-shadow: 0 18px 55px rgba(21, 40, 75, .2); }
.consent-banner h2 { margin-bottom: 7px; font-size: 1.15rem; }
.consent-banner [hidden] { display: none !important; }
.consent-banner p { margin-bottom: 14px; color: var(--muted); font-size: .9rem; }
.consent-options { display: grid; gap: 9px; margin: 0 0 16px; }
.consent-option { display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: .88rem; }
.consent-option input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); }
.consent-option strong { display: block; color: var(--ink); }
.consent-manage { margin-bottom: 14px; }
.consent-settings-button { border: 0; padding: 0; color: var(--primary); background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.not-found { max-width: 720px; margin: 0 auto; padding: 90px 28px 120px; }
.not-found p { color: var(--muted); }
.noscript-card { max-width: 680px; margin: 80px auto; padding: 30px; background: white; border: 1px solid var(--line); border-radius: 18px; }
.boot-warning { max-width: 680px; margin: 80px auto; padding: 22px; color: #645722; background: #fff9e5; border: 1px solid #f3e4a9; border-radius: 15px; }
.boot-warning strong, .boot-warning span { display: block; }
.boot-warning span { margin-top: 6px; font-size: 0.9rem; }
.boot-warning code { padding: 2px 5px; background: rgba(100, 87, 34, 0.09); border-radius: 4px; }
.seo-fallback { max-width: 900px; margin: 0 auto; padding: 56px 28px 78px; }
.seo-fallback h1 { font-size: clamp(2.2rem, 5vw, 4rem); }
.seo-fallback h2 { margin-top: 34px; }
.seo-fallback p, .seo-fallback li { color: var(--muted); }
.seo-fallback .seo-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 24px 0; }
.seo-fallback .seo-links a { padding: 13px 15px; color: var(--primary); background: white; border: 1px solid var(--line); border-radius: 10px; font-weight: 700; }
.seo-fallback .seo-links a:hover, .seo-fallback .seo-links a:focus-visible { border-color: #a8bff8; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 18px; padding-top: 25px; }
  .hero-art { min-height: 320px; max-width: 600px; width: 100%; margin: 0 auto; }
  /* Three staggered rows so no card covers another once the hero stacks. */
  .floating-card.one { top: 10px; }
  .floating-card.two { top: 115px; }
  .floating-card.three { top: 220px; bottom: auto; }
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .category-page-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-layout { grid-template-columns: 1fr; }
  .side-panel { display: none; }
}
@media (max-width: 1180px) {
  .ad-rail-layout { display: block; width: 100%; }
  .ad-rail { display: none; }
}
@media (max-width: 600px) {
  .site-header { padding: 18px 18px; }
  .header-nav { gap: 13px; font-size: 0.8rem; }
  .header-actions { gap: 12px; }
  .lang-button { width: 34px; height: 34px; }
  .hero, .page-wrap, .section, .search-panel { padding-left: 18px; padding-right: 18px; }
  .hero { min-height: 0; padding-top: 32px; padding-bottom: 50px; }
  h1 { font-size: 3.1rem; }
  .hero-art { min-height: 290px; transform: scale(0.89); transform-origin: top center; margin-bottom: -30px; }
  .floating-card { padding: 13px; gap: 9px; }
  /* Three staggered rows so no card covers another on narrow screens. */
  .floating-card.one { top: 10px; left: 0; }
  .floating-card.two { top: 105px; right: 0; }
  .floating-card.three { top: 200px; bottom: auto; left: 8%; }
  .mini-icon { width: 36px; height: 36px; font-size: 1rem; }
  .tool-grid, .feature-strip, .related .tool-grid, .faq-grid { grid-template-columns: 1fr; }
  .category-page-grid, .seo-fallback .seo-links, .category-guide dl { grid-template-columns: 1fr; }
  .section-heading { display: block; }
  .section-heading p { margin-top: 9px; }
  .tool-panel { padding: 17px; }
  .form-grid, .form-grid.three, .qr-result, .tool-guide-grid { grid-template-columns: 1fr; }
  .qr-result img { width: 170px; height: 170px; }
  .site-footer { display: block; padding-left: 18px; padding-right: 18px; }
.footer-note { margin-top: 24px !important; }
  .consent-banner { right: 12px; bottom: 12px; width: calc(100% - 24px); }
  .file-row { align-items: flex-start; flex-wrap: wrap; }
  #pdf-files .file-actions { width: 100%; justify-content: flex-end; }
}
@media (max-width: 420px) {
  .header-nav a + a { display: none; }
}
