:root {
  --bg: #101319;
  --surface: #1b2230;
  --surface2: #252f41;
  --line: #303b4e;
  --text: #eef2f9;
  --muted: #a0aec4;
  --accent: #79a7ff;
  --green: #8ccba6;
  --orange: #d9b984;
  --red: #e5a0a6;
}
.brand-logo { width: 44px; height: 44px; object-fit: contain; border-radius: 12px; flex-shrink: 0; }
.heading-logo { display: none; }
@media (max-width: 900px) {
  .heading-logo { display: inline-block; width: 30px; height: 30px; object-fit: contain; vertical-align: middle; margin-right: 8px; border-radius: 8px; }
}
[hidden] {
  display: none !important;
}
.quick-actions .btn.primary {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
}
.subject-grid.single-subject {
  grid-template-columns: 1fr;
}
.btn.primary {
  color: #0c1b36;
}
.btn:hover {
  background: #2d3b51;
  border-color: #526380;
}
.btn.primary:hover {
  background: #9bbeff;
}
.btn.subtle:hover {
  background: #253147;
}
.brand-symbol {
  color: #0d1d39;
}
.brand,
.tab,
.nav-footer {
  color: #bbc6d8;
}
#tabbar {
  background: #141923;
}
.tab:hover {
  background: #202c40;
}
.tab.active {
  background: #233553;
  border-color: #354e76;
  color: #9abcff;
}
.nav-caption,
.nav-footer > .muted {
  color: #8391a8;
}
.version {
  border-color: #3a4860;
}
.local-dot {
  background: var(--green);
}
.insight {
  background: #192438;
  border-color: #2d4263;
}
.insight strong {
  color: #d5e3ff;
}
.insight p {
  color: #a8badc;
}
.tag {
  background: #222d40;
  border-color: #35435b;
}
.tag.warning,
.notice.warning {
  background: #332c21;
  border-color: #615038;
  color: var(--orange);
}
.notice {
  background: #1c2940;
  border-color: #354969;
  color: #bdcee9;
}
.body-copy {
  color: #c0cbdb;
}
.field {
  color: #bdc9dc;
}
.field input,
.field select,
.field textarea,
.set-row input {
  background: #131c2a;
  border-color: #3a4a65;
}
.check-item {
  color: #acbcd2;
}
.segmented .btn.active {
  background: #243958;
  color: #bad0ff;
}
.week-day.selected {
  background: #233858;
  border-color: #476699;
}
.calendar-day.today strong {
  color: #101c33;
}
.calendar-day,
.day-blank,
.weekday {
  background: var(--surface);
}
.calendar-day:hover {
  background: #26334b;
}
.module-icon {
  background: #243756;
}
.module-card:hover {
  border-color: #5876a8;
}
.empty-icon {
  background: #24334a;
  border-color: #3b506f;
  color: #afc9f8;
}
.complete {
  color: var(--green);
  border-color: #526c63;
}
.complete:hover {
  background: #233b31;
  color: #afe6c3;
}
.modal {
  background: #1b2332;
  border-color: #3c4b65;
}
.modal-actions {
  background: #1b2332;
}
.progress-track {
  background: #303d54;
}
.form-photo {
  border: 1px solid var(--line);
}
.text-button {
  text-decoration-color: #596e91;
}
.btn.danger {
  background: #35252e;
  border-color: #62404d;
}
.photo-box {
  background: #141d2b;
}
#toast {
  background: #caddfe;
  color: #142843;
}
#toast.error {
  background: #edb6b2;
  color: #391b19;
}
.home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 4px;
  column-gap: 16px;
  row-gap: 0;
  align-items: start;
}
.dashboard-item {
  min-width: 0;
  align-self: start;
  padding-bottom: 16px;
}
.dashboard-item > .card {
  margin: 0;
  padding: 18px;
}
.home-grid .card-head {
  margin-bottom: 12px;
}
.home-grid .card-head h2 {
  font-size: 14px;
}
.home-grid .card-head > .btn {
  font-size: 10px;
}
.home-grid .empty {
  min-height: 0;
  padding: 6px 0 0;
  align-items: start;
  text-align: left;
  gap: 5px;
}
.home-grid .empty-icon {
  display: none;
}
.home-grid .empty p {
  font-size: 11px;
  line-height: 1.6;
}
.home-grid .empty strong {
  font-size: 12px;
}
.home-grid .empty .btn {
  padding: 5px 8px;
  min-height: 29px;
  font-size: 11px;
}
.home-grid .row {
  padding: 11px 0;
}
.home-grid .row-main strong {
  font-size: 12px;
}
.home-grid .row-main p {
  font-size: 10px;
}
.home-grid .tag {
  font-size: 9px;
  padding: 3px 5px;
}
.home-grid .stat-grid {
  margin: 8px 0 14px;
}
.period-label {
  font-size: 8px;
  letter-spacing: 1px;
  color: #98acc8;
  margin: 8px 0;
}
.home-footer {
  padding-top: 2px;
}
.home-footer .btn {
  font-size: 11px;
}
.data-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 15px;
  margin: 0 0 17px;
  border: 1px solid #665035;
  background: #2b251e;
  border-radius: 9px;
  font-size: 12px;
  color: var(--orange);
}
.home-grid .match-feature h3 {
  font-size: 24px;
  line-height: 1.3;
  color: #e9f1ff;
}
.home-grid .match-feature p {
  line-height: 1.6;
}
.home-grid .countdown-row {
  gap: 8px;
  flex-wrap: wrap;
}
.home-grid .countdown-row > .btn {
  display: none;
}
.home-grid .countdown-symbol {
  display: none;
}
.home-grid .countdown-days {
  font-size: 18px;
}
.home-grid .countdown-row > div {
  min-width: 120px;
}
.home-grid .week-strip {
  gap: 5px;
}
.home-grid .week-day {
  padding: 8px 1px;
  gap: 5px;
}
.home-grid .week-day span {
  font-size: 9px;
}
.home-grid .week-day strong {
  font-size: 16px;
}
.home-grid .week-day small {
  font-size: 8px;
}
.school-actions {
  display: inline-flex;
  margin: 0 0 22px 12px;
  gap: 8px;
}
.subject-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.subject-tile {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 13px;
  padding: 19px;
  min-width: 0;
}
.subject-tile > header {
  display: flex;
  gap: 10px;
  align-items: start;
  margin-bottom: 17px;
}
.subject-tile h2 {
  flex: 1;
  line-height: 1.45;
  min-width: 0;
  font-size: 14px;
}
.subject-tile h2 button {
  text-decoration: none;
  overflow-wrap: anywhere;
}
.subject-mark {
  width: 5px;
  height: 20px;
  display: inline-block;
  border-radius: 4px;
  background: var(--subject-color, var(--accent));
  flex-shrink: 0;
  margin-top: 1px;
}
.subject-tile > header > .btn {
  padding: 3px 6px;
  min-height: 26px;
  font-size: 10px;
}
.subject-tile .term-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: space-between;
  font-size: 10px;
}
.term-picker select {
  max-width: 190px;
  font-size: 11px;
}
.subject-summary {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 18px 0 10px;
}
.subject-summary > div:first-child {
  display: grid;
  gap: 4px;
}
.subject-summary strong {
  font-size: 38px;
  line-height: 1;
  letter-spacing: -1px;
  font-weight: 500;
  color: #c2d8ff;
}
.subject-summary span {
  font-size: 10px;
  color: var(--muted);
}
.subject-summary .coverage {
  flex: 1;
  min-width: 80px;
}
.coverage .progress-track {
  margin: 7px 0;
  height: 5px;
}
.subject-global {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 10px;
}
.subject-recent {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}
.subject-recent .row {
  padding: 9px 0;
}
.subject-recent .row-main p {
  font-size: 10px;
}
.subject-tile footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 15px;
}
.subject-tile footer .btn {
  font-size: 10px;
  min-height: 29px;
  padding: 6px 9px;
}
.subject-tile .grade-value {
  font-size: 17px;
  white-space: nowrap;
}
.grade-value small {
  font-size: 10px;
  color: var(--muted);
}
.academic-warning {
  font-size: 11px;
  color: var(--orange);
  margin: 9px 0;
}
.goal-hint {
  font-size: 12px;
  color: #b2c8ed;
  padding: 13px 0 0;
}
.subject-checks {
  display: grid;
  gap: 8px;
  margin: 20px 0;
}
.setup-subject {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-size: 12px;
  border-bottom: 1px solid var(--line);
}
.setup-subject input {
  accent-color: var(--accent);
  flex-shrink: 0;
}
.setup-subject > .tag {
  margin-left: auto;
  white-space: normal;
  max-width: 150px;
}
.quick-form .field-title,
.quick-form .field-opponent {
  grid-column: 1/-1;
}
.quick-form .field-description textarea {
  min-height: 58px;
}
.form-context {
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 18px;
}
.advanced-fields {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 15px;
}
.advanced-fields > summary {
  cursor: pointer;
  color: #b0c2df;
  font-size: 12px;
  list-style-position: inside;
}
.advanced-fields > summary span {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin: 5px 0 0 15px;
}
.advanced-fields > .form-grid {
  margin-top: 20px;
}
.inline-create .text-link {
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-size: 11px;
  text-align: left;
}
.inline-create-panel {
  border: 1px solid #3b506f;
  border-radius: 8px;
  background: #172339;
  padding: 12px;
  display: grid;
  gap: 10px;
  margin-top: 10px;
}
.inline-create-panel .field {
  font-size: 11px;
}
.inline-create-panel .btn {
  justify-self: start;
  white-space: normal;
}
.inline-error {
  font-size: 11px;
  color: var(--red);
}
.field-grade-subject,
.field-termId {
  grid-column: 1/-1;
}
.countdown-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.countdown-row:first-of-type {
  border-top: 0;
}
.countdown-row:last-child {
  padding-bottom: 0;
}
.countdown-row > div {
  flex: 1;
  min-width: 0;
}
.countdown-row > div > strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.countdown-row p {
  font-size: 11px;
  color: var(--muted);
  margin: 4px 0;
}
.countdown-symbol {
  color: var(--countdown-color);
  background: #253249;
  border-radius: 9px;
  padding: 9px;
  display: grid;
  place-items: center;
}
.countdown-days {
  font-size: 23px;
  font-weight: 500;
  color: var(--countdown-color);
  letter-spacing: -0.6px;
  white-space: nowrap;
}
.storage-table {
  margin: 20px 0;
}
.storage-table > div {
  display: grid;
  grid-template-columns: 1fr 60px 60px;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.storage-table > div > :nth-child(n + 2) {
  text-align: right;
}
.calendar-chip.countdowns,
.dot.countdowns {
  background: #79a7ff;
}
.calendar-card h2 {
  text-transform: none;
}
.calendar-card h2::first-letter {
  text-transform: uppercase;
}
@media (min-width: 761px) and (max-width: 1220px) {
  .home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .subject-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  #tabbar {
    background: #141c2bed;
  }
  .tab.active {
    background: #253a5c;
    color: #afcbff;
  }
  .home-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .dashboard-item {
    padding-bottom: 0;
    width: 100%;
  }
  .dashboard-item > .card {
    padding: 16px;
  }
  .home-grid .empty {
    padding: 3px 0;
  }
  .home-grid .countdown-row > div {
    min-width: 100px;
  }
  .subject-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .subject-tile {
    padding: 16px;
  }
  .subject-tile h2 {
    font-size: 13px;
  }
  .school-actions {
    display: flex;
    margin-left: 0;
    margin-top: -7px;
  }
  .school-actions .btn {
    font-size: 11px;
  }
  .subject-summary {
    gap: 15px;
  }
  .setup-subject {
    flex-wrap: wrap;
  }
  .setup-subject > .tag {
    max-width: 180px;
    margin-left: 25px;
  }
  .countdown-row {
    gap: 9px;
    flex-wrap: wrap;
  }
  .countdown-row > div {
    min-width: 130px;
  }
  .countdown-days {
    font-size: 20px;
  }
  .countdown-symbol {
    padding: 7px;
  }
  .modal-actions {
    background: #1b2332;
  }
  .data-alert {
    align-items: flex-start;
    font-size: 11px;
  }
  .home-grid .row-main p {
    font-size: 11px;
  }
  .home-grid .row-main strong {
    font-size: 13px;
  }
  .home-grid .card-head h2 {
    font-size: 14px;
  }
  .home-grid .week-day {
    padding: 9px 3px;
  }
  .home-grid .week-day strong {
    font-size: 18px;
  }
  .field .inline-create-panel input {
    font-size: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .home-grid * {
    transition: none !important;
  }
}
