:root {
    font-family: Inter, system-ui, sans-serif;
    color: #102c45;
    background: #f3f7fc;
    --navy: #061e33;
    --blue: #0b60bd;
    --border: #dbe6f1;
    --red: #ec2941;
    --sidebar: 250px;
}
* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.7rem, 3vw, 2.6rem); margin-bottom: .65rem; }
h2 { font-size: 1.25rem; }
p, li { line-height: 1.6; }
a { color: #0755a2; }
button, input, select, textarea { font: inherit; }
button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: .5rem .85rem;
    border: 1px solid transparent;
    border-radius: .6rem;
    text-decoration: none;
    background: #e8f1fb;
    color: #103960;
    cursor: pointer;
}
button:disabled { opacity: .55; cursor: wait; }
.primary { background: #075eb9; color: white; }
.secondary { background: white; border-color: #c5d9eb; color: #154a78; }
:focus-visible { outline: 3px solid #ffb742; outline-offset: 3px; }
.skip { position: absolute; top: -100px; left: 12px; z-index: 20; background: white; padding: 12px; }
.skip:focus { top: 12px; }
.logo { display: block; width: 132px; border-radius: 12px; background: white; padding: .35rem; }
.logo img { width: 100%; height: auto; display: block; }
.portal { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar {
    position: sticky;
    top: 0;
    height: 100dvh;
    background: linear-gradient(#061c30 40%, transparent 100%), url(portal-landscape.svg) center bottom / auto 56% no-repeat, var(--navy);
    display: flex;
    flex-direction: column;
    padding: 1.45rem 1rem 0;
    color: white;
    overflow: auto;
}
.sidebar .logo { width: 145px; margin: 0 auto 2rem; }
.sidebar nav { display: grid; gap: .5rem; }
.sidebar nav a {
    position: relative;
    display: flex;
    gap: .7rem;
    align-items: center;
    min-height: 49px;
    border-radius: .65rem;
    border-left: 4px solid transparent;
    padding: .6rem .85rem;
    color: #f2f8ff;
    font-weight: 650;
    text-decoration: none;
}
.sidebar nav a:hover { background: #163955; }
.sidebar nav a[aria-current=page] {
    border-left-color: var(--red);
    background: linear-gradient(105deg,#1369c2,#073e80);
    color: white;
    box-shadow: 0 2px 10px #0003;
}
.nav-icon { width: 1.2rem; text-align: center; font-size: 1rem; }
.maple { margin: auto -1rem 0; padding-top: 1rem; }
.maple svg { display: block; width: 100%; }
.workspace { min-width: 0; }
.portal-header, .public-header {
    background: linear-gradient(90deg,#041a2cdb,#08243ac7), url(portal-landscape.svg) center 54% / cover, var(--navy);
    color: white;
    padding: .85rem 1.4rem;
    display: flex;
    align-items: center;
    gap: .8rem;
    min-height: 82px;
}
.brand { min-width: 10.5rem; display: grid; gap: .2rem; }
.brand span { color: #c2d8ec; font-size: .84rem; }
.search { display: flex; align-items: stretch; flex: 1; gap: .35rem; min-width: 11rem; }
.search input { flex: 1; min-width: 0; }
.header-actions { display: flex; gap: .35rem; align-items: center; }
.header-actions button, .header-actions summary, #menu { background: #173a58; color: white; border-radius: .55rem; }
.header-actions summary { padding: .7rem; cursor: pointer; }
.header-actions details { position: relative; }
#account-options { position: absolute; right: 0; z-index: 5; min-width: 13rem; background: #173a58; padding: .5rem; border-radius: .6rem; }
#account-options a, #account-options button { display: flex; color: white; padding: .5rem .65rem; width: 100%; }
#buddy img { width: 24px; height: 24px; object-fit: contain; margin-right: .35rem; }
#menu { display: none; }
main { padding: 1.65rem clamp(1rem, 3vw, 2.2rem); }
.notice { background: #e5f0ff; border: 1px solid #cadef8; padding: .7rem 1rem; border-radius: .55rem; margin-bottom: 1.2rem; }
#status:not(:empty) { border-left: 4px solid #2b8757; background: #f2fff6; padding: .7rem; margin-bottom: 1rem; }
#status.error { border-color: #ad1630; background: #fff0f2; }
.grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(280px, 100%),1fr)); gap: 1rem; }
.card { background: white; border: 1px solid var(--border); border-radius: .8rem; padding: 1.15rem; margin-bottom: 1rem; box-shadow: 0 2px 10px #173a5808; min-width: 0; }
.card > :last-child { margin-bottom: 0; }
.metric { font-size: 1.85rem; font-weight: 750; display: block; }
.table-wrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; font-size: .91rem; }
th, td { padding: .65rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
th { background: #eff5fb; }
.tag { display: inline-block; color: #134b76; background: #e5f0ff; padding: .18rem .5rem; border-radius: 2rem; }
.tag[data-state=failed], .tag[data-state=rework], .tag[data-state=rejected], .tag[data-state=blocked] { background: #ffe6e9; color: #9b1230; }
.tag[data-state=approved], .tag[data-state=delivered], .tag[data-state=simulated_paid] { background: #e1f5e6; color: #175a34; }
.fields { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(180px,100%),1fr)); gap: .75rem; margin-bottom: .8rem; }
label { display: flex; flex-direction: column; gap: .25rem; font-size: .9rem; font-weight: 600; min-width: 0; }
input, select, textarea {
    padding: .58rem .65rem;
    min-height: 42px;
    width: 100%;
    border: 1px solid #b9ccdd;
    border-radius: .45rem;
    color: #142f47;
    background: white;
}
label.check { flex-direction: row; align-items: center; }
input[type=checkbox] { width: 1.15rem; min-height: 1.15rem; flex-shrink: 0; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.line { border: 1px solid var(--border); padding: .7rem; border-radius: .5rem; margin-bottom: .65rem; }
dialog { border: 1px solid var(--border); border-radius: .8rem; width: min(880px,95vw); max-height: 86dvh; padding: 1.2rem; }
dialog::backdrop { background: #001529ac; }
.public-header { justify-content: space-between; flex-wrap: wrap; }
.public-header nav { display: flex; flex-wrap: wrap; gap: .45rem .85rem; }
.public-header nav a { color: white; padding: .45rem .2rem; text-underline-offset: .35rem; }
.public-main { max-width: 1230px; margin: 0 auto; }
.public-main .hero { background: white; border: 1px solid var(--border); border-radius: 1rem; padding: clamp(1rem,5vw,3rem); margin-bottom: 1.2rem; }
.hero p { max-width: 60ch; }
.eyebrow { color: #07559e; font-size: .82rem; letter-spacing: .08em; font-weight: 800; text-transform: uppercase; }
.narrow { max-width: 650px; margin-inline: auto; }
.public-footer { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; color: #cfe3f5; background: var(--navy); padding: 1rem 1.5rem; }
.public-footer a { color: white; }
.secret { word-break: break-all; user-select: all; }
@media (max-width: 1150px) {
    .portal-header { flex-wrap: wrap; }
    .search { order: 3; flex-basis: 100%; }
    .header-actions { margin-left: auto; }
}
@media (max-width: 780px) {
    .portal { display: block; }
    .sidebar { display: none; position: relative; height: auto; padding: .8rem; }
    .sidebar.open { display: flex; }
    .sidebar .logo { width: 104px; margin: 0 0 .7rem; }
    .sidebar nav { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .maple { display: none; }
    #menu { display: inline-flex; }
    .portal-header { padding: .65rem .8rem; }
    .header-actions { margin-left: 0; flex-wrap: wrap; }
    .brand { min-width: 0; }
    main { padding: 1rem .8rem; }
}
.sidebar .logo { width: min(190px,100%); margin-bottom: 1.75rem; }
.nav-icon { flex: 0 0 1.35rem; height: 1.35rem; }
.portal-header { min-height: 106px; background-position: center 42%; }
.dashboard-intro { display:flex; flex-wrap:wrap; justify-content:space-between; gap:.75rem; align-items:center; }
.dashboard-intro p { margin:0; }
.range { display:flex; align-items:end; gap:.5rem; }
.dashboard-shortcuts { margin-bottom:1rem; }
.kpi-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.8rem; }
.kpi { border-bottom:3px solid #176de3; background:linear-gradient(145deg,#fff,#eaf3ff); }
.kpi-1 { border-bottom-color:#188949; background:linear-gradient(145deg,#fff,#e8f7ed); }
.kpi-2 { border-bottom-color:#dc9c14; background:linear-gradient(145deg,#fff,#fff5d9); }
.kpi-3 { border-bottom-color:#d52742; background:linear-gradient(145deg,#fff,#ffecf0); }
.kpi h2 { font-size:.96rem; }
.dashboard-grid { display:grid; grid-template-columns:1.1fr 1fr; gap:.85rem; }
.chart { margin:0; }
.chart svg { width:100%; height:auto; }
.chart figcaption { color:#45647e; font-size:.8rem; }
.health { display:flex; flex-wrap:wrap; align-items:center; gap:.55rem; }
.health svg { width:155px; max-width:100%; }
.health ul { padding-left:1.1rem; }
.form-error { color:#9b1230; margin:.6rem 0 0; }
@media (max-width:1080px) {
    .kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:780px) {
    .sidebar .logo { width:104px; margin:0 0 .7rem; }
    .portal-header { min-height:82px; }
    .dashboard-grid { grid-template-columns:minmax(0,1fr); gap:0; }
}

/* Additive operational previews; preserve the approved portal shell. */
.shelf-preview{display:grid;gap:12px;margin:16px 0}.shelf-row{display:flex;gap:8px;overflow:auto;padding:5px}.shelf-bin{display:grid;gap:5px;min-width:140px;padding:10px;border:1px solid #b8cddd;border-radius:8px;background:#f1f7ff}.shelf-bin[data-state=new]{border-color:#148350}.shelf-bin[data-state=conflict]{border:2px solid #b9223a}.shelf-bin[data-state=skipped]{background:#e8edf1;color:#536676}.shelf-bin small{font-size:.75rem}fieldset.fields{border:1px solid #c5d6e6;border-radius:8px;margin:12px 0;padding:12px}.founder-film video{display:block;width:100%;max-height:580px;background:#061e32;border-radius:12px}.public-main .mission{border-left:4px solid #e52337}.public-main .slogan{font-size:clamp(1.3rem,3vw,2rem);font-weight:750;color:#123858}.founder-film .film-status{padding:20px;background:#edf4fa;border-radius:12px}

#dialog svg[aria-label^="Warehouse map"]{display:block;width:100%;max-height:480px;min-height:240px;background:#fff;border:1px solid #b9cfdf;touch-action:none}#dialog svg g[role=button]:focus rect{stroke:#e52337;stroke-width:3}

.film-transcript{white-space:pre-line}
