:root {
  color-scheme: light;
  --bg: #f5f7f5;
  --surface: #ffffff;
  --surface-2: #edf5f3;
  --ink: #17202a;
  --muted: #66747c;
  --line: #dce5e1;
  --teal: #187b78;
  --teal-dark: #105c5a;
  --coral: #e56b5f;
  --yellow: #f1b84b;
  --blue: #356f9f;
  --shadow: 0 18px 48px rgba(28, 49, 58, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  padding: 24px;
}

.workspace {
  width: min(1180px, 100%);
  margin: 0 auto;
}

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

.eyebrow,
.label {
  margin: 0 0 7px;
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  font-size: clamp(2rem, 6vw, 4.25rem);
  line-height: 0.96;
  max-width: 720px;
}

h2 {
  font-size: 1.2rem;
  line-height: 1.2;
}

.date-card,
.pill {
  border: 1px solid var(--line);
  background: var(--surface);
}

.date-card {
  min-width: 148px;
  padding: 12px 14px;
  border-radius: 8px;
  text-align: right;
  box-shadow: 0 8px 22px rgba(30, 49, 58, 0.07);
}

.date-card span,
.date-card strong {
  display: block;
}

.date-card span {
  color: var(--muted);
  font-size: 0.83rem;
  margin-bottom: 3px;
}

.hero-panel {
  position: relative;
  min-height: 308px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #d9e8e7;
  isolation: isolate;
}

.hero-panel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.96) contrast(0.98);
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(245, 247, 245, 0.97), rgba(245, 247, 245, 0.7) 44%, rgba(245, 247, 245, 0.08));
  z-index: 1;
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: min(520px, 100%);
  padding: 34px;
}

.hero-copy h2 {
  max-width: 410px;
  font-size: clamp(1.7rem, 3vw, 3rem);
  line-height: 1;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 28px;
}

.quick-stats div {
  min-height: 82px;
  border: 1px solid rgba(220, 229, 225, 0.92);
  background: rgba(255, 255, 255, 0.83);
  border-radius: 8px;
  padding: 14px;
  backdrop-filter: blur(12px);
}

.quick-stats span {
  display: block;
  font-size: 1.7rem;
  font-weight: 800;
}

.quick-stats small {
  color: var(--muted);
  font-weight: 700;
}

.tabs {
  display: flex;
  gap: 8px;
  margin: 18px 0;
  overflow-x: auto;
}

.tab-button,
.text-button,
.primary-action,
.icon-button {
  border: 0;
  border-radius: 8px;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.tab-button {
  min-width: 96px;
  min-height: 42px;
  padding: 0 18px;
  background: #e6eeeb;
  color: #40525b;
  font-weight: 800;
}

.tab-button.active {
  background: var(--ink);
  color: #fff;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 16px;
}

.tool-panel,
.activity-list {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(28, 49, 58, 0.07);
}

.panel-heading,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--teal-dark);
  font-size: 0.75rem;
  font-weight: 800;
}

form label {
  display: grid;
  gap: 7px;
  color: #43535c;
  font-size: 0.86rem;
  font-weight: 800;
  margin-bottom: 12px;
}

input,
select {
  min-width: 0;
  width: 100%;
  min-height: 44px;
  border: 1px solid #cfdcd8;
  border-radius: 8px;
  background: #fbfdfc;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(24, 123, 120, 0.14);
}

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

.primary-action {
  width: 100%;
  min-height: 46px;
  background: var(--teal);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(24, 123, 120, 0.2);
}

.primary-action:hover,
.icon-button:hover,
.tab-button:hover {
  transform: translateY(-1px);
}

.timer-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.timer-panel h2 {
  font-size: 2.5rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  padding: 0;
  accent-color: var(--coral);
}

.timer-actions {
  display: grid;
  grid-template-columns: repeat(3, 54px);
  gap: 10px;
  justify-content: start;
  margin-top: 18px;
}

.icon-button {
  width: 54px;
  height: 48px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 900;
}

.activity-list {
  margin-top: 16px;
}

.section-title h2 {
  font-size: 1.1rem;
}

.text-button {
  min-height: 36px;
  background: transparent;
  color: var(--coral);
  font-weight: 800;
}

.session-row,
.trial-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

.session-row:first-child,
.trial-row:first-child {
  border-top: 0;
}

.row-title {
  margin: 0 0 4px;
  font-weight: 900;
}

.row-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.badge {
  min-width: 78px;
  border-radius: 999px;
  padding: 8px 10px;
  text-align: center;
  color: #fff;
  font-weight: 900;
  background: var(--blue);
}

.badge.done {
  background: var(--teal);
}

.empty-state {
  min-height: 96px;
  display: grid;
  place-items: center;
  border: 1px dashed #bdcbc7;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
}

.topic-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.topic-group {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 16px;
}

.topic-group h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.topic-chip {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #d5e1dd;
  background: #fbfdfc;
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 8px;
  text-align: left;
  font-weight: 800;
}

.topic-chip::after {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border: 2px solid #93a7a0;
  border-radius: 50%;
}

.topic-chip.done {
  border-color: rgba(24, 123, 120, 0.36);
  background: #e6f2ef;
  color: var(--teal-dark);
}

.topic-chip.done::after {
  border-color: var(--teal);
  background: radial-gradient(circle at center, var(--teal) 45%, transparent 47%);
}

.chart-panel {
  min-height: 265px;
}

.bar-chart {
  height: 176px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(26px, 1fr);
  align-items: end;
  gap: 10px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px 10px 0;
}

.bar {
  min-height: 8px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--coral), var(--yellow));
  position: relative;
}

.bar span {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

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

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

  .date-card {
    text-align: left;
  }

  .hero-panel {
    min-height: 430px;
  }

  .hero-panel::after {
    background: linear-gradient(180deg, rgba(245, 247, 245, 0.98), rgba(245, 247, 245, 0.8) 52%, rgba(245, 247, 245, 0.08));
  }

  .hero-copy {
    padding: 22px;
  }

  .quick-stats,
  .panel-grid,
  .topic-board {
    grid-template-columns: 1fr;
  }

  .split-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .workspace {
    width: min(100%, 362px);
  }

  h1 {
    font-size: 2.2rem;
  }

  .hero-copy h2 {
    font-size: 1.75rem;
  }

  .quick-stats {
    gap: 8px;
  }

  .quick-stats div {
    min-height: 70px;
    padding: 10px;
  }

  .timer-actions {
    grid-template-columns: repeat(3, 1fr);
  }

  .icon-button {
    width: 100%;
  }
}
