:root {
  color-scheme: light;
  --navy: #143b5d;
  --blue: #1d5d8f;
  --ink: #172b3b;
  --muted: #657789;
  --line: #dce5ec;
  --paper: #ffffff;
  --ground: #f3f7fa;
  --green: #177455;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.topbar { min-height: 68px; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 10px max(20px, calc((100vw - 1180px) / 2)); }
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #ffffff80; border-radius: 12px; font-weight: 800; font-size: 20px; }
.brand strong, .brand small { display: block; }
.brand small { color: #c4d6e4; margin-top: 2px; }
.account { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.page { width: min(1180px, calc(100% - 32px)); margin: 34px auto 60px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(25px, 4vw, 34px); letter-spacing: -.03em; margin-bottom: 8px; }
h2 { font-size: 19px; margin-bottom: 0; }
.eyebrow { color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .12em; margin: 0 0 8px; }
.muted { color: var(--muted); line-height: 1.55; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 5px 20px #173b5909; }
.login-panel, .notice { max-width: 470px; margin: 9vh auto 0; padding: clamp(24px, 6vw, 40px); }
.stack { display: grid; gap: 10px; margin-top: 26px; }
label { color: #42576a; font-size: 13px; font-weight: 650; }
input, select, textarea { width: 100%; border: 1px solid #cbd8e1; border-radius: 9px; background: #fff; padding: 11px 12px; color: var(--ink); outline: none; }
input:focus, select:focus, textarea:focus { border-color: #3482b7; box-shadow: 0 0 0 3px #3482b71b; }
textarea { resize: vertical; }
.button { border: 0; border-radius: 9px; padding: 10px 15px; font-weight: 700; }
.button-primary { background: var(--blue); color: white; min-height: 43px; }
.button-primary:hover { background: #164d78; }
.button-quiet { background: transparent; color: inherit; border: 1px solid currentColor; padding: 8px 12px; }
.welcome-row { display: flex; justify-content: space-between; align-items: end; margin-bottom: 22px; }
.count-pill { border-radius: 30px; background: #e1edf5; color: #285c7e; padding: 8px 12px; font-size: 13px; font-weight: 700; }
.team-panel { margin: -5px 0 22px; padding: 0 18px 14px; }
.team-panel summary { list-style: none; cursor: pointer; padding: 15px 0; font-weight: 750; }
.team-panel summary::-webkit-details-marker { display: none; }
.team-panel > .muted { max-width: 760px; margin-bottom: 14px; font-size: 13px; }
.team-user-form { grid-template-columns: minmax(180px, .8fr) minmax(220px, 1.4fr) auto; align-items: end; margin: 12px 0; }
.team-user-list { display: grid; gap: 8px; list-style: none; padding: 0; margin: 10px 0 0; }
.team-user-row { display: flex; flex-direction: column; align-items: stretch; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #f8fafb; }
.team-user-description { min-width: 0; }
.team-user-description strong { font-size: 13px; }
.team-user-row .button { flex: 0 0 auto; color: var(--blue); border-color: #9eb9cc; }
.team-user-row .button:disabled { cursor: not-allowed; }
.team-user-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.team-user-actions select { min-height: 36px; max-width: 150px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.team-user-row .button-danger { color: #a12626; border-color: #dfb0b0; }
.team-specialties { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 9px; }
.team-specialties legend { font-size: 13px; color: var(--muted); padding: 0 5px; }
.team-specialty { display: flex; align-items: center; gap: 7px; min-height: 32px; }
.team-specialty input { width: 18px; height: 18px; margin: 0; }
.team-profile-editor { width: 100%; }
.team-profile-editor summary { padding: 7px 0; font-size: 13px; color: var(--blue); }
#legacyTeamList h3 { margin-top: 25px; }
#legacyTeamList .team-user-row { margin-top: 10px; }
.create-panel { margin-bottom: 25px; padding: 0 20px; }
.create-panel summary { list-style: none; cursor: pointer; padding: 18px 0; font-weight: 750; }
.create-panel summary::-webkit-details-marker { display: none; }
.plus { color: var(--blue); font-size: 21px; vertical-align: -1px; margin-right: 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; border-top: 1px solid var(--line); padding: 18px 0 20px; }
.field { display: grid; gap: 7px; }
.field-wide { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(310px, .9fr); gap: 20px; align-items: start; }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin: 0 2px 12px; }
.section-heading .button { color: var(--blue); border-color: #9eb9cc; }
.search-label { display: block; margin: 0 2px 6px; }
.job-search { margin-bottom: 12px; }
.job-list { display: grid; gap: 10px; }
.job-card { width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 13px; padding: 15px; background: #fff; color: var(--ink); transition: border-color .15s, transform .15s; }
.job-card:hover, .job-card.selected { border-color: #4b8bb4; transform: translateY(-1px); }
.job-card h3 { margin: 0 0 8px; font-size: 15px; }
.job-next-action { margin: 9px 0 0; color: #3b586d; font-size: 12px; line-height: 1.45; }
.job-meta { display: flex; flex-wrap: wrap; gap: 7px 12px; color: var(--muted); font-size: 12px; }
.tag { color: #265b7b; background: #eaf3f8; border-radius: 20px; padding: 4px 8px; font-size: 11px; font-weight: 700; }
.detail-panel { padding: 19px; min-height: 260px; position: sticky; top: 15px; }
.empty-state { min-height: 220px; display: grid; align-content: center; justify-items: center; text-align: center; color: var(--muted); }
.empty-state h2 { color: var(--ink); margin: 13px 0 7px; }
.empty-state p { font-size: 13px; max-width: 250px; margin: 0; line-height: 1.5; }
.empty-icon { font-size: 28px; color: #5183a2; }
.navigation-menu { margin-bottom: 20px; position: relative; }
.navigation-menu > summary { cursor: pointer; display: inline-block; background: var(--navy); color: white; padding: 12px 18px; border-radius: 10px; font-weight: 700; list-style: none; }
.navigation-menu .page-navigation { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.calendar-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 20px 0; }
.calendar-controls h2 { text-transform: capitalize; margin: 0; }
.calendar-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 5px; }
.calendar-weekday { text-align: center; font-size: 12px; font-weight: 700; padding: 8px 0; }
.calendar-day { min-height: 105px; display: flex; flex-direction: column; gap: 5px; align-items: stretch; padding: 7px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); text-align: left; }
.calendar-day.other-month { background: #f2f5f8; color: var(--muted); }
.calendar-day.today { border: 2px solid var(--blue); }
.calendar-day.selected { background: #eaf3f8; box-shadow: inset 0 0 0 1px var(--blue); }
.calendar-number { font-weight: 700; font-size: 13px; }
.calendar-stripe { color: white; border-radius: 4px; padding: 3px 5px; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calendar-day-detail { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 10px; }
.calendar-day-detail .job-card { margin-bottom: 8px; }
.institution-admin-list { display: grid; gap: 8px; }
.institution-admin-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px; border-bottom: 1px solid var(--line); }
.app-logo { width: 48px; height: 48px; object-fit: contain; background: white; border-radius: 9px; padding: 4px; }
.page-navigation { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.page-navigation a { text-decoration: none; color: var(--blue); background: white; border: 1px solid var(--line); padding: 11px 14px; border-radius: 9px; font-weight: 700; font-size: 13px; }
.page-navigation a.selected { color: white; background: var(--blue); }
.navigation-page { padding: 20px; margin-bottom: 20px; }
.navigation-page > .job-card { margin-bottom: 10px; }
.institution-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.institution-card { border: 1px solid var(--line); border-radius: 10px; padding: 15px; display: grid; gap: 9px; align-content: start; }
.institution-card img { width: 64px; height: 64px; object-fit: contain; }
.institution-logo { width: 38px; height: 38px; object-fit: contain; float: right; margin-left: 8px; }
.tracking-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 20px; }
.tracking-stat { display: grid; gap: 7px; text-align: left; background: white; border: 1px solid var(--line); border-radius: 12px; padding: 16px; color: var(--ink); }
.tracking-stat strong { font-size: 27px; }
.tracking-stat span { font-size: 12px; }
.tracking-stat.selected { border-color: var(--blue); background: #eaf3f8; }
.tracking-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.tracking-filters label:first-child { grid-column: 1 / -1; }
.overdue-tag { color: #a03232; background: #ffeded; }
.overdue-text { color: #a03232; font-weight: 700; }
.detail-section > summary { cursor: pointer; font-weight: 700; }
.document-checklist { display: grid; gap: 8px; padding-left: 20px; font-size: 13px; }
.document-present { color: #23683f; }
.document-missing { color: #a03232; }
.process-list { display: grid; gap: 10px; }
.process-card { padding: 12px; margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; overflow-wrap: anywhere; }
.process-card summary { cursor: pointer; font-weight: 700; line-height: 1.5; }
.detail-title { margin-bottom: 8px; font-size: 20px; }
.detail-section { border-top: 1px solid var(--line); padding-top: 15px; margin-top: 15px; }
.detail-section h3 { font-size: 14px; margin: 0 0 10px; }
.detail-copy { white-space: pre-wrap; line-height: 1.5; color: #4e6273; font-size: 13px; }
.note-list, .file-list { display: grid; gap: 8px; padding: 0; list-style: none; }
.note, .file-row { background: #f5f8fa; border: 1px solid #e5edf2; border-radius: 9px; padding: 10px; font-size: 13px; overflow-wrap: anywhere; }
.small-meta { display: block; color: var(--muted); font-size: 11px; margin-top: 5px; }
.inline-form { display: grid; gap: 8px; }
.inline-form .button { justify-self: end; }
.compact-form { grid-template-columns: 1fr 1fr; gap: 10px; padding: 0; border: 0; }
.compact-form .field-wide { grid-column: 1 / -1; }
.compact-form label { display: grid; gap: 6px; }
.compact-form .button { width: 100%; }
.button:disabled, input:disabled, textarea:disabled { cursor: not-allowed; opacity: .6; }
.activity-list { display: grid; gap: 8px; padding: 0; list-style: none; }
.activity-item { background: #f5f8fa; border-left: 3px solid #77a5c3; border-radius: 5px; padding: 9px 11px; font-size: 12px; overflow-wrap: anywhere; }
.assignment-list { display: grid; gap: 9px; }
.assignment-choice { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: #f8fafb; }
.assignment-choice input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }
.assignment-list > .button { width: 100%; }
.file-input { display: block; font-size: 12px; padding: 7px 0; }
.app-message { min-height: 22px; margin: 18px 2px 0; color: var(--green); font-size: 13px; }
.app-message.error { color: #a03232; }
footer { border-top: 1px solid var(--line); padding: 18px 16px 28px; text-align: center; color: var(--muted); font-size: 12px; }

@media (max-width: 760px) {
  .calendar-grid { gap: 3px; }
  .calendar-day { min-height: 85px; padding: 4px; }
  .calendar-stripe { padding: 2px; font-size: 9px; }
  .calendar-controls h2 { font-size: 17px; }
  .tracking-stats { grid-template-columns: repeat(2, 1fr); }
  .topbar { min-height: 60px; padding: 9px 16px; }
  .page { width: min(100% - 24px, 560px); margin: 23px auto 40px; }
  .content-grid { grid-template-columns: 1fr; }
  .detail-panel { position: static; }
  .form-grid { grid-template-columns: 1fr; }
  .compact-form { grid-template-columns: 1fr 1fr; }
  .field-wide { grid-column: auto; }
  .welcome-row { align-items: center; }
  .account { gap: 8px; font-size: 12px; }
  .team-user-form { grid-template-columns: 1fr; }
  .team-user-row { align-items: flex-start; }
  .team-user-actions { justify-content: flex-start; }
}
