:root {
  --ink: #050505;
  --graphite: #30343a;
  --muted: #646a72;
  --paper: #eaf6fb;
  --panel: #f3fbfe;
  --panel-soft: #e2f2f8;
  --line: #bfd8e2;
  --accent: #c9e5ed;
  --accent-strong: #30343a;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.09);
  --sprint-bg: linear-gradient(160deg, #f3fbfe, #dff1f8);
  --capsule-bg: rgba(243, 251, 254, 0.88);
  --canvas-bg: #dff1f8;
  --ring-track: rgba(5, 5, 5, 0.08);
  --focus-shadow: rgba(201, 229, 237, 0.62);
  --primary-bg: #050505;
  --primary-text: #eaf7fb;
  --active-text: #eaf7fb;
}

body[data-theme="dark"] {
  --ink: #ffffff;
  --graphite: #dce2e8;
  --muted: #a7adb4;
  --paper: #1f2327;
  --panel: #282d32;
  --panel-soft: #30363d;
  --line: #414951;
  --accent: #c9e5ed;
  --accent-strong: #c9e5ed;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
  --sprint-bg: linear-gradient(160deg, #1f2327, #2b3238);
  --capsule-bg: rgba(40, 45, 50, 0.82);
  --canvas-bg: #242a30;
  --ring-track: rgba(255, 255, 255, 0.14);
  --focus-shadow: rgba(201, 229, 237, 0.28);
  --primary-bg: #ffffff;
  --primary-text: #050505;
  --active-text: #050505;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(420px, 1.08fr);
  min-height: 100vh;
}

.sprint-pane {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  padding: clamp(20px, 3vw, 40px);
  background: var(--sprint-bg);
  border-right: 1px solid var(--line);
}

.topbar,
.panel-head,
.sprint-controls,
.theme-control,
.entry-row,
.stats-strip {
  display: flex;
  align-items: center;
}

.topbar,
.panel-head,
.stats-strip {
  justify-content: space-between;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(4.8rem, 11vw, 7.4rem);
  line-height: 0.86;
  letter-spacing: 0;
}

h2 {
  font-size: 1rem;
  letter-spacing: 0;
}

.capsule {
  min-width: 92px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--capsule-bg);
  text-align: center;
}

.capsule span {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
}

.capsule small,
.stats-strip span,
.counter {
  color: var(--muted);
  font-size: 0.8rem;
}

.orbit-wrap {
  position: relative;
  overflow: hidden;
  min-height: 225px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--canvas-bg);
  box-shadow: var(--shadow);
}

#focusCanvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 225px;
}

.progress-ring {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.progress-ring svg {
  width: min(56%, 260px);
  min-width: 190px;
}

.ring-track,
.ring-progress {
  fill: none;
  stroke-width: 10;
}

.ring-track {
  stroke: var(--ring-track);
}

.ring-progress {
  stroke: var(--accent-strong);
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 0.3s ease;
}

.intent-box {
  display: grid;
  gap: 10px;
}

label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  outline: none;
}

input {
  min-height: 48px;
  padding: 0 14px;
}

textarea {
  min-height: 156px;
  padding: 14px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--focus-shadow);
}

.sprint-controls {
  justify-content: center;
  gap: 14px;
}

.primary-btn,
.icon-btn,
.text-btn,
.text-submit,
.theme-btn {
  border: 0;
  border-radius: 8px;
}

.primary-btn {
  min-width: 160px;
  min-height: 58px;
  background: var(--primary-bg);
  color: var(--primary-text);
  font-size: 1rem;
  font-weight: 800;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}

.icon-btn.compact {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
}

.icon-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.sprint-options {
  display: flex;
  align-self: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.theme-control {
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--capsule-bg);
}

.theme-btn {
  height: 38px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.theme-btn {
  width: 72px;
}

.theme-btn.is-active {
  background: var(--accent-strong);
  color: var(--active-text);
}

.work-pane {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-content: start;
  padding: clamp(20px, 3vw, 42px);
}

.panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.queue-panel {
  grid-row: span 2;
}

.account-panel {
  align-self: start;
}

.notes-panel,
.stats-strip {
  grid-column: 1 / -1;
}

.panel-head {
  min-height: 34px;
  margin-bottom: 14px;
}

.text-btn {
  background: transparent;
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 800;
}

.text-submit {
  flex: 0 0 76px;
  height: 46px;
  background: var(--graphite);
  color: var(--panel);
  font-weight: 800;
}

.entry-row {
  gap: 8px;
  margin-bottom: 14px;
}

.queue-list,
.parking-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.queue-item,
.parking-item {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  gap: 8px;
  align-items: center;
  min-height: 46px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.parking-item {
  grid-template-columns: 1fr 34px;
}

.check-btn,
.delete-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
}

.check-btn {
  border: 1px solid var(--line);
}

.queue-item.is-complete .check-btn {
  border-color: var(--accent);
  background: var(--accent);
  color: #050505;
}

.queue-item.is-complete .queue-text {
  color: var(--muted);
  text-decoration: line-through;
}

.queue-text,
.parking-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.empty-state {
  padding: 18px 8px;
  color: var(--muted);
  text-align: center;
}

.save-status {
  min-height: 20px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.stats-strip {
  gap: 12px;
  padding: 18px;
  border-top: 1px solid var(--line);
}

.stats-strip div {
  display: grid;
  gap: 2px;
}

.stats-strip strong {
  font-size: 1.6rem;
}

@media (max-width: 900px) {
  .app-shell,
  .work-pane {
    grid-template-columns: 1fr;
  }

  .sprint-pane {
    min-height: 760px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .queue-panel {
    grid-row: auto;
  }
}

@media (max-width: 520px) {
  .sprint-pane,
  .work-pane {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
    gap: 16px;
  }

  h1 {
    font-size: clamp(4.2rem, 22vw, 6rem);
  }

  .primary-btn {
    min-width: 120px;
  }
}
