:root {
  font-family: "Aptos", "Segoe UI", system-ui, sans-serif;
  color: #17323b;
  background: #f2f6f5;
  --navy: #102f38;
  --muted: #52686b;
  --line: #dbe6e4;
  --blue: #087365;
  --pale: #e4f2ee;
  --white: #fff;
}

.top { background: #fff; border-bottom: 1px solid var(--line); color: var(--navy); }
.top-inner { min-height: 73px; max-width: 1450px; padding-inline: 34px; }
.brand { gap: 12px; line-height: 1.1; font-size: 1.34rem; letter-spacing: -.04em; }
.brand small { color: var(--muted); margin-top: 5px; font-size: .8rem; letter-spacing: 0; }
.brand-accent { color: #087365; }
.mark { background: #0e3b43; width: 42px; height: 42px; border-radius: 12px; display: flex; gap: 3px; align-items: flex-end; justify-content: center; padding-bottom: 10px; }
.mark i { display: block; width: 4px; background: #8ee2bb; border-radius: 4px; height: 9px; transform: skewY(-17deg); }
.mark i:nth-child(2) { height: 14px; }
.mark i:nth-child(3) { height: 20px; }
.top-context { color: var(--muted); font-size: .84rem; font-weight: 550; }

.layout { max-width: 1450px; grid-template-columns: 245px minmax(0, 1fr); padding: 27px 34px 36px; gap: 24px; }
.rail { padding: 19px 14px 18px; background: #fff; border: 1px solid var(--line); border-radius: 17px; position: sticky; top: 18px; }
.rail-label, .project-meta small { font-size: .72rem; letter-spacing: .08em; font-weight: 750; color: var(--muted); }
.rail-label { padding: 0 8px 10px; }
nav { gap: 4px; }
nav button { min-height: 44px; border-radius: 9px; font-size: .91rem; color: #365557; }
nav button span { background: #edf2f1; color: #355a59; font-weight: 750; }
nav button:hover { background: #f1f7f5; }
nav button[aria-current] { background: #e5f3ee; color: #07584d; border-color: #cde7dd; }
nav button[aria-current] span { color: #fff; background: #087365; }
.project-meta { background: #f5f8f7; border: 1px solid var(--line); border-radius: 11px; padding: 11px 10px; margin: 18px 0 17px; }
.project-meta strong { display: block; font-size: .91rem; line-height: 1.35; margin-top: 4px; }
.project-meta span { font-size: .8rem; line-height: 1.42; }
.sample-select, .local-note { padding-inline: 2px; }
.sample-select select { font-size: .87rem; }
.local-note { font-size: .76rem; }

.intro { min-height: 158px; border-radius: 18px; padding: 24px 28px; margin-bottom: 15px; color: #fff; background: radial-gradient(ellipse at 88% 120%, #226766 0, transparent 63%), linear-gradient(110deg,#102f38 58%,#15474d); position: relative; overflow: hidden; isolation: isolate; }
.intro::after { content: ""; inset: 0 0 0 50%; position: absolute; background: repeating-linear-gradient(146deg, transparent 0 24px, #bef4df1d 25px 26px, transparent 27px 43px); mask-image: linear-gradient(90deg,transparent,#0009); z-index: -1; pointer-events: none; }
.eyebrow { color: #9be5c2; font-size: .74rem; letter-spacing: .09em; }
h1 { margin: 4px 0 8px; font-size: clamp(1.88rem, 3.8vw, 2.6rem); line-height: 1.1; }
.intro p:not(.eyebrow) { color: #d0e8e4; max-width: 570px; font-size: .91rem; }
#saved { background: #ffffff13; border: 1px solid #ffffff2b; color: #d9f7eb; border-radius: 999px; font-size: .76rem; padding: 5px 9px; display: inline-flex; align-items: center; gap: 6px; }
#saved:empty { display: none; }
#saved::before { content: ""; border-radius: 99px; width: 6px; height: 6px; background: #85deb3; }
#saved.error { color: #ffddd8; }
#saved.error::before { background: #feb5a8; }

.stats { gap: 12px; margin-bottom: 16px; }
.stat { position: relative; padding: 13px 15px 15px; min-height: 105px; border-radius: 13px; }
.stat span { color: var(--muted); font-size: .81rem; font-weight: 700; }
.stat strong { font-size: clamp(1.05rem, 2.55vw, 1.55rem); margin-top: 1px; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.stat small { display: block; line-height: 1.2; font-size: .74rem; color: var(--muted); margin-top: 4px; }
.stat-actual { background: #f6fbf8; }
.stat-balance strong { color: #08675a; }
.stat-over strong { color: #a33527; }
.stat progress { appearance: none; border: 0; display: block; width: calc(100% - 30px); height: 4px; position: absolute; left: 15px; bottom: 7px; border-radius: 99px; overflow: hidden; background: #dcebe6; accent-color: #0b8a75; }
.stat progress::-webkit-progress-bar { background: #dcebe6; }
.stat progress::-webkit-progress-value { background: #0b8a75; border-radius: 99px; }
.stat progress::-moz-progress-bar { background: #0b8a75; border-radius: 99px; }

.card { border-radius: 15px; padding: 20px 22px; margin-bottom: 14px; }
.card-head { align-items: flex-start; margin-bottom: 16px; }
.card-head h2 { font-size: 1.16rem; letter-spacing: -.018em; }
.card-head p { margin-top: 3px; line-height: 1.4; }
.grid { gap: 14px; }
label { color: #24494e; }
input:not([type=checkbox]), select, textarea { border-color: #c5d6d3; color: #17323b; min-height: 43px; border-radius: 9px; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible { outline-color: #008b7a; outline-offset: 3px; }
button, .file-button { border-radius: 9px; min-height: 40px; }
.compact { min-height: 36px; padding-inline: .72rem; }
.primary:hover { background: #065b50; }
.secondary, .file-button { color: #075d51; border-color: #cfe3dd; background: #e7f3ef; }
.secondary:hover, .file-button:hover { background: #d9ede6; }
.quiet { background: #f4f7f6; color: #345358; }
.quiet:hover { background: #eaf0ee; }
.record { padding: 13px 0; }
.record h3 { overflow-wrap: anywhere; }
.record .meta { margin-top: 2px; }
.note { background: #edf6f3; color: #285a54; }
.warning { background: #fff3dc; color: #70481a; }
.empty { background: #f3f7f6; }
.actions { margin-bottom: 20px; }
.actions button { padding-inline: min(7vw, 24px); }

.budget-strip { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border: 1px solid #d5e6e0; border-radius: 10px; background: #f2f8f5; padding: 10px 12px; margin-bottom: 13px; }
.budget-strip p { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px; }
.budget-strip strong { color: #16463f; font-variant-numeric: tabular-nums; }
.budget-strip p span { color: var(--muted); font-size: .83rem; }
.template-link { color: #08675a; font-size: .88rem; font-weight: 700; text-underline-offset: 3px; }
dialog { width: min(760px, calc(100% - 24px)); max-height: calc(100dvh - 28px); border-radius: 16px; color: #17323b; }
dialog::backdrop { background: #102f38aa; }
.dialog-content { padding: 19px 22px; }
.dialog-head .quiet { min-width: 40px; }
.rab-file { background: #f8fbfa; border: 1px dashed #a8c5bd; border-radius: 10px; padding: 8px 10px 10px; margin: 11px 0; }
.rab-file input { background: #fff; }
#rab-error { color: #a33527; font-size: .88rem; margin-top: 8px; }
.import-results { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.import-results .row-between { align-items: flex-start; flex-wrap: wrap; }
.import-results .table-scroll { max-height: 244px; margin: 8px 0; border-radius: 8px; border: 1px solid var(--line); }
.import-results thead { position: sticky; top: 0; }
.import-warnings { background: #fff7e8; border-radius: 8px; color: #70481a; padding: 8px 10px; margin: 8px 0; }
.import-warnings summary { cursor: pointer; font-weight: 650; font-size: .9rem; }
.report { background: #fff; }
th { background: #edf3f2; color: #304d53; }
.report-section h2 { color: #14343e; }

@media (max-width: 890px) {
  .layout { padding-inline: 20px; gap: 17px; grid-template-columns: 205px minmax(0, 1fr); }
  .top-inner { padding-inline: 20px; }
  .intro { padding: 21px; }
}
@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; gap: 12px; padding: 13px 15px 23px; }
  .top-inner { min-height: 64px; padding-inline: 15px; }
  .rail { position: static; padding: 9px 10px; border-radius: 12px; }
  .rail-label, .local-note { display: none; }
  nav { gap: 3px; }
  nav button { min-height: 48px; padding: 4px 2px; font-size: .74rem; line-height: 1.15; }
  .sample-select { margin-top: 8px; justify-content: space-between; font-size: .8rem; }
  .sample-select select { min-height: 31px; padding-block: 4px; }
  .intro { min-height: 138px; margin-bottom: 12px; padding: 18px; }
  .stats { gap: 7px; margin-bottom: 12px; }
  .stat { min-height: 89px; padding: 9px 8px 13px; }
  .stat progress { width: calc(100% - 16px); left: 8px; }
  .card { padding: 15px; }
}
@media (max-width: 465px) {
  .top-context { display: none; }
  h1 { font-size: 1.87rem; }
  .intro p:not(.eyebrow) { font-size: .83rem; }
  #saved { margin-top: 9px; }
  .stats strong { font-size: .95rem; }
  .stat span { font-size: .73rem; }
  .stat small { font-size: .67rem; }
  .dialog-content { padding: 15px; }
}
@media print {
  .report { border: none; padding: 0; }
}
