@layer reset, base, layout, components, responsive;
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  body, h1, h2, h3, p { margin: 0; }
  button, input, select { font: inherit; }
  button, select { cursor: pointer; }
  button { color: inherit; }
  button:disabled { cursor: default; opacity: .45; }
  button { border: 0; }
  [hidden] { display: none !important; }
}
@layer base {
  :root { --ink: #1b3338; --muted: #66747b; --teal: #176b59; --teal-soft: #eaf4ef; --line: #e1e7e8; --canvas: #f7f9fa; --serif: Georgia, 'Times New Roman', serif; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: var(--ink); background: var(--canvas); font-size: 16px; }
  body { line-height: 1.55; }
  button { background: none; }
  a { color: var(--teal); text-underline-offset: 3px; }
  :focus-visible { outline: 3px solid #40a88b; outline-offset: 4px; }
  ::selection { background: #c6e7dc; color: #12352b; }
  .icon { width: 22px; height: 22px; flex: 0 0 auto; vertical-align: middle; }
  .eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .13em; color: var(--teal); }
  h1, h2, h3 { line-height: 1.2; }
  .button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 12px 18px; min-height: 44px; border-radius: 7px; font-size: .875rem; font-weight: 600; transition: background .15s, box-shadow .15s; white-space: nowrap; }
  .button .icon { width: 18px; height: 18px; }
  .button.primary { background: var(--teal); color: #fff; box-shadow: 0 2px 3px #0e493014; }
  .button.primary:hover { background: #115744; }
  .button.secondary { background: #fff; border: 1px solid #d8e1df; }
  .button.secondary:hover { background: #f0f5f2; }
  .button.ghost { color: var(--muted); }
  .button.ghost:hover:not(:disabled) { background: #edf1f2; color: var(--ink); }
  .icon-button { width: 40px; height: 40px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .icon-button:hover { background: #e9efed; }
  .text-button { display: inline-flex; align-items: center; gap: 5px; font-size: .875rem; font-weight: 600; color: var(--teal); padding: 8px 0; }
  .text-button .icon { width: 16px; }
  .skip-link { position: fixed; top: -100px; left: 20px; background: #fff; z-index: 100; padding: 10px; }
  .skip-link:focus { top: 12px; }
}
@layer layout {
  .app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
  .sidebar { background: #142c32; color: #bacbd0; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 35px 20px 23px; overflow-y: auto; }
  .brand { display: flex; align-items: center; gap: 12px; text-align: left; color: #f4f9f7; padding: 0 8px; margin-bottom: 47px; font-size: .875rem; line-height: 1.1; }
  .brand strong { display: block; font-family: var(--serif); font-size: 2.05rem; letter-spacing: -.035em; font-weight: 400; margin-top: 3px; }
  .brand-mark { display: flex; align-items: center; justify-content: center; color: #a4dcc6; height: 44px; width: 44px; background: #203d42; border: 1px solid #365350; border-radius: 11px; }
  .brand-mark .icon { width: 27px; height: 27px; }
  .brand-dot { color: #a4dcc6; }
  .nav-label { font-size: .65rem; font-weight: 600; letter-spacing: .12em; padding: 0 14px; color: #8fa9b0; }
  .sub-label { margin: 29px 0 12px; font-size: .62rem; }
  .sidebar nav { margin-top: 12px; }
  .nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; width: 100%; min-height: 48px; text-align: left; border-radius: 7px; font-size: .875rem; margin-bottom: 5px; transition: background .15s; }
  .nav-item > .icon { width: 20px; height: 20px; opacity: .8; }
  .nav-item:hover { background: #203b40; color: #fff; }
  .nav-item.active { background: #2b4b4c; color: #e5f5ec; }
  .nav-item.active > .icon { color: #ade0c9; opacity: 1; }
  .nav-count { margin-left: auto; font-size: .75rem; min-width: 22px; text-align: center; color: #abc2c4; }
  .nav-item.active .nav-count { color: #d7e7df; }
  .nav-divider { border-bottom: 1px solid #2c454a; margin: 24px 13px 18px; }
  .sidebar-bottom { margin-top: auto; padding: 55px 14px 0; }
  .local-label { display: flex; gap: 9px; align-items: center; color: #d7e6e4; font-size: .8125rem; font-weight: 500; }
  .local-label .icon { width: 17px; height: 17px; color: #a4c9bc; }
  .sidebar-bottom p { color: #91a9ae; font-size: .75rem; margin: 13px 0 18px; line-height: 1.7; }
  .version { color: #8fa6ad; font-size: .7rem; }
  .workspace { min-width: 0; display: flex; flex-direction: column; }
  .topbar { min-height: 80px; display: flex; align-items: center; justify-content: space-between; padding: 16px 46px; border-bottom: 1px solid var(--line); background: #fff; gap: 15px; }
  .breadcrumbs { display: flex; align-items: center; gap: 13px; color: #748087; font-size: .8125rem; }
  .breadcrumbs > .icon { width: 13px; height: 13px; color: #a6b1b6; }
  .breadcrumbs strong { color: #364b50; font-weight: 500; }
  .topbar-actions { display: flex; align-items: center; gap: 18px; }
  .topbar-actions .icon-button { color: #748087; width: 32px; height: 32px; }
  .topbar-actions .icon { width: 19px; }
  .local-badge { font-size: .72rem; color: #547366; padding: 4px 10px; background: #f0f6f2; border: 1px solid #e0eae3; border-radius: 5px; }
  #main { padding: 43px 46px 32px; width: 100%; max-width: 1510px; margin: 0 auto; flex: 1; outline: none; }
  .workspace-footer { display: flex; justify-content: space-between; gap: 10px; margin: 0 46px; padding: 20px 0 24px; color: #7a868a; font-size: .7rem; border-top: 1px solid var(--line); }
  .mobile-menu { display: none; }
  .mobile-close { display: none; }
  body.menu-open { overflow: hidden; }
  .demo-banner { background: #fff2d8; color: #70531c; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 46px; font-size: .8125rem; border-bottom: 1px solid #e9dab7; }
  .demo-banner > span { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .demo-banner .icon { width: 17px; height: 17px; }
  .demo-banner button { padding: 4px 0; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; white-space: nowrap; }
}
@layer components {
  .home-intro { padding: 1px 0 28px; }
  .home-intro h1 { font-family: var(--serif); font-size: clamp(2.2rem, 3.1vw, 3.5rem); font-weight: 400; letter-spacing: -.045em; line-height: 1.15; margin-top: 16px; }
  .home-intro h1 em { color: var(--teal); font-weight: 400; font-style: normal; }
  .home-intro p { margin-top: 20px; color: var(--muted); font-size: .9375rem; line-height: 1.75; }
  .overview-strip { display: flex; align-items: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 20px 0; gap: 30px; }
  .overview-strip > div { display: flex; align-items: center; gap: 10px; font-size: .8125rem; color: #647278; }
  .overview-strip > div + div { border-left: 1px solid var(--line); padding-left: 30px; }
  .overview-strip .icon { width: 18px; height: 18px; color: #637d75; }
  .overview-strip strong { color: var(--ink); font-size: 1.15rem; font-weight: 600; }
  .court-section { padding: 32px 0; }
  .section-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 22px; }
  .section-heading h2 { font-size: 1.1875rem; letter-spacing: -.025em; font-weight: 600; }
  .section-heading p { margin-top: 7px; color: var(--muted); font-size: .875rem; }
  .subtle-label { font-size: .72rem; color: #76858b; white-space: nowrap; }
  .court-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .court-card { padding: 21px 20px 15px; background: #fff; border: 1px solid #dce4e3; border-radius: 10px; text-align: left; display: flex; flex-direction: column; box-shadow: 0 2px 2px #16312c03; transition: border-color .2s, transform .2s, box-shadow .2s; }
  .court-card:hover { border-color: #7aab98; transform: translateY(-3px); box-shadow: 0 8px 20px #15362c0b; }
  .court-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 26px; }
  .court-symbol { width: 36px; height: 36px; background: #eaf3ee; color: #3c7a64; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; }
  .court-symbol .icon { width: 21px; height: 21px; }
  .court-stj .court-symbol { background: #edf1f8; color: #5a7295; }
  .court-tjs .court-symbol { background: #f2eef7; color: #8a709e; }
  .court-tst .court-symbol { background: #fbf1e7; color: #9e7853; }
  .court-category { color: #768186; font-size: .65rem; line-height: 1.35; }
  .court-title { font-family: var(--serif); font-size: 2rem; line-height: 1; letter-spacing: -.025em; }
  .court-name { font-size: .875rem; color: #65747a; margin-top: 10px; line-height: 1.5; min-height: 42px; }
  .court-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 4px; border-top: 1px solid #edf0f1; padding-top: 15px; margin-top: 20px; color: #718079; font-size: .68rem; }
  .round-chevron { width: 24px; height: 24px; color: #618274; border-radius: 50%; background: #f3f7f5; display: grid; place-items: center; flex-shrink: 0; }
  .round-chevron .icon { width: 14px; height: 14px; }
  .preparation-card { display: flex; align-items: center; gap: 20px; background: #edf4f0; border: 1px solid #dce9e2; padding: 26px; border-radius: 10px; }
  .preparation-icon { border: 1px solid #d7e5dc; border-radius: 10px; background: #f8fbf9; width: 50px; height: 54px; display: grid; place-items: center; color: #66917e; flex-shrink: 0; }
  .preparation-icon .icon { width: 27px; height: 27px; }
  .preparation-card .eyebrow { font-size: .62rem; }
  .preparation-card h2 { font-size: .9375rem; margin: 7px 0 8px; font-weight: 600; letter-spacing: -.015em; }
  .preparation-card p { font-size: .8125rem; color: #6a7a72; line-height: 1.65; }
  .preparation-card > .button { margin-left: auto; font-size: .8125rem; padding: 11px 15px; }
  .reading-guide { display: grid; grid-template-columns: 1.35fr repeat(3, 1fr); gap: 32px; padding: 37px 0 13px; }
  .reading-guide .eyebrow { font-size: .6rem; }
  .reading-guide h2 { font-family: var(--serif); font-size: 1.45rem; font-weight: 400; letter-spacing: -.03em; margin: 9px 0 10px; }
  .reading-guide p { font-size: .75rem; color: #7a8589; line-height: 1.75; }
  .guide-item { padding-top: 5px; }
  .guide-item .icon { width: 22px; height: 22px; color: #637f74; margin-bottom: 12px; }
  .guide-item h3 { font-size: .8125rem; font-weight: 600; margin-bottom: 9px; }
  .library-heading { padding: 0 0 30px; }
  .library-heading h1 { font-size: 2rem; font-weight: 400; font-family: var(--serif); letter-spacing: -.035em; margin: 12px 0 12px; }
  .library-heading p { color: var(--muted); font-size: .875rem; }
  .search-panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px; }
  .search-box { display: flex; align-items: center; gap: 12px; padding: 0 14px; border: 1px solid #dbe2e3; border-radius: 7px; height: 50px; background: #fcfdfd; }
  .search-box:focus-within { border-color: #68a78f; box-shadow: 0 0 0 3px #176b590d; }
  .search-box .icon { width: 20px; color: #7a8e88; }
  .search-box input { color: var(--ink); min-width: 0; flex: 1; background: transparent; border: none; height: 100%; outline: none; font-size: .9375rem; }
  .search-box input::placeholder { color: #84918f; }
  .search-box kbd { font-family: inherit; font-size: .75rem; color: #93a09d; padding: 0 6px; border: 1px solid #e2e7e5; border-radius: 4px; }
  .filter-row { display: flex; align-items: end; gap: 16px; margin-top: 19px; }
  .filter-field { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 6px; }
  .filter-field > span { font-size: .875rem; color: #718079; }
  .filter-field select { min-width: 0; width: 100%; appearance: none; padding: 10px 30px 10px 12px; border: 1px solid #dfe5e3; border-radius: 6px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2365756d' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; font-size: .875rem; color: #425951; text-overflow: ellipsis; }
  .clear-filters { font-size: .8125rem; padding: 10px 4px; min-height: 42px; }
  .results-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 27px 0 21px; border-bottom: 1px solid var(--line); }
  .tabs { display: flex; align-items: stretch; gap: 22px; overflow-x: auto; }
  .tabs button { font-size: .875rem; white-space: nowrap; color: #7a8688; padding: 12px 0 14px; border-bottom: 2px solid transparent; }
  .tabs button.selected { color: var(--teal); font-weight: 600; border-bottom-color: var(--teal); }
  .result-count { font-size: .75rem; color: #7d8a8f; white-space: nowrap; padding-bottom: 2px; }
  .empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 63px 20px 68px; border: 1px dashed #d8e3dd; background: #fff; border-radius: 10px; }
  .empty-icon { display: grid; place-items: center; width: 60px; height: 60px; background: #f0f5f2; border: 1px solid #e4eee8; border-radius: 17px; color: #6b9a85; margin-bottom: 23px; }
  .empty-icon .icon { width: 29px; height: 29px; }
  .empty-state .eyebrow { font-size: .65rem; }
  .empty-state h2 { font-family: var(--serif); font-weight: 400; font-size: 1.7rem; letter-spacing: -.025em; margin: 12px 0; }
  .empty-state p { color: #7c8a84; font-size: .875rem; line-height: 1.8; margin-bottom: 23px; }
  .library-note { display: flex; align-items: start; gap: 9px; color: #7f8d88; padding: 21px 3px; }
  .library-note .icon { width: 16px; height: 16px; margin-top: 2px; }
  .library-note p { font-size: .75rem; }
  .record-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .record-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 18px 22px 12px; display: flex; flex-direction: column; }
  .record-card:hover { border-color: #a1bdb1; }
  .record-card-top { display: flex; justify-content: space-between; align-items: center; }
  .court-tag { font-size: .7rem; font-weight: 600; letter-spacing: .025em; background: #edf3f1; color: #4f7364; padding: 3px 8px; border-radius: 4px; }
  .favorite { color: #85978f; }
  .favorite .icon { width: 19px; height: 19px; }
  .is-saved { color: var(--teal); }
  .is-saved .icon { fill: #d8eee4; }
  .record-open { display: flex; flex-direction: column; text-align: left; width: 100%; padding: 10px 0 22px; flex: 1; }
  .record-title { font-family: var(--serif); font-size: 1.6rem; line-height: 1.3; letter-spacing: -.02em; }
  .record-subject { color: #537461; font-size: .8125rem; font-weight: 500; margin: 8px 0 13px; }
  .record-excerpt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: .875rem; color: #6e7c76; line-height: 1.75; }
  .record-card-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid #edf0ef; padding-top: 8px; }
  .editorial-badge { display: inline-flex; align-items: center; gap: 5px; font-size: .6875rem; color: #7e8989; }
  .editorial-badge .icon { width: 13px; height: 13px; }
  .editorial-badge.reviewed { color: #427a60; }
  .editorial-badge.draft { color: #a07c37; }
  .pagination { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 28px 0 0; }
  .pagination > span { font-size: .8125rem; color: var(--muted); }
  dialog { border: 1px solid #dce6e1; padding: 0; background: #fff; color: var(--ink); box-shadow: 0 20px 100px #102b3533; }
  dialog::backdrop { background: #102c366e; backdrop-filter: blur(3px); }
  .reader { width: min(800px, calc(100vw - 48px)); max-height: calc(100dvh - 56px); border-radius: 12px; }
  .reader-bar { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; position: sticky; top: 0; z-index: 1; background: #fff; border-bottom: 1px solid var(--line); color: #6f8378; }
  .reader-bar > span { display: inline-flex; align-items: center; gap: 8px; font-size: .65rem; letter-spacing: .1em; font-weight: 600; }
  .reader-bar > span .icon { width: 17px; height: 17px; }
  .reader-body { padding: 32px 45px 40px; }
  .reader-demo { font-size: .8125rem; padding: 10px 14px; background: #fff3dc; border-radius: 5px; color: #846225; margin-bottom: 25px; }
  .reader-meta { display: flex; align-items: center; gap: 14px; }
  .reader h2 { font-size: 2.35rem; font-family: var(--serif); font-weight: 400; margin: 15px 0 10px; letter-spacing: -.035em; }
  .reader-subtitle { color: #6a7d73; font-size: .9375rem; }
  .reader-actions { display: flex; gap: 10px; margin: 23px 0 30px; flex-wrap: wrap; }
  .reader-actions .button { font-size: .8125rem; padding: 9px 12px; min-height: 40px; }
  .original-section { background: #f1f6f3; padding: 25px; border-radius: 8px; border-left: 3px solid #77a38b; }
  .original-section .eyebrow { font-size: .65rem; }
  .original-section > p { margin: 13px 0 20px; font-family: var(--serif); font-size: 1.15rem; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
  .original-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .72rem; color: #6a7f73; border-top: 1px solid #dbe6df; padding-top: 14px; }
  .editorial-divider { display: flex; align-items: center; gap: 20px; font-size: .65rem; letter-spacing: .12em; color: #8c9990; margin: 33px 0 26px; }
  .editorial-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
  .editorial-section { padding: 0 0 25px; }
  .editorial-section h3 { font-size: 1rem; margin-bottom: 10px; font-weight: 600; }
  .editorial-section p { font-size: 1rem; line-height: 1.85; color: #55675d; white-space: pre-wrap; overflow-wrap: anywhere; }
  .editorial-section .pending-text { color: #8a948e; font-style: italic; font-size: .875rem; }
  .example-section { padding: 22px 24px; margin: 0 0 27px; border: 1px solid #dce9e1; background: #f8fbf9; border-radius: 8px; }
  .example-section h3 { display: flex; align-items: center; gap: 8px; color: #3f7158; }
  .example-section h3 .icon { width: 18px; height: 18px; }
  .source-section { border-top: 1px solid var(--line); padding-top: 24px; }
  .source-section h3 { font-size: .875rem; margin-bottom: 9px; }
  .source-section p, .source-section a { font-size: .8125rem; color: #7e8b83; margin: 5px 0; }
  .source-section a { color: var(--teal); }
  .source-section a .icon { width: 14px; height: 14px; }
  .pending-note { display: flex; align-items: start; gap: 10px; padding: 16px; background: #f9f5ec; border-radius: 6px; margin-bottom: 28px; color: #8d7749; }
  .pending-note .icon { width: 17px; height: 17px; margin-top: 2px; }
  .pending-note strong { font-size: .8125rem; font-weight: 600; }
  .pending-note p { font-size: .8125rem; margin-top: 4px; line-height: 1.7; }
  .about-dialog { width: min(600px, calc(100vw - 40px)); border-radius: 12px; max-height: calc(100dvh - 40px); }
  .about-body { padding: 32px; }
  .about-body h2 { font-family: var(--serif); font-weight: 400; font-size: 1.9rem; letter-spacing: -.03em; margin: 13px 0 16px; }
  .about-body > p { color: var(--muted); font-size: .9375rem; margin-bottom: 30px; }
  .about-row { display: flex; gap: 15px; margin-bottom: 25px; }
  .about-row > .icon { color: #658c76; margin-top: 2px; }
  .about-row h3 { font-size: .9375rem; font-weight: 600; margin: 0 0 7px; }
  .about-row p { font-size: .875rem; color: var(--muted); line-height: 1.8; }
  .toast { position: fixed; bottom: 25px; left: 50%; transform: translate(-50%, 10px); background: #173c32; color: #fff; border: 1px solid #3e6c58; padding: 12px 20px; border-radius: 8px; font-size: .875rem; opacity: 0; pointer-events: none; z-index: 100; transition: opacity .2s, transform .2s; box-shadow: 0 5px 30px #193d2b22; max-width: calc(100vw - 30px); width: max-content; }
  .toast.visible { opacity: 1; transform: translate(-50%, 0); }
  .initial-loading { padding: 80px 20px; color: var(--muted); }
  .error-panel { padding: 60px 20px; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
  .error-panel h1 { font-size: 1.5rem; }
}
@layer responsive {
  @media (min-width: 1600px) { #main { padding-top: 56px; } .home-intro { padding-bottom: 38px; } .court-section { padding: 38px 0; } .court-card { padding: 25px; } .court-card-top { margin-bottom: 35px; } .reading-guide { padding-top: 46px; } }
  @media (max-width: 1230px) {
    .app-shell { grid-template-columns: 222px minmax(0, 1fr); }
    .sidebar { padding-left: 13px; padding-right: 13px; }
    #main { padding: 34px 30px 28px; }
    .topbar { padding-left: 30px; padding-right: 30px; }
    .workspace-footer { margin: 0 30px; }
    .court-grid { gap: 12px; }
    .court-card { padding: 18px 16px 13px; }
    .court-card-top { align-items: start; flex-direction: column; gap: 10px; margin-bottom: 20px; }
    .court-category { font-size: .65rem; }
    .court-name { min-height: 56px; }
    .overview-strip { gap: 20px; }
    .overview-strip > div + div { padding-left: 20px; }
    .overview-strip > div { gap: 8px; font-size: .75rem; }
    .preparation-card { gap: 16px; padding: 23px; flex-wrap: wrap; }
    .preparation-card > div:nth-child(2) { flex: 1; min-width: 200px; }
    .preparation-card > .button { margin-left: 66px; }
    .reading-guide { gap: 23px; grid-template-columns: 1.2fr repeat(3, 1fr); }
    .reading-guide h2 { font-size: 1.3rem; }
    .tabs { gap: 18px; }
  }
  @media (max-width: 980px) {
    .court-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
    .court-card-top { flex-direction: row; align-items: center; margin-bottom: 23px; }
    .court-card { padding: 22px 22px 16px; }
    .court-name { min-height: 40px; }
    .overview-strip { flex-wrap: wrap; gap: 15px 20px; }
    .overview-strip > div + div { border-left: 0; padding-left: 0; }
    .overview-strip > div { font-size: .75rem; }
    .reading-guide { grid-template-columns: repeat(3, 1fr); gap: 25px; }
    .reading-guide > div:first-child { grid-column: 1 / -1; }
    .reading-guide > div:first-child p br { display: none; }
    .section-heading { align-items: start; }
    .subtle-label { display: none; }
    .record-grid { grid-template-columns: 1fr; }
    .filter-row { flex-wrap: wrap; }
    .filter-field { flex: 1 1 40%; }
    .clear-filters { flex: 0 1 40%; justify-content: start; }
    .library-heading h1 { font-size: 1.8rem; }
  }
  @media (max-width: 760px) {
    .app-shell { display: block; }
    .sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 30; width: 270px; height: 100dvh; transform: translateX(-100%); transition: transform .2s; padding-top: 30px; }
    .sidebar.open { transform: translateX(0); }
    .mobile-close { display: inline-flex; align-self: end; margin: -15px 0 8px; color: #d2e4de; }
    .mobile-shade { position: fixed; inset: 0; z-index: 20; background: #122f3766; }
    .mobile-menu { display: inline-flex; margin-left: -8px; }
    .topbar { min-height: 68px; padding: 12px 24px; }
    .breadcrumbs { gap: 8px; }
    .breadcrumbs > span { display: none; }
    .breadcrumbs > .icon { display: none; }
    .topbar-actions { gap: 10px; }
    .local-badge { font-size: .65rem; }
    #main { padding: 30px 24px 25px; }
    .workspace { min-height: 100dvh; }
    .workspace-footer { margin: 0 24px; }
    .demo-banner { padding: 12px 24px; align-items: start; font-size: .75rem; flex-wrap: wrap; gap: 4px; }
    .demo-banner > span { gap: 6px; }
    .demo-banner > span > span { flex-basis: 100%; padding-left: 23px; }
    .demo-banner > button { margin-left: 23px; }
    .home-intro h1 { font-size: 2.7rem; }
    .overview-strip { column-gap: 25px; }
    .reading-guide { padding-top: 31px; }
    .library-heading h1 { font-size: 1.9rem; }
  }
  @media (max-width: 480px) {
    #main { padding: 28px 20px 25px; }
    .topbar { padding: 10px 20px; }
    .home-intro h1 { font-size: 2.2rem; }
    .home-intro p { font-size: .875rem; }
    .overview-strip { gap: 14px; align-items: stretch; justify-content: space-between; }
    .overview-strip > div { display: grid; grid-template-columns: 17px 1fr; gap: 4px 7px; flex: 1; align-items: center; }
    .overview-strip > div > span { grid-column: 1 / -1; font-size: .65rem; max-width: 90px; }
    .overview-strip > div .icon { width: 16px; }
    .section-heading h2 { font-size: 1.1rem; }
    .section-heading p { font-size: .8125rem; }
    .court-grid { gap: 12px; }
    .court-card { padding: 17px 14px 12px; }
    .court-card-top { flex-direction: column; align-items: start; gap: 10px; margin-bottom: 17px; }
    .court-category { font-size: .62rem; }
    .court-name { font-size: .75rem; min-height: 42px; }
    .court-card-bottom { font-size: .62rem; line-height: 1.4; padding-top: 11px; margin-top: 15px; }
    .court-title { font-size: 1.85rem; }
    .round-chevron { width: 20px; height: 20px; }
    .preparation-card { padding: 21px; gap: 14px; }
    .preparation-icon { display: none; }
    .preparation-card > .button { margin-left: 0; margin-top: 6px; width: 100%; }
    .preparation-card p br { display: none; }
    .reading-guide { grid-template-columns: 1fr; gap: 23px; }
    .reading-guide > div:first-child { grid-column: auto; }
    .guide-item { display: grid; grid-template-columns: 26px 1fr; column-gap: 11px; }
    .guide-item > .icon { grid-column: 1; grid-row: 1 / 3; margin-bottom: 0; }
    .guide-item > h3 { grid-column: 2; margin: 2px 0 6px; }
    .guide-item > p { grid-column: 2; }
    .workspace-footer { margin: 0 20px; font-size: .62rem; }
    .library-heading h1 { font-size: 1.75rem; }
    .search-panel { padding: 16px; }
    .search-box { padding: 0 10px; gap: 8px; }
    .search-box input { font-size: 1rem; }
    .search-box kbd { display: none; }
    .filter-row { gap: 13px 10px; }
    .filter-field select { font-size: .8125rem; padding-left: 9px; }
    .clear-filters { font-size: .75rem; }
    .results-toolbar { align-items: end; gap: 8px; }
    .tabs { gap: 17px; }
    .tabs button { font-size: .75rem; padding-top: 5px; }
    .result-count { display: none; }
    .empty-state { padding: 45px 17px; }
    .empty-state h2 { font-size: 1.5rem; }
    .empty-state p { font-size: .8125rem; }
    .empty-state p br { display: none; }
    .record-card { padding: 15px 18px 11px; }
    .record-title { font-size: 1.5rem; }
    .editorial-badge { font-size: .65rem; }
    .record-card-footer .text-button { font-size: .8125rem; }
    .reader { width: 100vw; height: 100dvh; max-height: 100dvh; max-width: 100vw; border-radius: 0; margin: 0; border: 0; }
    .reader-bar { padding: 12px 18px; }
    .reader-body { padding: 24px 22px 30px; }
    .reader h2 { font-size: 2rem; }
    .reader-demo { font-size: .75rem; }
    .original-section { padding: 20px; }
    .original-section > p { font-size: 1.05rem; }
    .editorial-section p { font-size: 1rem; }
    .about-body { padding: 25px; }
    .about-body h2 { font-size: 1.7rem; }
    .pagination { gap: 10px; }
    .pagination .button { padding: 9px 10px; font-size: .75rem; }
    .pagination > span { font-size: .7rem; }
  }
  @media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
}
