:root {
  color-scheme: light;
  font: 16px/1.5 "Instrument Sans", "Microsoft YaHei UI", system-ui, sans-serif;
  color: #162a25;
  background: #f2f6f4;
  --muted: #486059;
  --border: #d3dfd9;
  --accent: #08614c;
  --mint: #e2f3eb;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.workspace { max-width: 1160px; margin: auto; padding: 24px clamp(12px, 3vw, 36px) 44px; }
.page-head, .brand, .section-actions, .device-head { display: flex; align-items: center; gap: 10px; }
.page-head, .device-head { justify-content: space-between; }
.brand { gap: 13px; }
.sun {
  flex: 0 0 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #104b3e;
  color: #cdf9e6;
  font: 30px/1 system-ui;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.2rem, 3vw, 1.95rem); line-height: 1.24; letter-spacing: -.025em; }
h2 { font-size: 1.19rem; margin-bottom: 12px; }
h3 { font-size: 1rem; margin: 14px 0 8px; }
.intro { margin: 12px 0; color: var(--muted); }
.section-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.section-nav a, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--accent);
  font: inherit;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.section-nav a:hover, .quiet:hover, .secondary:hover { background: var(--mint); }
.primary { min-height: 48px; padding-inline: 24px; background: var(--accent); color: #fff; border-color: var(--accent); }
.primary:hover { background: #064739; }
.secondary { background: #eaf5ef; border-color: #c2d9cc; }
.quiet { border-color: transparent; background: transparent; }
:focus-visible { outline: 3px solid #0b6e56; outline-offset: 3px; }
.planner-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; gap: 16px; }
.panel { min-width: 0; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: clamp(14px, 2.4vw, 24px); }
.panel + .panel, .submit-row, #extra { margin-top: 16px; }
.section-actions { flex-wrap: wrap; margin: 8px 0; }
.device {
  padding: 10px 12px 14px;
  margin-top: 10px;
  border: 1px solid #dce6e1;
  background: #f8faf9;
  border-radius: 10px;
}
.device h3 { margin: 0; overflow-wrap: anywhere; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.field { display: flex; flex-direction: column; min-width: 0; gap: 4px; font-size: .9rem; }
.field > span:first-child { font-weight: 620; }
.field input, .field select {
  font: inherit;
  font-size: 1rem;
  color: inherit;
  background: #fff;
  border: 1px solid #a8beb4;
  border-radius: 8px;
  padding: 8px;
  min-height: 44px;
  min-width: 0;
  width: 100%;
}
.field input[type=file] { overflow: hidden; }
.field select, summary { cursor: pointer; }
.field .control { display: flex; align-items: center; position: relative; }
.control small { padding-left: 6px; color: var(--muted); white-space: nowrap; }
.field input[aria-invalid=true] { border-color: #a12822; }
.field-error { color: #a12822; }
.field-error:empty { display: none; }
.submit-row .primary { width: 100%; }
.results { position: sticky; top: 12px; overflow-wrap: anywhere; }
.results:focus { outline: 2px solid var(--accent); outline-offset: 3px; }
.metrics { display: grid; gap: 8px; }
.metric, .result-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.metric { padding: 10px 12px; background: #f1f7f4; border-radius: 8px; }
.metric strong { font-size: 1.11rem; white-space: nowrap; }
.result-line { border-top: 1px solid #e5ece8; padding: 8px 0; font-size: .9rem; }
.result-line strong { text-align: right; }
.balance, .notice { padding: 10px 12px; border-radius: 8px; margin: 8px 0; font-weight: 650; }
.balance.good { background: var(--mint); color: #075442; }
.balance.neutral { background: #edf1ef; }
.balance.warn, .notice { background: #fff0d7; color: #694402; }
.muted { color: var(--muted); }
.note { font-size: .86rem; margin-top: 8px; overflow-wrap: anywhere; }
.note a { color: var(--accent); }
details { border: 1px solid var(--border); border-radius: 8px; }
details + details { margin-top: 8px; }
summary { min-height: 44px; padding: 10px 12px; font-weight: 650; }
.detail-body { padding: 0 12px 12px; }
.detail-body .fields { margin-top: 10px; }
.check-result, .check-submit { margin-top: 10px; }
@media (max-width: 820px) {
  .planner-grid { grid-template-columns: minmax(0, 1fr); }
  .results { position: static; }
}
@media (max-width: 420px) {
  .device .field:has(select) { grid-column: 1 / -1; }
  .section-nav a { padding-inline: 8px; font-size: .875rem; }
}
