:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: #182e32;
  background: #f3f6f5;
  --ink: #182e32;
  --muted: #536a6c;
  --line: #d9e4e2;
  --paper: #fff;
  --accent: #12695e;
  --accent-dark: #0c5248;
  --soft: #e7f3ef;
  --radius: 14px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
:focus-visible { outline: 3px solid #4e9d92; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.8rem, 3.3vw, 2.85rem); line-height: 1.08; letter-spacing: -.045em; overflow-wrap: anywhere; }
h2 { font-size: 1.12rem; line-height: 1.25; letter-spacing: -.022em; }
h3 { font-size: 1rem; line-height: 1.4; }
small, .hint, .sub { color: var(--muted); }
small { font-size: .8rem; }
.eyebrow { color: var(--accent); letter-spacing: .12em; font-size: .68rem; font-weight: 750; }
.loading { margin: 3rem; }
.workspace { min-height: 100vh; display: grid; grid-template-columns: 218px minmax(0, 1fr); }
.sidebar { height: 100vh; position: sticky; top: 0; overflow-y: auto; background: #143b3a; color: #ecf5f2; display: flex; flex-direction: column; padding: 30px 16px 20px; }
.sidebar > * { flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 11px; color: #fff; padding: 0 8px; }
.brand:hover { text-decoration: none; }
.brand strong { display: block; font-size: 1.1rem; letter-spacing: .015em; }
.brand small, .sidebar-foot small { display: block; color: #bbd5d0; }
.brand-mark { background: #bce6d8; color: #143b3a; display: grid; place-items: center; width: 41px; height: 41px; border-radius: 13px; font-size: 1.35rem; font-weight: 800; flex: 0 0 auto; }
.sidebar nav { display: grid; margin-top: clamp(16px, 4vh, 44px); gap: 4px; }
.sidebar nav a { color: #d8eae5; display: flex; align-items: center; gap: 12px; padding: 12px 10px; border-radius: 9px; font-size: .93rem; }
.sidebar nav a span { width: 17px; text-align: center; opacity: .85; }
.sidebar nav a:hover, .sidebar nav a.current { color: #fff; background: #29605a; text-decoration: none; }
.sidebar nav a.current { font-weight: 700; }
.sidebar-foot { margin-top: auto; display: grid; gap: 6px; padding: 12px 8px 0; }
.local-tag { font-size: .72rem; color: #bce6d8; margin-bottom: 10px; }
.sidebar-foot .button { justify-self: start; color: #e7f3ef; padding-left: 0; }
main { width: 100%; max-width: 1500px; margin-inline: auto; padding: 42px clamp(18px, 4vw, 56px); min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 25px; }
.page-head > div:first-child { flex: 1 1 440px; }
.page-head .eyebrow { margin-bottom: 10px; }
.sub { margin-top: 10px; line-height: 1.45; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: #fff; color: var(--accent-dark); border-radius: 9px; padding: 9px 13px; font-size: .86rem; font-weight: 680; line-height: 1.3; }
.button:hover { background: var(--soft); }
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button.primary:hover { background: var(--accent-dark); }
.button.subtle { border-color: transparent; background: transparent; }
.button.subtle:hover { text-decoration: underline; }
.button.compact { padding: 6px 9px; font-size: .78rem; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 21px; }
.stats > div { display: grid; gap: 7px; background: var(--soft); border: 1px solid #d8ebe5; border-radius: 12px; padding: 15px 17px; }
.stats span { font-size: .82rem; color: var(--accent-dark); }
.stats strong { font-size: 1.85rem; line-height: 1; }
.panel { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 2px 6px #19322e05; }
.pad { padding: 19px; }
.section-head, .label-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.section-head { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.section-head small { display: block; margin-top: 5px; }
.panel-foot { padding: 12px 17px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; padding: 15px 17px; align-items: flex-end; }
.filter-bar .field:first-child { flex: 1 1 225px; }
.filter-bar .field { flex: 0 1 180px; }
.filter-bar .check { padding-bottom: 8px; }
.field { display: grid; gap: 5px; color: #354d4e; font-weight: 630; font-size: .8rem; min-width: 0; }
input:not([type="checkbox"]), select, textarea { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid #cbdad7; border-radius: 8px; color: var(--ink); background: #fff; font-size: .91rem; font-weight: 450; }
textarea { resize: vertical; line-height: 1.5; }
input[type="checkbox"] { accent-color: var(--accent); }
.check { display: flex; align-items: center; gap: 6px; font-size: .83rem; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-spacing: 0; font-size: .88rem; text-align: left; }
th { background: #f7faf9; color: #465e5e; padding: 11px 15px; font-size: .77rem; white-space: nowrap; }
td { padding: 14px 15px; border-top: 1px solid var(--line); vertical-align: top; line-height: 1.4; min-width: 100px; overflow-wrap: anywhere; }
td:first-child { width: 38%; min-width: 210px; }
td small, .list-row small, .history-row small { display: block; margin-top: 4px; }
.row-link { font-weight: 700; }
.pill { display: inline-block; padding: 4px 8px; border-radius: 99px; font-size: .74rem; line-height: 1.25; font-weight: 690; }
.pill.blue { background: #e7f0fc; color: #244a7b; }
.pill.amber { background: #fff2d9; color: #7a4804; }
.pill.green { background: #dcf2e7; color: #125b45; }
.pill.gray { background: #edf2f1; color: #3c5757; }
.pill.red { background: #fce9e7; color: #8b2923; }
.overdue { color: #8b2923; font-weight: 650; }
.demo-text { color: #335d95; }
.empty { color: var(--muted); padding: 20px; font-size: .9rem; }
.example-hint { margin-top: 12px; }
.back { display: inline-block; margin-bottom: 18px; font-size: .86rem; }
.case-grid, .today-columns { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.today-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: grid; gap: 15px; }
blockquote { margin: 16px 0 0; background: #f3f7f7; padding: 13px 15px; border-left: 3px solid #84b9ae; border-radius: 0 9px 9px 0; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.matches { margin-top: 18px; display: grid; gap: 9px; }
.matches > div { display: flex; align-items: flex-start; gap: 8px; font-size: .87rem; }
.matches > div span:nth-child(2) { flex: 1; }
.list-row, .history-row { padding: 13px 17px; border-bottom: 1px solid var(--line); font-size: .86rem; display: flex; align-items: center; justify-content: space-between; gap: 10px; overflow-wrap: anywhere; }
.list-row:last-child, .history-row:last-child { border-bottom: 0; }
.task-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.history-row { justify-content: flex-start; align-items: flex-start; }
.history-row p { margin: 6px 0; }
.history-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #78b3a7; margin-top: 5px; }
dl { margin: 12px 0 0; }
dl > div { display: grid; grid-template-columns: minmax(90px, .8fr) minmax(0, 1.2fr); gap: 10px; padding: 8px 0; border-top: 1px solid #e9efed; font-size: .84rem; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
dl + .button, dl + .pill { margin-top: 10px; }
.template-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 225px), 1fr)); gap: 14px; }
.template-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.template-card p:not(.eyebrow) { font-size: .86rem; color: var(--muted); overflow-wrap: anywhere; }
.template-card .button { margin-top: auto; }
dialog { width: min(690px, calc(100% - 28px)); max-height: calc(100% - 28px); border: 1px solid var(--line); border-radius: 16px; padding: 0; color: var(--ink); box-shadow: 0 18px 80px #132e3655; }
dialog::backdrop { background: #18333277; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 18px; background: #f4f9f7; position: sticky; top: 0; z-index: 1; border-bottom: 1px solid var(--line); }
.dialog-form { display: grid; gap: 13px; padding: 18px; }
.dialog-form form { display: grid; gap: 8px; }
.dialog-form form .button { justify-self: start; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.registry-pages { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 14px 16px; }
.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.block { display: grid; gap: 11px; background: #f7faf9; border: 1px solid #e5eeeb; border-radius: 10px; padding: 12px; }
#training-fields { display: grid; gap: 10px; }
#training-fields:empty { display: none; }
.letter { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.5; margin: 0; }
.hint { font-size: .82rem; line-height: 1.45; }
.dialog-error { padding: 10px 18px; color: #8b2923; background: #fce9e7; font-size: .86rem; position: sticky; top: 56px; z-index: 1; }
#toast { position: fixed; z-index: 2; bottom: 20px; right: 20px; max-width: min(470px, calc(100vw - 40px)); padding: 11px 15px; background: #194b45; color: white; border-radius: 9px; visibility: hidden; }
#toast.shown { visibility: visible; }
#toast.error { background: #832e29; }
.login-wrap { width: min(910px, calc(100% - 36px)); margin: 8vh auto; display: grid; grid-template-columns: 1fr .85fr; border-radius: 19px; overflow: hidden; background: #fff; border: 1px solid var(--line); box-shadow: 0 18px 50px #153b3a14; }
.login-story { background: #143b3a; color: #fff; display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 34px; }
.login-story .eyebrow { color: #bce6d8; margin-top: 14px; }
.login-story p:not(.eyebrow) { color: #cee4de; line-height: 1.6; }
.story-flow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.story-flow span { font-size: .74rem; padding: 6px 8px; border-radius: 99px; color: #e7f3ef; background: #245954; }
.login-panel { padding: 33px; }
.login-panel h2 { font-size: 1.6rem; margin: 10px 0; }
.login-panel > p:not(.eyebrow) { color: var(--muted); font-size: .89rem; }
.login-panel form { display: grid; gap: 13px; margin-top: 20px; }
@media (max-width: 970px) {
  .workspace { grid-template-columns: 172px minmax(0, 1fr); }
  .case-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .workspace { display: block; }
  .sidebar { position: static; height: auto; padding: 12px; }
  .sidebar nav { margin-top: 12px; display: flex; flex-wrap: wrap; }
  .sidebar nav a { font-size: .79rem; padding: 7px; gap: 3px; }
  .sidebar-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 7px 0 0; }
  .sidebar-foot .local-tag { margin: 0; }
  main { padding: 20px 12px; }
  .today-columns, .login-wrap { grid-template-columns: 1fr; }
  .login-wrap { margin: 20px auto; }
  .login-story, .login-panel { padding: 22px; }
  .grid-form { grid-template-columns: 1fr; }
}
.letterhead-versions { margin-top: 16px; }
.proposal-line { display: grid; gap: 10px; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 0; }
.proposal-line + .proposal-line { margin-top: 8px; }
.proposal-line legend { padding: 0 6px; font-size: .83rem; font-weight: 670; color: var(--muted); }
.proposal-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.proposal-tools { display: flex; flex-wrap: wrap; gap: 7px; }
@media (max-width: 530px) {
  .proposal-fields { grid-template-columns: 1fr; }
}
.intake-hint { margin-top: 8px; }
.intake-tools { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 10px; }
.response-rules { display: grid; gap: 9px; margin-top: 15px; }
.response-rule { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px 12px; margin: 0; }
.response-rule legend { color: var(--ink); font-size: .84rem; font-weight: 670; padding: 0 5px; }
.invitation-batch { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.invitation-batch summary { cursor: pointer; font-weight: 650; }
.invitation-batch > p { margin-top: 8px; }
.finance-range { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 14px 0; }
.finance-range .field { width: min(170px, 100%); }
.finance-stats { margin-top: 12px; }
.finance-stats strong { font-size: clamp(1.15rem, 2.4vw, 1.85rem); overflow-wrap: anywhere; }
.finance-results { margin-top: 12px; }
.finance-people { display: grid; gap: 9px; max-height: 50vh; overflow: auto; }
.education-section { margin-bottom: 15px; margin-top: 15px; }
.education-guide { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin-top: 12px; }
.education-guide > div { display: grid; gap: 7px; justify-items: start; }
@media (max-width: 680px) { .education-guide { grid-template-columns: 1fr; } }

.workflow-stack { margin-top: 16px; }
.workflow-comment { white-space: pre-wrap; overflow-wrap: anywhere; }
.workflow-picker { display: grid; gap: 8px; max-height: 45vh; overflow: auto; }
.workflow-picker label { display: flex; align-items: flex-start; gap: 8px; padding: 8px; border-bottom: 1px solid var(--line); }
.workflow-picker small { display: block; }
.workflow-table td .button.compact { display: table; margin-top: 5px; }

.manage-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.manage-entry { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.manage-entry summary { cursor: pointer; font-weight: 650; }
.manage-entry summary small { display: block; margin: 4px 0 0 17px; font-weight: 400; }
.manage-entry > .hint { margin: 9px 0; }
.manage-checks { margin: 12px 0; }
.workflow-table td > a { display: inline-block; }

.teacher-password { max-width: 650px; }
.teacher-password-fields { display: grid; gap: 12px; margin-top: 15px; }
.teacher-lesson { align-items: flex-start; }
.teacher-lesson details { margin-top: 8px; }
.teacher-lesson summary { cursor: pointer; color: var(--accent-dark); }
.teacher-lesson ul { margin: 7px 0 0; padding-left: 24px; }
.teacher-journal-actions { display: grid; justify-items: end; gap: 6px; max-width: 240px; text-align: right; }
.teaching-picker, .attendance-choices { min-width: 0; border: 1px solid var(--line); border-radius: 8px; margin: 0; padding: 8px; }
.teaching-picker legend, .attendance-choices legend { padding: 0 5px; color: var(--accent-dark); font-weight: 650; }
.attendance-choices > div { display: grid; grid-template-columns: repeat(auto-fit, minmax(123px, 1fr)); gap: 6px; max-height: 170px; overflow-y: auto; }
.attendance-choices .check { min-height: 30px; padding: 4px; border-radius: 5px; background: var(--soft); }
#teacher-password-error { padding: 10px; border-radius: 7px; background: #fce9e7; color: #8b2923; }
@media (max-width: 680px) {
  .teacher-lesson, .teacher-admin-row { flex-direction: column; align-items: stretch; }
  .teacher-admin-row .task-actions { justify-content: flex-start; }
  .teacher-journal-actions { max-width: none; text-align: left; justify-items: start; }
  .teacher-lesson .button, .teacher-admin-row .button { min-height: 44px; }
}
