/* Site-wide styles on top of common-min.css (shared with onlinedocscanner.com):
   Material 3 theme, icon font, top bar, navigation drawer, footer, privacy dialog, map,
   articles, content pages and RTL. */

/* ---------- Material 3 theme (Google GM3 baseline: blue primary, neutral surfaces) ---------- */
html[data-theme="light"] {
    --bg-color: #f0f4f9;
    --surface-color: #ffffff;
    --surface-container-low-color: #f0f4f9;
    --surface-container-color: #e9eef6;
    --surface-container-high-color: #dde3ea;
    --primary-color: #0b57d0;
    --on-primary-color: #ffffff;
    --primary-container-color: #d3e3fd;
    --on-primary-container-color: #041e49;
    --secondary-container-color: #c2e7ff;
    --on-secondary-container-color: #001d35;
    --text-color: #1f1f1f;
    --text-color-secondary: #444746;
    --outline-color: #747775;
    --outline-variant-color: #c4c7c5;
    --divider-color: #e1e3e1;
    --error-color: #b3261e;
    --inverse-surface-color: #303030;
    --inverse-on-surface-color: #f2f2f2;
    --shadow-soft: 0 1px 2px rgba(31,31,31,.06), 0 4px 16px rgba(11,87,208,.06);
    color-scheme: light;
}
html[data-theme="dark"] {
    --bg-color: #131314;
    --surface-color: #1e1f20;
    --surface-container-low-color: #282a2c;
    --surface-container-color: #333537;
    --surface-container-high-color: #3c3e40;
    --primary-color: #a8c7fa;
    --on-primary-color: #062e6f;
    --primary-container-color: #0842a0;
    --on-primary-container-color: #d3e3fd;
    --secondary-container-color: #004a77;
    --on-secondary-container-color: #c2e7ff;
    --text-color: #e3e3e3;
    --text-color-secondary: #c4c7c5;
    --outline-color: #8e918f;
    --outline-variant-color: #444746;
    --divider-color: #333537;
    --error-color: #f2b8b5;
    --inverse-surface-color: #e3e3e3;
    --inverse-on-surface-color: #303030;
    --shadow-soft: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
    color-scheme: dark;
}
body { font-optical-sizing: auto; line-height: 1.5; }
::selection { background: var(--primary-container-color); color: var(--on-primary-container-color); }

/* ---------- Icons (self-hosted Material Symbols subset, see fonts.css) ---------- */
.material-symbols-rounded {
    font-family: 'Material Symbols Rounded';
    font-weight: normal; font-style: normal; font-size: 24px; line-height: 1;
    /* A fixed 1em box: until the font arrives the ligature is still a long word ("dark_mode"), which would push things around. */
    width: 1em; height: 1em; overflow: hidden; flex-shrink: 0;
    letter-spacing: normal; text-transform: none; display: inline-block; white-space: nowrap;
    word-wrap: normal; direction: ltr; -webkit-font-feature-settings: 'liga'; font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased; font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* Line breaking: Korean wraps between words, Japanese between phrases (Chinese may break between characters). */
:lang(ko) body { word-break: keep-all; overflow-wrap: break-word; }
:lang(ja) :is(h1, h2, h3, .ts-home__lead, .tool-start__lead) { word-break: auto-phrase; }
/* Pinch-zoom stays available; this only removes the double-tap zoom delay on controls. */
a, button, label, summary, input, select, textarea, [role="button"] { touch-action: manipulation; }
[hidden] { display: none !important; }
html.pd-open { overflow: hidden; }
img, svg, canvas, video { max-width: 100%; }

.skip-link {
    position: fixed; left: 12px; top: -60px; z-index: 2000; padding: 10px 16px; border-radius: 999px;
    background: var(--primary-color); color: var(--on-primary-color); font-weight: 600; text-decoration: none; transition: top .2s;
}
.skip-link:focus { top: 12px; }
.main-anchor { position: relative; height: 0; outline: none; }
:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }

/* ---------- Header (static: scrolls away with the page) ---------- */
#global-header { position: relative; z-index: 900; height: 64px; padding: 0 8px; background: var(--bg-color); border-bottom: 0; }
#app { padding-top: 0; min-height: calc(100vh - 64px); min-height: calc(100dvh - 64px); }
.main-content { min-height: 0; }
.header-section.header-left { gap: 4px; }
.header-center { display: flex; align-items: center; }
#global-header h1 { color: var(--text-color); font-size: clamp(1.125rem, 2.6vw, 1.375rem); font-weight: 600; letter-spacing: -.01em; }
.header-logo { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; }
.header-logo img { width: 32px; height: 32px; display: block; }
.header-logo:hover { background: var(--surface-container-low-color); }
@media (min-width: 600px) { .header-logo { display: inline-flex; } }
.header-btn { border-radius: 999px; color: var(--text-color-secondary); }
.header-btn:hover { background: var(--surface-container-color); color: var(--text-color); }
.dropdown-content { min-width: 240px; max-height: min(80vh, 640px); border: 0; border-radius: 16px; padding: 8px; background: var(--surface-color); box-shadow: 0 8px 28px rgba(0,0,0,.16); overflow-y: auto; }
@media (min-width: 600px) { .dropdown-content { width: 440px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; align-content: start; } }
@media (min-width: 900px) { .dropdown-content { width: 620px; grid-template-columns: repeat(3, 1fr); } }
/* Closed = not rendered at all: the language names (Русский, Tiếng Việt, Čeština…) would otherwise make
   every page download the Cyrillic, Vietnamese and Latin Extended font files. */
.dropdown:not(.active) .dropdown-content { display: none; }
.dropdown.active .dropdown-content { animation: dropdown-in .18s ease-out; }
@keyframes dropdown-in { from { opacity: 0; transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .dropdown.active .dropdown-content { animation: none; } }
.dropdown-item a { margin: 0; padding: 10px 14px; border-radius: 999px; font-size: .9375rem; white-space: nowrap; }
.dropdown-item a:hover { background: var(--surface-container-low-color); }
.dropdown-item.active { background: none; }
.dropdown-item.active a { background: var(--secondary-container-color); color: var(--on-secondary-container-color); font-weight: 600; }

/* ---------- Navigation drawer (Material 3 modal drawer) ---------- */
#mobile-menu {
    top: 0; left: 0; width: 320px; max-width: 86vw; height: 100vh; height: 100dvh; padding: 0;
    display: flex; flex-direction: column; overflow: hidden; z-index: 1002; border: 0; border-radius: 0;
    background: var(--surface-color); transform: translateX(-105%); visibility: hidden; box-shadow: none;
    transition: transform .3s cubic-bezier(.2, 0, 0, 1), visibility 0s linear .3s, box-shadow .3s;
}
#mobile-menu.active { left: 0; transform: none; visibility: visible; box-shadow: 0 0 48px rgba(0,0,0,.2); transition: transform .3s cubic-bezier(.2, 0, 0, 1), visibility 0s, box-shadow .3s; }
.menu-overlay { top: 0; z-index: 1001; background: rgba(0,0,0,.32); }
html.menu-open { overflow: hidden; }
.menu-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 64px; padding: 8px 8px 8px 20px; }
.menu-brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--text-color); text-decoration: none; font-weight: 600; font-size: 1.0625rem; line-height: 1.2; }
.menu-brand img { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px; }
.menu-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 12px 12px; }
.menu-section { margin: 0; padding: 4px 0; }
.menu-section + .menu-section { border-top: 1px solid var(--divider-color); }
.menu-title { margin: 0; padding: 14px 16px 8px; color: var(--text-color-secondary); font-size: .875rem; font-weight: 600; letter-spacing: .1px; text-transform: none; }
.menu-item { margin: 0; border-radius: 999px; }
.menu-item:hover { background: none; }
.menu-item a { min-height: 52px; gap: 12px; padding: 0 20px 0 16px; border-radius: 999px; color: var(--text-color-secondary); font-size: .9375rem; font-weight: 500; line-height: 1.25; transition: background-color .15s, color .15s; }
.menu-item a:hover { background: var(--surface-container-low-color); color: var(--text-color); }
.menu-icon { flex: 0 0 auto; width: 24px; height: 24px; display: grid; place-items: center; color: inherit; }
.menu-icon .material-symbols-rounded { font-size: 24px; }
.menu-label { flex: 1; min-width: 0; }
.menu-item a[aria-current="page"] { background: var(--secondary-container-color); color: var(--on-secondary-container-color); font-weight: 600; }
.menu-item a[aria-current="page"] .material-symbols-rounded { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.menu-foot { display: flex; align-items: center; gap: 10px; margin: 0; padding: 16px 24px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--divider-color); font-size: .8125rem; color: var(--text-color-secondary); }
.menu-foot .material-symbols-rounded { font-size: 18px; color: var(--primary-color); }
@media (prefers-reduced-motion: reduce) { #mobile-menu, #mobile-menu.active { transition: none; } }

/* ---------- Footer: copyright + contact + legal ---------- */
#footer { padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); background: var(--bg-color); border-top: 1px solid var(--divider-color); }
.footer-bar { max-width: 1120px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; }
.footer-bar .footer-copyright { margin: 0; padding: 0; border: 0; font-size: .875rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 24px; margin: 0; }
.footer-links .footer-link { display: inline-flex; align-items: center; min-height: 40px; color: var(--text-color-secondary); font-size: .875rem; }
.footer-links .footer-link:hover { color: var(--primary-color); }
.footer-bar .footer-copyright { color: var(--text-color-secondary); }
@media (max-width: 599px) { .footer-bar { flex-direction: column-reverse; justify-content: center; text-align: center; } .footer-links { justify-content: center; } }

/* No hover "lift" anywhere (also neutralises the unused document-scanner rules in common-min.css) */
.cta-button:hover, .adjust-control:hover, .effect-card:hover, .paint-tool:hover, .download-card:hover { transform: none; }

/* ---------- Privacy dialog ---------- */
.pd {
    width: min(480px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 0; border: 0; border-radius: 28px;
    background: var(--surface-color); color: var(--text-color); box-shadow: 0 16px 48px rgba(0,0,0,.24);
}
.pd::backdrop { background: rgba(0,0,0,.32); }
.pd[open] { animation: pdIn .2s ease-out; }
@keyframes pdIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.pd__card { padding: 24px; }
.pd__icon { width: 48px; height: 48px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 16px; background: var(--primary-container-color); color: var(--on-primary-container-color); }
.pd__title { margin: 0 0 8px; font-size: 1.375rem; line-height: 1.3; text-align: center; }
.pd__lead { margin: 0 0 16px; color: var(--text-color-secondary); line-height: 1.5; text-align: center; }
.pd__facts { margin: 0 0 16px; display: grid; gap: 10px; }
.pd__facts > div { padding: 12px 16px; border-radius: 16px; background: var(--surface-container-low-color); }
.pd__facts dt { margin: 0 0 2px; font-size: .8125rem; font-weight: 600; color: var(--text-color-secondary); }
.pd__facts dd { margin: 0; line-height: 1.45; font-size: .9375rem; }
.pd__facts small { color: var(--text-color-secondary); }
.pd__note { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; font-size: .875rem; line-height: 1.45; color: var(--text-color-secondary); }
.pd__note .material-symbols-rounded { font-size: 20px; color: var(--primary-color); }
.pd__links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 12px; font-size: .875rem; }
.pd__links a, .pd__service a { color: var(--primary-color); }
.pd__remember { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: .9375rem; cursor: pointer; }
.pd__remember input { width: 18px; height: 18px; accent-color: var(--primary-color); }
.pd__actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pd__services { display: grid; gap: 8px; margin-bottom: 16px; }
.pd__service { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-radius: 20px; background: var(--surface-container-low-color); cursor: pointer; }
.pd__service-text { flex: 1; min-width: 0; display: grid; gap: 4px; }
.pd__service-text small { color: var(--text-color-secondary); line-height: 1.4; }
.pd__service-provider { font-size: .75rem; }
.pd [hidden] { display: none !important; }

/* ---------- Map ---------- */
.tsmap {
    position: relative; overflow: hidden; min-height: 240px; border-radius: 16px; outline: none;
    background: #e9eef6; touch-action: none; user-select: none; -webkit-user-select: none; isolation: isolate;
}
[data-theme="dark"] .tsmap { background: #1b2229; }
.tsmap:focus-visible { box-shadow: 0 0 0 3px var(--primary-color); }
.tsmap.is-loaded { cursor: grab; }
.tsmap.is-grabbing { cursor: grabbing; }
.tsmap__tiles, .tsmap__markers { position: absolute; inset: 0; }
.tsmap__tile { position: absolute; left: 0; top: 0; max-width: none; opacity: 0; transform-origin: 0 0; transition: opacity .2s; pointer-events: none; image-rendering: auto; }
.tsmap__tile.is-loaded { opacity: 1; }
[data-theme="dark"] .tsmap__tile { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.8); }
.tsmap__markers { z-index: 3; pointer-events: none; }
.tsmap__marker { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: auto; }
.tsmap__marker:focus-visible .tsmap__pin { filter: drop-shadow(0 0 0 var(--primary-color)) drop-shadow(0 0 3px var(--primary-color)); }
.tsmap__pin { position: absolute; left: -16px; top: -42px; width: 32px; height: 42px; cursor: pointer; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); transition: transform .15s; transform-origin: 50% 100%; }
.tsmap__pin svg { display: block; width: 100%; height: 100%; }
.tsmap__pin-body { fill: #e53935; stroke: #fff; stroke-width: 2; }
.tsmap__pin-dot { fill: #fff; }
.tsmap__pin-label { position: absolute; left: 0; right: 0; top: 7px; text-align: center; color: #e53935; font: 700 11px/17px var(--md-ref-typeface-plain); }
.tsmap__marker.is-muted .tsmap__pin-body { fill: #78909c; }
.tsmap__marker.is-muted .tsmap__pin-label { color: #546e7a; }
.tsmap__marker.is-active { z-index: 2; }
.tsmap__marker.is-active .tsmap__pin { transform: scale(1.2); }
.tsmap__marker.is-active .tsmap__pin-body { fill: #0b57d0; }
.tsmap__marker.is-active .tsmap__pin-label { color: #0b57d0; }
.tsmap__marker.is-draggable .tsmap__pin { cursor: grab; }
.tsmap__marker.is-dragging .tsmap__pin { cursor: grabbing; transform: scale(1.25) translateY(-6px); }
.tsmap__cone {
    position: absolute; left: -40px; top: -40px; width: 80px; height: 80px; pointer-events: none; border-radius: 50%;
    background: conic-gradient(from -30deg, rgba(229,57,53,.45) 0deg 60deg, transparent 60deg);
}
.tsmap__marker.is-active .tsmap__cone { background: conic-gradient(from -30deg, rgba(11,87,208,.4) 0deg 60deg, transparent 60deg); }
.tsmap__controls { position: absolute; z-index: 4; right: 10px; top: 10px; display: flex; flex-direction: column; overflow: hidden; border-radius: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.2), 0 4px 12px rgba(0,0,0,.1); background: var(--surface-color); }
.tsmap__btn { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: var(--text-color); cursor: pointer; }
.tsmap__btn + .tsmap__btn { border-top: 1px solid var(--outline-variant-color); }
.tsmap__btn:hover { background: var(--surface-container-low-color); }
.tsmap__btn:disabled { opacity: .35; cursor: default; }
.tsmap__attr { position: absolute; z-index: 4; right: 0; bottom: 0; padding: 2px 8px; border-top-left-radius: 8px; background: rgba(255,255,255,.82); font-size: 11px; line-height: 16px; }
.tsmap__attr a { color: #1a1c1e; text-decoration: none; }
.tsmap__attr a:hover { text-decoration: underline; }
.tsmap:not(.is-loaded) .tsmap__controls, .tsmap:not(.is-loaded) .tsmap__attr { display: none; }
.tsmap__hint {
    position: absolute; z-index: 5; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: calc(100% - 32px);
    padding: 10px 16px; border-radius: 12px; background: rgba(0,0,0,.72); color: #fff; font-size: .875rem; text-align: center;
    opacity: 0; pointer-events: none; transition: opacity .2s;
}
.tsmap__hint.is-visible { opacity: 1; }
.tsmap__gate { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; padding: 16px; background:
    radial-gradient(circle at 20% 30%, rgba(11,87,208,.1), transparent 40%), radial-gradient(circle at 80% 70%, rgba(30,142,62,.1), transparent 45%),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(0,0,0,.05) 39px 40px), repeating-linear-gradient(90deg, transparent 0 39px, rgba(0,0,0,.05) 39px 40px), var(--surface-container-low-color); }
.tsmap__gate[hidden] { display: none; }
.tsmap__gate-card { max-width: 340px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.tsmap__gate-card > .material-symbols-rounded { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: var(--primary-container-color); color: var(--on-primary-container-color); }
.tsmap__gate-card p { margin: 0; font-size: .9375rem; line-height: 1.45; color: var(--text-color-secondary); }
.tsmap__gate-link { padding: 4px 8px; border: 0; background: none; color: var(--primary-color); font: 500 .8125rem var(--md-ref-typeface-plain); cursor: pointer; text-decoration: underline; }

/* ---------- Content pages (privacy, terms, contact, 404) ---------- */
.doc-section { padding: 40px 16px 72px; }
.doc-page { padding: 48px; border: 0; border-radius: 28px; background: var(--surface-color); }
.doc-page h2 { color: var(--text-color); font-size: 1.25rem; font-weight: 600; border-bottom: 0; padding-bottom: 0; margin: 2.25rem 0 .75rem; }
.doc-page h1 { margin: 0 0 8px; font-size: 1.75rem; line-height: 1.25; }
.doc-page h3 { margin: 1.5rem 0 .5rem; font-size: 1.0625rem; }
.doc-meta { margin: 0 0 24px; font-size: .875rem; color: var(--text-color-secondary); }
.doc-page table { width: 100%; border-collapse: collapse; margin: 0 0 1.25rem; font-size: .9375rem; }
.doc-page th, .doc-page td { padding: 10px 12px; border-bottom: 1px solid var(--outline-variant-color); text-align: start; vertical-align: top; line-height: 1.5; }
.doc-page th { font-size: .8125rem; color: var(--text-color-secondary); font-weight: 700; }
.doc-table-wrap { overflow-x: auto; margin: 0 0 1.25rem; }
.doc-table-wrap table { margin: 0; min-width: 520px; }

/* ---------- Article under every tool: what, why, how (with screenshots), FAQ ---------- */
.article-section { padding: 48px 20px 64px; background: transparent; }
.article-container { max-width: 980px; }
.tool-article { padding: 48px; border-radius: 28px; background: var(--surface-color); border: 0; }
.tool-article h2 { margin: 48px 0 14px; color: var(--text-color); font-size: 1.5rem; font-weight: 600; line-height: 1.3; letter-spacing: -.015em; }
.tool-article > h2:first-child { margin-top: 0; }
.tool-article p { margin: 0 0 14px; color: var(--text-color); font-size: 1rem; line-height: 1.7; }
.tool-article a { color: var(--primary-color); }
.check-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.check-list li { display: flex; gap: 12px; align-items: flex-start; line-height: 1.6; }
.check-list .material-symbols-rounded { flex: 0 0 auto; margin-top: 1px; font-size: 22px; color: var(--primary-color); font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.howto { display: grid; gap: 20px; margin: 0; padding: 0; list-style: none; }
.howto-step { display: grid; gap: 16px; align-items: center; padding: 20px; border-radius: 24px; background: var(--surface-container-low-color); }
@media (min-width: 860px) { .howto-step { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 28px; padding: 24px; } }
.howto-text { display: flex; gap: 14px; align-items: flex-start; }
.howto-num { flex: 0 0 auto; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--primary-color); color: var(--on-primary-color); font-weight: 600; }
.howto-text h3 { margin: 4px 0 6px; font-size: 1.125rem; line-height: 1.35; color: var(--text-color); }
.tool-article .howto-text p { margin: 0; color: var(--text-color-secondary); font-size: .9375rem; line-height: 1.6; }
.howto-shot { margin: 0; overflow: hidden; border-radius: 16px; background: var(--surface-color); box-shadow: var(--shadow-soft); }
.howto-shot img { display: block; width: 100%; height: auto; }
.faq h3 { margin: 24px 0 6px; font-size: 1.0625rem; line-height: 1.4; color: var(--text-color); }
.faq h3:first-child { margin-top: 0; }
.tool-article .faq p { margin: 0; color: var(--text-color-secondary); }
.article-block { margin-top: 40px; }
.article-block > h2 { margin: 0 0 16px; color: var(--text-color); font-size: 1.25rem; font-weight: 600; }
.related-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.related-tools a {
    display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 16px 10px 12px; border-radius: 20px;
    background: var(--surface-color); color: var(--text-color); text-decoration: none; font-weight: 500; font-size: .9375rem; line-height: 1.3;
    border: 0; transition: background-color .2s;
}
.related-tools a:hover { background: var(--secondary-container-color); color: var(--on-secondary-container-color); }
.related-tools .material-symbols-rounded { flex: 0 0 auto; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--primary-container-color); color: var(--on-primary-container-color); }

/* ---------- Legal page (Terms and Privacy) ---------- */
.legal-list { margin: 0 0 1.5rem; padding-inline-start: 1.75rem; }
.legal-list li { margin-bottom: .875rem; padding-inline-start: .25rem; }
.legal-list li::marker { color: var(--primary-color); font-weight: 700; }
.legal .doc-lead { margin-bottom: 2rem; }
.legal-contact { padding-top: 1.25rem; border-top: 1px solid var(--outline-variant-color); color: var(--text-color-secondary); }
.legal-back { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 20px 0 16px; border-radius: 999px; background: var(--secondary-container-color); color: var(--on-secondary-container-color); font-weight: 500; text-decoration: none; }
.legal-back:hover { filter: brightness(.97); }
.link-button { padding: 0; border: 0; background: none; color: var(--primary-color); font: inherit; text-decoration: underline; cursor: pointer; }

/* ---------- RTL ---------- */
[dir="rtl"] #mobile-menu { left: auto; right: 0; transform: translateX(105%); }
[dir="rtl"] #mobile-menu.active { left: auto; right: 0; transform: none; box-shadow: -16px 0 48px rgba(0,0,0,.2); }
[dir="rtl"] .dropdown-content { right: auto; left: 0; }
/* Right-to-left pages: values and typed text keep the direction of their own content, so
   "© 2026 Alex Sample" or "1/250 s · f/1.8 · ISO 50" are not reordered. */
[dir="rtl"] :is(input[type="text"], input[type="search"], textarea, .kv dd, .kv-tile__value, .meta-table td, .file-item__name, .file-item__meta) { unicode-bidi: plaintext; }
[dir="rtl"] .tsmap__controls { right: auto; left: 10px; }

@media (max-width: 768px) {
    .doc-section { padding: 16px 12px 40px; }
    .doc-page { padding: 28px 20px; border-radius: 24px; }
    .article-section { padding: 32px 12px 40px; }
    .tool-article { padding: 28px 18px; border-radius: 24px; }
    .tool-article h2 { margin-top: 36px; font-size: 1.25rem; }
    .howto-step { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .pd[open] { animation: none; }
    .skip-link, .tsmap__tile { transition: none; }
}

/* ---------- Contact & 404 ---------- */
.contact-page { max-width: 560px; text-align: center; }
.contact-icon { width: 64px; height: 64px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 20px; background: var(--primary-container-color); color: var(--on-primary-container-color); }
.contact-icon .material-symbols-rounded { font-size: 32px; }
.doc-page .contact-title { margin: 0 0 8px; font-size: 1.5rem; color: var(--text-color); }
.contact-page .contact-lead { margin: 0 0 24px; color: var(--text-color-secondary); }
.doc-page a.contact-mail { max-width: 100%; color: var(--on-primary-color); text-decoration: none; overflow-wrap: normal; }
.contact-mail span:last-child { overflow: hidden; text-overflow: ellipsis; }
.contact-page .contact-note { margin: 20px 0 0; font-size: .875rem; color: var(--text-color-secondary); }
.notfound__lead { margin: 32px 0 0; color: var(--text-color-secondary); }
.notfound__more { margin-top: 12px; }
.notfound { border-radius: 28px; padding: 56px 32px; }
.notfound__cta { min-height: 48px; padding: 0 24px; font-weight: 500; }
.notfound__more a { background: var(--surface-container-low-color); }
