:root { color-scheme: light; font-family: system-ui, sans-serif; color: #193044; background: #f4f7fa; }
* { box-sizing: border-box; }
body { margin: 0; }
header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .8rem; padding: 1rem max(1rem, calc((100vw - 72rem) / 2)); background: #122638; color: white; }
header a, .quiet { color: white; }
.brand { font-size: 1.3rem; font-weight: 750; letter-spacing: .03em; text-decoration: none; }
nav, nav form { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .9rem; margin: 0; }
main { max-width: 72rem; margin: 2rem auto; padding: 0 1rem 3rem; }
h1 { overflow-wrap: anywhere; }
h2 { font-size: 1.18rem; }
a { color: #075b85; }
form { display: flex; flex-wrap: wrap; gap: .65rem; align-items: end; margin: .75rem 0; }
label { display: grid; gap: .2rem; font-size: .9rem; }
label:has(input[type=checkbox]) { display: flex; align-items: center; }
input, select, button { max-width: 100%; font: inherit; padding: .52rem .7rem; border: 1px solid #9cabb9; border-radius: .35rem; }
button { background: #075b85; color: white; border-color: #075b85; cursor: pointer; }
.quiet { background: transparent; border-color: #7691a4; }
section, details, .table, .notice, .error, pre { background: white; border: 1px solid #d3dce5; border-radius: .5rem; padding: .8rem; margin: .8rem 0; }
summary { cursor: pointer; }
.table { overflow: auto; padding: 0; }
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: .7rem; border-bottom: 1px solid #d3dce5; overflow-wrap: anywhere; vertical-align: top; }
td details { padding: .4rem; margin: .35rem 0 0; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.notice { border-color: #268163; }
.error { border-color: #a53831; }
.results li { margin-bottom: 1.1rem; }
.results p { white-space: pre-wrap; }
:focus-visible { outline: .16rem solid #ce6600; outline-offset: .12rem; }
.page-preview { display: block; max-width: 100%; height: auto; border: 1px solid #d3dce5; }
fieldset { flex: 1 1 100%; display: grid; gap: .65rem; min-width: 0; border: 1px solid #d3dce5; border-radius: .4rem; }
textarea { width: 100%; font: inherit; }
.settings-layout form { display: grid; align-items: start; gap: .9rem; width: 100%; max-width: 44rem; }
.settings-layout form label { font-weight: 600; min-width: 0; gap: .35rem; }
.settings-layout form input:not([type=checkbox]):not([type=hidden]), .settings-layout form select, .settings-layout form textarea {
    width: 100%;
    min-width: 0;
    font-weight: normal;
}
.settings-layout form input[type=checkbox] { flex: 0 0 auto; }
.settings-layout form > button { justify-self: start; }
.settings-layout small { color: #405970; font-weight: normal; overflow-wrap: anywhere; }
.settings-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.file-manager { display: grid; grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr); gap: 1rem; }
.file-sidebar { background: #fff; border: 1px solid #d3dce5; border-radius: .5rem; padding: .85rem; align-self: start; }
.file-sidebar nav { display: grid; gap: .3rem; overflow-wrap: anywhere; }
.file-sidebar [hidden] { display: none; }
.file-sidebar nav strong:not(:first-child) { margin-top: .4rem; }
.file-content { min-width: 0; }
.crumbs { margin: 0 0 .8rem; overflow-wrap: anywhere; }
.file-toolbar { background: white; border: 1px solid #d3dce5; border-top: .2rem solid #1678aa; border-radius: .5rem; padding: .25rem .85rem .6rem; }
.file-toolbar form label { min-width: 0; }
.file-empty { margin-top: .8rem; }
.file-note { color: #405970; }
.file-icon { color: #406585; display: inline-block; width: 1.3rem; }
.file-actions { display: flex; flex-wrap: wrap; align-items: baseline; gap: .65rem; }
.file-actions details { margin: 0; }
.file-sidebar a { padding: .45rem .55rem; border-radius: .3rem; text-decoration: none; }
.file-sidebar a:hover, .file-sidebar .current-folder { background: #e5f2fa; color: #124e70; }
.file-sidebar #folder-filter { margin: .35rem 0; }
.file-sidebar #folder-filter input { width: 100%; min-width: 0; }
.file-top, .file-location { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .7rem; }
.file-top form { flex: 1 1 19rem; }
.file-top form label { flex: 1 1 10rem; }
.file-top input[type=search] { width: 100%; }
.file-location .crumbs { margin: 0; }
.file-count { color: #405970; font-size: .9rem; white-space: nowrap; }
.import-link { background: #075b85; border-radius: .35rem; color: white; font-weight: 650; padding: .65rem .85rem; text-decoration: none; }
.import-link:hover { background: #064b6f; }
#file-import { scroll-margin-top: 1rem; }
#file-import:target { border-color: #1678aa; }
#file-import h2 { margin: .25rem 0 .5rem; }
#file-import form { align-items: flex-start; }
.upload-zone { flex: 1 1 18rem; min-width: 0; padding: .8rem; border: 1px dashed #7798ac; border-radius: .4rem; background: #f4f9fc; }
.upload-zone.is-dragging { border-color: #075b85; background: #deeffb; }
.upload-zone p { margin: 0 0 .6rem; }
.upload-zone small { display: block; margin-top: .45rem; }
#upload-status:empty, #upload-results:empty { display: none; }
#upload-results { overflow-wrap: anywhere; }
.upload-ok { color: #176243; }
.file-sort { margin: .8rem 0; }
.document-list { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid #d3dce5; border-radius: .5rem; }
.document-row { display: grid; grid-template-columns: 4.25rem minmax(0, 1fr) auto; gap: .9rem; padding: .85rem; align-items: start; }
.document-row + .document-row { border-top: 1px solid #dce4eb; }
.document-row:nth-child(even) { background: #f9fbfc; }
.document-thumb { display: grid; width: 4.25rem; min-height: 4.75rem; place-items: center; background: #eaf2f7; border-radius: .3rem; text-decoration: none; }
.document-thumb img { width: 100%; height: 5.125rem; object-fit: contain; background: #f2f6f8; }
.document-thumb .file-icon { font-size: 1.7rem; width: auto; }
.document-info { overflow-wrap: anywhere; }
.document-info p { color: #405970; margin: .35rem 0; font-size: .9rem; }
.document-row .file-actions { max-width: 18rem; }
.file-pagination { margin: 1rem 0; }
@media (max-width: 650px) {
    .file-manager { grid-template-columns: minmax(0, 1fr); }
    .file-sidebar nav { display: flex; flex-wrap: wrap; align-items: center; }
    .file-sidebar nav strong:not(:first-child) { margin-top: 0; }
    .file-sidebar nav strong { width: 100%; }
    .file-sidebar #folder-filter { width: 100%; }
    .document-row { grid-template-columns: 3.1rem minmax(0, 1fr); gap: .65rem; }
    .document-thumb { width: 3.1rem; min-height: 3.7rem; }
    .document-thumb img { height: 3.7rem; }
    .document-row .file-actions { grid-column: 2; }
}
