:root {
  --ink: #0b132b;
  --paper: #f6fff8;
  --aqua: #5bc0be;
  --sun: #ffd166;
  --muted: #60717a;
  --line: rgba(11, 19, 43, 0.12);
  --danger: #e45757;
  --good: #2f9f70;
  --surface: #ffffff;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(91, 192, 190, 0.12) 1px, transparent 1px),
    linear-gradient(180deg, rgba(11, 19, 43, 0.06) 1px, transparent 1px),
    var(--paper);
  background-size: 36px 36px;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 340px;
  min-height: 100vh;
}

.left-rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  padding: 24px 18px;
  background: var(--ink);
  color: var(--paper);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 19px;
  line-height: 1;
}

.brand small {
  margin-top: 4px;
  color: rgba(246, 255, 248, 0.66);
}

.rail-nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: rgba(246, 255, 248, 0.74);
  text-align: left;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-item:hover,
.nav-item.is-active {
  background: rgba(91, 192, 190, 0.16);
  color: var(--paper);
  transform: translateX(2px);
}

.rail-note {
  margin-top: auto;
  display: flex;
  gap: 10px;
  color: rgba(246, 255, 248, 0.72);
  font-size: 13px;
  line-height: 1.45;
}

.pulse {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--sun);
  box-shadow: 0 0 0 0 rgba(255, 209, 102, 0.58);
  animation: pulse 1.7s infinite;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  gap: 24px;
  align-items: end;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 58px);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 14px;
  font-size: 17px;
}

.search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 142px;
  gap: 8px;
}

.search input,
.search select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  padding: 0 12px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.metric {
  min-height: 118px;
  padding: 17px;
  border-top: 3px solid var(--aqua);
  background: rgba(255, 255, 255, 0.84);
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
}

.metric strong {
  display: block;
  margin: 8px 0 2px;
  font-size: 42px;
  line-height: 1;
  letter-spacing: 0;
}

.screen-panel {
  min-height: 520px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.canvas-head,
.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.quiet-action {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  padding: 0 14px;
}

.progress-track {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}

.track-step {
  position: relative;
  min-height: 72px;
  padding: 11px;
  border: 1px dashed rgba(11, 19, 43, 0.22);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.track-step.is-done {
  border-style: solid;
  border-color: rgba(91, 192, 190, 0.72);
  background: rgba(91, 192, 190, 0.12);
  color: var(--ink);
}

.track-step.is-current {
  box-shadow: inset 0 -3px 0 var(--sun);
}

.track-dot {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 800;
}

.session-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.session-card {
  display: grid;
  gap: 9px;
  min-height: 168px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.session-card:hover,
.session-card.is-selected {
  border-color: var(--aqua);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(11, 19, 43, 0.12);
}

.badge {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(11, 19, 43, 0.08);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
}

.badge.danger {
  background: rgba(228, 87, 87, 0.14);
  color: #9b2f2f;
}

.badge.watch {
  background: rgba(255, 209, 102, 0.28);
  color: #77560b;
}

.badge.good {
  background: rgba(47, 159, 112, 0.14);
  color: #176647;
}

.card-title {
  display: block;
  font-size: 19px;
  font-weight: 850;
  line-height: 1.1;
}

.card-meta,
.card-row {
  color: var(--muted);
  font-size: 13px;
}

.card-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.card-row strong {
  color: var(--ink);
  font-size: 24px;
}

.mini-track {
  display: block;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--aqua) var(--progress), rgba(11, 19, 43, 0.1) var(--progress));
}

.inspector {
  position: sticky;
  top: 0;
  min-width: 0;
  height: 100vh;
  overflow: auto;
  padding: 28px 22px;
  background: #ffffff;
  border-left: 1px solid var(--line);
}

.drawer-head {
  display: grid;
}

.drawer-head p {
  margin-bottom: 0;
  color: var(--muted);
}

.inspector .progress-track {
  grid-template-columns: 1fr;
}

.inspector .track-step {
  min-height: 56px;
}

.inspector-list,
.plain-section dl {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px 14px;
  margin: 0;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  min-width: 0;
}

.drawer-actions {
  display: grid;
  gap: 9px;
  margin-top: 20px;
}

.drawer-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 800;
}

.drawer-actions button:nth-child(2) {
  background: var(--aqua);
  color: var(--ink);
}

.drawer-actions button:nth-child(3) {
  background: var(--sun);
  color: var(--ink);
}

.detail-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 0.9fr;
  gap: 18px;
}

.plain-section {
  min-width: 0;
  padding-top: 16px;
  border-top: 3px solid var(--ink);
}

.line-list {
  display: grid;
  gap: 10px;
}

.line-list > div,
.calendar-row,
.report-board > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  min-height: 56px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.line-list strong {
  white-space: nowrap;
}

.calendar-list {
  display: grid;
}

.calendar-row {
  width: 100%;
  border-top: 0;
  border-right: 0;
  border-left: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.calendar-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.calendar-time {
  width: 100px;
  color: var(--muted);
  font-weight: 800;
}

.report-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.report-board > div {
  display: grid;
  align-items: start;
  border-bottom: 0;
  border-top: 3px solid var(--sun);
  background: rgba(255, 255, 255, 0.72);
}

.report-board strong {
  font-size: 36px;
  line-height: 1;
}

.report-board span,
.report-board small {
  color: var(--muted);
}

.empty-state,
.loading {
  display: grid;
  align-content: center;
  min-height: 260px;
  color: var(--muted);
}

.empty-state h2 {
  color: var(--ink);
}

.skeleton {
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.58), transparent);
  animation: shimmer 1.4s infinite;
  content: "";
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 12px rgba(255, 209, 102, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 209, 102, 0);
  }
}

@keyframes shimmer {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

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

  .brand span,
  .rail-note {
    display: none;
  }

  .nav-item {
    text-align: center;
    padding-right: 6px;
    padding-left: 6px;
    font-size: 12px;
  }

  .topbar,
  .metrics,
  .detail-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .left-rail,
  .inspector {
    position: static;
    height: auto;
  }

  .left-rail {
    padding: 14px;
  }

  .brand span,
  .rail-note {
    display: block;
  }

  .rail-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav-item {
    min-height: 40px;
    text-align: center;
  }

  .workspace,
  .inspector {
    padding: 18px 14px;
  }

  .search,
  .session-grid,
  .progress-track,
  .report-board {
    grid-template-columns: 1fr;
  }

  .screen-panel {
    padding: 16px;
  }

  .canvas-head {
    display: grid;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 32px;
    line-height: 1.02;
  }

  h2 {
    font-size: 23px;
  }

  .rail-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metrics {
    grid-template-columns: 1fr 1fr;
  }

  .metric {
    min-height: 104px;
    padding: 13px;
  }

  .metric strong {
    font-size: 30px;
  }

  .inspector-list,
  .plain-section dl {
    grid-template-columns: 1fr;
  }

  .line-list > div,
  .calendar-row {
    display: grid;
    gap: 6px;
    justify-content: stretch;
  }
}
