:root {
    color-scheme: light;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    color: #172f2b;
    background: #eef4f1;
    --ink: #172f2b;
    --muted: #46635b;
    --accent: #176751;
    --accent-dark: #0c4c3a;
    --line: #cbdad4;
    --paper: #fff;
    --danger: #8d293a;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; }
h1,h2,h3,p { margin: 0; }
h1 { font-size: clamp(1.7rem, 4vw, 2.45rem); line-height: 1.16; letter-spacing: -.035em; }
h2 { font-size: 1.25rem; }
a { color: var(--accent-dark); }
button, .button {
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid transparent; border-radius: .65rem; background: var(--accent);
    padding: .62rem .95rem; min-height: 44px; color: white; font: inherit; font-weight: 650;
    cursor: pointer; text-decoration: none; line-height: 1.25;
}
button:hover,.button:hover { background: var(--accent-dark); }
button.secondary,.button.secondary { background: white; border-color: var(--line); color: var(--ink); }
button.secondary:hover,.button.secondary:hover { background: #e6f1eb; }
button.danger { background: #fff; color: var(--danger); border-color: #e8c5cb; }
button:disabled { opacity: .56; cursor: default; }
:focus-visible { outline: 3px solid #ba7020; outline-offset: 3px; }
label { display: grid; gap: .35rem; font-weight: 620; min-width: 0; }
input,select,textarea {
    min-width: 0; width: 100%; padding: .65rem .75rem; border: 1px solid #afc5ba;
    border-radius: .55rem; background: white; color: var(--ink); font: inherit;
}
input[readonly] { background: #f0f5f2; }
input[type=checkbox] { width: auto; }
input[type=file] { color: var(--muted); }
textarea { min-height: 5rem; resize: vertical; }
p { line-height: 1.55; }
small,.muted { color: var(--muted); overflow-wrap: anywhere; }
[hidden] { display: none !important; }
.brand { display: inline-flex; align-items: center; gap: .7rem; font-weight: 750; color: var(--ink); text-decoration: none; }
.brand-mark {
    border-radius: .6rem; padding: .56rem .45rem; color: #fff; background: var(--accent-dark);
    font-size: .73rem; letter-spacing: .05em; font-weight: 850;
}
.entrance { display: grid; place-items: center; padding: max(1rem, 5vw); background: linear-gradient(135deg,#dcebe3,#f3f6eb 70%); }
.entry-card {
    display: grid; gap: 1.55rem; width: min(100%, 28rem); padding: clamp(1.15rem, 5vw, 2.4rem);
    border: 1px solid var(--line); border-radius: 1.15rem; background: #fff;
    box-shadow: 0 20px 72px #123e2c19;
}
.entry-card form,.dialog-body { display: grid; gap: 1rem; }
.entry-card details { border-top: 1px solid var(--line); padding-top: 1rem; font-size: .92rem; color: var(--muted); }
.entry-card details button { margin-top: .75rem; }
summary { cursor: pointer; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); display:flex; align-items:center;
    justify-content:space-between; gap:1rem; min-height: 70px; padding: .8rem clamp(1rem, 4vw, 3.25rem); }
.top-actions,.actions,.subnav,.pager { display:flex; gap:.6rem; align-items:center; flex-wrap:wrap; }
.top-actions span { color:var(--muted); font-size:.91rem; }
.workspace { display:grid; grid-template-columns: minmax(12rem, 15%) minmax(0, 1fr);
    gap:clamp(1rem, 3vw, 2.25rem); max-width:1420px; margin:0 auto; padding:clamp(.65rem, 3vw,2.1rem); }
nav { display:flex; flex-direction:column; gap:.45rem; align-self:start; }
nav button,.subnav button { justify-content:flex-start; background: transparent; color:var(--ink); }
nav button:hover,.subnav button:hover,nav button[aria-current],.subnav button[aria-current] { background:#dcece3; color:var(--accent-dark); }
.surface { min-width:0; display:grid; gap:1.15rem; align-content:start; }
#content { min-width:0; display:grid; gap:1rem; }
.card { min-width:0; background:#fff; border:1px solid var(--line); border-radius:.9rem; padding:clamp(.8rem, 2vw, 1.35rem); }
.card,.stack { display:grid; gap:.9rem; }
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap: .9rem 1rem; }
.form-grid .wide { grid-column:1 / -1; }
.record { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:.65rem; padding:.7rem 0; border-top:1px solid var(--line); }
.record p { overflow-wrap:anywhere; }
.record strong { display:block; margin-bottom:.2rem; }
.check { display:flex; align-items:center; gap:.55rem; }
.feedback { padding:.65rem .85rem; border:1px solid #abcbb7; color:#164e3c; background:#e9f4ed; border-radius:.6rem; }
.feedback[data-error] { background:#fff0f2; color:#7e2032; border-color:#deb6bf; }
dialog { width:min(calc(100vw - 1.4rem),34rem); border:1px solid var(--line); border-radius:.9rem; padding:0; }
.dialog-body { padding:1.3rem; }
dialog::backdrop { background:#14352c85; }
.scan-preview { max-width:min(100%,20rem); max-height:16rem; object-fit:contain; border-radius:.5rem; background:#edf2ef; }
.tree,.tree ul { list-style:none; margin:0; padding-left:.9rem; display:grid; gap:.65rem; }
.tree { padding-left:0; }
.tree li details { border-left:2px solid #bfd4c7; padding-left:.65rem; }
.tree .actions { margin:.5rem 0; }
@media (max-width: 760px) {
    .workspace { grid-template-columns:1fr; }
    nav { flex-direction:row; flex-wrap:wrap; }
    nav button,.subnav button { padding:.55rem .65rem; }
    .record { grid-template-columns:1fr; }
}
@media (max-width: 475px) {
    .form-grid { grid-template-columns:1fr; }
    .top-actions span { display:none; }
    .entry-card { gap:1.2rem; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior:auto !important; } }
.course-work {display:grid;grid-template-columns:minmax(0,1.8fr) minmax(13rem,1fr);gap:1rem;align-items:start}
.course-staff {grid-template-columns:minmax(13rem,1fr) minmax(0,2fr)}
.course-list {display:grid;gap:.45rem;max-height:65vh;overflow:auto}
.course-list button {text-align:left;justify-content:flex-start}
.course-list button[aria-current] {background:#dcece3;border-color:#86ab98}
.course-dates {display:grid;grid-template-columns:repeat(auto-fit,minmax(7rem,1fr));gap:.6rem}
.course-facts {margin:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.85rem}
.course-facts dt {font-size:.84rem;color:var(--muted)}
.course-facts dd {margin:.2rem 0 0;overflow-wrap:anywhere}
.table-scroll {overflow:auto;max-height:70vh}
.data-table {border-collapse:collapse;min-width:100%;font-size:.88rem}
.data-table th,.data-table td {text-align:left;padding:.45rem .65rem;border:1px solid var(--line);min-width:9rem}
.data-table th {background:#e5eee8;color:var(--ink);font-weight:650}
.data-table td {max-width:22rem;overflow-wrap:anywhere}
.announcement {white-space:pre-wrap;overflow-wrap:anywhere}
.api-example {display:block;white-space:pre-wrap;overflow-wrap:anywhere;padding:.65rem;background:#edf3ef;border-radius:.5rem}
@media (max-width:760px) {
    .course-work,.course-staff {grid-template-columns:1fr}
    .course-list {max-height:35vh}
}
