:root {
  color-scheme: light;
  --bg: oklch(96.5% 0.011 224);
  --surface: oklch(99% 0.006 226);
  --surface-2: oklch(93.8% 0.018 225);
  --line: oklch(86% 0.018 225);
  --text: oklch(22% 0.028 245);
  --muted: oklch(49% 0.026 245);
  --accent: oklch(47% 0.12 166);
  --accent-soft: oklch(92% 0.045 166);
  --info: oklch(47% 0.11 250);
  --info-soft: oklch(93% 0.04 250);
  --warn: oklch(55% 0.12 70);
  --warn-soft: oklch(94% 0.06 80);
  --danger: oklch(51% 0.16 28);
  --danger-soft: oklch(94% 0.055 28);
  --focus: oklch(51% 0.16 250);
  --shadow: 0 18px 45px oklch(30% 0.04 245 / 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, oklch(97.8% 0.01 222), var(--bg) 280px),
    var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0 14px;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

button:active {
  transform: translateY(1px);
}

button.primary {
  border-color: var(--text);
  background: var(--text);
  color: var(--surface);
  font-weight: 750;
}

button.danger {
  border-color: oklch(81% 0.06 28);
  color: var(--danger);
  background: var(--danger-soft);
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

button:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 34px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

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

.app-mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.eyebrow,
.kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 2px;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  letter-spacing: 0;
}

.lede {
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.control-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 12px;
  margin-bottom: 12px;
}

.control-group {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.control-copy strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}

.control-copy p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.control-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.token {
  width: 232px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: var(--bg);
}

.notice {
  margin-bottom: 12px;
  border: 1px solid oklch(82% 0.09 74);
  border-radius: 8px;
  background: var(--warn-soft);
  color: var(--warn);
  padding: 12px 14px;
  font-size: 14px;
}

.notice[data-tone="ok"] {
  border-color: oklch(78% 0.08 166);
  background: var(--accent-soft);
  color: var(--accent);
}

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

.metric,
.panel,
.session {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric {
  min-height: 82px;
  padding: 14px 16px;
}

.metric span,
.meta,
.path,
.panel-head span,
.mobile-hint {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1;
}

.panel {
  padding: 16px;
}

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

.mobile-hint {
  display: none;
  margin: -2px 0 12px;
  line-height: 1.45;
}

.sessions {
  display: grid;
  gap: 10px;
}

.session {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 14px;
  box-shadow: 0 1px 0 oklch(30% 0.04 245 / 0.03);
}

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

.session-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
}

.session-title strong {
  font-size: 18px;
}

.badge {
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 800;
}

.badge.working {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge.idle {
  background: var(--warn-soft);
  color: var(--warn);
}

.purpose {
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 700;
}

.task-summary {
  display: -webkit-box;
  margin-bottom: 8px;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.path {
  overflow-wrap: anywhere;
}

.meta {
  display: flex;
  gap: 10px 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.session-actions {
  display: flex;
  align-items: flex-start;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .control-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100vw - 24px, 680px);
    padding: 18px 0 24px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  h1 {
    font-size: 28px;
  }

  .topbar > button {
    width: 100%;
  }

  .control-group {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .control-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .token {
    grid-column: 1 / -1;
    width: 100%;
  }

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

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

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

  .panel {
    padding: 14px;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .mobile-hint {
    display: block;
  }

  .session {
    grid-template-columns: minmax(0, 1fr) 76px;
    padding: 13px;
  }

  .session-actions button {
    width: 76px;
  }
}
