:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #647184;
  --line: #dce4ea;
  --surface: #ffffff;
  --wash: #f3f7f8;
  --accent: #007f91;
  --accent-strong: #045e69;
  --gold: #b27712;
  --green: #137a52;
  --red: #b43b3b;
  --shadow: 0 12px 30px rgba(20, 41, 54, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--wash);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px;
}

.topbar,
.panel-heading,
.leaderboard-row,
.pr-row,
.benchmark-row,
.timeline-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 22px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  font-size: 1.1rem;
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-grid,
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

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

.metric {
  min-height: 138px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric span,
.metric small,
.pr-row span,
.benchmark-row span,
.leaderboard-row span,
.timeline-item span {
  color: var(--muted);
  font-size: 0.84rem;
}

.metric strong {
  font-size: 2.2rem;
  line-height: 1;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(310px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  margin-bottom: 18px;
}

.analytics-grid {
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
}

.panel {
  padding: 18px;
}

.wide {
  min-width: 0;
}

.log-form,
.log-form label {
  display: flex;
  flex-direction: column;
}

.log-form {
  gap: 14px;
}

.log-form label {
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfe;
  color: var(--ink);
  padding: 11px 12px;
}

textarea {
  resize: vertical;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  min-height: 42px;
  padding: 0 16px;
}

.primary {
  background: var(--accent);
  color: white;
}

.ghost {
  background: #e5eef1;
  color: var(--accent-strong);
}

.notice {
  border-radius: 8px;
  margin-bottom: 18px;
  padding: 14px 16px;
  font-weight: 750;
}

.notice.success {
  background: #daf2e9;
  color: #0e5d3c;
}

.notice.neutral {
  background: #e6eef5;
  color: #31516d;
}

.notice.error {
  background: #f8dddd;
  color: var(--red);
}

.pr-list,
.benchmark-list,
.leaderboard,
.timeline {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.pr-row,
.benchmark-row,
.leaderboard-row,
.timeline-item {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.pr-row div,
.benchmark-row div,
.leaderboard-row div,
.timeline-item div {
  min-width: 0;
}

.right {
  text-align: right;
}

.trend {
  width: 100%;
  min-height: 220px;
  margin: 14px 0 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(#fbfdfe, #f5fafb);
}

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.chart-line.best {
  stroke: var(--gold);
  stroke-dasharray: 5 5;
}

.dot,
.pr-dot {
  fill: white;
  stroke: var(--accent);
  stroke-width: 3;
}

.pr-dot {
  fill: var(--gold);
  stroke: var(--gold);
}

.trend text {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.pill {
  border-radius: 999px;
  background: #edf3f5;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 6px 10px;
  font-weight: 800;
}

.pill.hot {
  background: #fff1d7;
  color: var(--gold);
}

.rank {
  background: #edf3f5;
  border-radius: 999px;
  color: var(--accent-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  height: 34px;
  width: 34px;
  flex: 0 0 34px;
}

.leaderboard-row.me {
  border-color: rgba(0, 127, 145, 0.45);
  background: #f4fbfc;
}

.qualified {
  color: var(--green);
}

.next-steps {
  margin: 16px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
}

.empty,
.chart-empty {
  color: var(--muted);
}

.chart-empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  margin-top: 14px;
}

@media (max-width: 860px) {
  .shell {
    padding: 18px;
  }

  .hero-grid,
  .workbench,
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .topbar,
  .panel-heading,
  .pr-row,
  .benchmark-row,
  .timeline-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .right {
    text-align: left;
  }
}
