:root {
  color-scheme: light;
  --canvas: #f5f7f5;
  --surface: #fff;
  --surface-subtle: #f8faf8;
  --ink: #172921;
  --text: #2d3b34;
  --muted: #617168;
  --soft: #66746b;
  --line: #e1e8e2;
  --line-strong: #cfdad2;
  --green: #23654e;
  --green-dark: #174c3b;
  --green-light: #e8f2ec;
  --focus: #3c8b6e;
  --radius: 12px;
  --shadow: 0 1px 2px #213d2808, 0 3px 10px #213d2805;
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 16px;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--canvas); color: var(--text); }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled, select:disabled { cursor: default; }
button:disabled { opacity: .5; }
a { color: var(--green); text-underline-offset: .18em; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
h1, h2, h3, h4, p { margin: 0; }
svg { display: block; }
[hidden] { display: none !important; }
::selection { background: #d4eadc; color: #183e2e; }
.icon { width: 1.125rem; height: 1.125rem; flex: 0 0 auto; }
.muted { color: var(--muted); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.app-shell {
  --rail: 236px;
  --top: 64px;
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
}
.sidebar {
  min-width: 0;
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 24px 17px 17px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 1px 8px;
  text-decoration: none;
  color: var(--ink);
}
.brand-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 12px;
  background: linear-gradient(145deg, #32775c, #1b5742);
  color: #fff;
  box-shadow: 0 3px 7px #22513c34, inset 0 0 0 1px #0e4f363d;
}
.brand-icon .icon { width: 22px; height: 22px; }
.brand-text { display: grid; gap: 3px; font-size: 1.0625rem; font-weight: 750; letter-spacing: .015em; line-height: 1.2; }
.brand-text small { color: var(--soft); font-size: .75rem; font-weight: 500; letter-spacing: .01em; }
.nav-label {
  margin: 38px 10px 11px;
  color: var(--soft);
  font-size: .75rem;
  font-weight: 650;
  letter-spacing: .07em;
}
.sidebar nav { display: grid; gap: 5px; }
.nav-item {
  position: relative;
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #53645a;
  text-align: left;
  text-decoration: none;
  font-size: .9375rem;
  font-weight: 550;
  white-space: nowrap;
  transition: background .16s, color .16s;
}
.nav-item:hover { background: var(--surface-subtle); color: var(--green-dark); }
.nav-item.is-active { background: var(--green-light); color: var(--green-dark); font-weight: 720; }
.nav-item.is-active::before {
  content: "";
  position: absolute;
  inset: 11px auto 11px 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #39775d;
}
.nav-item .icon { opacity: .89; }
.sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
}
.workspace { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 13px 8px 3px; border-top: 1px solid var(--line); }
.workspace-mark, .avatar {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 9px;
  font-size: .8125rem;
  font-weight: 700;
  color: #3d6351;
  background: #e8f1eb;
}
.workspace-meta { min-width: 0; display: grid; gap: 2px; font-size: .8125rem; font-weight: 650; }
.workspace-meta small, .workspace-meta .muted { font-size: .75rem; font-weight: 450; }
.shell-main { min-width: 0; }
.topbar {
  position: sticky;
  z-index: 3;
  top: 0;
  min-height: var(--top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.breadcrumbs, .top-actions, .profile, .demo-switch { display: flex; align-items: center; gap: 9px; }
.breadcrumbs { min-width: 0; color: var(--soft); font-size: .875rem; }
.breadcrumbs strong { color: var(--ink); font-weight: 650; }
.breadcrumbs .icon { width: .9375rem; height: .9375rem; color: #94a098; }
.mobile-menu { display: none !important; }
.top-actions { flex: 0 0 auto; gap: 13px; }
.demo-switch {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #d9e7dd;
  border-radius: 8px;
  background: #f2f8f4;
  color: var(--green-dark);
  font-size: .8125rem;
  font-weight: 650;
  white-space: nowrap;
}
button.demo-switch:hover { background: var(--green-light); border-color: #c8dfd0; }
.demo-switch .icon { width: .9375rem; height: .9375rem; }
.demo-switch select.control { min-height: 32px; width: auto; max-width: 160px; padding-left: 0; padding-right: 20px; border: 0; background-color: transparent; background-position: right 0 center; color: inherit; font-size: inherit; font-weight: inherit; }
.demo-switch:focus-within { outline: 2px solid var(--focus); outline-offset: 3px; }
.demo-switch select.control:focus-visible { outline: 0; }
.profile { position: relative; color: var(--ink); font-size: .875rem; font-weight: 650; }
button.profile { padding: 0; border: 0; background: transparent; }
.profile-details { text-align: left; }
.profile > .icon { width: .875rem; height: .875rem; color: var(--soft); }
.profile .avatar { width: 34px; height: 34px; flex-basis: 34px; border-radius: 50%; background: #e2eee5; }
.profile small { display: block; color: var(--muted); font-size: .75rem; font-weight: 500; }

.main { width: 100%; max-width: 1536px; margin-inline: auto; padding: 33px 32px 45px; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px 24px; margin-bottom: 27px; }
.section-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
  color: var(--green);
  font-size: .8125rem;
  font-weight: 660;
  letter-spacing: .045em;
}
.section-kicker .icon { width: .9375rem; height: .9375rem; }
.hero h1 { color: var(--ink); font-size: clamp(1.75rem, 1.2rem + 1vw, 2.125rem); font-weight: 760; line-height: 1.25; letter-spacing: -.035em; }
.hero p { margin-top: 8px; color: var(--muted); font-size: .9375rem; line-height: 1.65; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 39px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: .875rem;
  font-weight: 650;
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.button:hover:not(:disabled) { border-color: #a5b8ad; background: #f8faf8; }
.button .icon { width: 1rem; height: 1rem; }
.button.primary {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
  box-shadow: 0 2px 4px #1c4e3a20;
}
.button.primary:hover:not(:disabled) { border-color: var(--green-dark); background: var(--green-dark); }
.button.danger { border-color: #e9cbc7; color: #a1382f; }
.button.danger:hover:not(:disabled) { border-color: #dfb2ad; background: #fff4f2; }
.button.ghost, .icon-button { border-color: transparent; background: transparent; }
.hero .button { min-height: 43px; padding-inline: 15px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 24px; }
.stat-card {
  min-width: 0;
  min-height: 126px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.stat-top { display: flex; align-items: center; gap: 9px; }
.stat-icon {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  flex: 0 0 33px;
  border-radius: 9px;
  background: #edf0f4;
  color: #586477;
}
.stat-icon .icon { width: 17px; height: 17px; }
.stat-icon.amber { background: #fff3db; color: #8c5417; }
.stat-icon.emerald { background: #e6f3ea; color: #306e50; }
.stat-icon.blue { background: #e8effa; color: #395f95; }
.stat-label { color: #53645a; font-size: .875rem; font-weight: 650; line-height: 1.35; }
.stat-value { display: block; margin-top: 7px; color: var(--ink); font-size: 1.875rem; font-weight: 720; font-variant-numeric: tabular-nums; letter-spacing: -.04em; line-height: 1.15; }
.stat-caption { display: block; margin-top: 4px; color: var(--soft); font-size: .75rem; line-height: 1.4; }

.panel { min-width: 0; overflow: clip; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 19px 21px 14px; }
.panel-heading h2 { color: var(--ink); font-size: 1.125rem; font-weight: 740; line-height: 1.35; }
.panel-heading p { margin-top: 4px; color: var(--muted); font-size: .8125rem; line-height: 1.5; }
.period-caption { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-subtle); color: var(--muted); font-size: .8125rem; white-space: nowrap; }
.period-caption .icon { width: .9375rem; height: .9375rem; }
.tabs { display: flex; align-items: stretch; gap: 23px; padding: 0 21px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 45px;
  padding: 0 1px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 590;
  white-space: nowrap;
}
.tab:focus-visible { outline-offset: -2px; border-radius: 4px; }
.tab:hover { color: var(--green); }
.tab.is-active { border-bottom-color: var(--green); color: var(--green-dark); font-weight: 730; }
.tab-count {
  min-width: 19px;
  padding: 1px 5px;
  border-radius: 20px;
  background: #f0f3f0;
  color: #58675e;
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.tab.is-active .tab-count { background: var(--green-light); color: var(--green); }
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 15px 21px; }
.toolbar .button.is-active { border-color: #cee0d3; background: var(--green-light); color: var(--green-dark); }
.toolbar .text-button { border-color: transparent; color: var(--muted); }
.toolbar .text-button:hover { border-color: transparent; }
.year-filters { display: flex; flex-wrap: wrap; gap: 12px; padding: 0 21px 15px; }
.year-filters .field { width: min(140px, calc(50% - 6px)); }
.search { position: relative; flex: 1 1 205px; max-width: 308px; }
.search .icon { position: absolute; z-index: 1; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: #7c8a82; pointer-events: none; }
.control {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 39px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: .875rem;
  line-height: 1.4;
  transition: border-color .15s, background .15s;
}
.control:hover { border-color: #a8b9ad; }
.control::placeholder { color: var(--soft); opacity: 1; }
.control:disabled { background: #f3f6f3; color: var(--muted); }
.control[aria-invalid="true"] { border-color: #bf5a4d; }
.search .control { padding-left: 35px; }
.filter-field { min-width: 106px; display: grid; gap: 5px; font-size: .8125rem; color: var(--muted); }
select.control {
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m4 6 4 4 4-4' stroke='%23617168' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 9px center;
  background-repeat: no-repeat;
  background-size: 14px 14px;
}
textarea.control { min-height: 88px; resize: vertical; }
.table-wrap { overflow-x: auto; overscroll-behavior-inline: contain; }
.work-table { width: 100%; min-width: 740px; border-collapse: collapse; font-size: .875rem; text-align: left; }
.work-table th, .work-table td { padding: 12px 11px; text-align: left; }
.work-table th:first-child, .work-table td:first-child { padding-left: 21px; }
.work-table th:last-child, .work-table td:last-child { padding-right: 21px; }
.work-table thead th {
  height: 42px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f3f6f3;
  color: #54645b;
  font-size: .8125rem;
  font-weight: 660;
  white-space: nowrap;
}
.work-table tbody td { height: 62px; border-bottom: 1px solid #ebefeb; }
.work-table tbody tr:last-child td { border-bottom: 0; }
.work-table tbody tr:hover { background: #f9fbf9; }
.work-table td > .muted, .person-cell .muted { display: block; margin-top: 3px; font-size: .75rem; }
.comment-preview { display: block; max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-cell { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.person-cell .avatar { border-radius: 50%; }
.avatar.avatar-violet { color: #4d5b8a; background: #edeff8; }
.avatar.avatar-amber { color: #795629; background: #f7eee3; }
.avatar.avatar-blue { color: #4b6679; background: #e5eef4; }
.person-name, .record-name { color: var(--ink); font-weight: 680; }
.record-name { line-height: 1.45; overflow-wrap: anywhere; }
.period-cell { white-space: nowrap; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 25px;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #eef1f2;
  color: #536271;
  font-size: .8125rem;
  font-weight: 660;
  line-height: 1.2;
  white-space: nowrap;
}
.badge.status-pending { background: #fff3db; color: #814814; }
.badge.status-returned { background: #fcece8; color: #a34234; }
.badge.status-active { background: #e8f0fb; color: #315e96; }
.badge.status-completed { background: #e5f3e9; color: #276145; }
.badge i { width: 5px; height: 5px; flex: 0 0 5px; border-radius: 50%; background: currentColor; }
.badge .icon { width: .875rem; height: .875rem; }
.action-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 4px 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--green);
  font-size: .875rem;
  font-weight: 680;
  white-space: nowrap;
  text-decoration: none;
}
.action-link + .action-link { margin-inline-start: 10px; }
.action-link.secondary-link { color: var(--muted); }
.action-link:hover { color: var(--green-dark); text-decoration: underline; }
.panel-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 21px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8125rem; }
.pager { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.pager .button, .pager .icon-button { min-height: 32px; height: 32px; padding-inline: 9px; }
.pager .icon-button { min-width: 32px; padding-inline: 5px; border-color: var(--line); }
.page-number { min-width: 39px; text-align: center; font-variant-numeric: tabular-nums; }
.pager :is(.is-active, [aria-current="page"]) { border-color: #cee0d3; background: var(--green-light); color: var(--green-dark); }
.empty { display: grid; justify-items: center; gap: 8px; min-width: 0; padding: 34px 16px; text-align: center; color: var(--muted); }
.empty h3, .empty strong { color: var(--ink); font-size: 1rem; }
.empty p { max-width: 34ch; font-size: .875rem; line-height: 1.55; }
.empty-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--green-light); color: var(--green); }
.empty-icon .icon { width: 21px; height: 21px; }

.icon-button {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  min-height: 36px;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  line-height: 1;
}
.icon-button:hover:not(:disabled) { background: var(--surface-subtle); color: var(--green-dark); }
dialog {
  max-width: calc(100% - 24px);
  max-height: calc(100% - 24px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 16px 65px #1729212c;
}
dialog::backdrop { background: #13251f70; }
.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(720px, 100vw);
  height: 100dvh;
  max-width: 100%;
  max-height: 100dvh;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 17px 0 0 17px;
}
.drawer[open], .drawer[open] > form { display: flex; flex-direction: column; }
.drawer[open] > form { min-height: 0; flex: 1; }
.drawer[open] { animation: drawer-in .2s ease-out; }
@keyframes drawer-in { from { transform: translateX(22px); opacity: .45; } }
.drawer-header, .drawer-footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 24px;
}
.drawer-header { border-bottom: 1px solid var(--line); }
.drawer-header h2, .drawer-title { color: var(--ink); font-size: 1.25rem; font-weight: 750; line-height: 1.4; }
.drawer-header p, .drawer-header .muted { margin-top: 5px; color: var(--muted); font-size: .875rem; line-height: 1.45; }
.drawer-body { display: block; min-height: 0; flex: 1; overflow: auto; padding: 22px 24px 27px; overscroll-behavior: contain; }
.drawer-footer { flex-wrap: wrap; justify-content: flex-end; min-height: 66px; border-top: 1px solid var(--line); }
.drawer-footer > .muted:first-child { margin-right: auto; }
.drawer-footer .button { min-height: 40px; }
.detail-meta {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 13px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-subtle);
}
.meta-item { min-width: 0; display: grid; justify-items: start; align-content: start; gap: 5px; overflow-wrap: anywhere; }
.meta-item > :first-child { color: var(--muted); font-size: .8125rem; }
.meta-item > :last-child { color: var(--ink); font-size: .9375rem; font-weight: 660; }
.meta-item > .badge:last-child { font-size: .8125rem; }
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 25px 0 10px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 730;
  line-height: 1.45;
}
.drawer-body > .section-title:first-child { margin-top: 0; }
.section-title small, .section-title .muted { color: var(--muted); font-size: .8125rem; font-weight: 500; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 25px 0 10px; }
.section-title-row .section-title { margin: 0; }
.section-title-row > span { font-size: .875rem; text-align: right; }
.goal-list { display: grid; gap: 8px; }
.goal-card, .editor-goal {
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  overflow-wrap: anywhere;
}
.goal-card h3, .goal-card h4 { color: var(--ink); font-size: .9375rem; line-height: 1.45; font-weight: 680; }
.goal-card p { margin-top: 5px; color: var(--muted); font-size: .875rem; line-height: 1.6; white-space: pre-wrap; }
.goal-editor-top, .goal-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.goal-card-head h4 { flex: 1; }
.goal-index { color: var(--soft); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.goal-card .goal-plan { margin-left: 26px; }
.goal-editor-top { margin-bottom: 9px; color: var(--ink); font-size: .875rem; font-weight: 700; }
.goal-editor-top .icon-button { min-height: 28px; min-width: 29px; padding: 4px; }
.goal-weight {
  display: inline-flex;
  align-items: center;
  padding: 4px 7px;
  border-radius: 5px;
  background: #eaf3ed;
  color: var(--green-dark);
  font-size: .8125rem;
  font-weight: 700;
  white-space: nowrap;
}
.weight-total { color: #814814; font-weight: 650; }
.weight-total.is-valid { color: var(--green); }
.add-goal { margin-top: 10px; border-style: dashed; color: var(--green-dark); }
.evaluation-result { margin-top: 18px; padding: 13px 15px 15px; border: 1px solid #dbe8de; border-radius: 10px; background: #f2f8f3; }
.evaluation-result .section-title { margin: 0 0 8px; }
.evaluation-score { display: flex; align-items: baseline; gap: 6px; color: var(--green-dark); }
.evaluation-score strong { font-size: 1.875rem; font-weight: 750; line-height: 1.1; }
.evaluation-score span { font-size: .875rem; }
.evaluation-result p { margin-top: 8px; font-size: .875rem; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-wrap; }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline-item {
  position: relative;
  min-height: 47px;
  padding: 0 0 13px 24px;
  color: var(--text);
  font-size: .875rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.timeline-item:not(:last-child)::after { content: ""; position: absolute; left: 6px; top: 11px; bottom: -5px; width: 1px; background: #d9e6dc; }
.timeline-item::before { content: ""; position: absolute; z-index: 1; top: 5px; left: 2px; width: 9px; height: 9px; border: 2px solid #78a28b; border-radius: 50%; background: var(--surface); }
.timeline-item:first-child::before { background: #53876c; border-color: #53876c; }
.timeline-item p { margin-top: 2px; white-space: pre-wrap; }
.timeline-item .muted, .timeline-item time { color: var(--muted); font-size: .8125rem; }
.timeline-meta { display: block; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid > .form-grid, .form-grid > .error { grid-column: 1 / -1; }
.editor-goal .form-grid { grid-template-columns: minmax(0, 1fr) minmax(72px, .27fr); }
.field { display: grid; align-content: start; gap: 6px; color: var(--ink); font-size: .875rem; font-weight: 650; }
.field .control { font-weight: 450; }
.field.full, .field.wide, .field.span-2, .field:has(textarea) { grid-column: 1 / -1; }
.field small, .field .muted { font-size: .8125rem; font-weight: 450; }
.editor-goal + .editor-goal { margin-top: 9px; }
.goal-list .editor-goal + .editor-goal { margin-top: 0; }
.notice, .error {
  margin: 10px 0;
  padding: 9px 11px;
  border: 1px solid #d6e7db;
  border-radius: 8px;
  background: #f0f8f2;
  color: #345c46;
  font-size: .875rem;
  line-height: 1.5;
}
.error { border-color: #f0d0c9; background: #fdf3ef; color: #923b2e; }
.notice:empty, .error:empty { display: none; }
.notice:has(.icon) { display: flex; align-items: flex-start; gap: 7px; }
.notice .icon { margin-top: 2px; }
.modal { width: min(480px, calc(100% - 24px)); max-height: min(680px, calc(100% - 24px)); }
.modal[open] { animation: modal-in .15s ease-out; }
@keyframes modal-in { from { opacity: .4; transform: translateY(4px) scale(.99); } }
.modal .drawer-body { padding-block: 17px; }
.help-content ol { display: grid; gap: 8px; margin: 0; padding-left: 1.25em; font-size: .9375rem; line-height: 1.6; }
.toast {
  position: fixed;
  z-index: 10;
  right: 22px;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(420px, calc(100vw - 44px));
  padding: 11px 14px;
  border: 1px solid #386951;
  border-radius: 9px;
  background: #224c3a;
  color: #fff;
  box-shadow: 0 5px 20px #112e2242;
  font-size: .875rem;
  line-height: 1.5;
}
.toast:empty { display: none; }
.toast.toast-error { border-color: #ae554b; background: #8e3e35; color: #fff; }

.login-screen {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 28px 18px;
  background: radial-gradient(ellipse at 13% 3%, #e1eee7, transparent 52%), radial-gradient(ellipse at 83% 96%, #e2ece7, transparent 48%), var(--canvas);
}
.login-card {
  width: min(100%, 455px);
  padding: 29px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: 0 16px 58px #213d2812;
}
.login-card .brand { padding: 0; margin-bottom: 25px; }
.login-card h1, .login-card h2 { color: var(--ink); font-size: 1.5rem; font-weight: 750; line-height: 1.4; }
.login-card > p { margin: 6px 0 18px; color: var(--muted); font-size: .9375rem; line-height: 1.5; }
.login-card form { display: grid; grid-template-columns: 1fr; gap: 13px; margin-top: 13px; }
.login-card form .button { min-height: 42px; }
.login-card .notice { margin: 14px 0 0; }
.login-demos { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.login-demos p { flex-basis: 100%; margin-bottom: 3px; color: var(--muted); font-size: .875rem; }
.login-screen:has(.filing-footer) { grid-template-rows: 1fr auto; }
.filing-footer { padding-top: 20px; text-align: center; font-size: .8125rem; line-height: 1.5; }
.filing-footer a { color: var(--muted); }

@media (max-width: 1120px) {
  .app-shell { --rail: 209px; }
  .main { padding-inline: 24px; }
  .topbar { padding-inline: 24px; }
  .stats-grid { gap: 11px; }
}
@media (max-width: 930px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .app-shell { display: grid; align-content: start; grid-template-columns: minmax(0, 1fr); --top: 55px; }
  .sidebar, .shell-main { display: contents; }
  .sidebar > .brand { order: 0; padding: 12px 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
  .topbar { order: 1; }
  .sidebar nav { display: none; order: 2; gap: 5px; padding: 8px 18px 0; background: var(--surface); }
  .mobile-menu { display: inline-grid !important; margin-left: -6px; }
  .mobile-menu .icon { width: 1.125rem; height: 1.125rem; color: var(--green); }
  .sidebar .nav-label, .sidebar-footer, .sidebar-footer .workspace { display: none; }
  .sidebar-footer { order: 3; gap: 5px; margin: 0; padding: 5px 18px 8px; border-bottom: 1px solid var(--line); background: var(--surface); }
  .menu-open .sidebar nav, .menu-open .sidebar-footer { display: grid; }
  .nav-item { width: auto; min-height: 39px; padding-inline: 11px; font-size: .875rem; }
  .nav-item.is-active::before { display: none; }
  .brand { padding: 0; }
  .brand-icon { width: 34px; height: 34px; flex-basis: 34px; border-radius: 9px; }
  .brand-icon .icon { width: 18px; height: 18px; }
  .topbar { position: static; padding-inline: 18px; }
  .main { order: 4; padding: 22px 18px 33px; }
  .hero { margin-bottom: 18px; }
  .stats-grid { margin-bottom: 17px; }
  .stat-card { min-height: 109px; padding: 12px; }
}
@media (max-width: 515px) {
  .topbar { padding-inline: 13px; }
  .top-actions { gap: 6px; }
  .breadcrumbs { gap: 4px; font-size: .8125rem; }
  .breadcrumbs .icon { width: 12px; height: 12px; }
  .breadcrumbs .mobile-menu .icon { width: 1.125rem; height: 1.125rem; }
  .breadcrumbs > span, .breadcrumbs > svg, .profile-details, .profile > .icon { display: none; }
  .demo-switch { padding-inline: 7px; }
  .demo-switch select.control { max-width: 119px; }
  .profile { gap: 4px; }
  .profile .avatar { width: 28px; height: 28px; flex-basis: 28px; }
  .main { padding-inline: 13px; }
  .hero { flex-direction: column; align-items: flex-start; gap: 12px; }
  .hero h1 { font-size: 1.625rem; }
  .hero p { margin-top: 5px; font-size: .875rem; }
  .hero .button { min-height: 39px; }
  .panel-heading, .toolbar, .panel-footer, .year-filters { padding-inline: 13px; }
  .tabs { gap: 15px; padding-inline: 13px; }
  .search { flex-basis: 100%; max-width: none; }
  .toolbar .filter-field { flex-grow: 1; }
  .work-table th:first-child, .work-table td:first-child { padding-left: 13px; }
  .work-table th:last-child, .work-table td:last-child { padding-right: 13px; }
  .drawer { border-radius: 0; }
  .drawer-header, .drawer-body, .drawer-footer { padding-inline: 16px; }
  .detail-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; gap: 9px; }
  .login-card { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
