/* Sherpa — Schedule screen. Same shell/tokens as Today/Tasks/School
   (black background, teal cards, Manrope + JetBrains Mono, shared tab
   bar). New here: a week of horizontal bar rows — commitments.json's
   real clock-time ranges as proportional bars against a shared hour
   window, so a glance compares one day's shape to the next. */

* { 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;
}

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

.subtitle {
  font-size: 13px;
  color: #98a5a6;
  margin-top: 5px;
}

/* Mine/Family filter — same chip styling as Tasks' kind filter (.chip/
   .chip.active), reused verbatim. Drives BOTH the week strip and the
   Committed time list together (one fetch of each, same mode). */

.filters {
  display: flex;
  gap: 6px;
  padding: 6px 20px 4px;
  overflow-x: auto;
}

.chip {
  flex: none;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  background: rgba(0, 73, 83, 0.45);
  color: #7fa8ad;
  -webkit-tap-highlight-color: transparent;
}

.chip.active {
  background: #f2f5f4;
  color: #00181c;
  font-weight: 600;
}

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

/* Break mode chips (weekly rows) and the calendar section — reuse
   .chip/.chip.active and the commit-row/confirm styles below. */

.mode-row {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mode-chip { padding: 6px 11px; font-size: 11.5px; }

.day-cal {
  font-size: 11px;
  color: #6fe3d2;
  margin-bottom: 4px;
}

.cal-add {
  border: none;
  background: transparent;
  color: #6fe3d2;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.cal-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 0 16px;
  border-bottom: 1px solid #1c1f20;
}

.cal-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #1c3a3e;
  background: rgba(0, 73, 83, 0.25);
  color: #f2f7f7;
  font: inherit;
  font-size: 14px;
  color-scheme: dark;
}

.cal-date-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: #7fa8ad;
}

.cal-error { font-size: 12.5px; color: #e08a83; }

/* Changing a saved commitment's reminders, inline on its row. */
.rem-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.cal-save { background: #6fe3d2; color: #00181c; }

/* Hour ruler — shares the exact same left offset and window math as
   each day-track below, so its tick marks line up with the bars. */

.ruler {
  margin: 18px 20px 2px;
  padding-left: 62px; /* .day-label width (52px) + .day-row gap (10px) — keeps tick marks over the tracks, not the labels */
  display: flex;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.04em;
  color: #4e7378;
}

.ruler span {
  flex: 1;
  text-align: left;
}

.ruler span:last-child {
  flex: 0;
  text-align: right;
  transform: translateX(100%);
}

/* Week */

.week {
  margin: 6px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.day-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.day-row.today .day-track { background: rgba(0, 73, 83, 0.75); }

.day-label {
  width: 52px;
  flex: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: #7fa8ad;
  line-height: 1.35;
}

.day-row.today .day-label { color: #6fe3d2; }

.day-date {
  display: block;
  color: #4e7378;
  font-size: 9.5px;
}

.day-row.today .day-date { color: #4a8f88; }

.day-body { flex: 1; min-width: 0; }

.day-track {
  position: relative;
  height: 22px;
  border-radius: 6px;
  background: rgba(0, 73, 83, 0.42);
  overflow: hidden;
}

.day-bar {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 4px;
  background: #0c8c9c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  min-width: 3px;
}

.day-bar.oneoff { background: #6fe3d2; }

.day-legend {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

/* Each entry is now two lines — the time range, then its owners — same
   vertical shape as a .commit-row in the list below (title/meta, then
   .commit-who), just smaller. */
.legend-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: #8fb0b3;
}

.legend-item-label {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #0c8c9c;
  flex: none;
}

.legend-item.oneoff .legend-dot { background: #6fe3d2; }

/* Committed time — the entity list (view/delete/add), below the bar
   chart above. Same domain, same screen, per the one-app-one-spine
   call: extend Schedule rather than add a fifth screen for this. */

.commit-section {
  margin: 4px 20px 24px;
}

.commit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

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

.commit-group + .commit-group { margin-top: 16px; }

.commit-group-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: #4e7378;
  margin-bottom: 8px;
}

.commit-empty {
  font-size: 13.5px;
  color: #7fa8ad;
  line-height: 1.5;
}

.commit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid #131617;
}

.commit-row:last-child { border-bottom: none; }

.commit-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #0c8c9c;
  flex: none;
}

.commit-row.oneoff .commit-dot { background: #6fe3d2; }

.commit-body { flex: 1; min-width: 0; }

.commit-title {
  font-size: 14.5px;
  font-weight: 600;
  color: #f2f7f7;
  overflow-wrap: break-word;
}

.commit-meta {
  margin-top: 3px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #7fa8ad;
}

.commit-who {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.who-tag {
  font-size: 10.5px;
  letter-spacing: 0.03em;
  color: #8fb0b3;
  background: rgba(0, 73, 83, 0.4);
  border-radius: 999px;
  padding: 2px 8px;
}

.commit-trash {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: #6c9298;
  font-size: 15px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.commit-trash:active { background: rgba(0, 73, 83, 0.45); }

.commit-confirm {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.commit-confirm-text {
  font-size: 13px;
  color: #cfe0e2;
}

.commit-confirm-actions {
  display: flex;
  gap: 6px;
  flex: none;
}

.commit-confirm-actions button {
  border: none;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.commit-confirm-yes { background: #b5453f; color: #fff0ee; }
.commit-confirm-cancel { background: rgba(0, 73, 83, 0.45); color: #9cc3c7; }

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

.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;
}
