:root {
  --ink: #17262e;
  --muted: #62727b;
  --line: #dfe7e8;
  --canvas: #f4f7f6;
  --panel: #ffffff;
  --navy: #173b4b;
  --teal: #23766f;
  --teal-pale: #e4f2ee;
  --amber: #9a6413;
  --amber-pale: #fff3df;
  --red: #ae4d49;
  --red-pale: #faecea;
  --shadow: 0 10px 30px rgba(22, 48, 55, .06);
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: Inter, Aptos, "Segoe UI", Arial, sans-serif; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.sidebar { background: var(--navy); color: #e9f2f1; padding: 27px 16px; display: flex; flex-direction: column; gap: 28px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 9px; font-weight: 700; font-size: 1.02rem; letter-spacing: -.01em; }
.brand-mark { width: 30px; height: 30px; border: 1px solid #6ca99f; border-radius: 50%; display: grid; place-items: center; color: #b8ddd5; font-size: .75rem; }
.brand small { display: block; color: #a9c0c2; font-size: .69rem; font-weight: 500; letter-spacing: .03em; text-transform: uppercase; }
.nav { display: grid; gap: 4px; }
.nav a { border-radius: 8px; padding: 10px 12px; color: #c8d7d8; font-size: .92rem; transition: .15s ease; }
.nav a:hover, .nav a.active { background: rgba(255,255,255,.1); color: white; }
.side-note { margin-top: auto; border-top: 1px solid rgba(255,255,255,.16); padding: 18px 9px 0; color: #b9cbcb; font-size: .77rem; line-height: 1.55; }
.side-note strong { color: #fff; font-weight: 600; }

.main { min-width: 0; }
.topbar { padding: 19px clamp(20px, 4vw, 52px); display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.75); }
.eyebrow { color: var(--teal); font-size: .71rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.topbar p { margin: 3px 0 0; color: var(--muted); font-size: .81rem; }
.data-status { display: inline-flex; gap: 8px; align-items: center; padding: 7px 10px; border: 1px solid #d4e2df; border-radius: 999px; color: #46615f; background: #f5faf8; font-size: .74rem; white-space: nowrap; }
.dot { width: 7px; height: 7px; background: var(--teal); border-radius: 50%; }
.content { max-width: 1400px; margin: 0 auto; padding: 38px clamp(20px, 4vw, 52px) 55px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 28px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: clamp(1.75rem, 3vw, 2.35rem); line-height: 1.15; letter-spacing: -.035em; }
h2 { margin-bottom: 4px; font-size: 1.13rem; letter-spacing: -.02em; }
h3 { margin-bottom: 6px; font-size: .94rem; }
.intro { color: var(--muted); margin: 0; max-width: 700px; }
.grid { display: grid; gap: 18px; }
.grid-two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; box-shadow: var(--shadow); }
.card > :last-child { margin-bottom: 0; }
.card-label { color: var(--muted); font-size: .76rem; font-weight: 650; letter-spacing: .045em; text-transform: uppercase; }
.metric { margin: 5px 0 3px; font-size: 1.75rem; font-weight: 700; line-height: 1.15; letter-spacing: -.04em; }
.muted { color: var(--muted); font-size: .88rem; }
.mode-card { position: relative; overflow: hidden; min-height: 204px; display: flex; flex-direction: column; }
.mode-card::after { content: ''; position: absolute; width: 135px; height: 135px; border: 1px solid #c5ded9; border-radius: 50%; right: -49px; top: -52px; }
.mode-card.short::after { border-color: #f0d5a9; }
.mode-card p { color: var(--muted); max-width: 420px; font-size: .91rem; }
.mode-meta { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.text-link { color: var(--teal); font-size: .87rem; font-weight: 650; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: .72rem; font-weight: 650; white-space: nowrap; }
.badge.watch { background: var(--teal-pale); color: #17645d; }
.badge.wait { background: var(--amber-pale); color: #835108; }
.badge.confirm { background: #edf0f6; color: #526174; }
.badge.positive { background: var(--teal-pale); color: #17645d; }
.badge.negative { background: var(--red-pale); color: var(--red); }
.badge.neutral { background: #eef2f2; color: #57666b; }
.approach { border-left: 4px solid var(--teal); background: #f1f8f6; }
.approach p { margin: 8px 0 5px; font-size: 1.12rem; font-weight: 650; letter-spacing: -.015em; }
.risk { background: #fffaf2; border-color: #ecdcbf; }
.risk p { color: #6f5d42; font-size: .85rem; }
.section-header { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin: 28px 0 12px; }
.section-header h2 { margin: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th { text-align: left; color: var(--muted); font-size: .69rem; letter-spacing: .055em; text-transform: uppercase; font-weight: 700; padding: 0 12px 11px; }
td { border-top: 1px solid var(--line); padding: 13px 12px; vertical-align: middle; }
td:first-child, th:first-child { padding-left: 0; }
td:last-child, th:last-child { padding-right: 0; }
.symbol { display: block; font-weight: 700; }
.subline { color: var(--muted); font-size: .77rem; }
.progress { height: 8px; background: #e6edeb; border-radius: 999px; overflow: hidden; margin: 13px 0 8px; }
.progress > span { display: block; height: 100%; background: var(--teal); border-radius: inherit; }
.stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 20px; }
.stats strong { display: block; margin-top: 2px; font-size: 1.05rem; }
.plan { padding: 19px 20px; border-left: 3px solid var(--teal); background: #f8fbfa; }
.plan p { margin-bottom: 0; color: var(--muted); font-size: .88rem; }
.split-label { margin: 4px 0 15px; color: var(--muted); font-size: .88rem; }
.rule-list { padding: 0; margin: 15px 0 0; list-style: none; display: grid; gap: 10px; }
.rule-list li { display: flex; gap: 10px; color: #5e584b; font-size: .87rem; }
.rule-list li::before { content: '—'; color: var(--amber); font-weight: 700; }
.notice { padding: 14px 16px; border: 1px solid #d7e5e2; border-radius: 10px; background: #f8fcfb; color: #4d6662; font-size: .85rem; }
.settings { display: grid; gap: 0; }
.setting-row { padding: 17px 0; display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.setting-row:last-child { padding-bottom: 0; border-bottom: 0; }
.setting-row p { margin: 3px 0 0; color: var(--muted); font-size: .84rem; }
.setting-value { color: var(--teal); font-weight: 650; font-size: .86rem; text-align: right; }
.mobile-toggle { display: none; border: 1px solid var(--line); background: white; border-radius: 8px; padding: 8px 10px; color: var(--ink); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.form-grid label { display: grid; gap: 6px; color: #42535a; font-size: .82rem; font-weight: 650; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; border: 1px solid #cfdcdc; border-radius: 8px; padding: 9px 10px; color: var(--ink); background: white; font: inherit; font-size: .9rem; }
.form-grid textarea { resize: vertical; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { outline: 2px solid #b7d8d2; outline-offset: 1px; border-color: var(--teal); }
.form-grid button, .delete-button { width: fit-content; border: 0; border-radius: 8px; padding: 10px 14px; background: var(--teal); color: white; cursor: pointer; font-size: .86rem; font-weight: 650; }
.form-grid button:hover { background: #175f59; }
.flash { margin: 0 0 18px; border: 1px solid; border-radius: 10px; padding: 12px 14px; font-size: .88rem; }
.flash.success { border-color: #b8d9d2; background: var(--teal-pale); color: #175c55; }
.flash.error { border-color: #edc9c5; background: var(--red-pale); color: #86433f; }
.admin-notice { margin-bottom: 18px; }
.admin-notice code { font-family: ui-monospace, Consolas, monospace; font-size: .82em; }
.inline-form { margin: 0; }
.delete-button { padding: 7px 9px; background: transparent; border: 1px solid #dfb6b1; color: #a5423d; }
.delete-button:hover { background: var(--red-pale); }

@media (max-width: 850px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 5; inset: 0 auto 0 0; width: 260px; transform: translateX(-100%); transition: transform .2s ease; }
  body.menu-open .sidebar { transform: translateX(0); box-shadow: 20px 0 50px rgba(0,0,0,.2); }
  .mobile-toggle { display: inline-block; }
  .topbar { gap: 12px; }
  .data-status { display: none; }
  .grid-three { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 620px) {
  .content { padding-top: 28px; }
  .page-heading { align-items: start; flex-direction: column; margin-bottom: 20px; }
  .grid-two, .grid-three { grid-template-columns: 1fr; }
  .topbar p { display: none; }
  .card { padding: 18px; }
  .stats { gap: 16px 26px; }
  .setting-row { flex-direction: column; gap: 4px; }
  .setting-value { text-align: left; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
}
