:root {
    --ink: #171a17;
    --muted: #687068;
    --paper: #f2f0e9;
    --panel: #fffdf7;
    --line: #d7d3c6;
    --olive: #46523a;
    --olive-dark: #2f3828;
    --sand: #c3a86b;
    --danger: #8a3730;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--paper);
}

* { box-sizing: border-box; }
[hidden] { display:none!important; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top right, #e1ddcf, transparent 36rem), var(--paper); }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }

.topbar {
    position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
    min-height: 72px; padding: 0 5vw; color: white; background: rgba(35, 42, 31, .96); backdrop-filter: blur(12px);
    border-bottom: 3px solid var(--sand);
}
.brand { display: flex; align-items: center; gap: .7rem; font-weight: 760; letter-spacing: .01em; }
.brand-logo { display: block; width: 66px; height: 52px; flex: 0 0 auto; object-fit: contain; }
nav { display: flex; gap: .45rem; }
nav a { padding: .65rem .8rem; border-radius: .35rem; color: #dbe0d5; font-size: .92rem; }
nav a:hover { background: #3c4734; color: white; }

.page-shell { width: min(1180px, 92vw); margin: 0 auto; padding: 3.5rem 0 5rem; }
footer { padding: 2rem 5vw; color: var(--muted); text-align: center; border-top: 1px solid var(--line); }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: .6rem; font-family: Georgia, serif; font-size: clamp(2rem, 5vw, 4.2rem); line-height: .98; font-weight: 600; }
h2 { font-family: Georgia, serif; font-weight: 600; }
p { color: var(--muted); line-height: 1.6; }
.eyebrow { margin-bottom: .65rem; color: var(--olive); font-size: .76rem; font-weight: 800; letter-spacing: .18em; }

.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 3rem; padding: 2rem 0 4rem; }
.hero > div { max-width: 750px; }
.hero p:not(.eyebrow) { max-width: 600px; font-size: 1.12rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: .68rem 1rem; cursor: pointer; border: 1px solid var(--line); border-radius: .35rem; background: var(--panel); color: var(--ink); font-weight: 700; }
.button:hover { border-color: var(--olive); }
.button.primary { border-color: var(--olive); background: var(--olive); color: white; }
.button.primary:hover { background: var(--olive-dark); }
.button.small { min-height: 34px; padding: .42rem .7rem; font-size: .85rem; }
.button:disabled { opacity: .45; cursor: not-allowed; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 4rem; }
.metric { display: flex; flex-direction: column; padding: 1.25rem; border-top: 3px solid var(--olive); background: var(--panel); box-shadow: 0 8px 28px #2f38280b; }
.metric strong { font-family: Georgia, serif; font-size: 2.2rem; }
.metric span { color: var(--muted); }
.workflow-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.workflow-card { min-height: 220px; padding: 1.5rem; border: 1px solid var(--line); background: #e9e5d9; transition: transform .15s, border-color .15s; }
.workflow-card:hover { transform: translateY(-2px); border-color: var(--olive); }
.workflow-card > span { color: var(--olive); font-weight: 800; }
.workflow-card h2 { margin: 2.2rem 0 .45rem; font-size: 1.6rem; }
.dashboard-hero { padding-bottom:2.5rem; }
.dashboard-stat-row { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; margin-bottom:1rem; }
.dashboard-stat { display:flex; min-height:145px; flex-direction:column; justify-content:flex-end; padding:1.35rem; border-top:4px solid var(--olive); background:var(--panel); }
.dashboard-stat > span,.dashboard-stat small { color:var(--muted); }
.dashboard-stat strong { margin:.3rem 0; font:600 clamp(2rem,4vw,3.2rem)/1 Georgia,serif; }
.dashboard-section { margin-bottom:1rem; padding:1.4rem; border:1px solid var(--line); background:var(--panel); }
.dashboard-section > header { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; margin-bottom:1rem; }
.dashboard-section > header h2 { margin:0; }
.dashboard-section > header > a { color:var(--olive); font-weight:750; }
.dashboard-columns { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; align-items:start; }
.dashboard-columns > .dashboard-section { width:100%; min-height:225px; margin-top:0; }
.dashboard-task-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.65rem; }
.dashboard-task-list > a { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.85rem; border:1px solid var(--line); background:#f5f3ec; }
.dashboard-task-list > a:hover,.inventory-row:hover,.recent-list a:hover { border-color:var(--olive); background:#ecefe7; }
.dashboard-task-list span,.inventory-row span { display:flex; min-width:0; flex-direction:column; }
.dashboard-task-list small,.inventory-row small { overflow:hidden; color:var(--muted); text-overflow:ellipsis; white-space:nowrap; }
.dashboard-step { align-items:flex-end; flex:0 0 auto; }
.inventory-columns { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; }
.inventory-columns h3 { margin:.2rem 0 .6rem; color:var(--olive); font-size:.78rem; letter-spacing:.1em; text-transform:uppercase; }
.inventory-row { display:flex; align-items:center; justify-content:space-between; gap:.75rem; padding:.65rem; border-top:1px solid var(--line); }
.inventory-row > b { display:grid; place-items:center; min-width:2.2rem; height:2.2rem; border-radius:50%; background:#e7eadf; }
.recent-list { display:grid; }
.recent-list a { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.8rem .35rem; border-top:1px solid var(--line); }
.recent-list time { color:var(--muted); font-size:.8rem; }
.dashboard-link-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.65rem; }
.dashboard-link-grid a { display:flex; min-height:105px; flex-direction:column; justify-content:space-between; padding:1rem; border:1px solid var(--line); background:#e9e5d9; transition:transform .15s,border-color .15s,box-shadow .15s; }
.dashboard-link-grid a:hover { transform:translateY(-2px); border-color:var(--olive); box-shadow:0 12px 28px rgba(47,56,40,.12); }
.dashboard-link-grid span { color:var(--olive); font:700 .75rem ui-monospace,monospace; }
.dashboard-link-grid strong { font-family:Georgia,serif; font-size:1.15rem; }
.army-actions { display:grid; grid-template-columns:1fr minmax(210px,.7fr) auto auto; align-items:end; gap:.75rem; margin-bottom:1rem; }
.army-actions > div { display:flex; flex-direction:column; }
.army-actions small { color:var(--muted); }
.army-selector { position:relative; z-index:2; display:flex; grid-template-columns:auto 1fr; align-items:center; gap:.4rem; cursor:pointer; }
.army-selector input,.selection-list input { width:auto; }
.selection-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.55rem; }
.selection-list label { display:flex; grid-template-columns:auto 1fr; align-items:center; gap:.6rem; padding:.7rem; border:1px solid var(--line); background:#f5f3ec; }
.linked-list { padding-left:0; }
.linked-list > a { display:flex; justify-content:space-between; gap:1rem; padding:.7rem; border:1px solid var(--line); background:#f5f3ec; }
.conflict-panel { border-left:4px solid var(--danger); background:#fff7f3; }

.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 2.5rem; }
.page-heading h1 { font-size: clamp(2.2rem, 4vw, 3.5rem); }
.page-heading p:last-child { margin-bottom: 0; }
.notice { margin-bottom: 1.5rem; padding: .9rem 1rem; border-left: 4px solid var(--olive); background: #e0e6d9; }
.empty { padding: 4rem 2rem; border: 1px dashed #a9aa9f; background: #ece9df; text-align: center; }
.empty p { max-width: 640px; margin-right: auto; margin-left: auto; }
.empty .button { margin-top: .5rem; }

.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.catalog-card { position:relative; display: flex; flex-direction: column; min-height: 330px; height:100%; padding: 1.25rem; border: 1px solid var(--line); background: var(--panel); transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease; }
.catalog-card:hover,.catalog-card:focus-within { transform:translateY(-3px); border-color:var(--olive); box-shadow:0 16px 36px rgba(47,56,40,.16); }
.catalog-card h2 a::after,.combat-group-card h2 a::after { content:""; position:absolute; inset:0; z-index:1; }
.catalog-card a:not(h2 a),.catalog-card form,.combat-group-card form,.combat-group-card a:not(h2 a) { position:relative; z-index:2; }
.catalog-card h2 { margin: 1.6rem 0 .5rem; }
.catalog-card > p { flex-grow: 1; }
.blueprint-card,.blueprint-panel { background:#eaf3fb; border-color:#a9c8df; }
.blueprint-heading { padding:1.25rem; border-left:5px solid #78a9cb; background:#eaf3fb; }
.blueprint-badge { border-color:#78a9cb; background:#d8eafa; color:#235b82; }
.catalog-controls { display:flex; align-items:end; justify-content:space-between; gap:1rem; margin-bottom:1.5rem; }
.catalog-search { width:min(520px,100%); }
.catalog-filter { display:flex; flex-wrap:wrap; gap:.5rem; }
.catalog-filter .is-active { border-color:var(--olive); background:var(--olive); color:white; }
.card-metadata { display:grid; gap:.35rem; margin:1rem 0 0; }
.card-metadata div { display:flex; justify-content:space-between; gap:1rem; padding-top:.35rem; border-top:1px solid rgba(80,90,75,.18); }
.card-metadata dt { color:var(--muted); font-size:.75rem; font-weight:750; text-transform:uppercase; }
.card-metadata dd { margin:0; text-align:right; }
.serial-number { color:var(--olive); font:700 .9rem ui-monospace,monospace; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; color: var(--muted); font-size: .8rem; }
.badge { display: inline-block; padding: .25rem .45rem; border: 1px solid #9b9f8e; border-radius: 99px; color: var(--olive-dark); background: #e7eadf; font: 700 .72rem/1.2 ui-monospace, monospace; }
.file-list { display: grid; gap: .45rem; margin-top: 1rem; }
.file-list a { display: grid; grid-template-columns: 55px 1fr auto; align-items: center; gap: .5rem; padding: .6rem; border: 1px solid var(--line); background: #f3f1e9; font-size: .78rem; }
.file-list a:hover { border-color: var(--olive); }
.file-list strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list small { color: var(--muted); }
.component-list { display: grid; gap: .4rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.component-list li { display: flex; gap: .7rem; padding: .55rem 0; border-top: 1px solid var(--line); }
.component-list strong { color: var(--olive); }

.form-card, .panel { padding: 1.5rem; border: 1px solid var(--line); background: var(--panel); box-shadow: 0 16px 50px #2f382808; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
.model-core-field { min-width:0; width:100%; }
.model-core-field input { width:100%; }
label { display: grid; gap: .4rem; color: var(--muted); font-size: .86rem; font-weight: 650; }
label.wide { grid-column: 1 / -1; }
.form-grid > .wide { grid-column:1 / -1; }
input, textarea, select { width: 100%; padding: .78rem .85rem; border:0; border-bottom:2px solid #989b8d; border-radius:0; outline:none; background:#eeece2; color:var(--ink); transition:border-color .15s,background .15s,box-shadow .15s; }
input:hover, textarea:hover, select:hover { background:#e8e6db; }
input:focus, textarea:focus, select:focus { border-bottom-color:var(--olive); background:#f3f1e9; box-shadow:0 3px 0 #46523a1b; }
input[type="checkbox"] { appearance:none; width:1.35rem!important; height:1.35rem; min-width:1.35rem; padding:0; border:2px solid #7f8474; border-radius:.18rem; background:#e7eadf; cursor:pointer; }
input[type="checkbox"]:checked { border-color:var(--olive); background:var(--olive); box-shadow:inset 0 0 0 3px #e7eadf; }
input[type="checkbox"]:focus { box-shadow:0 0 0 3px #46523a2b,inset 0 0 0 3px #e7eadf; }
.upload-box { min-height: 145px; padding: 1rem; border: 1px dashed #9b9f8e; background: #f1efe7; align-content: center; }
.upload-box small, label small { color: var(--muted); font-weight: 400; }
.form-actions { display: flex; justify-content: flex-end; gap: .7rem; margin-top: 1.5rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.validation { color: var(--danger); }
.section-title { margin: 2rem 0 1rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.quantity-list { display: grid; gap: .4rem; }
.quantity-list label { grid-template-columns: 1fr 110px; align-items: center; padding: .75rem; border: 1px solid var(--line); background: #f5f3ec; }
.quantity-list label > span { display: flex; flex-direction: column; }

.inline-form { display: grid; grid-template-columns: 2fr 1fr auto; align-items: end; gap: 1rem; margin-bottom: 2rem; }
.batch-list { display: grid; gap: 1rem; }
.batch-card { padding: 1.25rem; border: 1px solid var(--line); background: var(--panel); }
.batch-header { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.batch-header h2 { margin: .7rem 0 .2rem; }
.batch-header > strong { font-family: Georgia, serif; font-size: 2.2rem; }
.progress { height: 7px; margin: 1.1rem 0; overflow: hidden; background: #ddd9cc; }
.progress span { display: block; height: 100%; background: var(--olive); }
.job-list { display: grid; gap: .4rem; }
.job-list form { display: grid; grid-template-columns: 1fr 160px auto; align-items: center; gap: .8rem; padding: .7rem; background: #f2f0e8; }
.job-list form > div { display: flex; flex-direction: column; }
.job-list label { display: grid; grid-template-columns: 1fr auto; align-items: center; }
.status-completed { background: #d7e6d2; }

.assignment-list { display: grid; gap: 1rem; }
.assignment-card { display: grid; grid-template-columns: 240px 1fr; gap: 2rem; padding: 1.25rem; border: 1px solid var(--line); background: var(--panel); }
.assignment-card h2 { margin: .8rem 0 .2rem; }
.assignment-card form { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; }
.assignment-card button { align-self: end; }

@media (max-width: 850px) {
    .topbar { align-items: flex-start; padding-top: 1rem; padding-bottom: 1rem; }
    nav { display: grid; grid-template-columns: repeat(2, auto); }
    .hero, .page-heading { align-items: flex-start; flex-direction: column; }
    .metric-grid, .card-grid { grid-template-columns: repeat(2, 1fr); }
    .inline-form, .assignment-card { grid-template-columns: 1fr; }
    .dashboard-columns { grid-template-columns:1fr; }
    .army-actions { grid-template-columns:1fr; }
}

@media (max-width: 560px) {
    .topbar { position: static; display: block; }
    nav { margin-top: 1rem; grid-template-columns: 1fr 1fr; }
    .page-shell { padding-top: 2rem; }
    .metric-grid, .workflow-grid, .card-grid, .form-grid, .assignment-card form { grid-template-columns: 1fr; }
    .dashboard-stat-row,.dashboard-task-list,.inventory-columns,.dashboard-link-grid { grid-template-columns:1fr; }
    .selection-list { grid-template-columns:1fr; }
    .job-list form { grid-template-columns: 1fr; }
    .quantity-list label { grid-template-columns: 1fr 90px; }
    label.wide { grid-column: auto; }
}

.current-version {
    align-self: center;
    padding: .55rem .8rem;
    border: 1px solid #9b9f8e;
    border-radius: 99px;
    background: #e7eadf;
    color: var(--olive-dark);
    font: 700 .78rem/1.2 ui-monospace, monospace;
}

.changelog-list {
    display: grid;
    gap: 1rem;
    max-width: 900px;
}

.changelog-release {
    padding: 1.5rem;
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: 0 12px 36px #2f382808;
}

.changelog-release.is-current {
    border-top: 4px solid var(--olive);
}

.changelog-release > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}

.changelog-release h2 {
    margin: .6rem 0 0;
    font-size: 1.7rem;
}

.changelog-release time {
    color: var(--muted);
    font: 650 .82rem/1.4 ui-monospace, monospace;
}

.changelog-sections {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    padding-top: 1.2rem;
}

.changelog-sections h3 {
    margin: 0 0 .65rem;
    color: var(--olive);
    font-size: .78rem;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.changelog-sections ul {
    display: grid;
    gap: .55rem;
    margin: 0;
    padding-left: 1.2rem;
    color: var(--muted);
    line-height: 1.55;
}

footer a {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: .2rem;
}

@media (max-width: 650px) {
    .changelog-release > header {
        gap: .75rem;
    }

    .changelog-sections {
        grid-template-columns: 1fr;
    }

    .current-version {
        align-self: flex-start;
    }
}


.field-label { display: block; margin-bottom: .45rem; font-weight: 650; }
.drop-zone {
    display: grid;
    place-items: center;
    min-height: 180px;
    padding: 1.5rem;
    border: 2px dashed #9b9f8e;
    border-radius: .35rem;
    background: #f1efe7;
    color: var(--muted);
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s, transform .15s;
}
.drop-zone strong { color: var(--ink); font-size: 1.05rem; }
.drop-zone small { margin-top: .45rem; }
.drop-zone:hover, .drop-zone:focus, .drop-zone.drag-over {
    border-color: var(--olive);
    background: #e7eadf;
    outline: none;
}
.drop-zone.drag-over { transform: scale(1.005); }
.upload-file-list { display: grid; gap: .45rem; margin: .75rem 0 0; padding: 0; list-style: none; }
.upload-file-list li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: .75rem;
    padding: .65rem .75rem;
    border: 1px solid var(--line);
    background: #f8f7f2;
}
.upload-file-list li > span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; }
.upload-file-list li strong, .upload-file-list li small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-file-list button { border: 0; background: transparent; color: var(--danger); font-weight: 700; cursor: pointer; }
.file-icon { padding: .3rem .4rem; border-radius: .2rem; background: var(--olive); color: white; font: 700 .7rem/1 ui-monospace, monospace; }
.meta-line { color: var(--olive); font-weight: 700; }


.card-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
    padding-top: .85rem;
    border-top: 1px solid var(--line);
}
.button.danger {
    border-color: #9f3d32;
    background: transparent;
    color: #8f3026;
}
.button.danger:hover {
    background: #8f3026;
    color: white;
}
.notice-error {
    border-color: #c98379;
    background: #f4ded9;
    color: #76271f;
}


.management-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.compact-form { display: grid; gap: .75rem; }
.compact-form h2 { margin: 0 0 .25rem; }
.branch-registry { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 2rem; }
.branch-registry > div { display: flex; align-items: center; gap: .55rem; padding: .5rem .65rem; border: 1px solid var(--line); background: var(--panel); }
.branch-registry form, .organization-unit form { margin-left: auto; }
.level-badge { color: var(--olive); font: 700 .72rem/1 ui-monospace, monospace; }
.text-danger { padding: 0; border: 0; background: transparent; color: #8f3026; font-weight: 700; cursor: pointer; }
.combat-group-list { display: grid; gap: 1.5rem; }
.combat-group-card { position:relative; min-height:330px; padding: 1.4rem; border: 1px solid var(--line); background: var(--panel); transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease; }
.combat-group-card:hover { transform:translateY(-3px); border-color:var(--olive); box-shadow:0 16px 36px rgba(47,56,40,.16); }
.combat-group-card > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; }
.combat-group-card h2 { margin: .7rem 0 .25rem; }
.member-form { display: grid; grid-template-columns: 2fr 1.3fr auto; align-items: end; gap: .75rem; margin: 1.25rem 0; padding: 1rem; background: #f1efe7; }
.organization-chart { display: grid; gap: .75rem; margin-top: 1.25rem; }
.organization-level { display: grid; grid-template-columns: 72px 1fr; gap: .75rem; }
.level-axis { display: flex; flex-direction: column; align-items: center; justify-content: center; border-right: 3px solid var(--olive); color: var(--muted); }
.level-axis strong { color: var(--ink); font: 700 1.5rem/1 Georgia, serif; }
.organization-branches { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .65rem; }
.organization-branch { padding: .75rem; border: 1px solid #c7c4b8; background: #f8f7f2; }
.organization-branch h3 { margin: 0 0 .65rem; color: var(--olive); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }
.organization-unit { display: flex; align-items: center; gap: .6rem; padding: .55rem; border-top: 1px solid var(--line); }
.organization-unit > span { display: flex; min-width: 0; flex-direction: column; }
.empty.compact { padding: 1rem; }
@media (max-width: 850px) {
    .management-grid, .member-form { grid-template-columns: 1fr; }
    .combat-group-card > header { flex-direction: column; }
}


.member-form { grid-template-columns: 2fr 1.3fr .7fr auto; }
.produced-unit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .65rem; }
.produced-unit-grid article { display: flex; flex-direction: column; gap: .45rem; padding: .85rem; border: 1px solid var(--line); background: var(--panel); }
.produced-unit-grid .badge { align-self: flex-start; }
@media (max-width: 850px) { .member-form { grid-template-columns: 1fr; } }


.requirement-preview { margin: 1rem 0 2rem; padding: 1.4rem; border: 1px solid var(--line); border-top: 4px solid var(--olive); background: var(--panel); }
.requirement-preview > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.requirement-preview h2 { margin: .4rem 0 1rem; }
.requirement-columns { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1.25rem; }
.requirement-columns h3 { color: var(--olive); font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; }
.requirement-columns table { width: 100%; border-collapse: collapse; }
.requirement-columns th, .requirement-columns td { padding: .55rem; border-bottom: 1px solid var(--line); text-align: right; }
.requirement-columns th:first-child, .requirement-columns td:first-child { text-align: left; }
.requirement-list { display: grid; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.requirement-list li { display: flex; gap: .7rem; padding: .6rem; background: #f1efe7; }
@media (max-width: 850px) { .requirement-columns { grid-template-columns: 1fr; } }


.metric { color: inherit; text-decoration: none; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.metric:hover, .metric:focus-visible { transform: translateY(-2px); border-color: var(--olive); box-shadow: 0 8px 24px rgba(53, 58, 36, .12); }
.catalog-toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(180px, 240px) auto auto; gap: 1rem; align-items: end; margin-bottom: 1.5rem; padding: 1rem; border: 1px solid var(--line); background: var(--paper); }
.catalog-toolbar label { display: grid; gap: .4rem; }
.catalog-toolbar label > span { font-weight: 700; }
.catalog-toolbar input, .catalog-toolbar select { width: 100%; }
.metadata-list { display: grid; gap: .35rem; margin: 1rem 0; }
.metadata-list > div { display: grid; grid-template-columns: 7.5rem minmax(0,1fr); gap: .75rem; padding-bottom: .35rem; border-bottom: 1px solid var(--line); }
.metadata-list dt { font-size: .75rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.metadata-list dd { margin: 0; }
@media (max-width: 760px) { .catalog-toolbar { grid-template-columns: 1fr; } }


.breadcrumbs { display:flex; gap:.5rem; align-items:center; margin-bottom:1.25rem; color:var(--muted); }
.detail-hero { display:grid; grid-template-columns:minmax(240px,360px) 1fr; gap:2rem; align-items:center; margin-bottom:2rem; }
.detail-image { display:grid; gap:.75rem; }
.detail-image img,.image-placeholder { width:100%; aspect-ratio:4/3; object-fit:cover; border:1px solid var(--line); background:var(--paper); }
.image-placeholder { display:grid; place-items:center; color:var(--muted); font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.detail-image form { display:flex; gap:.5rem; flex-wrap:wrap; }
.detail-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1.25rem; margin-bottom:1.25rem; }
.panel { border:1px solid var(--line); background:var(--paper); padding:1.25rem; margin-bottom:1.25rem; }
.section-heading { display:flex; justify-content:space-between; align-items:center; gap:1rem; }
.file-row { display:grid; grid-template-columns:1fr auto; align-items:center; gap:1rem; border-bottom:1px solid var(--line); padding:.5rem 0; }
.file-row > a { display:grid; grid-template-columns:6rem 1fr; gap:1rem; }
.linked-list { display:grid; gap:.45rem; padding-left:0; }
.shelf-list,.compartment-list { display:grid; gap:1.25rem; }
.shelf-card,.compartment-card,.container-card { border:1px solid var(--line); background:var(--paper); padding:1rem; }
.shelf-card { box-shadow:0 10px 30px rgba(53,58,36,.08); }
.compartment-list { margin-top:1rem; }
.compartment-card { margin-left:1rem; border-left:4px solid var(--olive); }
.container-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:1rem; margin-top:1rem; }
.container-card { background:var(--cream); }
.organizer-create { margin-bottom:1rem; }
.organizer-edit { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:.75rem; align-items:end; }
.organizer-edit label { display:grid; gap:.35rem; }
.catalog-card h2 a,.combat-group-card h2 a,.produced-unit-grid a { color:inherit; text-decoration:none; }
.catalog-card h2 a:hover,.combat-group-card h2 a:hover,.produced-unit-grid a:hover { text-decoration:underline; }
@media(max-width:760px){.detail-hero,.detail-grid{grid-template-columns:1fr}.compartment-card{margin-left:0}.file-row{grid-template-columns:1fr}}


.shelf-tile-grid .shelf-tile,.container-tile-grid .container-tile { color:inherit; text-decoration:none; min-height:220px; }
.shelf-tile:hover,.container-tile:hover { border-color:var(--olive); transform:translateY(-2px); box-shadow:0 10px 28px rgba(53,58,36,.12); }
.compartment-selector { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:1rem; }
.compartment-tile { display:grid; gap:.5rem; min-height:110px; padding:1rem; color:inherit; text-decoration:none; border:1px solid var(--line); background:var(--cream); }
.compartment-tile:hover,.compartment-tile.selected { border-color:var(--olive); box-shadow:inset 0 0 0 2px var(--olive); }
.compartment-tile span { color:var(--muted); font-size:.85rem; }
.unit-assignment-list { display:grid; gap:.65rem; }
.unit-assignment-list article { display:grid; grid-template-columns:1fr auto; gap:1rem; align-items:center; padding:.75rem; border:1px solid var(--line); background:var(--cream); }
.unit-assignment-list article > a { display:grid; grid-template-columns:auto 1fr; gap:.75rem; align-items:center; color:inherit; text-decoration:none; }
.unit-assignment-list article > a small { grid-column:2; color:var(--muted); }
@media(max-width:760px){.unit-assignment-list article{grid-template-columns:1fr}}

.topbar nav { align-items:center; }
.nav-dropdown { position:relative; display:inline-flex; }
.nav-submenu { position:absolute; top:100%; left:0; display:none; min-width:230px; padding:.45rem; border:1px solid #66715d; border-top:3px solid var(--sand); background:var(--olive-dark); box-shadow:0 14px 30px rgba(0,0,0,.25); }
.nav-dropdown:hover .nav-submenu,.nav-dropdown:focus-within .nav-submenu { display:grid; }
.nav-submenu a { display:grid; grid-template-columns:3.5rem 1fr; gap:.45rem; align-items:center; white-space:nowrap; }
.nav-submenu strong { color:#e8dcbd; font:700 .76rem ui-monospace,monospace; }
.image-drop-form { display:block!important; }
.image-frame,.image-frame .image-drop-zone { position:relative; width:100%; aspect-ratio:4/3; padding:0; }
.image-drop-zone { display:grid; place-items:center; min-height:92px; padding:1rem; border:2px dashed #9b9f8e; background:#f1efe7; color:var(--muted); text-align:center; cursor:pointer; transition:.15s ease; overflow:hidden; }
.image-frame .image-drop-zone img,.image-frame .image-placeholder { position:absolute; inset:0; width:100%; height:100%; aspect-ratio:auto; border:0; }
.image-drop-hint { position:absolute; inset:auto 1rem 1rem; display:grid; gap:.1rem; padding:.65rem .8rem; border:1px solid rgba(255,255,255,.65); background:rgba(35,42,31,.82); color:white; opacity:0; transform:translateY(.35rem); transition:.15s ease; }
.image-frame .image-placeholder + .image-drop-hint { opacity:1; transform:none; }
.image-drop-zone:hover .image-drop-hint,.image-drop-zone:focus .image-drop-hint,.image-drop-zone.drag-over .image-drop-hint { opacity:1; transform:none; }
.image-drop-zone:hover,.image-drop-zone:focus,.image-drop-zone.drag-over { border-color:var(--olive); outline:none; box-shadow:inset 0 0 0 3px rgba(71,84,59,.25); }
.image-drop-zone span { font-size:.82rem; }
.storage-location-list { padding:0; list-style:none; }
.storage-location-list li { padding:.75rem 1rem; border-left:4px solid var(--sand); background:#eee6d1; color:var(--ink); }
.storage-location-list a { font-weight:750; text-decoration:underline; text-underline-offset:.18rem; }
.full-width-table { overflow-x:auto; }
.full-width-table table { width:100%; border-collapse:collapse; table-layout:auto; }
.full-width-table th,.full-width-table td { padding:.75rem 1rem; border-bottom:1px solid var(--line); text-align:left; white-space:nowrap; }
.generated-code-hint { align-self:center; margin:0; }
.panel > :last-child,.form-card > :last-child { margin-bottom:0; }
.panel h2 { margin-bottom:1rem; }
section + section { margin-top:1.25rem; }

.combat-group-create { max-width:580px; margin-bottom:2rem; }
.combat-group-grid .combat-group-tile { min-height:250px; }
.progress-tag { padding:.3rem .55rem; border:1px solid #779267; border-radius:99px; background:#dcebd5; color:#2f5b2c; font-size:.75rem; font-weight:800; }
.combat-group-builder { display:grid; grid-template-columns:minmax(230px,300px) minmax(0,1fr); gap:1.25rem; align-items:start; margin:1.25rem 0; }
.builder-main { display:grid; gap:1.25rem; min-width:0; }
.unit-palette { position:sticky; top:92px; }
.draggable-unit-list { display:grid; gap:.55rem; max-height:70vh; overflow:auto; }
.draggable-unit { display:flex; flex-direction:column; gap:.35rem; min-height:112px; padding:1rem; border:1px solid var(--line); border-left:4px solid var(--olive); background:#f8f7f2; cursor:grab; }
.draggable-unit:active,.node-template:active,.org-node:active { cursor:grabbing; }
.draggable-unit small { color:var(--muted); }
.node-template-create { display:grid; grid-template-columns:1fr auto; gap:.45rem; margin-bottom:.75rem; }
.node-template-list { display:grid; gap:.45rem; }
.node-template { display:flex; align-items:center; justify-content:space-between; gap:.6rem; padding:.7rem .8rem; border:1px solid #88947e; border-left:4px solid var(--sand); background:#eee5d4; cursor:grab; }
.node-template form { display:flex; }
.node-template button { font-size:1.15rem; line-height:1; }
.palette-divider { margin:1.4rem 0; border:0; border-top:1px solid var(--line); }
.drop-help { color:var(--muted); font-size:.78rem; }
.organigram-drop { min-height:380px; padding:2rem 1rem; overflow:auto; border:2px dashed #a8aa9e; background:linear-gradient(#f8f7f2,#efede5); transition:border-color .15s,background .15s; }
.organigram-drop.drag-target { border-color:var(--olive); background:#e7eadf; }
.organigram-empty { display:grid; place-items:center; min-height:300px; margin:0; text-align:center; }
.org-tree-root,.org-tree-root ul { position:relative; display:flex; justify-content:center; margin:0; padding:2rem 0 0; list-style:none; }
.org-tree-root { padding-top:0; }
.org-tree-item { position:relative; min-width:280px; padding:2rem .65rem 0; text-align:center; }
.org-tree-item::before,.org-tree-item::after { content:""; position:absolute; top:0; right:50%; width:50%; height:2rem; border-top:2px solid #7b806f; }
.org-tree-item::after { right:auto; left:50%; border-left:2px solid #7b806f; }
.org-tree-item:only-child::before,.org-tree-item:only-child::after { display:none; }
.org-tree-item:only-child { padding-top:0; }
.org-tree-item:first-child::before,.org-tree-item:last-child::after { border:0; }
.org-tree-item:last-child::before { border-right:2px solid #7b806f; border-radius:0 .45rem 0 0; }
.org-tree-item:first-child::after { border-radius:.45rem 0 0 0; }
.org-tree-item > ul::before { content:""; position:absolute; top:0; left:50%; height:2rem; border-left:2px solid #7b806f; }
.org-node { position:relative; display:grid; grid-template-columns:1fr auto; align-content:center; gap:.55rem 1rem; width:280px; height:180px; min-height:180px; margin:0 auto; padding:1.25rem; border:2px solid var(--olive); background:var(--panel); box-shadow:0 8px 20px rgba(47,56,40,.1); cursor:grab; overflow-wrap:anywhere; }
.org-node.unit-node { border-color:#78a9cb; background:#eaf3fb; }
.org-node.produced-unit-node { border-color:#779267; background:#f7fbf4; }
.organigram-unit-search { margin:0 0 1.25rem; }
.produced-palette-unit { border-left:4px solid #779267; background:#f7fbf4; }
.palette-no-results { padding:.75rem; border:1px dashed var(--line); color:var(--muted); text-align:center; }
.organization-catalog { display:grid; grid-template-columns:260px minmax(0,1fr); gap:1.5rem; align-items:stretch; margin:1.25rem 0; }
.department-create { padding-right:1.5rem; border-right:1px solid var(--line); }
.department-create p:not(.eyebrow) { color:var(--muted); }
.organization-catalog-main { min-width:0; }
.organization-catalog-controls { display:grid; grid-template-columns:minmax(260px,1fr) auto; gap:1rem; align-items:end; margin-bottom:1rem; }
.organization-filter-buttons { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:.5rem; }
.organization-filter-buttons .is-active { border-color:var(--olive); background:var(--olive); color:white; }
.organization-palette-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); grid-auto-rows:140px; gap:.75rem; }
.organization-palette-item { position:relative; display:grid; grid-template-rows:auto 1fr auto; gap:.35rem; min-width:0; height:140px; padding:.85rem; border:1px solid var(--line); cursor:grab; transition:transform .15s ease,box-shadow .15s ease; }
.organization-palette-item:hover { transform:translateY(-2px); box-shadow:0 9px 22px rgba(47,56,40,.13); }
.organization-palette-item strong,.organization-palette-item small { overflow:hidden; text-overflow:ellipsis; }
.organization-palette-item strong { align-self:center; font:600 1.05rem Georgia,serif; }
.organization-palette-item small { color:var(--muted); overflow-wrap:anywhere; }
.organization-palette-item .palette-kind { font-size:.66rem; font-weight:850; letter-spacing:.08em; text-transform:uppercase; }
.organization-palette-item form { position:absolute; top:.45rem; right:.55rem; }
.department-palette-item { border-color:var(--sand); background:#f3ead8; }
.blueprint-palette-item { border-color:#78a9cb; background:#eaf3fb; }
.produced-palette-item { border-color:#779267; background:#f7fbf4; }
.palette-pagination { display:flex; align-items:center; justify-content:center; gap:1rem; margin-top:1rem; }
.palette-pagination span { min-width:190px; color:var(--muted); text-align:center; font-size:.82rem; }
.full-width-organigram { width:100%; margin:1.25rem 0; }
.org-node.drag-target { outline:4px solid rgba(195,168,107,.55); transform:translateY(-2px); }
.org-node > a { grid-column:1/-1; margin-top:.3rem; font:600 1.35rem Georgia,serif; text-decoration:underline; text-underline-offset:.18rem; }
.org-node small { color:var(--muted); }
.org-node form { justify-self:end; }
.node-remove { grid-column:1/-1; justify-self:end!important; }
.node-level { justify-self:end; color:var(--muted); font-size:.7rem; font-weight:750; }
.node-type { justify-self:start; color:var(--olive); font-size:.68rem; font-weight:850; letter-spacing:.08em; text-transform:uppercase; }
.structural-node { border-color:var(--sand); background:#f3ead8; }
.structural-node .structural-title { text-decoration:none; cursor:grab; }
#organigram-token { display:none; }
.produce-action { margin-top:1.25rem; }
.recipe-state { display:inline-flex; align-self:flex-start; padding:.28rem .5rem; border-radius:99px; font-size:.72rem; font-weight:800; }
.recipe-state.is-produced { border:1px solid #779267; background:#dcebd5; color:#2f5b2c; }
.recipe-state.is-recipe { border:1px solid #aa9271; background:#eee5d4; color:#6c542f; }
.batch-link { display:block; color:inherit; text-decoration:none; transition:transform .15s ease,box-shadow .15s ease; }
.batch-link:hover { transform:translateY(-2px); box-shadow:0 12px 28px rgba(47,56,40,.14); }
.filter-tabs { display:flex; gap:.6rem; margin:1.5rem 0 1rem; }
.production-filter-row { display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.scenery-batch-card { border-left:5px solid #9a8460; }
.scenery-badge { border-color:#aa9271; background:#eee5d4; color:#6c542f; }
.scenery-step-counters { grid-template-columns:repeat(4,minmax(0,1fr)); }
.step-counters { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:.65rem; margin-top:1rem; }
.step-counters span { display:flex; justify-content:space-between; gap:.5rem; padding:.65rem .75rem; border:1px solid var(--line); background:#f3f1e9; font-size:.8rem; }
.step-counters.large span { padding:1rem; }
.workflow-list { display:grid; gap:1.25rem; margin-top:1.25rem; }
.workflow-card > header { display:flex; align-items:start; justify-content:space-between; gap:1rem; }
.workflow-composition { display:flex; flex-wrap:wrap; align-items:center; gap:.55rem; margin:1rem 0; padding:.85rem; background:#f3f1e9; }
.workflow-composition h3 { width:100%; margin:0; }
.workflow-composition a { padding:.35rem .55rem; border:1px solid var(--line); background:var(--panel); }
.production-steps { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); grid-auto-rows:290px; gap:1rem; align-items:center; }
.production-steps section { min-width:0; height:290px; padding:1rem; border:1px solid var(--line); background:#f7f5ee; transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease; }
.production-steps section.done { border-color:#779267; background:#f1f7ed; }
.production-steps section.waiting { opacity:.72; }
.production-steps section.active { z-index:1; border:2px solid var(--olive); background:var(--panel); transform:scale(1.035); box-shadow:0 12px 28px rgba(47,56,40,.14); }
.production-steps form { display:grid; gap:.55rem; }
.production-steps input,.production-steps select { min-width:0; width:100%; }
.production-steps select[multiple] { min-height:120px; }
.color-grid { margin-top:1.25rem; }
.color-card { display:flex; flex-direction:column; min-height:180px; color:inherit; text-decoration:none; }
.color-card strong { margin-top:auto; }
.color-code-tag { align-self:flex-start; width:auto; min-width:72px; padding:.32rem .65rem; text-align:center; }
.production-drop-zone { display:grid; place-items:center; gap:.35rem; min-height:135px; padding:1rem; border:2px dashed #a8aa9e; background:#f3f1e9; text-align:center; cursor:pointer; transition:border-color .15s,background .15s; }
.production-drop-zone.drag-over { border-color:var(--olive); background:#e7eadf; }
.production-drop-zone span { color:var(--muted); font-size:.78rem; }
.production-upload-list { width:100%; margin:.35rem 0 0; padding:0; list-style:none; font-size:.75rem; text-align:left; overflow-wrap:anywhere; }
.production-upload-list li { padding:.25rem .35rem; border-top:1px solid var(--line); }
.paint-picker { display:grid; gap:1rem; margin-top:1.5rem; padding:1.25rem; border:2px solid var(--olive); background:#f8f7f2; }
.paint-palette { display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:.65rem; }
.paint-option { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:.65rem; padding:.75rem; border:1px solid var(--line); background:var(--panel); }
.paint-option.selected { border-color:#779267; background:#f1f7ed; }
.paint-option > span:nth-of-type(2) { display:flex; flex-direction:column; min-width:0; }
.paint-option small { color:var(--muted); }
.paint-selection { padding-top:1rem; border-top:1px solid var(--line); }
.selected-paint-list,.production-color-list { display:flex; flex-wrap:wrap; gap:.55rem; }
.selected-paint,.production-color-list a { display:flex; align-items:center; gap:.55rem; padding:.45rem .6rem; border:1px solid var(--line); background:var(--panel); color:inherit; text-decoration:none; }
.production-color-list { width:100%; }
.production-color-list a { min-width:240px; }
.paint-empty { color:var(--muted); }
.standalone-file { display:inline-flex; width:min(100%,560px); }
.scenery-toggle { display:flex!important; align-items:center; gap:.65rem; }
.scenery-toggle input { width:auto!important; }
.detail-heading-actions { display:flex; align-items:center; gap:.7rem; }
.detail-hero { position:relative; }
.detail-hero .edit-toggle { position:absolute; top:0; right:0; z-index:4; }
.detail-hero > div:last-child { padding-right:4rem; }
.edit-toggle { display:grid; place-items:center; width:2.65rem; height:2.65rem; padding:0; border:1px solid var(--olive); background:#e7eadf; color:var(--olive-dark); font:700 1.4rem/1 Georgia,serif; cursor:pointer; transition:transform .15s,box-shadow .15s,background .15s; }
.edit-toggle:hover,.edit-toggle[aria-expanded="true"] { transform:translateY(-2px); background:var(--olive); color:white; box-shadow:0 8px 18px rgba(47,56,40,.18); }
.editable-panel[hidden] { display:none; }
.context-menu { position:absolute; top:1rem; right:1rem; z-index:8; }
.context-menu > summary { display:grid; place-items:center; width:2.35rem; height:2.35rem; border:1px solid #9b9f8e; background:#e7eadf; color:var(--olive-dark); cursor:pointer; font-weight:900; letter-spacing:.08em; list-style:none; }
.context-menu > summary::-webkit-details-marker { display:none; }
.context-menu[open] > summary { border-color:var(--olive); background:var(--olive); color:white; }
.context-menu-list { position:absolute; top:calc(100% + .35rem); right:0; display:grid; min-width:210px; padding:.4rem; border:1px solid var(--olive); background:var(--panel); box-shadow:0 16px 36px rgba(47,56,40,.2); }
.context-menu-list a,.context-menu-list button { display:block; width:100%; padding:.7rem .8rem; border:0; border-bottom:1px solid var(--line); background:transparent; color:var(--ink); text-align:left; text-decoration:none; font:inherit; cursor:pointer; }
.context-menu-list > :last-child,.context-menu-list form:last-child button { border-bottom:0; }
.context-menu-list a:hover,.context-menu-list button:hover { background:#e7eadf; color:var(--olive-dark); }
.context-menu-list .danger-action { color:var(--danger); }
.context-popup-surface { position:fixed; z-index:1000; }
.context-popup-surface .context-menu-list { position:static; inset:auto; }
.page-context { position:relative; top:auto; right:auto; }
.page-context .context-menu-list { min-width:240px; }
.page-heading-actions { display:flex; align-items:center; gap:.65rem; flex:0 0 auto; }
[data-context-target].catalog-card { padding-right:4.75rem; }
.batch-card { position:relative; padding:0; }
.batch-card { transition:transform .15s ease,box-shadow .15s ease; }
.batch-card:hover { transform:translateY(-2px); box-shadow:0 12px 28px rgba(47,56,40,.14); }
.batch-main-link { display:block; padding:1.25rem; color:inherit; text-decoration:none; }
.batch-card > .context-menu { top:.8rem; right:.8rem; }
.batch-card .batch-header > strong { margin-right:3.25rem; }
.status-cancelled { border-color:#a77b67; background:#eadbd2; color:#7b3022; }
.workflow-list.is-cancelled form { display:none; }
.stl-add-form { display:grid; gap:.75rem; margin-top:1rem; }
.scenery-production-steps { grid-template-columns:repeat(2,minmax(320px,1fr)); grid-auto-rows:auto; align-items:stretch; }
.scenery-production-steps section { height:auto; min-height:270px; }
.selection-list.compact { max-height:145px; overflow:auto; }
@media(max-width:800px){.scenery-production-steps{grid-template-columns:1fr}}
@media(max-width:1100px){.production-steps{grid-template-columns:1fr 1fr}.step-counters{grid-template-columns:1fr 1fr}}
@media(max-width:600px){.production-steps,.step-counters{grid-template-columns:1fr}}
@media(max-width:700px){.production-filter-row{align-items:stretch;flex-direction:column}.production-filter-row .filter-tabs{margin:.4rem 0}}
@media(max-width:900px){.combat-group-builder{grid-template-columns:1fr}.unit-palette{position:static}.org-tree-root,.org-tree-root ul{justify-content:flex-start}.catalog-controls{align-items:stretch;flex-direction:column}}
@media(max-width:1200px){.organization-palette-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:900px){.organization-catalog{grid-template-columns:1fr}.department-create{padding:0 0 1rem;border-right:0;border-bottom:1px solid var(--line)}.organization-catalog-controls{grid-template-columns:1fr}.organization-filter-buttons{justify-content:flex-start}.organization-palette-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.organization-palette-grid{grid-template-columns:1fr}}
.user-menu { position:relative; margin-left:.4rem; padding-left:.8rem; border-left:1px solid var(--line); color:var(--muted); font-size:.82rem; }
.user-menu summary { padding:.45rem .65rem; cursor:pointer; list-style:none; user-select:none; }
.user-menu summary::-webkit-details-marker { display:none; }
.user-menu summary::after { content:""; display:inline-block; margin-left:.55rem; border:.28rem solid transparent; border-top-color:var(--olive); transform:translateY(.18rem); }
.user-menu[open] summary { background:#e7eadf; color:var(--olive-dark); }
.user-submenu { position:absolute; z-index:30; top:calc(100% + .4rem); right:0; display:grid; min-width:190px; padding:.35rem; border:1px solid var(--line); background:var(--panel); box-shadow:0 12px 28px rgba(47,56,40,.16); }
.user-submenu a,.user-submenu button,.user-submenu .is-disabled { display:block; width:100%; padding:.65rem .75rem; border:0; background:transparent; color:var(--ink); text-align:left; text-decoration:none; font:inherit; }
.user-submenu a:hover,.user-submenu button:hover { background:#e7eadf; color:var(--olive-dark); }
.user-submenu form { margin:0; }
.user-submenu button { cursor:pointer; }
.user-submenu .is-disabled { color:var(--muted); opacity:.6; cursor:not-allowed; }
.account-form { max-width:680px; }
.role-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(320px,1fr)); gap:1rem; }
.role-card { display:grid; gap:1rem; }
.role-card header { display:flex; justify-content:space-between; }
.role-card h2 { margin:0; }
.role-card small { color:var(--muted); }
.role-options { display:grid; gap:.45rem; }
.role-options label { display:flex; align-items:center; gap:.65rem; padding:.6rem .7rem; background:#e7eadf; }
.account-create { margin-bottom:1.25rem; }
.role-tags { display:flex; flex-wrap:wrap; gap:.4rem; }
.publication-panel { display:flex; align-items:end; justify-content:space-between; gap:1.25rem; }
.publication-panel h2 { margin:.15rem 0 .55rem; }
.publication-form { display:flex; align-items:end; gap:.65rem; }
.publication-form select { min-width:240px; }
@media(max-width:700px){.publication-panel,.publication-form{align-items:stretch;flex-direction:column}}
.auth-page { min-height:100vh; background:var(--paper); }
.auth-shell { min-height:100vh; display:grid; place-items:center; padding:2rem; }
.auth-card { width:min(100%,470px); padding:2.4rem; border:1px solid var(--line); background:var(--panel); box-shadow:0 24px 70px rgba(47,56,40,.12); }
.auth-card h1 { margin:.35rem 0 .75rem; font-size:clamp(2.25rem,8vw,3.6rem); }
.auth-brand { display:inline-flex; margin-bottom:2.2rem; color:var(--ink); }
.auth-brand .brand-logo { width:72px; height:58px; }
.auth-form { display:grid; gap:1.15rem; margin-top:1.6rem; }
.auth-form .button { margin-top:.4rem; }
.auth-switch { margin:1.3rem 0 0; padding-top:1rem; border-top:1px solid var(--line); }
