:root{font-family:var(--font-ui,"Segoe UI",system-ui,Arial,sans-serif);color:#283241;background:#fafafb;line-height:1.6;font-synthesis:none;--red:#bc001b;--line:#e2e5ea}
*{box-sizing:border-box}body{margin:0}button,input,textarea,select{font:inherit}button{cursor:pointer;border:1px solid #dfc7ce;border-radius:6px;background:white;color:#a30018;padding:9px 14px;font-size:13px}button:disabled{opacity:.55;cursor:wait}a{color:#a30018}button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:3px solid #d88a97;outline-offset:2px}[hidden]{display:none!important}
header{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:16px max(20px,calc((100% - 1200px)/2));border-bottom:1px solid var(--line);background:white}.brand{display:flex;gap:11px;align-items:center;color:#283241;text-decoration:none;font-weight:bold}.brand small{display:block;font-size:11px;color:#737b87;font-weight:normal}.header-actions{display:flex;align-items:center;gap:18px;font-size:13px}
main{max-width:1240px;margin:auto;padding:20px}.login-panel{max-width:420px;margin:55px auto;background:white;border:1px solid var(--line);border-radius:10px;padding:30px}h1{font-size:24px;line-height:1.4;margin:10px 0 22px}h2{font-size:17px;margin:0 0 16px}.primary{background:var(--red);color:white;border-color:var(--red)}label{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:600;margin:0 0 17px;min-width:0}input,textarea,select{width:100%;min-width:0;border:1px solid #d8dce4;border-radius:5px;background:white;padding:10px 11px;font-size:14px;color:#283241}textarea{resize:vertical;font-weight:normal;line-height:1.7}input[readonly]{background:#f3f4f6;color:#697586}
nav{display:flex;gap:8px;flex-wrap:wrap;border-bottom:1px solid var(--line);padding:0 0 18px;margin:0 0 24px}nav button[aria-current]{background:#fff1f3;border-color:#bc001b;font-weight:bold}.section-head{display:flex;align-items:center;justify-content:space-between;gap:15px;margin:0 0 16px}.section-head h1{margin:0}.split{display:grid;grid-template-columns:minmax(250px,.9fr) minmax(0,1.6fr);gap:24px;margin-top:24px;align-items:start}.editor{background:white;border:1px solid var(--line);border-radius:8px;padding:24px;max-width:800px}.form-row{display:flex;gap:14px}.form-row label{flex:1}
.record-list{display:grid;gap:8px;max-height:70vh;overflow:auto;padding:2px 4px 8px 2px}.record-list button{text-align:left;color:#364152;border-color:var(--line);width:100%;overflow-wrap:anywhere}.record-list button:hover{border-color:#c58b96;background:#fffafb}.record-list strong{display:block;color:#a30018;font-size:13px}.record-list span{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;font-size:12px;margin:4px 0}.muted{font-size:12px;color:#707b89;font-weight:normal}.export-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:20px;margin:24px 0}.export-grid article{padding:22px;border:1px solid var(--line);border-radius:8px;background:white}.export-grid p{font-size:13px}.source-links{display:flex;flex-wrap:wrap;gap:12px;margin-top:18px;font-size:12px}#notice:empty{display:none}#notice{padding:12px 16px;border-radius:6px;background:#fff4dd;color:#76561c;white-space:pre-wrap;overflow-wrap:anywhere}#notice.success{background:#eaf4ec;color:#2c5e38}#audit p{font-size:13px;border-bottom:1px solid var(--line);padding:10px 0}
@media(max-width:750px){header{padding:13px 16px}.brand{font-size:14px}.header-actions{gap:10px;font-size:12px}main{padding:16px}.split{grid-template-columns:1fr}.record-list{max-height:320px}.editor{padding:18px}.form-row{flex-wrap:wrap}.form-row label{flex-basis:100px}h1{font-size:21px}.login-panel{margin:30px auto;padding:24px}input,textarea,select{font-size:16px}nav{gap:6px}nav button{font-size:12px;padding:8px 10px}}

#import-progress{font-size:13px;overflow-wrap:anywhere}.import-examples{max-height:580px;overflow:auto;margin:18px 0}.import-examples details{padding:12px 0;border-bottom:1px solid var(--line)}.import-examples p{white-space:pre-wrap;overflow-wrap:anywhere}.import-warning{padding:12px;background:#fff4dd}.import-history-item{padding:18px;border:1px solid var(--line);margin:12px 0;background:white;border-radius:8px}.import-history-item p{font-size:13px}.import-open{display:inline-block;margin-top:16px}#import-form{margin-top:20px}#import-preview{align-self:start}

body { font-size: 15px; line-height: 1.65; }
header { flex-wrap: wrap; row-gap: 12px; }
.brand { flex: 0 0 auto; font-size: 17px; font-weight: 600; line-height: 1.4; }
.brand img { flex: 0 0 38px; width: 38px; height: 38px; }
.brand > span { white-space: nowrap; }
.brand small { font-size: 12px; line-height: 1.5; }
.header-actions { margin-left: auto; flex-shrink: 0; gap: 12px; font-size: 13px; line-height: 1.5; }
button { min-height: 42px; line-height: 1.5; font-weight: 500; }
h1 { font-size: 24px; line-height: 1.4; font-weight: 700; }
h2 { font-size: 18px; line-height: 1.5; font-weight: 600; }
p { margin: 0 0 16px; }
label { font-size: 14px; line-height: 1.5; font-weight: 600; gap: 8px; margin-bottom: 18px; }
input, select, textarea { font-size: 15px; font-weight: 400; line-height: 1.5; padding: 10px 12px; }
input, select { height: 46px; min-height: 46px; }
textarea { line-height: 1.6; }
input[type="file"] { height: auto; padding: 8px; font-size: 13px; line-height: 26px; }
input::file-selector-button { font: inherit; font-weight: 500; line-height: 24px; padding: 1px 10px; margin-right: 10px; border: 1px solid #d8dce4; border-radius: 4px; color: #283241; background: #f7f8fa; cursor: pointer; }
nav { align-items: stretch; }
nav button { padding: 10px 16px; font-size: 14px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; align-items: end; }
.form-row label { align-self: end; }
.form-row-citation { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.section-head { align-items: center; }
.section-head button { flex-shrink: 0; }
.editor { min-width: 0; }
.editor details { margin: 18px 0; }
summary { font-size: 14px; line-height: 1.6; padding: 4px 0; cursor: pointer; }
details[open] > summary { margin-bottom: 12px; }
.muted, .source-links, .record-list span { font-size: 13px; line-height: 1.6; }
.record-list button { padding: 14px 16px; font-weight: 400; }
.record-list strong { font-size: 14px; line-height: 1.5; font-weight: 600; }
.record-list span { margin: 6px 0 0; }
.export-grid article { display: flex; flex-direction: column; align-items: flex-start; }
.export-grid p { font-size: 14px; }
.export-grid article > button { margin-top: auto; }
.export-grid label { align-self: stretch; }
#imports .split { grid-template-columns: minmax(300px, 1fr) minmax(0, 1.25fr); }
#imports > h2 { margin-top: 28px; }
#import-preview { font-size: 15px; line-height: 1.65; }
#import-preview > p { margin-bottom: 16px; }
#import-progress { font-size: 13px; line-height: 1.6; }
.import-examples details { margin: 0; padding: 10px 0; }
.import-examples summary { font-weight: 500; }
.import-examples p { font-size: 14px; line-height: 1.65; }
.import-examples small { font-size: 12px; line-height: 1.5; }
.import-history-item p { font-size: 14px; line-height: 1.6; }
.import-history-item strong { font-weight: 600; }

@media (max-width: 750px) {
  .brand { font-size: 16px; }
  .brand small { font-size: 11px; }
  .header-actions { gap: 10px; }
  .split, #imports .split { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  input, select, textarea { font-size: 16px; }
  input[type="file"] { font-size: 13px; }
  nav button { font-size: 13px; }
  .section-head h1 { font-size: 21px; }
}
@media (max-width: 560px) {
  nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  nav button { min-width: 0; min-height: 44px; padding: 10px 8px; }
  nav button:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .form-row-citation { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 10px; }
  .section-head { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
  .editor { padding: 18px; }
  h1 { font-size: 22px; }
}
