/* Sherpa — School screen. Same shell/tokens as Today and Tasks (black
   background, teal cards, Manrope + JetBrains Mono, shared tab bar).
   New here: the balance strip (bars for every subject, zeros included)
   and per-subject sections mixing task cards with outlined book rows. */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #000;
  color: #e8eeee;
  font-family: Manrope, Helvetica, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mono { font-family: 'JetBrains Mono', monospace; }

/* Header */

.head {
  padding: 20px 20px 8px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f2f7f7;
  line-height: 1.1;
}

.stats {
  padding-top: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #6f8f94;
}

/* Balance strip */

.balance {
  margin: 8px 20px 22px;
  padding: 18px 16px 14px;
  border-radius: 18px;
  background: rgba(0, 73, 83, 0.28);
}

.balance-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.balance-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: #7fa8ad;
}

.balance-scope {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: #4e7378;
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.bar-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.bar-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: #cfe0e2;
}

.bar-count.zero { color: #5e868b; }

.bar-track {
  width: 100%;
  height: 62px;
  display: flex;
  align-items: flex-end;
  border-radius: 4px;
  background: rgba(0, 73, 83, 0.5);
  overflow: hidden;
}

.bar-fill {
  width: 100%;
  background: #0c8c9c;
  border-radius: 4px;
}

.bar-fill.zero {
  height: 2px !important;
  background: #2b4e53;
}

.bar-short {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: #5e868b;
  text-align: center;
  line-height: 1.3;
  overflow-wrap: break-word;
}

.balance-note {
  margin-top: 15px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #7fa8ad;
}

/* Calm-state message (empty / auth) */

.message {
  margin: 8px 20px 4px;
  padding: 14px 16px;
  border: 1px solid #1c1f20;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  color: #b9c5c6;
}

/* Subject sections */

.list {
  padding: 0 20px 10px;
  flex: 1;
}

.subject {
  margin-bottom: 26px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.subject:last-child { margin-bottom: 0; }

.subject-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 2px 3px;
}

.subject-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #dce8e9;
}

.subject-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: #4e7378;
}

/* Task cards — same three-tier treatment as the Tasks screen */

.task-card {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 16px;
  padding: 15px 16px 13px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.task-card:active { transform: scale(0.98); }

.task-card-body { flex: 1; min-width: 0; }
.task-card .chevron { flex: none; }

.task-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.01em;
  overflow-wrap: break-word;
}

.task-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  letter-spacing: 0.04em;
}

.task-tag { flex: none; }

.task-card--calm {
  background: #004953;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
}
.task-card--calm .task-due { color: #9cc3c7; }
.task-card--calm .task-tag { color: #6c9298; opacity: .8; }

.task-card--urgent {
  background: #005a66;
  box-shadow: inset 0 1px 0 rgba(255, 210, 168, 0.14);
}
.task-card--urgent .task-due {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #ffb257;
  font-weight: 600;
}
.task-card--urgent .due-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #ffb257;
  flex: none;
}
.task-card--urgent .task-tag { color: #8fb2b8; opacity: .75; }

.task-card--blocked {
  background: #002c33;
  padding: 15px 16px 13px;
}
.task-card--blocked .task-title { font-weight: 500; color: #6f8f94; }
.task-card--blocked .task-due { color: #4e7378; }
.task-card--blocked .task-tag { color: #4e7378; opacity: .85; }

/* Book rows — outlined, distinct from task cards on purpose: reading is
   its own stream, never merged with dated work */

.book-row {
  /* No detail view for books this pass — no cursor:pointer, no :active
     press state, so it doesn't read as tappable when it isn't. */
  border: 1px solid #10353b;
  border-radius: 16px;
  padding: 14px 16px 13px;
}

.book-top {
  display: flex;
  align-items: center;
  gap: 9px;
}

.book-icon { flex: none; }

.book-title {
  flex: 1;
  min-width: 0;
  font-size: 15.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #dce8e9;
  overflow-wrap: break-word;
}

.book-pct {
  flex: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #7fa8ad;
}

.book-bar {
  margin-top: 12px;
  height: 3px;
  border-radius: 999px;
  background: rgba(0, 73, 83, 0.65);
  overflow: hidden;
}

.book-bar-fill {
  height: 100%;
  background: #0c8c9c;
  border-radius: 999px;
}

.book-foot {
  margin-top: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #5e868b;
}

.book-foot .reading-tag { opacity: .85; }

/* Tab bar (shared with Today and Tasks) */

.tabbar {
  margin-top: auto;
  border-top: 1px solid #131617;
  padding: 12px 14px calc(18px + env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  gap: 4px;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: #8b9899;
  text-decoration: none;
}

.tab.active { color: #6fe3d2; font-weight: 600; }

.tab-icon {
  width: 17px;
  height: 17px;
  border: 1.4px solid #6d7a7b;
  border-radius: 4px;
}

.tab.active .tab-icon { border-color: #6fe3d2; }

.tab-fab {
  display: flex;
  justify-content: center;
  text-decoration: none;
}

.tab-fab span {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #006d7c;
  color: #eafcfa;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  line-height: 1;
  margin-bottom: 4px;
}
