/* ============================================================
   Młotek - licytacje komornicze
   Design system: auction catalogue. Deep green, brass, oxblood.
   ============================================================ */

:root {
  --paper: #F4F5EF;
  --paper-2: #EAEEE4;
  --surface: #FFFFFF;
  --ink: #15201B;
  --muted: #4C5A53;
  --line: #D5DBD0;
  --line-strong: #B7C1B4;

  --green-950: #081A15;
  --green-900: #0E2A22;
  --green-800: #14382D;
  --green-700: #1C4638;
  --green-100: #E1E9DF;

  --brass: #B8892B;
  --brass-dark: #85601C;
  --brass-light: #E7D3A3;
  --brass-soft: #F5EDDA;

  --oxblood: #6E2222;
  --oxblood-soft: #F7E8E3;

  --wash-green: rgba(28, 70, 56, 0.055);
  --wash-brass: rgba(184, 137, 43, 0.05);

  --header-h: 72px;
  --sidebar-w: 288px;
  --radius: 9px;
  --shadow-pop: 0 18px 44px -18px rgba(8, 26, 21, 0.35);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0B1512;
    --paper-2: #101E19;
    --surface: #12211A;
    --ink: #E9EEE7;
    --muted: #A9B8AE;
    --line: #24362C;
    --line-strong: #35493C;

    --green-100: #17291F;
    --brass: #D2A64A;
    --brass-dark: #E0BD72;
    --brass-light: #EAD8AC;
    --brass-soft: #1E1A11;

    --oxblood: #E39A90;
    --oxblood-soft: #2A1613;

    --wash-green: rgba(64, 120, 96, 0.10);
    --wash-brass: rgba(210, 166, 74, 0.05);
    --shadow-pop: 0 20px 50px -18px rgba(0, 0, 0, 0.7);
  }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17.5px;
  line-height: 1.7;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(900px 520px at 6% -8%, var(--wash-green), transparent 62%),
    radial-gradient(820px 520px at 100% 0%, var(--wash-brass), transparent 58%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
::selection { background: var(--brass); color: #10201A; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 3px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--green-900); color: #fff; padding: 10px 16px;
  border-radius: 6px; font-size: 0.9rem; text-decoration: none;
  transition: top 160ms var(--ease-out);
}
.skip-link:focus { top: 10px; }

/* ---------- Header ---------- */
.app-header {
  position: sticky; top: 0; z-index: 60;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 93%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1320px; margin: 0 auto; padding: 0 24px;
  height: var(--header-h);
  display: flex; align-items: center; gap: 22px;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  text-decoration: none; color: var(--ink); flex-shrink: 0;
}
.brand-mark {
  width: 34px; height: 34px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--green-900); color: var(--brass);
  font-family: 'Bodoni Moda', Georgia, serif;
  font-size: 1.2rem; font-weight: 600; line-height: 1;
  border-radius: 6px; padding-bottom: 2px;
}
.brand-text {
  font-family: 'Bodoni Moda', Georgia, serif;
  font-size: 1.5rem; font-weight: 600; line-height: 1;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-size: 0.68rem; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--muted); border-left: 1px solid var(--line-strong);
  padding-left: 11px; line-height: 1.3; max-width: 120px;
}

.search-box { position: relative; margin-left: auto; width: min(340px, 100%); }
.search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
.search-box input {
  width: 100%; border: 1px solid var(--line);
  background: var(--paper-2); color: var(--ink);
  border-radius: 8px; padding: 9px 12px 9px 36px;
  font-family: inherit; font-size: 0.9rem; line-height: 1.4;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.search-box input::placeholder { color: var(--muted); opacity: 1; }
.search-box input:focus {
  outline: none; border-color: var(--brass);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brass) 22%, transparent);
}
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 90;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-pop);
  max-height: 64vh; overflow-y: auto; padding: 6px;
}
.search-result {
  display: block; text-decoration: none; color: var(--ink);
  padding: 9px 11px; border-radius: 6px; line-height: 1.4;
}
.search-result:hover, .search-result:focus-visible { background: var(--paper-2); }
.search-result .sr-section {
  display: block; font-size: 0.68rem; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--brass-dark); margin-bottom: 2px;
}
.search-result .sr-title { display: block; font-size: 0.9rem; font-weight: 600; }
.search-hit {
  display: block; text-decoration: none; color: var(--ink);
  padding: 9px 11px; border-radius: 6px; line-height: 1.4;
}
.search-hit:hover, .search-hit:focus-visible { background: var(--paper-2); }
.search-hit-section {
  display: block; font-size: 0.68rem; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--brass-dark); margin-bottom: 2px;
}
.search-hit-title { display: block; font-size: 0.9rem; font-weight: 600; }
.search-results[hidden] { display: none; }
.search-empty { padding: 12px; font-size: 0.88rem; color: var(--muted); margin: 0; }

.menu-toggle {
  display: none; width: 42px; height: 42px; flex-shrink: 0;
  border: 1px solid var(--line); border-radius: 7px;
  background: transparent; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  transition: background 160ms ease;
}
.menu-toggle span { display: block; width: 17px; height: 2px; background: var(--ink); transition: transform 200ms var(--ease-out), opacity 160ms ease; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Layout ---------- */
.layout {
  max-width: 1320px; margin: 0 auto; padding: 0 24px;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: 0 44px;
}
.main { min-width: 0; padding: 34px 0 90px; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky; top: var(--header-h);
  align-self: start;
  max-height: calc(100dvh - var(--header-h));
  overflow-y: auto; overscroll-behavior: contain;
  padding: 28px 18px 48px 0;
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
.sidebar-search { display: none; margin-bottom: 22px; }
.sidebar-search .search-box { width: 100%; margin: 0; }

.nav-group { margin-bottom: 21px; }
.nav-group + .nav-group { border-top: 1px solid var(--line); padding-top: 18px; }
.nav-section-title {
  margin: 0 0 6px 10px;
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}
.sidebar-link {
  display: block; padding: 6px 10px; margin: 1px 0;
  font-size: 0.9rem; line-height: 1.42; color: var(--ink);
  text-decoration: none; border-radius: 6px;
  transition: background 140ms ease, color 140ms ease;
}
.sidebar-link:hover { background: var(--paper-2); }
.sidebar-link.active {
  background: var(--green-100); color: var(--ink);
  font-weight: 600;
}

/* ---------- Home hero ---------- */
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  background: var(--green-900);
  color: #F3F5EF;
  overflow: hidden;
  min-height: 440px;
  box-shadow: 0 26px 60px -34px rgba(8, 26, 21, 0.55);
}
.hero-copy {
  padding: clamp(28px, 4.2vw, 54px);
  display: flex; flex-direction: column; justify-content: center;
  align-items: flex-start;
}
.hero-brand {
  margin: 0 0 14px;
  font-family: 'Bodoni Moda', Georgia, serif;
  font-size: clamp(2.6rem, 4.4vw, 3.7rem);
  font-weight: 600; line-height: 0.95; letter-spacing: -0.015em;
  color: var(--brass-light);
}
.hero-brand::after {
  content: ''; display: block; width: 48px; height: 1px;
  background: var(--brass); margin-top: 16px;
}
.home-hero h1 {
  margin: 0 0 14px;
  font-family: 'Bodoni Moda', Georgia, serif;
  font-size: clamp(1.65rem, 2.5vw, 2.3rem);
  font-weight: 500; line-height: 1.16; letter-spacing: -0.01em;
  color: #F6F7F2; max-width: 20ch;
}
.hero-lead {
  margin: 0 0 26px; max-width: 46ch;
  font-size: 0.98rem; line-height: 1.62; color: #C9D5CB;
}
.hero-cta {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--brass); color: #12211B;
  padding: 13px 22px; border-radius: 6px;
  font-size: 0.93rem; font-weight: 600; letter-spacing: 0.01em;
  text-decoration: none;
  transition: transform 160ms var(--ease-out), background 160ms ease;
}
.hero-cta span { transition: transform 180ms var(--ease-out); }
.hero-cta:active { transform: scale(0.98); }

.hero-media { margin: 0; position: relative; min-height: 300px; overflow: hidden; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.82) contrast(1.02); animation: heroReveal 900ms var(--ease-out) both; }
.hero-media::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(14, 42, 34, 0.55), rgba(14, 42, 34, 0) 42%);
  pointer-events: none;
}

/* ---------- Home sections ---------- */
.home-section { margin-top: 46px; padding-top: 34px; border-top: 1px solid var(--line); }
.home-section:first-of-type { margin-top: 52px; }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.section-head h2 {
  margin: 0; font-family: 'Bodoni Moda', Georgia, serif;
  font-size: 1.65rem; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em;
}
.section-head p { margin: 0; max-width: 66ch; font-size: 0.92rem; color: var(--muted); line-height: 1.55; }

.cat-list { list-style: none; margin: 16px 0 0; padding: 0; border-top: 1px solid var(--line); }
.cat-list li { margin: 0; }
.cat-row {
  display: grid; grid-template-columns: 42px minmax(0, 1fr) 22px;
  gap: 12px; align-items: center;
  padding: 14px 8px 14px 4px;
  border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--ink);
  transition: background 150ms ease;
  animation: rowIn 340ms var(--ease-out) both;
}
.cat-no {
  font-family: 'Bodoni Moda', Georgia, serif;
  font-size: 1rem; font-weight: 500; color: var(--brass-dark);
  font-variant-numeric: tabular-nums; letter-spacing: 0.03em;
}
.cat-body { min-width: 0; }
.cat-title { display: block; font-size: 1rem; font-weight: 600; line-height: 1.38; }
.cat-excerpt { display: block; margin-top: 2px; font-size: 0.86rem; line-height: 1.5; color: var(--muted); }
.cat-arrow { color: var(--brass-dark); font-size: 1.05rem; opacity: 0.55; transition: transform 180ms var(--ease-out), opacity 150ms ease; }
.cat-list li:nth-child(1) .cat-row { animation-delay: 20ms; }
.cat-list li:nth-child(2) .cat-row { animation-delay: 45ms; }
.cat-list li:nth-child(3) .cat-row { animation-delay: 70ms; }
.cat-list li:nth-child(4) .cat-row { animation-delay: 95ms; }
.cat-list li:nth-child(5) .cat-row { animation-delay: 120ms; }
.cat-list li:nth-child(6) .cat-row { animation-delay: 145ms; }
.cat-list li:nth-child(7) .cat-row { animation-delay: 170ms; }
.cat-list li:nth-child(8) .cat-row { animation-delay: 195ms; }

/* ---------- Article ---------- */
.page-enter { animation: pageIn 280ms var(--ease-out) both; }
.content-article { max-width: 772px; }
.breadcrumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
  margin: 0 0 16px; font-size: 0.78rem; color: var(--muted);
}
.breadcrumbs a { text-decoration: none; border-bottom: 1px solid transparent; }
.breadcrumbs a:hover { border-bottom-color: var(--line-strong); }
.breadcrumbs span[aria-current] { color: var(--ink); }

.article-header { padding-bottom: 24px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.article-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 9px;
  margin: 0 0 12px; font-size: 0.78rem; color: var(--muted);
}
.article-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--brass); }
.article-header h1 {
  margin: 0 0 14px;
  font-family: 'Bodoni Moda', Georgia, serif;
  font-size: clamp(1.95rem, 3.4vw, 2.85rem);
  font-weight: 600; line-height: 1.1; letter-spacing: -0.02em;
}
.article-lead { margin: 0; max-width: 62ch; font-size: 1.04rem; line-height: 1.62; color: var(--muted); }

.toc { margin: 24px 0 34px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.toc-title { margin: 0 0 10px; font-family: 'Bodoni Moda', Georgia, serif; font-size: 1.1rem; font-weight: 600; }
.toc ol { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: 30px; }
.toc li { break-inside: avoid; margin: 0 0 5px; }
.toc a { font-size: 0.89rem; line-height: 1.45; color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--brass-dark); text-decoration: underline; text-underline-offset: 2px; }

.article-body { font-size: 1rem; line-height: 1.75; }
.article-body > p { margin: 0 0 1.15em; max-width: 68ch; }
.article-body h2 {
  margin: 2.1em 0 0.55em; padding-top: 0.95em;
  border-top: 1px solid var(--line);
  font-family: 'Bodoni Moda', Georgia, serif;
  font-size: 1.55rem; font-weight: 600; line-height: 1.22; letter-spacing: -0.01em;
  max-width: 64ch;
}
.article-body h3 { margin: 1.6em 0 0.4em; font-size: 1.04rem; font-weight: 700; line-height: 1.4; }
.article-body ul, .article-body ol { margin: 0 0 1.2em; padding-left: 1.3em; max-width: 66ch; }
.article-body li { margin: 0.32em 0; }
.article-body li::marker { color: var(--brass-dark); }
.article-body a { color: var(--green-700); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.article-body a:hover { color: var(--brass-dark); }
.article-body strong { font-weight: 700; }
.article-body hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

.info-box, .warning-box, .takeaways {
  margin: 1.6em 0; padding: 15px 18px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  font-size: 0.94rem; line-height: 1.62; color: var(--ink);
}
.info-box { background: var(--brass-soft); }
.warning-box { background: var(--oxblood-soft); border-color: color-mix(in srgb, var(--oxblood) 34%, var(--line)); }
.takeaways { background: var(--green-100); }
.info-box p:last-child, .warning-box p:last-child, .takeaways p:last-child,
.info-box ul:last-child, .warning-box ul:last-child, .takeaways ul:last-child { margin-bottom: 0; }
.info-box strong:first-child, .warning-box strong:first-child { display: block; margin-bottom: 3px; }

.table-responsive { margin: 1.6em 0; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 8px; border: 1px solid var(--line); }
.article-body table, table.error-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.88rem; line-height: 1.45; background: var(--surface);
}
.article-body th, table.error-table th {
  background: var(--green-700); color: #FFFFFF;
  text-align: left; padding: 10px 12px;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em;
  vertical-align: bottom;
}
.article-body td, table.error-table td {
  padding: 10px 12px; border-top: 1px solid var(--line);
  vertical-align: top; color: var(--ink);
}
.article-body tbody tr:nth-child(even) td { background: var(--paper-2); }
.table-responsive .error-table { border: 0; border-radius: 0; }

.faq-item {
  margin: 9px 0; padding: 0 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
}
.faq-item summary {
  cursor: pointer; list-style: none;
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 13px 0; font-size: 0.97rem; font-weight: 600; line-height: 1.45;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; flex-shrink: 0; color: var(--brass-dark); font-size: 1.15rem; line-height: 1; transition: transform 180ms var(--ease-out); }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-a { padding: 0 0 14px; font-size: 0.94rem; line-height: 1.65; color: var(--muted); }
.faq-a p { margin: 0 0 0.7em; }
.faq-a p:last-child { margin-bottom: 0; }

.glossary { margin: 1.2em 0 0; }
.glossary dt { margin-top: 1.15em; font-weight: 700; font-size: 0.98rem; }
.glossary dd { margin: 0.2em 0 0; color: var(--muted); font-size: 0.95rem; }

.yes { color: var(--green-700); font-weight: 700; }
.no { color: var(--oxblood); font-weight: 700; }

.article-nav {
  margin-top: 46px; padding-top: 22px; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
}
.article-nav a { text-decoration: none; color: var(--ink); display: block; }
.article-nav .nav-label { display: block; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.article-nav .nav-title { font-size: 0.94rem; font-weight: 600; line-height: 1.4; }
.article-nav a:hover .nav-title { color: var(--brass-dark); text-decoration: underline; text-underline-offset: 2px; }
.article-nav .next { text-align: right; }

/* ---------- 404 ---------- */
.notfound { max-width: 620px; padding: 40px 0; }
.notfound .code { font-family: 'Bodoni Moda', Georgia, serif; font-size: 4rem; line-height: 1; color: var(--brass-dark); margin: 0 0 10px; }
.notfound h1 { font-family: 'Bodoni Moda', Georgia, serif; font-size: 2rem; margin: 0 0 12px; }
.notfound p { color: var(--muted); margin: 0 0 22px; }

/* ---------- Footer ---------- */
.app-footer { background: var(--green-950); color: #C6D2C8; margin-top: 40px; padding: 44px 24px 34px; }
.footer-inner { max-width: 1320px; margin: 0 auto; }
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.footer-mark {
  width: 36px; height: 36px; display: grid; place-items: center;
  background: var(--green-800); color: var(--brass-light); border: 1px solid #2C4A3C;
  border-radius: 6px; font-family: 'Bodoni Moda', Georgia, serif; font-size: 1.2rem; padding-bottom: 2px;
}
.footer-name { margin: 0; font-family: 'Bodoni Moda', Georgia, serif; font-size: 1.3rem; line-height: 1.1; color: #F1F4EE; }
.footer-tag { margin: 2px 0 0; font-size: 0.78rem; color: #93A69A; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 16px; }
.footer-links a { color: var(--brass-light); font-size: 0.88rem; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer-note { margin: 0 0 8px; max-width: 76ch; font-size: 0.8rem; line-height: 1.6; color: #9FB0A4; }
.footer-credit { margin: 0; font-size: 0.73rem; color: #7C9084; }

/* ---------- Utilities ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---------- Motion ---------- */
@keyframes heroReveal { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }
@keyframes rowIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (hover: hover) and (pointer: fine) {
  .sidebar-link:hover { color: var(--green-900); }
  .cat-row:hover { background: var(--paper-2); }
  .cat-row:hover .cat-arrow { transform: translateX(5px); opacity: 1; }
  .cat-row:hover .cat-title { color: var(--brass-dark); }
  .hero-cta:hover { background: #C79A38; transform: translateY(-1px); }
  .hero-cta:hover span { transform: translateX(4px); }
  .menu-toggle:hover { background: var(--paper-2); }
  .app-footer a:hover { color: #F1DCB0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .layout { gap: 0 30px; }
  :root { --sidebar-w: 262px; }
  .brand-sub { display: none; }
}

@media (max-width: 900px) {
  :root { --header-h: 64px; }
  .layout { display: block; padding: 0 20px; }
  .main { padding-top: 24px; }
  .header-inner { padding: 0 20px; height: var(--header-h); gap: 14px; }
  .header-inner > .search-box { display: none; }
  .menu-toggle { display: flex; margin-left: auto; }

  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 80;
    width: min(320px, 86vw); max-height: 100dvh;
    padding: 22px 16px 44px;
    background: var(--paper); border-right: 1px solid var(--line);
    box-shadow: 18px 0 40px -20px rgba(8, 26, 21, 0.5);
    transform: translateX(-104%);
    transition: transform 300ms var(--ease-drawer, cubic-bezier(0.32, 0.72, 0, 1));
    overflow-y: auto;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-search { display: block; }
  .sidebar-search .search-results { position: static; margin-top: 6px; box-shadow: none; max-height: 36vh; }
  .sidebar-overlay {
    position: fixed; inset: 0; z-index: 70;
    background: rgba(8, 26, 21, 0.46);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  }
  .sidebar-overlay[hidden] { display: none; }

  .home-hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-copy { padding: 30px 26px 28px; }
  .hero-media { min-height: 230px; max-height: 300px; order: 2; }
  .hero-media::after { background: linear-gradient(180deg, rgba(14, 42, 34, 0.45), rgba(14, 42, 34, 0) 45%); }
  .content-article { max-width: 100%; }
  .toc ol { columns: 2; }
}

@media (max-width: 620px) {
  body { font-size: 17px; }
  .header-inner { padding: 0 16px; }
  .brand-mark { width: 31px; height: 31px; font-size: 1.1rem; }
  .brand-text { font-size: 1.32rem; }
  .layout { padding: 0 16px; }
  .home-hero h1 { font-size: 1.55rem; }
  .hero-brand { font-size: 2.5rem; }
  .hero-copy { padding: 26px 20px 24px; }
  .hero-lead { font-size: 0.94rem; }
  .hero-media { min-height: 200px; max-height: 240px; }
  .home-section { margin-top: 36px; padding-top: 26px; }
  .section-head h2 { font-size: 1.42rem; }
  .cat-row { grid-template-columns: 34px minmax(0, 1fr) 18px; gap: 9px; padding: 13px 4px 13px 2px; }
  .cat-no { font-size: 0.92rem; }
  .cat-title { font-size: 0.96rem; }
  .cat-excerpt { font-size: 0.83rem; }
  .article-header h1 { font-size: 1.95rem; }
  .article-body { font-size: 0.99rem; }
  .article-body h2 { font-size: 1.38rem; }
  .toc ol { columns: 1; }
  .article-nav { grid-template-columns: 1fr; gap: 14px; }
  .article-nav .next { text-align: left; }
  .app-footer { padding: 36px 16px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero-media img { clip-path: none; }
}
