:root {
    --ink: #18242f;
    --muted: #667684;
    --line: #d8e0e6;
    --surface: #ffffff;
    --surface-2: #f5f7f8;
    --accent: #245b82;
    --accent-2: #173d59;
    --good: #1f6b45;
    --warn: #8a5b14;
    --bad: #8c3434;
    --shadow: 0 8px 24px rgba(20, 42, 58, .08);
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; background: #eef2f4; color: var(--ink); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; gap: 1rem; align-items: center; justify-content: space-between; padding: .8rem clamp(.8rem, 3vw, 2rem); background: #172a39; color: white; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.topbar a { color: white; }
.topbar nav { display: flex; gap: .9rem; font-size: .92rem; }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none !important; }
.brand-mark { display: inline-grid; place-items: center; width: 2.55rem; height: 2.1rem; border: 1px solid rgba(255,255,255,.38); border-radius: .45rem; font-weight: 800; letter-spacing: .04em; }
.brand-copy { font-weight: 650; }
.shell { width: min(1280px, calc(100% - 1.4rem)); margin: 1.2rem auto 3rem; }
.footer { padding: 1.2rem; text-align: center; color: var(--muted); font-size: .8rem; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin: .4rem 0 1.1rem; }
.page-head h1 { margin: 0; font-size: clamp(1.45rem, 4vw, 2.1rem); }
.page-head p { margin: .35rem 0 0; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: .75rem; box-shadow: var(--shadow); padding: 1rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: .85rem; }
.project-card h2 { margin: 0 0 .25rem; font-size: 1.15rem; }
.meta { color: var(--muted); font-size: .87rem; }
.badge { display: inline-flex; align-items: center; padding: .23rem .5rem; border-radius: 999px; font-size: .76rem; font-weight: 650; background: #e9f1f7; color: #244b67; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 2.55rem; padding: .58rem .85rem; border: 1px solid var(--line); border-radius: .5rem; background: white; color: var(--ink); font: inherit; font-weight: 650; cursor: pointer; text-decoration: none !important; }
.btn:hover { background: #f5f8fa; }
.btn.primary { color: white; background: var(--accent); border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: var(--bad); border-color: #e3bcbc; }
form.stack { display: grid; gap: .8rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .8rem; }
label { display: grid; gap: .28rem; font-size: .88rem; font-weight: 650; }
input, select, textarea { width: 100%; min-height: 2.55rem; padding: .55rem .65rem; border: 1px solid #bfcbd3; border-radius: .45rem; background: white; color: var(--ink); font: inherit; }
textarea { min-height: 6rem; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: .7rem; margin: 1.15rem 0 .55rem; }
.section-title h2 { margin: 0; font-size: 1.1rem; }
.flash { margin-bottom: .85rem; padding: .75rem .9rem; border-radius: .5rem; background: #e7f4ec; border: 1px solid #b9dec8; color: #245d3d; }
.notice { padding: .75rem .85rem; border-left: 4px solid var(--accent); background: #edf4f8; border-radius: .3rem; color: #315468; }
.area-list { display: grid; gap: .5rem; }
.area-row { display: grid; grid-template-columns: minmax(170px, 1fr) minmax(110px,.35fr) minmax(150px,.6fr); gap: .6rem; align-items: center; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: .5rem; background: white; }
.area-row .indent { padding-left: 1rem; }
.matrix-wrap { overflow: auto; border: 1px solid var(--line); border-radius: .65rem; background: white; box-shadow: var(--shadow); max-height: 70vh; }
table.matrix { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: .82rem; }
.matrix th, .matrix td { padding: .5rem .55rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; min-width: 118px; }
.matrix th { position: sticky; top: 0; z-index: 4; background: #203a4e; color: white; font-weight: 700; }
.matrix .area-head, .matrix .area-cell { position: sticky; left: 0; min-width: 165px; text-align: left; }
.matrix .area-head { z-index: 6; }
.matrix .area-cell { z-index: 3; background: #f8fafb; font-weight: 700; }
.matrix .weight { display: block; margin-top: .15rem; color: var(--muted); font-weight: 500; font-size: .72rem; }
.state { display: inline-flex; align-items: center; justify-content: center; padding: .22rem .43rem; border-radius: .4rem; font-size: .72rem; font-weight: 700; }
.state-complete { background: #dcefe4; color: var(--good); }
.state-ready { background: #e4eff7; color: #245c81; }
.state-notready, .state-planned { background: #edf0f2; color: #65727b; }
.state-inprogress { background: #fff0cc; color: var(--warn); }
.matrix-check { display: flex; justify-content: center; align-items: center; gap: .35rem; margin-top: .35rem; font-size: .7rem; font-weight: 500; color: var(--muted); }
.matrix-check input { width: 1.05rem; min-height: 1.05rem; }
.empty { padding: 1.4rem; text-align: center; color: var(--muted); }
.inline-form { display: flex; flex-wrap: wrap; gap: .55rem; align-items: end; }
.inline-form label { min-width: 150px; flex: 1; }
.small { font-size: .82rem; color: var(--muted); }
@media (max-width: 720px) {
    .brand-copy { display: none; }
    .topbar nav { gap: .6rem; font-size: .84rem; }
    .shell { width: min(100% - .8rem, 1280px); margin-top: .7rem; }
    .page-head { display: grid; }
    .form-grid { grid-template-columns: 1fr; }
    .area-row { grid-template-columns: 1fr 90px; }
    .area-row > :last-child { grid-column: 1 / -1; }
    .card { padding: .8rem; border-radius: .6rem; }
}
