:root {
  color-scheme: dark;
  --bg: #111312;
  --panel: #1a1d1a;
  --panel-2: #211f24;
  --panel-3: #1d2423;
  --line: rgba(244, 239, 228, 0.12);
  --text: #f4efe4;
  --muted: #aaa296;
  --soft: #d8d0c3;
  --teal: #52c7b8;
  --red: #d85f4c;
  --gold: #d6b957;
  --violet: #9d8cff;
  --green: #8bcf77;
  --blue: #78a9ff;
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: radial-gradient(circle at top left, rgba(82, 199, 184, 0.14), transparent 34rem), var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.topbar {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(17, 19, 18, 0.9);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(14px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 220px;
}

.mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(82, 199, 184, 0.38);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(216, 95, 76, 0.18), rgba(82, 199, 184, 0.18));
  color: var(--teal);
  font-weight: 800;
  font-size: 24px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1;
}

.brand-block p,
.intel-header p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.clock-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
  width: min(520px, 100%);
}

.clock-card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 54px;
}

.clock-card span,
.section-kicker,
.stat-cell span,
.resource-row span,
.assigned-list span,
.block-row span,
.time-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.clock-card strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
  line-height: 1;
}

.clock-card.alt strong {
  color: var(--gold);
}

.clock-card.physics strong {
  color: var(--teal);
}

.app-shell {
  display: grid;
  grid-template-columns: 290px minmax(460px, 1fr) 360px;
  min-height: calc(100vh - 84px);
}

.rail,
.intel-panel {
  border-right: 1px solid var(--line);
  background: rgba(26, 29, 26, 0.72);
  padding: 18px;
  overflow: auto;
}

.intel-panel {
  border-right: 0;
  border-left: 1px solid var(--line);
  background: rgba(29, 36, 35, 0.72);
}

.rail-section + .rail-section {
  margin-top: 22px;
}

.section-kicker {
  margin-bottom: 10px;
  color: var(--teal);
  font-weight: 800;
}

.lens-stack {
  display: grid;
  gap: 8px;
}

.lens-button,
.event-row,
.segmented button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  cursor: pointer;
}

.lens-button {
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 11px 12px;
  min-height: 58px;
}

.lens-button span {
  font-weight: 750;
}

.lens-button small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.lens-button:hover,
.event-row:hover,
.segmented button:hover {
  border-color: rgba(82, 199, 184, 0.5);
}

.lens-button.is-active {
  background: rgba(82, 199, 184, 0.12);
  border-color: rgba(82, 199, 184, 0.72);
}

.orbit-section {
  padding-bottom: 4px;
}

#timeOrbit {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
  background: #161917;
}

.resource-list {
  display: grid;
  gap: 8px;
}

.resource-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.resource-row strong,
.assigned-list strong {
  display: block;
  font-size: 13px;
  line-height: 1.2;
}

.resource-row em {
  align-self: start;
  border-radius: 999px;
  background: rgba(139, 207, 119, 0.12);
  color: var(--green);
  font-size: 11px;
  font-style: normal;
  padding: 4px 7px;
  white-space: nowrap;
}

.calendar-surface {
  padding: 20px;
  overflow: auto;
}

.surface-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.surface-head h2,
.intel-header h2 {
  font-size: 26px;
  line-height: 1.08;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.segmented button {
  min-height: 36px;
  padding: 7px 10px;
  color: var(--soft);
  text-transform: capitalize;
}

.segmented button span {
  color: var(--muted);
  margin-left: 4px;
}

.segmented button.is-active {
  background: rgba(216, 95, 76, 0.16);
  border-color: rgba(216, 95, 76, 0.66);
  color: var(--text);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(90px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.stat-cell {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 12px;
  min-height: 74px;
}

.stat-cell strong {
  display: block;
  font-size: 25px;
  line-height: 1;
  margin-bottom: 10px;
}

.event-list {
  display: grid;
  gap: 9px;
}

.month-divider {
  margin: 12px 0 2px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.event-row {
  width: 100%;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 150px;
  gap: 14px;
  align-items: center;
  min-height: 88px;
  padding: 12px;
  text-align: left;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: none;
}

.event-row.is-selected {
  border-color: var(--teal);
  background: rgba(82, 199, 184, 0.1);
  box-shadow: var(--shadow);
}

.event-datebox {
  display: grid;
  place-items: center;
  border-radius: 8px;
  min-height: 60px;
  background: #141817;
  border: 1px solid var(--line);
}

.event-datebox span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.event-datebox strong {
  font-size: 23px;
  line-height: 1;
}

.event-main {
  min-width: 0;
}

.event-titleline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.event-titleline strong {
  min-width: 0;
  font-size: 16px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.event-titleline span,
.event-tags span,
.gap-cloud span,
.run-status {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 4px 8px;
  font-size: 11px;
  text-transform: capitalize;
  white-space: nowrap;
}

.event-titleline span {
  align-self: start;
  color: var(--gold);
  background: rgba(214, 185, 87, 0.12);
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.event-tags {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.mode-in_person .event-datebox {
  border-color: rgba(82, 199, 184, 0.35);
}

.mode-video .event-datebox {
  border-color: rgba(120, 169, 255, 0.45);
}

.mode-phone .event-datebox {
  border-color: rgba(214, 185, 87, 0.45);
}

.intel-header {
  margin-bottom: 16px;
}

.intel-block {
  border-top: 1px solid var(--line);
  padding: 15px 0;
}

.intel-block h3 {
  font-size: 14px;
  margin-bottom: 10px;
}

.focus-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  padding: 12px;
  margin-bottom: 4px;
}

.block-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  padding: 7px 0;
}

.block-row strong {
  min-width: 0;
  font-size: 13px;
  text-transform: capitalize;
}

.run-status {
  display: inline-block;
  color: var(--teal);
  background: rgba(82, 199, 184, 0.1);
  margin-bottom: 10px;
}

.run-status.running {
  color: var(--gold);
  background: rgba(214, 185, 87, 0.12);
}

.run-status.completed {
  color: var(--green);
  background: rgba(139, 207, 119, 0.12);
}

.run-status.queued {
  color: var(--violet);
  background: rgba(157, 140, 255, 0.12);
}

.task-list,
.finding-list {
  margin: 0;
  padding-left: 18px;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.5;
}

.finding-list {
  color: var(--muted);
}

.gap-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.gap-cloud span {
  color: var(--red);
  background: rgba(216, 95, 76, 0.1);
}

.time-grid {
  display: grid;
  gap: 9px;
}

.time-grid h3 {
  margin-bottom: 0;
}

.time-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #161917;
}

.time-card strong {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.35;
}

.assigned-list {
  display: grid;
  gap: 8px;
}

.assigned-list div {
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.source-ledger {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-ledger h3,
.local-source {
  flex: 0 0 100%;
}

.source-ledger a {
  color: var(--teal);
  border: 1px solid rgba(82, 199, 184, 0.25);
  border-radius: 999px;
  padding: 5px 9px;
  text-decoration: none;
  font-size: 12px;
}

.local-source {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  word-break: break-word;
}

.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 250px minmax(420px, 1fr);
  }

  .intel-panel {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 840px) {
  .topbar,
  .surface-head {
    align-items: stretch;
    flex-direction: column;
  }

  .clock-strip,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .rail,
  .intel-panel {
    border: 0;
    border-bottom: 1px solid var(--line);
  }

  .event-row {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .event-tags {
    grid-column: 2;
    justify-content: flex-start;
  }
}
