:root,
:root[data-theme="dark"] {
  --background: #14161a;
  --surface: #1d2026;
  --text: #e4e6eb;
  --text-muted: #9aa0a6;
  --error: #f28b82;
  --success: #81c995;
}

:root[data-theme="light"] {
  --background: #eef0f3;
  --surface: #ffffff;
  --text: #1f2328;
  --text-muted: #5f6670;
  --error: #c5221f;
  --success: #188038;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--background);
  color: var(--text);
  font-family: system-ui, sans-serif;
}

button, input, select {
  font: inherit;
}

.login {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 280px;
  padding: 24px;
  background: var(--surface);
  border-radius: 12px;
}

.login-form button {
  margin-top: 8px;
}

.login-message {
  min-height: 1.5em;
  margin: 0;
  color: var(--error);
}

.dashboard {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 0;
}

.controls-message {
  color: var(--error);
}

.columns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  flex: 1;
  min-height: 0;
  padding: 16px;
}

.column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.column-center {
  align-items: center;
  justify-content: center;
}

.tile {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 12px;
  padding: 16px;
  min-height: 0;
}

.column-left .tile,
.column-right .tile {
  flex: 1;
}

.tile-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.tile-title {
  margin: 0;
  font-size: 1rem;
}

.tile-stale,
.tile-message {
  color: var(--text-muted);
}

.tile-error {
  margin-left: auto;
  color: var(--error);
}

.tile-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.tile-message {
  margin: 0;
}

.clock {
  text-align: center;
}

.clock-time {
  font-size: 8rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.clock-date {
  margin-top: 12px;
  font-size: 1.25rem;
  color: var(--text-muted);
}

.clock-next {
  display: inline-block;
  margin-top: 16px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
}

.calendar-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.calendar-item {
  padding: 8px 0;
}

.calendar-time,
.calendar-location {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.calendar-title {
  display: block;
  font-weight: 600;
}

.calendar-location {
  display: block;
}

.calendar-now {
  margin-left: 8px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--background);
  background: var(--text);
}

.runs-heading {
  margin: 0 0 4px;
  font-size: 0.85rem;
  font-weight: normal;
  color: var(--text-muted);
}

.runs-summary {
  margin: 0 0 12px;
}

.runs-name {
  display: block;
  font-weight: 600;
}

.runs-meta {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.run-route {
  display: block;
  width: 100%;
  height: 160px;
  margin-top: 8px;
}

.run-route polyline {
  fill: none;
  stroke: var(--text);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.todo-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
}

.todo-item input {
  margin-top: 4px;
}

.todo-title {
  display: block;
}

.todo-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.todo-overdue {
  color: var(--error);
}

.todo-today {
  color: var(--success);
}

.news-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.news-item {
  display: block;
  padding: 8px 0 8px 8px;
  border-left: 3px solid transparent;
  color: inherit;
  text-decoration: none;
}

.news-item-breaking {
  border-left-color: var(--error);
}

.news-topline,
.news-time {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.news-title {
  display: block;
  font-weight: 600;
}

.news-sentence {
  display: block;
  font-size: 0.9rem;
}
