:root {
  --forest: #173e32;
  --lime: #d6f27d;
  --cream: #f8f8ef;
  --ink: #17221e;
  --muted: #65716b;
  --line: #dfe5dc;
  --danger: #8d3b32;
  --card: #fffef9;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(var(--lime), var(--lime)) left top / 100% 8px no-repeat,
    var(--cream);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  padding: calc(8px + env(safe-area-inset-top)) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; letter-spacing: -0.04em; color: var(--forest); }
.mark { width: 28px; height: 28px; border-radius: 8px; background: var(--forest); flex: none; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: -0.04em; }
h1 { font-size: clamp(32px, 8vw, 44px); margin: 18px 0 8px; }
h2 { font-size: 28px; margin: 0 0 8px; }
.lede, .muted { color: var(--muted); line-height: 1.5; }
.gate { width: min(560px, calc(100% - 32px)); margin: 7vh auto 48px; }
.shell[hidden] { display: none; }
.shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: calc(100vh - 16px);
  width: min(1180px, calc(100% - 16px));
  margin: 8px auto 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
}
.sidebar {
  background: #d6ff4a;
  color: var(--forest);
  padding: 22px 14px 16px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.sidebar .brand { color: var(--forest); padding: 2px 10px 22px; }
.sidebar .mark { background: var(--forest); }
.nav-list { display: grid; gap: 4px; align-content: start; }
.nav-list > button, .subnav button {
  margin-top: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--forest);
  text-align: left;
  font-weight: 650;
  min-height: 40px;
  padding: 8px 12px;
}
.nav-list > button:hover, .subnav button:hover { background: rgba(23, 62, 50, 0.08); }
.nav-list > button[aria-current="page"], .subnav button[aria-current="page"] {
  background: var(--forest);
  color: #f3ffc4;
}
.subnav { display: grid; gap: 2px; margin: 0 0 6px 12px; padding-left: 8px; border-left: 2px solid rgba(23, 62, 50, 0.25); }
.subnav[hidden] { display: none; }
.subnav button { font-size: 14px; font-weight: 600; min-height: 34px; }
.sidebar-bottom { margin-top: auto; padding: 16px 12px 4px; }
.sidebar-bottom small { display: block; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.75; }
.sidebar-bottom strong { display: block; margin-top: 4px; font-size: 13px; word-break: break-all; }
.main { padding: 28px 28px 40px; min-width: 0; }
form, .card, .detail {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}
label { display: block; font-size: 13px; font-weight: 700; margin: 12px 0 6px; }
input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  min-height: 48px;
  font: inherit;
  font-size: 16px;
  background: white;
}
button {
  margin-top: 12px;
  border: 0;
  border-radius: 999px;
  background: var(--forest);
  color: white;
  font: inherit;
  font-weight: 700;
  min-height: 44px;
  padding: 10px 16px;
  cursor: pointer;
}
button.secondary { background: transparent; color: var(--forest); border: 1px solid var(--line); }
button:disabled { opacity: 0.6; cursor: wait; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #9ab64a; outline-offset: 3px; }
.notice { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.notice.is-error { border-color: var(--danger); color: var(--danger); }
.accounts-board { display: grid; gap: 36px; margin-top: 8px; align-items: start; }
.account { font-size: 14px; padding: 12px 14px; }
.account strong, .account small { display: block; }
.account strong { font-size: 14px; font-weight: 650; }
.account small { margin-top: 2px; }
.detail h2 { font-size: 18px; margin: 18px 0 8px; }
.detail .account-title { font-size: 22px; margin-top: 0; }
.detail .stat strong { font-size: 15px; font-weight: 650; }
.detail .muted, .detail small { font-size: 13px; }
.charts { display: grid; gap: 16px; margin-top: 16px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 190px) minmax(0, 1fr) auto; gap: 10px; align-items: center; margin: 8px 0; font-size: 13px; }
.bar-label, .bar-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; background: #e7eedd; border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--forest); min-width: 2px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 14px; }
.stat strong { display: block; font-size: 28px; letter-spacing: -0.04em; margin-top: 4px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tag {
  display: inline-block;
  background: var(--lime);
  color: var(--forest);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 700;
}
.account {
  width: 100%;
  text-align: left;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  margin-top: 10px;
}
.account small, .detail small { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions button { margin-top: 0; }
.split { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 800px) {
  .split { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 980px) {
  .accounts-board { grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 56px; }
  .charts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .shell { display: block; width: calc(100% - 8px); }
  .sidebar { min-height: 0; }
  .sidebar-bottom { margin-top: 16px; }
  .nav-list { display: flex; gap: 6px; overflow-x: auto; }
  .subnav { display: flex; margin: 0; padding: 0; border: 0; }
  .nav-list > button, .subnav button { white-space: nowrap; width: auto; }
  .main { padding: 18px 14px 28px; }
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.danger { background: var(--danger); }
