:root {
  color-scheme: light;
  --ink: #212529;
  --muted: #707070;
  --line: #dce4ee;
  --soft: #f6f9fd;
  --panel: #ffffff;
  --brand: #1560bd;
  --brand-dark: #0f4087;
  --accent: #05b6ef;
  --gold: #f2c94c;
  --danger: #b42318;
  --good: #16803c;
  --shadow: 0 18px 48px rgba(21, 96, 189, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 6% 4%, rgba(5, 182, 239, 0.15), transparent 28%),
    linear-gradient(180deg, #f8fbff 0, #ffffff 42%, #eef5ff 100%);
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.app-shell {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
}

.side-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  color: #f8fbfa;
  background:
    linear-gradient(145deg, rgba(18, 58, 118, 0.96), rgba(21, 96, 189, 0.94)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 14px);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-logo {
  width: 122px;
  height: auto;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  object-fit: contain;
}

.brand h1,
.topbar h2,
.panel h3,
.score-panel h3 {
  margin: 0;
  letter-spacing: 0;
}

.brand h1 {
  font-size: 18px;
}

.brand p,
.side-note,
.eyebrow,
.muted-copy {
  margin: 0;
  color: var(--muted);
}

.brand p,
.side-note {
  color: rgba(248, 251, 250, 0.72);
  font-size: 13px;
}

.steps {
  display: grid;
  gap: 8px;
}

.step-link {
  color: rgba(248, 251, 250, 0.78);
  text-decoration: none;
  padding: 10px 12px;
  border-left: 3px solid transparent;
}

.step-link.active,
.step-link:hover {
  color: #ffffff;
  border-left-color: var(--gold);
  background: rgba(255, 255, 255, 0.1);
}

.side-note {
  margin-top: auto;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.35;
}

.status-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--gold);
}

.workspace {
  padding: 28px;
  display: grid;
  gap: 22px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.topbar h2 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.03;
  max-width: 780px;
}

.topbar-copy {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.top-actions,
.panel-heading,
.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.input-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 18px;
}

.transcript-panel {
  grid-column: 1 / -1;
}

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

.panel {
  padding: 18px;
}

.panel-heading {
  margin-bottom: 14px;
}

.panel h3,
.score-panel h3 {
  font-size: 19px;
}

.panel h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

label {
  display: block;
  margin: 12px 0 6px;
  color: #34444d;
  font-size: 13px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid #cdd7dd;
  border-radius: 6px;
  background: #fbfcfc;
  color: var(--ink);
  outline: none;
}

input {
  height: 42px;
  padding: 0 11px;
}

textarea {
  min-height: 188px;
  resize: vertical;
  padding: 11px;
  line-height: 1.45;
}

input:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(5, 182, 239, 0.18);
}

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

.file-row input {
  height: auto;
  max-width: 260px;
  padding: 8px;
  background: var(--soft);
}

.file-label {
  margin: 0;
}

.primary-button,
.ghost-button,
.icon-button {
  min-height: 38px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: 800;
}

.primary-button {
  margin-top: 14px;
  color: white;
  background: var(--brand);
}

.primary-button:hover {
  background: var(--brand-dark);
}

.ghost-button,
.icon-button {
  color: var(--brand-dark);
  border-color: #b9d2ef;
  background: #f7fbff;
}

.icon-button {
  width: 38px;
  padding: 0;
}

.danger {
  color: var(--danger);
  border-color: #f0b8b4;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: rgba(5, 182, 239, 0.14);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.tag.muted {
  color: #5c6670;
  background: #edf1f3;
}

.review-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
}

.score-panel {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 20px;
  grid-column: 1 / -1;
}

.score-ring {
  width: 132px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--brand) calc(var(--score) * 1%), #e4edf8 0);
  display: grid;
  place-items: center;
  position: relative;
}

.score-ring::after {
  content: "";
  width: 92px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: white;
  position: absolute;
}

.score-ring span {
  position: relative;
  z-index: 1;
  font-size: 28px;
  font-weight: 900;
}

.stacked-output {
  display: grid;
  gap: 10px;
}

.output-block {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
}

.output-block strong {
  display: block;
  margin-bottom: 5px;
}

.question-list,
.manager-summary,
.split-output ul {
  margin: 0;
  padding-left: 20px;
}

.question-list li,
.manager-summary li,
.split-output li {
  margin: 8px 0;
  line-height: 1.42;
}

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

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
  background: white;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: #41525d;
  background: #f6f8f9;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

tr:last-child td {
  border-bottom: 0;
}

.summary-panel,
.standings-panel {
  grid-column: 1 / -1;
}

.fit-yes {
  color: var(--good);
}

.fit-potential {
  color: var(--gold);
}

.fit-no {
  color: var(--danger);
}

#toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(560px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 6px;
  color: white;
  background: rgba(23, 32, 38, 0.94);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

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

  .side-panel {
    position: static;
    height: auto;
  }

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

  .step-link {
    border-left: 0;
    border-bottom: 3px solid transparent;
    text-align: center;
  }

  .input-grid,
  .review-layout,
  .split-output {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .workspace {
    padding: 18px;
  }

  .topbar,
  .top-actions,
  .panel-heading,
  .file-row {
    align-items: stretch;
    flex-direction: column;
  }

  .steps,
  .two-col,
  .score-panel {
    grid-template-columns: 1fr;
  }

  .score-panel {
    justify-items: start;
  }

  .file-row input {
    max-width: none;
  }
}
