*{box-sizing:border-box}
:root{color-scheme:light;--ink:#17223a;--muted:#5c687a;--line:#dee3eb;--paper:#fff;--ground:#f4f5f7;--accent:#a7414b;--navy:#172747;--coral:#f48a83;--green:#257755;font:16px/1.55 "Inter","Microsoft YaHei UI","PingFang SC",system-ui,sans-serif}
body{margin:0;background:var(--ground);color:var(--ink)}
a{color:inherit;text-decoration:none}
button,input,select,textarea{font:inherit}
button,.button{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;min-height:42px;border:1px solid var(--line);border-radius:8px;padding:.5rem .9rem;background:var(--paper);color:var(--ink);cursor:pointer;text-align:center}
button:hover,.button:hover{border-color:var(--hover-line);background:var(--hover-surface)}
button:disabled{opacity:.55;cursor:default}
button.primary,.button.primary{color:white;border-color:var(--primary);background:var(--primary);font-weight:650}
button.primary:hover,.button.primary:hover{background:var(--primary-hover)}
:focus-visible{outline:2px solid var(--focus);outline-offset:3px}
input,select,textarea{width:100%;border:1px solid var(--line);border-radius:8px;background:var(--paper);color:var(--ink);padding:.6rem .75rem;min-height:42px;min-width:0}
textarea{resize:vertical}
.shell{min-height:100dvh;display:grid;grid-template-columns:230px minmax(0,1fr)}
.sidebar{position:sticky;top:0;height:100dvh;background:var(--paper);border-right:1px solid var(--line);padding:1.55rem 1rem 1rem;display:flex;flex-direction:column;gap:1.7rem}
.logo{display:flex;align-items:center;width:175px;max-width:100%;margin:0 auto;min-height:65px}
.logo img{display:block;width:100%;height:auto}
nav{display:grid;gap:.25rem}
nav a{border-radius:8px;display:flex;gap:.65rem;align-items:center;min-height:44px;padding:.5rem .7rem;color:var(--nav-ink)}
nav a:hover{background:var(--nav-hover)}
nav a[aria-current=page]{background:var(--nav-surface);color:var(--nav-selected);font-weight:700}
.nav-icon{width:1.2rem;text-align:center;font-size:1.1rem}
.device{margin-top:auto;display:grid;grid-template-columns:auto 1fr auto;gap:.5rem;text-align:left;font-size:.875rem}
.device i{width:.56rem;height:.56rem;background:#8490a2;border-radius:100%}
.device i.ok{background:var(--green)}.device i.warn{background:#ab6320}
main{max-width:1480px;width:100%;padding:0 clamp(1rem,4vw,4rem) 3rem;margin:0 auto;min-width:0}
.top{min-height:66px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);color:var(--muted);font-size:.875rem;margin-bottom:1.45rem;gap:.75rem}
.top span:first-child{font-weight:650;color:var(--ink)}
.hero{position:relative;isolation:isolate;overflow:hidden;min-height:222px;border-radius:16px;padding:clamp(1.25rem,3vw,2.6rem);background:var(--navy);color:white;display:flex;align-items:center;justify-content:space-between;gap:1.2rem}
.hero:after{content:"";position:absolute;z-index:-1;inset:0;background:radial-gradient(circle at 82% 40%,#3f538680,transparent 48%),radial-gradient(circle,#8199bf44 1px,transparent 1px);background-size:auto,22px 22px;mask-image:linear-gradient(90deg,transparent 20%,#000)}
.hero h1,.page-heading h1{font-size:clamp(1.7rem,4vw,2.65rem);line-height:1.2;margin:0;letter-spacing:.02em}
.hero p{color:#e0e7f5;margin:.8rem 0 1.35rem}
.hero .primary{background:#f5a39b;color:#202744;border-color:#f5a39b}
.hero .primary:hover{background:#ffc0b9}
.bridge-art{width:min(16rem,33%);height:112px;position:relative;flex:none;margin-right:2%}
.bridge-art i{position:absolute;top:50%;left:0;width:100%;height:2px;background:#7292bd;transform-origin:center}
.bridge-art i:nth-child(1){transform:rotate(24deg)}.bridge-art i:nth-child(2){transform:rotate(-24deg);background:#d48f9f}.bridge-art i:nth-child(3){transform:rotate(0deg);background:#b1a3e2}.bridge-art b{position:absolute;top:calc(50% - 8px);left:calc(50% - 8px);width:16px;height:16px;background:#ffb9ae;border-radius:50%;box-shadow:0 0 0 9px #f48a8324}
.metrics,.systems{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem;margin:1rem 0}
.metric,.card{background:var(--paper);border:1px solid var(--line);border-radius:12px;padding:1.12rem;min-width:0}
.metric{display:flex;align-items:center;justify-content:space-between;gap:.6rem;color:var(--muted)}
.metric b{font-size:1.7rem;line-height:1.2;font-variant-numeric:tabular-nums;color:var(--ink)}
.card h2,.section-title h2{font-size:1.13rem;margin:0}
.card p,.page-heading p{margin:.45rem 0 .8rem;color:var(--muted)}
.section-title,.page-heading,.entry-head,.dialog-header{display:flex;align-items:center;justify-content:space-between;gap:.75rem}
.section-title{margin-bottom:.75rem}
.page-heading{margin:0 0 1.2rem;align-items:flex-start}
.home-columns{display:grid;grid-template-columns:1.6fr 1fr;gap:1rem;align-items:start}
.entry-list{display:grid;gap:.55rem}
.entry{background:var(--paper);border:1px solid var(--line);border-radius:8px;padding:.8rem .9rem;min-width:0;overflow-wrap:anywhere}
.entry:focus-within{border-color:var(--hover-line)}
.entry-head{align-items:flex-start}
.entry-title{text-align:left;justify-content:flex-start;font-weight:700;padding:0;border:0;min-height:32px;overflow-wrap:anywhere;min-width:0}
.entry-title:hover{background:transparent;color:var(--accent)}
.entry-body{margin:.2rem 0 .6rem;font-size:.94rem;color:var(--muted);white-space:pre-wrap;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.meta{display:flex;gap:.4rem .65rem;align-items:center;flex-wrap:wrap;color:var(--muted);font-size:.84rem}
.chip{display:inline-block;padding:.12rem .46rem;background:var(--chip);color:var(--chip-ink);border-radius:5px}
.chip.overdue{background:var(--red-chip);color:var(--red-ink)}
.chip.lavender{background:var(--violet-chip);color:var(--violet-ink)}
.empty{padding:1.3rem .8rem;border:1px dashed var(--empty-line);border-radius:8px;text-align:center;color:var(--muted);font-size:.93rem}
.actions,.filters,.dialog-footer{display:flex;align-items:center;gap:.55rem;flex-wrap:wrap}
.filters{margin-bottom:1rem}.filters input{flex:1;min-width:160px}.filters select{width:auto}
.board{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.8rem}
.board section{min-width:0;background:var(--board);border:1px solid var(--line);border-radius:12px;padding:.65rem}
.board h2{font-size:1rem;margin:.2rem .35rem .7rem;display:flex;justify-content:space-between;gap:.5rem}
.board .entry{padding:.55rem .65rem}
.system-name{display:flex;gap:.55rem;align-items:center;margin-bottom:.55rem}
.system-mark{display:grid;place-items:center;width:38px;height:38px;border-radius:9px;background:var(--arinc-chip);color:var(--arinc-ink);font-weight:700}
.system-mark.afdx{background:var(--violet-chip);color:var(--violet-ink)}
.plot{margin:1rem 0;min-height:250px;border:1px solid var(--line);border-radius:12px;padding:1.3rem;background-color:var(--plot);background-image:radial-gradient(var(--plot-dots) 1px,transparent 1px);background-size:18px 18px;display:grid;grid-template-columns:1fr 1fr 1fr;align-items:center;gap:clamp(.3rem,3vw,3rem);text-align:center}
.plot-column{display:grid;gap:1.2rem;position:relative}
.plot-column:not(:last-child):after{content:"";position:absolute;height:1px;background:var(--plot-lines);width:clamp(.3rem,3vw,3rem);left:100%;top:50%}
.plot-node{border-radius:8px;padding:.65rem .25rem;border:1px solid var(--plot-border);background:var(--paper);font-size:.92rem}
dialog{width:min(620px,calc(100% - 1.5rem));max-height:calc(100% - 1.5rem);border:1px solid var(--line);border-radius:14px;padding:1.2rem;color:var(--ink);background:var(--paper);box-shadow:0 28px 95px #17223a33}
dialog::backdrop{background:#15203988}
.dialog-header{margin-bottom:.9rem}.dialog-header h2{margin:0;font-size:1.23rem}
.dialog-header button{padding:.2rem .5rem;min-height:34px}
label{display:grid;gap:.28rem;margin-bottom:.7rem;font-size:.9rem;color:var(--ink)}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 .7rem}
.dialog-footer{justify-content:flex-end;margin-top:.9rem}
.danger{color:var(--red-ink)}
.panel-section{border-top:1px solid var(--line);padding-top:.8rem;margin-top:.8rem}
.panel-section h3{font-size:1rem;margin:.1rem 0 .55rem}.panel-section p{font-size:.92rem;color:var(--muted)}
.code{font:700 1.6rem ui-monospace,monospace;letter-spacing:.18em;user-select:all}
.device-row{display:flex;justify-content:space-between;align-items:center;gap:.65rem;padding:.5rem 0;overflow-wrap:anywhere}
#toast{position:fixed;z-index:5;bottom:1rem;left:50%;transform:translateX(-50%);background:var(--navy);color:#fff;border-radius:8px;padding:.65rem 1rem;max-width:calc(100vw - 2rem);width:max-content;box-shadow:0 5px 20px #1a24433b}
@media(max-width:970px){.shell{grid-template-columns:185px minmax(0,1fr)}.home-columns{grid-template-columns:1fr}.board{grid-template-columns:1fr}}
@media(max-width:680px){.shell{display:block}.sidebar{position:static;height:auto;display:grid;grid-template-columns:1fr auto;gap:.25rem .75rem;padding:.65rem 1rem;border-right:0;border-bottom:1px solid var(--line)}.logo{width:125px;margin:0;min-height:auto;grid-column:1;grid-row:1}.device{grid-column:2;grid-row:1;margin:0;min-height:38px}.sidebar nav{grid-column:1/-1;display:flex;gap:.25rem;overflow:auto;padding:.25rem 0;scrollbar-width:thin}.sidebar nav a{white-space:nowrap;font-size:.875rem;padding:.35rem .55rem;min-height:38px}.nav-icon{display:none}.top{min-height:48px;margin-bottom:.85rem}.bridge-art{display:none}.hero{min-height:190px}.metrics{gap:.45rem}.metric{display:block;padding:.55rem .6rem;font-size:.81rem}.metric b{display:block;font-size:1.38rem;margin-top:.3rem}.systems{grid-template-columns:1fr}.page-heading{flex-wrap:wrap}.device-row button{flex:none}}

[hidden]{display:none!important}

/* Appearance */
:root {
  --hover-line:#8593aa;--hover-surface:#f5f7fb;--primary:var(--navy);--primary-hover:#263c65;--focus:#2253a4;
  --nav-ink:#49566b;--nav-hover:#f2f4f8;--nav-surface:#e9edf5;--nav-selected:#192940;
  --board:#e9edf3;--chip:#edf0f7;--chip-ink:#3f4e6a;--red-chip:#fae4e6;--red-ink:#993346;
  --violet-chip:#ede9fa;--violet-ink:#544b80;--empty-line:#cbd3df;--arinc-chip:#f6e5e5;--arinc-ink:#903b49;
  --plot:#f9fafc;--plot-dots:#dadde6;--plot-lines:#aebad1;--plot-border:#a3adc1;
}
:root[data-theme="dark"] {
  color-scheme:dark;
  --ground:#101520;--paper:#191f2d;--ink:#edf1fa;--muted:#adb8ce;--line:#30394c;
  --accent:#ffaaa6;--navy:#1c2b49;--green:#7dd9ad;
  --hover-line:#899ac0;--hover-surface:#222c40;--primary:#394f7d;--primary-hover:#455d91;--focus:#a5beff;
  --nav-ink:#bdc7db;--nav-hover:#222c40;--nav-surface:#293653;--nav-selected:#f1f5ff;
  --board:#141b28;--chip:#2b3752;--chip-ink:#cedaf7;--red-chip:#482a39;--red-ink:#ffc1c9;
  --violet-chip:#37314e;--violet-ink:#dbd4fa;--empty-line:#3d4963;--arinc-chip:#462934;--arinc-ink:#ffb6bd;
  --plot:#151e30;--plot-dots:#354158;--plot-lines:#6e80a5;--plot-border:#566585;
}
:root[data-theme="dark"] .logo {background:#e9edf4;border-radius:10px;padding:5px 10px}
:root[data-theme="dark"] .hero {border:1px solid #334466}
:root[data-theme="dark"] dialog::backdrop {background:#070b13b8}
:root[data-theme="dark"] #toast {background:#304369}
.top-controls {display:flex;align-items:center;justify-content:flex-end;gap:.75rem;min-width:0}
#today {text-align:right}
#theme-toggle {min-height:36px;white-space:nowrap;font-size:.875rem;gap:.35rem;padding:.32rem .65rem}
#theme-icon {width:1.1em;line-height:1;font-size:1.1em}
@media(max-width:400px){.top-controls{gap:.4rem}#today{font-size:.78rem}}
@media(max-width:330px){#today{display:none}}
