:root {
    --navy: #0b3d4c;
    --navy-deep: #072e3a;
    --teal: #16697a;
    --teal-bright: #1d8a9c;
    --gold: #d4b46a;
    --gold-dark: #b8903a;
    --cream: #f4efe4;
    --paper: #fffcf7;
    --ink: #1c2a31;
    --muted: #5c6d75;
    --line: #d9d1c3;
    --danger: #9b2c2c;
    --ok: #2f6f4e;
    --shadow: 0 18px 40px rgba(11, 61, 76, 0.12);
    --radius: 18px;
}

* { box-sizing: border-box; }
html, body {
    margin: 0;
    padding: 0;
    max-width: 100%;
    overflow-x: hidden;
}
html {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge legacy */
}
html::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}
body {
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--cream);
    min-height: 100vh;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
body::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}
h1, h2, h3 {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-weight: 700;
    margin: 0 0 0.35em;
    letter-spacing: 0.01em;
}
h1 { font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.1; }
h2 { font-size: 1.55rem; }
p { margin: 0 0 0.8rem; }
a { color: var(--teal); text-decoration: none; }
code {
    background: #efe7d6;
    padding: 0.1rem 0.4rem;
    border-radius: 6px;
    font-size: 0.92em;
}

.muted { color: var(--muted); }
.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--gold-dark);
    margin-bottom: 0.4rem;
}
.lede { color: var(--muted); max-width: 46rem; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: 0;
    border-radius: 999px;
    padding: 0.72rem 1.2rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--teal); color: #fff; box-shadow: 0 8px 18px rgba(22, 105, 122, 0.25); }
.btn-primary:hover { background: var(--teal-bright); color: #fff; }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-deep); color: #fff; }
.btn-ghost { background: transparent; color: var(--navy); border: 1px solid var(--line); }
.btn-block { width: 100%; }
.icon-btn {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #efe7d6;
    color: var(--navy);
    font-size: 1.3rem;
    cursor: pointer;
}

.input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 12px;
    padding: 0.72rem 0.85rem;
    font: inherit;
    color: var(--ink);
}
.input:focus, select:focus, textarea:focus {
    outline: 2px solid rgba(22, 105, 122, 0.35);
    border-color: var(--teal);
}
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field > span { font-size: 0.86rem; font-weight: 600; color: var(--navy); }
.field-full { grid-column: 1 / -1; }
.error { color: var(--danger); }

.topbar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.85rem 1.5rem;
    background: linear-gradient(90deg, var(--navy-deep), var(--teal));
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 8px 24px rgba(7, 46, 58, 0.2);
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
}
.brand .seal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.brand-logo,
.hero-logo {
    display: block;
    object-fit: contain;
}
.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    padding: 2px;
}
.hero-logo {
    width: 96px;
    height: 96px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    padding: 8px;
}
.brand strong { display: block; font-family: "Cormorant Garamond", serif; font-size: 1.25rem; }
.brand small { display: block; color: #dce9ec; letter-spacing: 0.04em; }
.top-nav { display: flex; gap: 1rem; flex: 1; }
.top-nav a { color: #e8f3f5; font-weight: 600; }
.top-nav a:hover { color: var(--gold); }
.user-chip { display: flex; align-items: center; gap: 0.75rem; }
.user-name { font-weight: 600; }
.role-pill {
    background: rgba(212, 180, 106, 0.18);
    color: var(--gold);
    border: 1px solid rgba(212, 180, 106, 0.45);
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.topbar .btn-ghost { color: #fff; border-color: rgba(255,255,255,0.25); }

.page { width: min(1180px, calc(100% - 2rem)); margin: 1.5rem auto 3rem; max-width: 100%; }
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.crumbs { display: flex; gap: 0.45rem; color: var(--muted); margin-bottom: 1rem; font-size: 0.92rem; }
.crumbs a { color: var(--teal); }

.stat-row { display: flex; gap: 0.8rem; }
.stat-card {
    background: var(--navy);
    color: #fff;
    min-width: 120px;
    padding: 0.9rem 1.1rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    text-decoration: none;
    display: block;
    transition: transform 0.15s ease, background 0.15s ease;
}
a.stat-card:hover {
    transform: translateY(-3px);
    background: var(--navy-deep);
    color: #fff;
}
.stat-card span { display: block; font-size: 1.7rem; font-family: "Cormorant Garamond", serif; }
.stat-card small { color: #d5e4e8; }

.type-grid, .mode-grid, .card-list { display: grid; gap: 1rem; }
.type-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.type-card, .mode-card, .matter-card, .panel, .doc-card {
    background: var(--paper);
    border: 1px solid rgba(11, 61, 76, 0.08);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.type-card {
    padding: 1.2rem 1.25rem 1.1rem;
    color: inherit;
    display: flex;
    flex-direction: column;
    min-height: 200px;
    transition: transform 0.16s ease;
}
.type-card:hover { transform: translateY(-4px); color: inherit; }
.type-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.type-code {
    background: var(--navy);
    color: #fff;
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}
.count-chip { color: var(--muted); font-size: 0.85rem; }
.type-cta { margin-top: auto; color: var(--teal); font-weight: 700; }

.mode-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.mode-card { padding: 1.6rem; min-height: 250px; color: inherit; display: flex; flex-direction: column; gap: 0.6rem; }
.mode-card:hover { color: inherit; }
.mode-kicker { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.75rem; font-weight: 700; color: var(--gold-dark); }
.mode-file { border-top: 6px solid var(--teal); }
.mode-archive { border-top: 6px solid var(--navy); }
.mode-card .btn { margin-top: auto; align-self: flex-start; }

.file-layout, .detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.file-layout-single { grid-template-columns: 1fr; }
.panel { padding: 1.2rem; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.form-actions { display: flex; gap: 0.7rem; margin-top: 1.1rem; flex-wrap: wrap; }
.form-actions[hidden] { display: none; }

.doc-row {
    border: 1px dashed var(--line);
    border-radius: 14px;
    padding: 0.9rem;
    margin-bottom: 0.8rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    background: #fff;
}
.upload-row { display: flex; gap: 0.6rem; align-items: stretch; }
.dropzone {
    flex: 1;
    border: 1px dashed #c9bda8;
    border-radius: 12px;
    padding: 0.7rem;
    background: #fbf7ef;
    cursor: pointer;
}
.dropzone input { display: none; }
.drop-label { display: block; font-weight: 600; color: var(--navy); }
.hint { color: var(--muted); font-size: 0.88rem; margin-top: 0.7rem; }

.filter-bar { display: flex; gap: 0.7rem; margin-bottom: 0.8rem; flex-wrap: wrap; }
.search-input { flex: 1; min-width: 220px; }
.result-meta { color: var(--muted); margin-bottom: 0.8rem; }

.table-wrap { overflow: auto; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 0.85rem 1rem; text-align: left; border-bottom: 1px solid #eee5d6; }
.data-table th { background: var(--navy); color: #fff; font-weight: 600; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: #f3eee3; }

.status {
    display: inline-block;
    border-radius: 999px;
    padding: 0.18rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 700;
    background: #e8e1d2;
    color: var(--navy);
}
.status-filed { background: #d7eef2; color: #12515e; }
.status-pending { background: #f7e7c6; color: #7a5a12; }
.status-hearing { background: #dce8f8; color: #1d4e89; }
.status-closed { background: #dcecde; color: #215c38; }
.status-archived { background: #e7e2ea; color: #4c3d5c; }
.status-lg { font-size: 0.92rem; padding: 0.4rem 0.9rem; }

.meta-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem 1rem; margin: 0; }
.meta-list div.full { grid-column: 1 / -1; }
.meta-list dt { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.meta-list dd { margin: 0.15rem 0 0; font-weight: 600; }
.inline-form { display: flex; gap: 0.7rem; align-items: end; margin-top: 1rem; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 0.7rem 0; border-bottom: 1px solid #eee5d6; }
.timeline span { display: block; color: var(--muted); font-size: 0.85rem; }

.doc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.9rem; }
.doc-card { padding: 0.9rem; display: flex; gap: 0.8rem; }
.doc-preview {
    width: 84px;
    height: 84px;
    border-radius: 12px;
    background: #efe7d6;
    display: grid;
    place-items: center;
    overflow: hidden;
    flex-shrink: 0;
}
.doc-preview img { width: 100%; height: 100%; object-fit: cover; }
.file-badge { font-weight: 800; color: var(--navy); }
.add-docs { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }

.matter-card {
    padding: 1.1rem 1.2rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: inherit;
}
.matter-card:hover { color: inherit; transform: none; border-color: var(--teal); }
.matter-card h2 { font-size: 1.4rem; }
.matter-side { text-align: right; display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-end; }

.empty, .notice {
    background: var(--paper);
    border-radius: var(--radius);
    padding: 1.4rem;
    box-shadow: var(--shadow);
}
.notice { border-left: 5px solid var(--gold); margin-bottom: 1rem; }

.pager { display: flex; gap: 0.8rem; align-items: center; margin-top: 1rem; }

.toast-stack {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 40;
    display: grid;
    gap: 0.5rem;
}
.toast {
    background: var(--navy);
    color: #fff;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    min-width: 240px;
}
.toast-success { background: var(--ok); }
.toast-error { background: var(--danger); }
.toast-warning { background: #8a5a12; }

.login-body {
    background: var(--navy-deep);
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.login-body::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}
.login-shell {
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    max-width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    overflow: hidden;
}
.hero-panel {
    background:
        radial-gradient(circle at 20% 20%, rgba(212,180,106,0.18), transparent 32%),
        linear-gradient(160deg, var(--navy-deep), var(--teal));
    color: #fff;
    padding: clamp(2rem, 6vw, 5rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}
.hero-panel h1 { color: #fff; max-width: 14ch; }
.hero-copy { color: #dce9ec; max-width: 34rem; font-size: 1.08rem; }
.hero-points { color: #f4efe4; line-height: 1.9; padding-left: 1.1rem; }
.login-panel {
    background: var(--cream);
    padding: clamp(1.5rem, 5vw, 3.5rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    max-width: 100%;
}
.login-form {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 100%;
}
.login-form .btn-block {
    margin-top: 0.35rem;
}
.role-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
    margin: 1rem 0 1.2rem;
    max-width: 100%;
}
.role-card {
    background: #fff;
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 0.9rem 0.7rem;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(11, 61, 76, 0.08);
    min-width: 0;
}
.role-card strong { display: block; font-family: "Cormorant Garamond", serif; font-size: 1.2rem; }
.role-card small { color: var(--muted); }
.role-card[aria-pressed="true"], .role-card.is-active {
    border-color: var(--teal);
    background: #eaf5f6;
}
.role-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--navy);
    color: var(--gold);
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.scan-modal {
    position: fixed;
    inset: 0;
    background: rgba(7, 46, 58, 0.62);
    display: grid;
    place-items: center;
    z-index: 60;
    padding: 1rem;
}
.doc-modal {
    position: fixed;
    inset: 0;
    background: rgba(7, 46, 58, 0.62);
    display: grid;
    place-items: center;
    z-index: 50;
    padding: 1rem;
    overflow: auto;
}
.doc-modal[hidden] { display: none; }
.doc-dialog {
    background: var(--paper);
    width: min(860px, 100%);
    border-radius: 20px;
    box-shadow: var(--shadow);
    max-height: calc(100vh - 2rem);
    overflow: auto;
}
.composer-head-actions { display: flex; align-items: center; gap: 0.5rem; }
body.modal-open { overflow: hidden; }
.scan-modal[hidden] { display: none; }
.scan-dialog {
    background: var(--paper);
    width: min(720px, 100%);
    border-radius: 20px;
    padding: 1.1rem;
    box-shadow: var(--shadow);
}
.scan-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.35rem; }
.scan-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
#scan-windows-dialog[hidden] { display: none; }
.scan-status { color: var(--muted); margin: 0.4rem 0 0.8rem; }
.scan-device-list { display: grid; gap: 0.55rem; margin-bottom: 0.9rem; }
.scan-device {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
}
.scan-device:has(input:checked) {
    border-color: var(--teal);
    background: #eaf5f6;
}
.scan-device small { display: block; color: var(--muted); }
.scan-camera-box { margin: 0.9rem 0; }
.scan-camera-box summary { cursor: pointer; font-weight: 600; color: var(--navy); }
#scan-video { width: 100%; border-radius: 14px; background: #111; min-height: 220px; margin: 0.8rem 0; }

.docs-body .page { margin-top: 1rem; margin-bottom: 2rem; }
.docs-body .crumbs { margin-bottom: 0.65rem; }
.docs-hero {
    background:
        radial-gradient(circle at 88% 10%, rgba(212, 180, 106, 0.22), transparent 28%),
        linear-gradient(135deg, var(--navy-deep), var(--teal));
    color: #fff;
    border-radius: 16px;
    padding: 0.9rem 1.2rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.85rem;
    box-shadow: var(--shadow);
}
.docs-hero h1 {
    color: #fff;
    font-size: clamp(1.45rem, 2.4vw, 2rem);
    margin: 0 0 0.15rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
}
.docs-hero p { color: #dce9ec; margin: 0; font-size: 0.92rem; }
.docs-hero .eyebrow { color: var(--gold); margin-bottom: 0.15rem; }
.docs-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: flex-end;
    align-items: center;
    max-width: 22rem;
}
.hero-stat {
    background: rgba(255,255,255,0.12);
    border-radius: 999px;
    padding: 0.28rem 0.7rem;
    font-size: 0.82rem;
    white-space: nowrap;
}
.docs-hero .status { background: rgba(255,255,255,0.14); color: #fff; }

.docs-shell {
    display: grid;
    grid-template-columns: minmax(280px, 0.92fr) minmax(320px, 1.08fr);
    gap: 1.1rem;
    align-items: start;
}
.filed-panel { margin-bottom: 0.85rem; padding: 0.9rem 1rem 1rem; }
.filed-panel .panel-head { margin-bottom: 0.7rem; gap: 0.75rem; flex-wrap: wrap; }
.panel-actions { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
.doc-search { min-width: 220px; flex: 1; max-width: 320px; }
.filed-empty-search {
    margin: 0;
    padding: 0.9rem 1rem;
    color: var(--muted);
}
.filed-panel .count-chip {
    background: var(--navy);
    color: #fff;
    border-radius: 999px;
    padding: 0.2rem 0.7rem;
    font-weight: 700;
}
.filed-table-wrap { box-shadow: none; border: 1px solid #eee5d6; }
.filed-table tbody tr { cursor: default; }
.filed-table .col-num { width: 3rem; color: var(--muted); font-weight: 700; }
.filed-table .col-action { text-align: right; white-space: nowrap; }
.filed-filename {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 400;
    margin-top: 0.15rem;
}
.filed-empty {
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.85rem;
    text-align: left;
    padding: 0.85rem 1rem;
    border: 1px dashed var(--line);
    border-radius: 12px;
    background: #fff;
}
.filed-empty h3 { margin-bottom: 0.3rem; }
.filed-empty p { margin: 0; color: var(--muted); max-width: 22rem; }

.composer {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 1.15rem 1.25rem 1.2rem;
    margin-top: 0;
}
.composer-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.8rem;
    margin-bottom: 1rem;
}
.composer-head h2 { margin: 0; }
.composer-list { counter-reset: docslot; }
.doc-row {
    position: relative;
    padding-left: 3.1rem;
}
.doc-row-index {
    position: absolute;
    left: 0.75rem;
    top: 0.9rem;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    background: var(--navy);
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 800;
    display: grid;
    place-items: center;
}
.composer-list .doc-row { counter-increment: docslot; }
.composer-list .doc-row-index::before { content: counter(docslot); }
.dropzone {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 0.65rem;
    align-items: center;
    min-height: 74px;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.drop-icon {
    grid-row: 1 / span 2;
    color: var(--teal);
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #eaf5f6;
}
.dropzone.is-filled {
    border-color: var(--teal);
    background: #eaf5f6;
}
.scan-pages {
    display: flex;
    align-items: flex-end;
    gap: 0.6rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}
.scan-pages[hidden] { display: none; }
.scan-page-list {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
}
.scan-page {
    margin: 0;
    width: 84px;
    text-align: center;
}
.scan-page img {
    width: 84px;
    height: 108px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: block;
}
.scan-page figcaption {
    margin-top: 0.25rem;
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 600;
}
.scan-add-page {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px dashed var(--teal);
    background: #eaf5f6;
    color: var(--teal);
    font-size: 1.45rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    align-self: center;
    display: grid;
    place-items: center;
    padding: 0;
}
.scan-add-page:hover {
    background: var(--teal);
    color: #fff;
    border-style: solid;
}
.file-types,
.file-types span {
    display: none !important;
}
.composer-actions {
    padding-top: 0.4rem;
    border-top: 1px solid #eee5d6;
    margin-top: 1rem;
}
.filed-save-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.95rem 1rem;
    border-top: 1px solid var(--line);
    background: #f7f1e6;
    border-radius: 12px;
}
.filed-save-bar p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.9rem; }
.archive-modal { z-index: 55; }
.archive-dialog { width: min(560px, 100%); }
.archive-confirm { padding: 1.15rem 1.25rem 1.2rem; }
.archive-error {
    background: #f8e4e4;
    color: var(--danger);
    padding: 0.7rem 0.85rem;
    border-radius: 10px;
    font-weight: 600;
}
.check-row {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin: 0.85rem 0 0.4rem;
    font-weight: 600;
}
.check-row input { margin-top: 0.25rem; }

@media (max-width: 960px) {
    .docs-hero { flex-direction: column; align-items: flex-start; }
    .docs-hero-meta { justify-content: flex-start; max-width: none; }
    .docs-shell { grid-template-columns: 1fr; }
    .login-shell, .file-layout, .detail-grid, .form-grid, .doc-row, .meta-list, .role-grid {
        grid-template-columns: 1fr;
    }
    .topbar { flex-wrap: wrap; }
    .page-head, .matter-card, .upload-row, .inline-form, .filed-save-bar { flex-direction: column; align-items: stretch; }
    .matter-side { text-align: left; align-items: flex-start; }
}
