:root {
  --bg: #11100d;
  --panel: #1c1a16;
  --panel-2: #26231e;
  --line: #3a342b;
  --text: #f2eadc;
  --muted: #a99c89;
  --accent: #d5b15f;
  --accent-2: #58a47b;
  --bad: #dc756a;
  --shadow: 0 18px 70px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(213, 177, 95, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(213, 177, 95, 0.04) 1px, transparent 1px),
    var(--bg);
  background-size: 44px 44px;
  font-family: Georgia, "Times New Roman", serif;
}

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

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0;
}

.workspace,
.side {
  display: grid;
  gap: 18px;
  align-content: start;
}

.topbar,
.panel,
.controls,
.metrics article,
.note {
  border: 1px solid var(--line);
  background: rgba(28, 26, 22, 0.94);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 112px;
  padding: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2.25rem, 6vw, 5.5rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 4px;
  font-size: 1.05rem;
}

p {
  color: var(--muted);
  line-height: 1.45;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #15130f;
}

.status-pill span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 18px var(--accent-2);
}

.panel,
.note {
  padding: 18px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.panel-header p {
  margin-bottom: 0;
}

.session-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.session-actions button {
  min-width: 124px;
}

.session-fields {
  display: grid;
  grid-template-columns: 1fr 1fr minmax(150px, 0.5fr);
  gap: 12px;
}

.notes-input {
  min-height: 74px;
  margin-top: 12px;
}

textarea {
  display: block;
  width: 100%;
  min-height: 180px;
  resize: vertical;
  border: 1px solid var(--line);
  color: var(--text);
  background: #12110e;
  padding: 14px;
  outline: none;
}

.live-panel textarea {
  min-height: 96px;
  margin-top: 12px;
}

.live-entry {
  display: grid;
  grid-template-columns: minmax(96px, 140px) minmax(140px, 220px);
  gap: 10px;
}

.live-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.live-stats span {
  border: 1px solid var(--line);
  background: #15130f;
  padding: 8px 10px;
}

.live-stats strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--accent);
}

.controls {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) repeat(5, minmax(104px, 0.7fr)) minmax(110px, 0.6fr);
  gap: 12px;
  padding: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

input,
select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  color: var(--text);
  background: #12110e;
  padding: 0 10px;
  outline: none;
}

button {
  min-height: 42px;
  border: 1px solid #8f7131;
  color: #17120a;
  background: var(--accent);
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.error-box {
  border: 1px solid rgba(220, 117, 106, 0.55);
  background: rgba(220, 117, 106, 0.1);
  color: #ffd3ce;
  padding: 12px 14px;
}

.metrics {
  display: grid;
  grid-template-columns: 0.55fr 0.65fr 0.75fr 0.9fr 1.6fr;
  gap: 12px;
}

.metrics article {
  min-height: 88px;
  padding: 16px;
}

.metrics span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.metrics strong {
  display: block;
  font-size: clamp(1.3rem, 3vw, 2.2rem);
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
  text-transform: uppercase;
}

td {
  font-variant-numeric: tabular-nums;
}

.good {
  color: #8ed6ad;
}

.bad {
  color: var(--bad);
}

.adaptive-panel {
  border-color: rgba(213, 177, 95, 0.55);
}

.report-panel {
  border-color: rgba(88, 164, 123, 0.42);
}

.live-ai-panel {
  border-color: rgba(88, 164, 123, 0.6);
}

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

.report-grid article {
  min-height: 82px;
  border: 1px solid var(--line);
  background: #15130f;
  padding: 14px;
}

.report-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.report-grid strong {
  display: block;
  font-size: 1.45rem;
  overflow-wrap: anywhere;
}

.confidence-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  min-width: 104px;
  padding: 0 12px;
  border: 1px solid rgba(213, 177, 95, 0.58);
  color: var(--accent);
  background: rgba(213, 177, 95, 0.08);
  font-variant-numeric: tabular-nums;
}

.adaptive-summary {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.adaptive-summary p {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: rgba(255, 255, 255, 0.025);
}

.number-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.wheel-map {
  position: relative;
  width: min(100%, 320px);
  aspect-ratio: 1;
  margin: 8px auto 18px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #15130f 0 34%, transparent 35%),
    repeating-conic-gradient(from -4deg, rgba(213, 177, 95, 0.08) 0deg 4deg, transparent 4deg 9.73deg);
}

.wheel-map::before {
  content: "";
  position: absolute;
  inset: 22%;
  border: 1px solid rgba(213, 177, 95, 0.28);
  border-radius: 50%;
}

.wheel-number {
  --radius: 43%;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  transform:
    rotate(var(--angle))
    translateY(calc(-1 * var(--radius)))
    rotate(calc(-1 * var(--angle)))
    translate(-50%, -50%);
  border: 1px solid color-mix(in srgb, var(--accent) calc(var(--heat) * 70%), var(--line));
  border-radius: 50%;
  color: var(--text);
  background: color-mix(in srgb, var(--accent) calc(var(--heat) * 34%), #12110e);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.wheel-number.active-sector {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 2px rgba(88, 164, 123, 0.18);
}

.sector-summary {
  display: grid;
  gap: 8px;
}

.sector-summary p {
  margin: 0;
  border: 1px solid var(--line);
  background: #15130f;
  padding: 9px 10px;
  color: var(--muted);
}

.sector-summary strong {
  color: var(--text);
}

.jump-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.jump-stats article,
.jump-summary p {
  border: 1px solid var(--line);
  background: #15130f;
  padding: 10px;
}

.jump-stats span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.76rem;
}

.jump-stats strong {
  display: block;
  font-size: 1.05rem;
  color: var(--text);
}

.jump-summary {
  display: grid;
  gap: 8px;
}

.jump-summary p {
  margin: 0;
  color: var(--muted);
}

.jump-summary strong {
  color: var(--text);
}

.number-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) calc(var(--heat) * 70%), var(--line));
  background: color-mix(in srgb, var(--accent) calc(var(--heat) * 32%), #12110e);
}

.number-cell strong,
.number-cell span {
  display: block;
  line-height: 1;
  text-align: center;
}

.number-cell strong {
  font-size: 1rem;
}

.number-cell span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.75rem;
}

.note {
  border-color: rgba(88, 164, 123, 0.5);
}

.note strong {
  color: #8ed6ad;
}

.note p {
  margin: 8px 0 0;
}

@media (max-width: 1050px) {
  .shell {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  .shell {
    width: min(100% - 20px, 1440px);
    padding: 10px 0;
  }

  .topbar,
  .panel-header {
    display: grid;
  }

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

  .session-actions {
    justify-content: stretch;
  }

  .session-actions button {
    width: 100%;
  }

  .controls,
  .metrics,
  .report-grid,
  .live-entry {
    grid-template-columns: 1fr;
  }

  .number-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
