:root {
  --ink: #0b132b;
  --paper: #f6fff8;
  --mint: #5bc0be;
  --sun: #ffd166;
  --blue: #3a86ff;
  --red: #ef476f;
  --line: rgba(11, 19, 43, 0.13);
  --muted: rgba(11, 19, 43, 0.64);
  --shadow: 0 24px 70px rgba(11, 19, 43, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.left-rail,
.inspect-drawer {
  min-width: 0;
  padding: 22px;
  background: rgba(246, 255, 248, 0.82);
  backdrop-filter: blur(18px);
}

.left-rail {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 20px;
  font-weight: 850;
}

.brand img {
  width: 42px;
  height: 42px;
}

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

.nav-item {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  text-align: left;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-item:hover,
.nav-item.is-active {
  background: var(--ink);
  color: var(--paper);
  transform: translateX(2px);
}

.nav-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(91, 192, 190, 0.2);
  color: inherit;
  font-size: 12px;
  font-weight: 800;
}

.rail-note {
  margin-top: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.pulse-dot {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 0 rgba(91, 192, 190, 0.5);
  animation: pulse 1.8s infinite;
  flex: 0 0 auto;
}

.work-canvas {
  min-width: 0;
  padding: 24px clamp(18px, 3vw, 42px);
}

.topbar {
  min-width: 0;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

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

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(36px, 5vw, 72px);
  line-height: 0.92;
}

h2 {
  font-size: clamp(24px, 3vw, 40px);
  line-height: 1;
}

.search-box {
  width: min(100%, 340px);
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.search-box input,
.quick-action input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
}

.search-box input:focus,
.quick-action input:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(91, 192, 190, 0.22);
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}

.metrics-strip > div {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.metric-value {
  font-size: clamp(32px, 4vw, 58px);
  line-height: 0.94;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}

.screen-panel {
  display: none;
  animation: rise 260ms ease both;
}

.screen-panel.is-active {
  display: block;
}

.track-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 14px;
  align-items: start;
}

.track-lane {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 12px;
  border-left: 5px solid var(--mint);
  background: rgba(255, 255, 255, 0.54);
  border-radius: 8px;
}

.track-lane.tone-yellow {
  border-color: var(--sun);
}

.track-lane.tone-blue {
  border-color: var(--blue);
}

.track-lane.tone-red {
  border-color: var(--red);
}

.track-head,
.session-row,
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stage-badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.track-count {
  color: var(--muted);
  font-size: 12px;
}

.session-card,
.calendar-row {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  text-align: left;
  padding: 14px;
  display: grid;
  gap: 10px;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.session-card:hover,
.calendar-row:hover {
  transform: translateY(-2px);
  border-color: rgba(11, 19, 43, 0.28);
  box-shadow: 0 18px 42px rgba(11, 19, 43, 0.12);
}

.session-card strong,
.calendar-row strong {
  font-size: 15px;
  line-height: 1.18;
}

.session-meta,
.record-fact span,
.action-item span,
.report-line span,
.calendar-date {
  color: var(--muted);
  font-size: 12px;
}

.progress-line,
.bar {
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(11, 19, 43, 0.09);
}

.progress-line span,
.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--mint);
}

.risk-mid .progress-line span,
.risk-mid .bar span {
  background: var(--sun);
}

.risk-high .progress-line span,
.risk-high .bar span {
  background: var(--red);
}

.record-layout,
.report-view {
  min-height: 460px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 22px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.record-layout .quiet {
  max-width: 680px;
  color: var(--muted);
  line-height: 1.55;
}

.record-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.record-fact {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 18px;
  background: rgba(246, 255, 248, 0.82);
}

.record-fact strong {
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.calendar-grid {
  display: grid;
  gap: 10px;
}

.calendar-row {
  grid-template-columns: 140px 1fr 100px;
  align-items: center;
}

.report-bars {
  display: grid;
  gap: 14px;
}

.report-line {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(120px, 280px) 52px;
  gap: 14px;
  align-items: center;
}

.report-line strong {
  display: block;
  line-height: 1.2;
}

.report-line b {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.inspect-drawer {
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.inspect-drawer h2 {
  font-size: 30px;
}

.inspect-drawer p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  transition: transform 160ms ease;
}

.icon-button:hover {
  transform: rotate(35deg);
}

.quick-action {
  display: grid;
  gap: 10px;
  padding-top: 8px;
}

.quick-action label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.quick-action button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--mint);
  color: var(--ink);
  font-weight: 900;
}

.action-list {
  display: grid;
  gap: 10px;
  overflow: auto;
}

.action-item {
  display: grid;
  gap: 5px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.action-item strong,
.action-item small {
  line-height: 1.25;
}

.action-item small {
  color: var(--muted);
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 10px rgba(91, 192, 190, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(91, 192, 190, 0);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .left-rail {
    padding: 14px;
  }

  .brand span,
  .nav-item span:last-child,
  .rail-note span:last-child {
    display: none;
  }

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

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

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

  .left-rail {
    position: sticky;
    top: 0;
    z-index: 3;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .screen-nav {
    display: flex;
    min-width: max-content;
  }

  .nav-item {
    width: auto;
    grid-template-columns: 30px 1fr;
  }

  .brand span,
  .nav-item span:last-child {
    display: inline;
  }

  .rail-note {
    display: none;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .metrics-strip,
  .track-map,
  .record-grid {
    grid-template-columns: 1fr;
  }

  .calendar-row,
  .report-line {
    grid-template-columns: 1fr;
  }

  .report-line b {
    text-align: left;
  }

  .record-layout,
  .report-view {
    padding: 18px;
    min-height: 0;
  }
}

