:root {
    --canvas: #f7f6f3;
    --surface: #ffffff;
    --surface-muted: #fbfbfa;
    --ink: #1d1d1a;
    --ink-soft: #343430;
    --muted: #787774;
    --faint: #a5a49f;
    --border: #e8e7e3;
    --border-strong: #d8d7d2;
    --accent-blue: #e1f3fe;
    --accent-blue-ink: #1f6c9f;
    --accent-green: #edf3ec;
    --accent-green-ink: #346538;
    --accent-yellow: #fbf3db;
    --accent-yellow-ink: #956400;
    --accent-red: #fdebec;
    --accent-red-ink: #9f2f2d;
    --sidebar-width: 248px;
    --content-width: 1480px;
    font-family: "SF Pro Display", "Geist Sans", "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: var(--canvas);
    font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--canvas); }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--canvas);
    color: var(--ink);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

.app-shell { min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    padding: 28px 18px 22px;
    background: #f1f0ec;
    border-right: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 9px;
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 7px;
    background: var(--ink);
    color: #fff;
    font: 700 10px/1 "SF Mono", "Geist Mono", monospace;
    letter-spacing: .08em;
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; line-height: 1.15; letter-spacing: -.01em; }
.brand small { margin-top: 3px; color: var(--muted); font: 600 10px/1 "SF Mono", monospace; letter-spacing: .14em; text-transform: uppercase; }
.brand-logo { align-items: flex-end; }
.brand-logo img { width: 145px; height: auto; display: block; }
.brand-logo > small { margin: 0 0 3px 2px; }

.primary-nav { display: grid; gap: 5px; margin-top: 52px; }

.primary-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 43px;
    padding: 0 12px;
    border-radius: 7px;
    color: #5f5e5a;
    font-weight: 550;
    transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.primary-nav a:hover { background: rgba(255,255,255,.7); color: var(--ink); }
.primary-nav a:active { transform: scale(.98); }
.primary-nav a.is-active { background: var(--surface); color: var(--ink); border: 1px solid var(--border); }
.primary-nav svg, .mobile-nav svg, .topbar svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.primary-nav a:first-child svg, .mobile-nav a:first-child svg { fill: currentColor; stroke: none; }

.sidebar-footer { margin-top: auto; padding: 18px 8px 0; border-top: 1px solid var(--border-strong); }
.user-chip { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: #deddd8; font-weight: 700; }
.user-chip strong, .user-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip strong { font-size: 13px; }
.user-chip small { max-width: 145px; color: var(--muted); font-size: 11px; }
.logout-link { display: inline-block; margin-top: 13px; color: var(--muted); font-size: 12px; }
.logout-link:hover { color: var(--ink); }

.workspace { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar { position: sticky; top: 0; z-index: 20; height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 clamp(24px, 4vw, 64px); background: rgba(247,246,243,.94); border-bottom: 1px solid var(--border); backdrop-filter: blur(16px); }

.global-search { width: min(620px, 65vw); height: 42px; display: flex; align-items: center; gap: 11px; padding: 0 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 7px; }
.global-search svg { flex: 0 0 auto; color: var(--muted); }
.global-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); }
.global-search input::placeholder { color: var(--faint); }
kbd { min-width: 24px; height: 24px; display: grid; place-items: center; padding: 0 6px; border: 1px solid var(--border); border-bottom-color: var(--border-strong); border-radius: 4px; background: var(--canvas); color: var(--muted); font: 11px/1 "SF Mono", monospace; }
.storage-state { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.storage-state span, .status-dot { width: 7px; height: 7px; border-radius: 50%; background: #5f8b63; box-shadow: 0 0 0 4px rgba(95,139,99,.1); }

.content { width: min(100%, var(--content-width)); margin: 0 auto; padding: 52px clamp(24px, 4vw, 64px) 100px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 46px; }
.page-heading.compact { align-items: center; margin-bottom: 36px; }
.page-heading h1, .project-hero h1, .document-header h1 { max-width: 850px; margin: 6px 0 8px; font-family: "Iowan Old Style", "Baskerville", "Times New Roman", serif; font-size: clamp(40px, 4.2vw, 66px); font-weight: 500; line-height: 1.04; letter-spacing: -.038em; }
.page-heading.compact h1, .document-header h1 { font-size: clamp(34px, 3.5vw, 54px); }
.page-heading p, .project-hero p, .document-header p { max-width: 670px; margin: 0; color: var(--muted); font-size: 16px; }
.eyebrow { margin: 0 0 6px !important; color: var(--muted); font: 650 10px/1.2 "SF Mono", "Geist Mono", monospace !important; letter-spacing: .13em; text-transform: uppercase; }

.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 0 17px; border: 1px solid transparent; border-radius: 6px; cursor: pointer; font-weight: 650; line-height: 1; transition: background 180ms ease, border-color 180ms ease, transform 120ms ease; }
.button:active { transform: scale(.98); }
.button-primary { background: var(--ink); color: #fff; }
.button-primary:hover { background: #383834; }
.button-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--ink); }
.button-secondary:hover { border-color: #aaa9a4; }
.button-wide { width: 100%; }

.stats-grid { display: grid; grid-template-columns: 1.4fr .8fr .8fr; gap: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.stat-card { min-height: 176px; display: flex; flex-direction: column; justify-content: flex-end; padding: 26px 28px; border-right: 1px solid var(--border); }
.stat-card:last-child { border-right: 0; }
.stat-card strong { margin: 15px 0 3px; font-family: "Iowan Old Style", "Baskerville", serif; font-size: 52px; font-weight: 500; line-height: .9; letter-spacing: -.04em; }
.stat-card .stat-status { font-family: inherit; font-size: 25px; font-weight: 650; letter-spacing: -.03em; }
.stat-label { font: 650 10px/1 "SF Mono", monospace; letter-spacing: .1em; text-transform: uppercase; }
.stat-card small { color: var(--muted); }
.stat-blue { background: var(--accent-blue); }
.stat-green { background: var(--accent-green); }

.section-block { margin-top: 70px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-heading h2 { margin: 0; font-family: "Iowan Old Style", "Baskerville", serif; font-size: 31px; font-weight: 500; letter-spacing: -.025em; }
.section-heading > a, .back-link { color: var(--muted); font-size: 13px; }
.section-heading > a:hover, .back-link:hover { color: var(--ink); }

.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.project-grid-full { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.project-card { min-height: 238px; display: flex; flex-direction: column; padding: 25px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease; }
.project-card:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: 0 2px 8px rgba(0,0,0,.035); }
.project-card-top { display: flex; justify-content: space-between; align-items: center; }
.project-code { display: inline-flex; width: fit-content; padding: 5px 7px; border-radius: 4px; background: var(--accent-yellow); color: var(--accent-yellow-ink); font: 700 10px/1 "SF Mono", monospace; letter-spacing: .08em; }
.project-card h3 { margin: 32px 0 7px; font-family: "Iowan Old Style", "Baskerville", serif; font-size: 27px; font-weight: 500; letter-spacing: -.025em; }
.project-card p { display: -webkit-box; margin: 0; overflow: hidden; color: var(--muted); font-size: 13px; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.project-meta { display: grid; gap: 4px; margin-top: auto; padding-top: 24px; color: var(--muted); font-size: 11px; }

.badge { display: inline-flex; align-items: center; width: fit-content; min-height: 23px; padding: 0 8px; border-radius: 999px; font: 700 9px/1 "SF Mono", monospace; letter-spacing: .06em; text-transform: uppercase; }
.badge-blue { color: var(--accent-blue-ink); background: var(--accent-blue); }
.badge-green { color: var(--accent-green-ink); background: var(--accent-green); }
.badge-yellow { color: var(--accent-yellow-ink); background: var(--accent-yellow); }
.badge-red { color: var(--accent-red-ink); background: var(--accent-red); }
.badge-neutral { color: #64635f; background: #efefed; }

.document-list { overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.document-row { min-height: 76px; display: grid; grid-template-columns: 44px minmax(200px, 1.5fr) minmax(100px, .6fr) auto 90px 18px; align-items: center; gap: 16px; padding: 12px 18px; border-bottom: 1px solid var(--border); transition: background 160ms ease; }
.document-row:last-child { border-bottom: 0; }
.document-row:hover { background: var(--surface-muted); }
.file-icon { width: 42px; height: 48px; display: grid; place-items: center; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--canvas); color: var(--muted); font: 700 9px/1 "SF Mono", monospace; letter-spacing: .05em; }
.document-main { min-width: 0; }
.document-main strong, .document-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-main strong { font-size: 14px; }
.document-main small { color: var(--muted); font-size: 11px; }
.document-project { display: grid; font: 650 11px/1.4 "SF Mono", monospace; }
.document-project small { color: var(--muted); font-family: inherit; font-size: 9px; text-transform: uppercase; }
.document-row time { color: var(--muted); font: 11px/1 "SF Mono", monospace; }
.row-arrow { width: 17px; height: 17px; fill: none; stroke: var(--faint); stroke-width: 1.7; }
.empty-state { grid-column: 1 / -1; padding: 48px 28px; text-align: center; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: 10px; }
.document-list .empty-state { border: 0; }
.empty-state h3 { margin: 0 0 5px; font-family: "Iowan Old Style", serif; font-size: 24px; font-weight: 500; }
.empty-state p { margin: 0; color: var(--muted); }

.form-card { width: min(100%, 820px); padding: 34px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.form-card form > div:not(.form-actions):not(.upload-zone):not(.form-grid), .form-grid > div { margin-bottom: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
label { display: block; margin-bottom: 7px; color: var(--ink-soft); font-size: 12px; font-weight: 650; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], textarea, select { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 6px; outline: 0; background: var(--surface); color: var(--ink); transition: border-color 150ms ease, box-shadow 150ms ease; }
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: #8e8d87; box-shadow: 0 0 0 3px rgba(29,29,26,.06); }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border); }
.form-checks { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 4px; }
.form-checks > div { margin: 0 !important; }
.form-checks label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.form-checks input[type="checkbox"] { width: 17px; height: 17px; }
.form-error, .form-card ul { margin: 0 0 18px; padding: 11px 13px; border-radius: 6px; background: var(--accent-red); color: var(--accent-red-ink); font-size: 12px; list-style: none; }

.mailbox-list { display: grid; gap: 10px; }
.mailbox-row { display: grid; grid-template-columns: minmax(250px, 1.6fr) minmax(220px, 1fr) 120px auto; align-items: center; gap: 24px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; }
.mailbox-title { display: flex; align-items: center; gap: 10px; }
.mailbox-title strong { font-size: 15px; }
.mailbox-main p { margin: 6px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.mailbox-project, .mailbox-status { display: grid; gap: 4px; }
.mailbox-project span, .mailbox-status span { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.mailbox-project strong, .mailbox-status strong { font-size: 12px; }
.mailbox-actions { display: flex; gap: 7px; }
.mailbox-actions .button { min-height: 36px; padding: 0 12px; font-size: 12px; }
.status-ok { color: #296340; }
.status-error { color: var(--accent-red-ink); }

.upload-card { width: min(100%, 960px); }
.upload-zone { position: relative; min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; margin-bottom: 30px; padding: 30px; border: 1px dashed #b9b8b2; border-radius: 8px; background: var(--surface-muted); text-align: center; transition: background 180ms ease, border-color 180ms ease; }
.upload-zone.is-dragging { background: var(--accent-blue); border-color: var(--accent-blue-ink); }
.upload-zone input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; opacity: 0; }
.upload-zone svg { width: 42px; height: 42px; margin-bottom: 19px; fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.upload-zone strong { font-size: 16px; }
.upload-zone small { margin-top: 5px; color: var(--muted); }

.project-hero, .document-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; padding-bottom: 36px; border-bottom: 1px solid var(--border-strong); }
.project-title-line, .document-title-meta { display: flex; align-items: center; gap: 8px; margin-top: 18px; }
.project-info-strip { display: grid; grid-template-columns: 1.4fr .6fr .6fr; margin-top: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.project-info-strip > div { padding: 17px 20px; border-right: 1px solid var(--border); }
.project-info-strip > div:last-child { border-right: 0; }
.project-info-strip span, .project-info-strip strong { display: block; }
.project-info-strip span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }
.project-info-strip strong { margin-top: 3px; font-size: 13px; }

.document-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; margin-top: 22px; }
.viewer-card { min-width: 0; min-height: 680px; overflow: hidden; border: 1px solid var(--border); border-radius: 9px; background: #e9e8e4; }
.pdf-viewer { width: 100%; height: min(78vh, 1040px); min-height: 680px; display: block; border: 0; background: #d8d7d2; }
.image-viewer { min-height: 680px; display: grid; place-items: center; padding: 24px; overflow: auto; }
.image-viewer img { display: block; max-width: 100%; max-height: 1000px; background: var(--surface); }
.email-viewer { min-height: 680px; padding: clamp(28px, 5vw, 70px); background: var(--surface); }
.email-viewer-header { padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.email-viewer h2 { max-width: 760px; margin: 10px 0 0; font-size: clamp(25px, 3vw, 40px); line-height: 1.15; letter-spacing: -.025em; }
.email-viewer dl { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 7px 14px; padding: 20px 0; border-bottom: 1px solid var(--border); }
.email-viewer dt { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.email-viewer dd { margin: 0; overflow-wrap: anywhere; font-size: 13px; }
.email-body-preview { max-width: 800px; padding-top: 30px; white-space: normal; overflow-wrap: anywhere; color: var(--ink-soft); }
.viewer-unavailable { min-height: 680px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 50px; text-align: center; background: var(--surface); }
.viewer-unavailable h2 { margin: 22px 0 6px; font-family: "Iowan Old Style", serif; font-size: 29px; font-weight: 500; }
.viewer-unavailable p { max-width: 520px; margin: 0 0 23px; color: var(--muted); }
.file-icon-large { width: 66px; height: 78px; font-size: 12px; }
.metadata-panel { align-self: start; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; }
.metadata-section { padding: 23px; border-bottom: 1px solid var(--border); }
.metadata-section dl { display: grid; grid-template-columns: 1fr; gap: 3px; margin: 18px 0 0; }
.metadata-section dt { margin-top: 13px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.metadata-section dd { margin: 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 550; }
.metadata-section code { padding: 3px 5px; border-radius: 4px; background: var(--canvas); font: 10px/1.3 "SF Mono", monospace; }
.version-list { display: grid; gap: 8px; margin-top: 15px; }
.version-list a { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 9px; border: 1px solid var(--border); border-radius: 6px; }
.version-list a > span:first-child { display: grid; place-items: center; height: 30px; border-radius: 4px; background: var(--accent-blue); color: var(--accent-blue-ink); font: 700 10px/1 "SF Mono", monospace; }
.version-list strong, .version-list small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.version-list strong { max-width: 205px; font-size: 11px; }
.version-list small { color: var(--muted); font-size: 10px; }
.version-upload { padding: 20px 23px; }
.version-upload summary { cursor: pointer; font-weight: 650; }
.version-upload form { display: grid; gap: 13px; margin-top: 17px; }
.version-upload input[type="file"] { width: 100%; font-size: 11px; }

.search-summary { display: flex; align-items: baseline; gap: 9px; margin: -16px 0 20px; }
.search-summary strong { font-family: "Iowan Old Style", serif; font-size: 34px; font-weight: 500; }
.search-summary span { color: var(--muted); }

.api-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: 12px; }
.api-card { padding: 27px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; }
.api-card-wide { grid-column: span 1; }
.api-card:last-child { grid-column: 1 / -1; }
.api-card h2 { margin: 0 0 8px; font-family: "Iowan Old Style", serif; font-size: 27px; font-weight: 500; }
.api-card p { color: var(--muted); }
pre { max-width: 100%; margin: 17px 0; padding: 17px; overflow: auto; border: 1px solid var(--border); border-radius: 6px; background: var(--canvas); color: var(--ink-soft); }
pre code { font: 11px/1.7 "SF Mono", "Geist Mono", monospace; }
.endpoint-list > div { display: grid; grid-template-columns: 58px minmax(250px, .9fr) 1fr; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.endpoint-list > div:last-child { border-bottom: 0; }
.endpoint-list code { font: 12px/1.4 "SF Mono", monospace; }
.endpoint-list p { margin: 0; }
.method { display: inline-flex; justify-content: center; padding: 5px 7px; border-radius: 4px; font: 800 9px/1 "SF Mono", monospace; }
.method.get { background: var(--accent-blue); color: var(--accent-blue-ink); }
.method.post { background: var(--accent-green); color: var(--accent-green-ink); }

.flash { margin-bottom: 22px; padding: 12px 15px; border: 1px solid var(--border); border-radius: 7px; font-size: 13px; }
.flash-success { background: var(--accent-green); color: var(--accent-green-ink); }
.flash-error { background: var(--accent-red); color: var(--accent-red-ink); }

.login-page { background: var(--canvas); }
.login-simple { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-box { width: min(100%, 430px); padding: 34px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.login-brand { display: grid; gap: 17px; padding: 0 0 28px; border-bottom: 1px solid var(--border); }
.login-brand img { width: 190px; height: auto; }
.login-brand strong, .login-brand small { display: block; }
.login-brand strong { font-size: 14px; }
.login-brand small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.login-form { width: 100%; padding-top: 28px; }
.form-heading { margin-bottom: 24px; }
.form-heading h1 { margin: 0; font-size: 24px; font-weight: 650; letter-spacing: -.02em; }
.login-form input { margin-bottom: 19px; }
.login-form .button { margin-top: 9px; }

.mobile-nav { display: none; }
.reveal { animation: reveal 600ms cubic-bezier(.16,1,.3,1) both; animation-delay: calc(var(--index) * 70ms); }
@keyframes reveal { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (max-width: 1120px) {
    :root { --sidebar-width: 218px; }
    .project-grid, .project-grid-full { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .document-layout { grid-template-columns: minmax(0, 1fr) 285px; }
    .document-row { grid-template-columns: 44px minmax(190px, 1fr) 100px auto 18px; }
    .document-row time { display: none; }
}

@media (max-width: 820px) {
    .sidebar { display: none; }
    .workspace { margin-left: 0; }
    .topbar { height: 65px; padding: 0 16px; }
    .global-search { width: 100%; }
    .global-search kbd, .storage-state { display: none; }
    .content { padding: 32px 16px 105px; }
    .mobile-nav { position: fixed; inset: auto 0 0; z-index: 50; height: calc(72px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5, 1fr); padding: 8px 8px env(safe-area-inset-bottom); background: rgba(255,255,255,.96); border-top: 1px solid var(--border); backdrop-filter: blur(15px); }
    .mobile-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 9px; }
    .mobile-nav svg { width: 20px; height: 20px; }
    .mobile-nav .mobile-add svg { width: 34px; height: 34px; padding: 8px; border-radius: 6px; background: var(--ink); color: #fff; }
    .page-heading, .project-hero, .document-header { align-items: flex-start; flex-direction: column; margin-bottom: 30px; }
    .page-heading h1, .project-hero h1, .document-header h1 { font-size: 42px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-card { min-height: 145px; padding: 20px; }
    .stat-card:first-child { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--border); }
    .stat-card:nth-child(2) { border-right: 1px solid var(--border); }
    .section-block { margin-top: 48px; }
    .project-grid, .project-grid-full { grid-template-columns: 1fr; }
    .project-card { min-height: 205px; }
    .document-row { grid-template-columns: 40px minmax(0, 1fr) 18px; gap: 12px; padding: 12px; }
    .file-icon { width: 38px; height: 44px; }
    .document-project, .document-category, .document-row time { display: none; }
    .form-card { padding: 22px; }
    .form-grid { grid-template-columns: 1fr; }
    .project-info-strip { grid-template-columns: 1fr; }
    .project-info-strip > div { border-right: 0; border-bottom: 1px solid var(--border); }
    .project-info-strip > div:last-child { border-bottom: 0; }
    .document-layout { grid-template-columns: 1fr; }
    .viewer-card, .image-viewer, .email-viewer, .viewer-unavailable { min-height: 500px; }
    .pdf-viewer { min-height: 70vh; }
    .metadata-panel { width: 100%; }
    .api-layout { grid-template-columns: 1fr; }
    .api-card, .api-card-wide, .api-card:last-child { grid-column: 1; }
    .endpoint-list > div { grid-template-columns: 58px 1fr; }
    .endpoint-list p { grid-column: 2; }
    .login-simple { padding: 18px; }
    .mailbox-row { grid-template-columns: 1fr; gap: 15px; }
    .mailbox-actions .button, .mailbox-actions form { flex: 1; width: 100%; }
}

@media (max-width: 480px) {
    .login-box { padding: 25px; }
    .page-heading h1, .project-hero h1, .document-header h1 { font-size: 36px; }
    .page-heading .button, .project-hero > .button, .document-header > .button { width: 100%; }
    .stat-card strong { font-size: 42px; }
    .section-heading { align-items: flex-start; }
    .section-heading h2 { font-size: 27px; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .button { width: 100%; }
    .upload-zone { min-height: 190px; padding: 20px; }
    .viewer-card, .image-viewer, .email-viewer, .viewer-unavailable { min-height: 420px; }
    .viewer-unavailable { padding: 28px; }
}
