:root {
  --bg: #07131a;
  --panel: rgba(11, 24, 32, 0.78);
  --panel-strong: rgba(18, 34, 43, 0.92);
  --ink: #f4f0e8;
  --muted: #9eb0b8;
  --line: rgba(244, 240, 232, 0.1);
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.34);
  --boost: #58d2b5;
  --boost-soft: #133f3b;
  --normal: #ff9c63;
  --normal-soft: #4c2d1f;
  --card-strong-start: rgba(18, 34, 43, 0.96);
  --card-strong-end: rgba(24, 48, 57, 0.92);
  --body-grad-1: rgba(255, 140, 92, 0.2);
  --body-grad-2: rgba(88, 210, 181, 0.18);
  --body-grad-3: rgba(67, 116, 255, 0.16);
  --body-base-start: #061018;
  --body-base-mid: #0b1721;
  --body-base-end: #09141d;
  --button-accent-border: rgba(88, 210, 181, 0.35);
  --button-accent-bg: rgba(88, 210, 181, 0.14);
  --button-accent-hover: rgba(88, 210, 181, 0.22);
  --button-focus-ring: rgba(88, 210, 181, 0.35);
  --control-bg: rgba(255, 255, 255, 0.04);
  --control-hover-bg: rgba(255, 255, 255, 0.08);
  --toggle-bg: rgba(255, 255, 255, 0.03);
  --cell-border: rgba(255, 255, 255, 0.04);
  --boost-grad-start: #1d5b55;
  --normal-grad-start: #6f422d;
  --today-outline: #ffffff;
}

body[data-theme="light"] {
  --panel: rgba(255, 252, 247, 0.86);
  --panel-strong: rgba(255, 248, 238, 0.95);
  --ink: #201914;
  --muted: #6f655b;
  --line: rgba(32, 25, 20, 0.1);
  --shadow: 0 24px 50px rgba(65, 43, 12, 0.1);
  --boost: #1a8a6f;
  --boost-soft: #d3f0e5;
  --normal: #c86e36;
  --normal-soft: #ffe2cf;
  --card-strong-start: rgba(244, 237, 226, 0.98);
  --card-strong-end: rgba(237, 229, 216, 0.96);
  --body-grad-1: rgba(255, 193, 123, 0.34);
  --body-grad-2: rgba(86, 187, 171, 0.18);
  --body-grad-3: rgba(242, 227, 196, 0.24);
  --body-base-start: #f8f1e7;
  --body-base-mid: #f5ede3;
  --body-base-end: #efe7dc;
  --button-accent-border: rgba(26, 138, 111, 0.22);
  --button-accent-bg: rgba(26, 138, 111, 0.1);
  --button-accent-hover: rgba(26, 138, 111, 0.16);
  --button-focus-ring: rgba(26, 138, 111, 0.24);
  --control-bg: rgba(255, 255, 255, 0.52);
  --control-hover-bg: rgba(255, 255, 255, 0.78);
  --toggle-bg: rgba(32, 25, 20, 0.03);
  --cell-border: rgba(32, 25, 20, 0.05);
  --boost-grad-start: #8fd8c8;
  --normal-grad-start: #efd0bd;
  --today-outline: #201914;
}

body[data-theme="claude"] {
  --panel: rgba(35, 28, 23, 0.74);
  --panel-strong: rgba(53, 41, 31, 0.9);
  --ink: #f8efe2;
  --muted: #c4b3a4;
  --line: rgba(248, 239, 226, 0.1);
  --shadow: 0 28px 72px rgba(22, 12, 7, 0.34);
  --boost: #d4a574;
  --boost-soft: #584132;
  --normal: #f08e57;
  --normal-soft: #5c3122;
  --card-strong-start: rgba(57, 44, 34, 0.96);
  --card-strong-end: rgba(73, 56, 43, 0.92);
  --body-grad-1: rgba(223, 164, 111, 0.24);
  --body-grad-2: rgba(163, 118, 82, 0.18);
  --body-grad-3: rgba(255, 230, 198, 0.08);
  --body-base-start: #17120f;
  --body-base-mid: #211914;
  --body-base-end: #191310;
  --button-accent-border: rgba(212, 165, 116, 0.3);
  --button-accent-bg: rgba(212, 165, 116, 0.12);
  --button-accent-hover: rgba(212, 165, 116, 0.18);
  --button-focus-ring: rgba(212, 165, 116, 0.26);
  --control-bg: rgba(255, 255, 255, 0.04);
  --control-hover-bg: rgba(255, 255, 255, 0.08);
  --toggle-bg: rgba(255, 255, 255, 0.03);
  --cell-border: rgba(248, 239, 226, 0.05);
  --boost-grad-start: #74604a;
  --normal-grad-start: #845239;
  --today-outline: #f4e7d8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, var(--body-grad-1), transparent 28%),
    radial-gradient(circle at 85% 20%, var(--body-grad-2), transparent 24%),
    radial-gradient(circle at bottom right, var(--body-grad-3), transparent 26%),
    linear-gradient(160deg, var(--body-base-start) 0%, var(--body-base-mid) 48%, var(--body-base-end) 100%);
}

body.focus-mode .top-row {
  display: none;
}

body.focus-mode .app-shell {
  padding-top: 28px;
}

.app-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 20px 64px;
}

.top-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.9fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.hero {
  margin-bottom: 0;
}

.control-bar {
  margin-bottom: 0;
}

.control-cluster {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.control-copy {
  min-width: 0;
}

.control-status {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

.timezone-controls {
  min-width: 0;
}

.timezone-controls.compact {
  min-width: 0;
}

.timezone-search,
.timezone-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--control-bg);
  color: var(--ink);
  font: inherit;
}

.timezone-search {
  margin-bottom: 10px;
}

.apply-button {
  width: 100%;
  margin-top: 12px;
  padding: 12px 16px;
  border: 1px solid var(--button-accent-border);
  border-radius: 14px;
  background: var(--button-accent-bg);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, opacity 120ms ease;
}

.apply-button:hover:not(:disabled) {
  background: var(--button-accent-hover);
  border-color: var(--button-accent-border);
}

.apply-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.secondary-button {
  width: 100%;
  margin-top: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--control-bg);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.secondary-button:hover {
  background: var(--control-hover-bg);
}

.timezone-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.timezone-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 22px) calc(50% - 3px),
    calc(100% - 16px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.timezone-search:focus,
.timezone-input:focus {
  outline: 2px solid var(--button-focus-ring);
  border-color: var(--button-accent-border);
}

.eyebrow,
.label,
.chart-note,
.legend,
.subvalue {
  color: var(--muted);
}

.eyebrow,
.label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
  font-weight: 700;
}

h1,
h2,
.value {
  margin: 0;
  line-height: 1;
}

h1 {
  font-size: clamp(2.8rem, 7vw, 5.8rem);
  letter-spacing: -0.05em;
  margin-top: 8px;
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
}

.lede {
  max-width: 720px;
  font-size: 1.05rem;
  line-height: 1.6;
}

.hero-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.card,
.chart-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.card {
  padding: 24px;
}

.card.primary {
  background: linear-gradient(135deg, var(--card-strong-start), var(--card-strong-end));
}

.value {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  margin-top: 16px;
}

.accent {
  color: var(--boost);
}

.subvalue {
  margin-top: 14px;
  font-size: 0.98rem;
  line-height: 1.5;
}

.detail-line {
  display: block;
}

.chart-card {
  padding: 24px;
}

.focus-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

body:not(.focus-mode) #focus-exit {
  display: none;
}

body.focus-mode #focus-enter {
  display: none;
}

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

.chart-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: end;
}

.format-toggle {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--toggle-bg);
}

.format-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.86rem;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.format-button.active {
  background: var(--button-accent-bg);
  color: var(--ink);
}

.legend {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.95rem;
}

.swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: -2px;
}

.swatch.boost {
  background: var(--boost);
}

.swatch.normal {
  background: var(--normal);
}

.week-grid {
  display: grid;
  grid-template-columns: 90px repeat(24, minmax(18px, 1fr));
  gap: 6px;
  align-items: center;
  overflow-x: auto;
  padding-bottom: 10px;
}

.day-label,
.hour-label {
  font-size: 0.78rem;
  color: var(--muted);
}

.hour-label {
  text-align: center;
  font-family: "IBM Plex Mono", monospace;
}

.hour-label.stacked {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  gap: 2px;
}

.hour-label-top {
  display: block;
}

.hour-label-bottom {
  display: block;
  font-size: 0.68em;
  letter-spacing: 0.06em;
}

.day-label {
  font-weight: 700;
  padding-right: 8px;
}

.cell {
  height: 26px;
  border-radius: 8px;
  border: 1px solid var(--cell-border);
}

.cell.boost {
  background: linear-gradient(180deg, var(--boost-grad-start), var(--boost-soft));
}

.cell.normal {
  background: linear-gradient(180deg, var(--normal-grad-start), var(--normal-soft));
}

.cell.today {
  outline: 2px solid var(--today-outline);
  outline-offset: 1px;
}

.chart-note {
  margin: 18px 0 0;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .top-row,
  .status-grid {
    grid-template-columns: 1fr;
  }

  .control-cluster {
    align-items: stretch;
  }

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

  .chart-tools {
    justify-content: start;
  }

  .legend {
    font-size: 0.88rem;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 24px 14px 40px;
  }

  .card,
  .chart-card {
    border-radius: 22px;
  }

  .card {
    padding: 20px;
  }

  .chart-card {
    padding: 18px;
  }

  .focus-actions {
    flex-direction: column;
  }

  .chart-note {
    font-size: 0.92rem;
  }
}
