:root {
  color-scheme: light;
  --bg: #eef1f4;
  --panel: #ffffff;
  --panel-2: #f7f8fa;
  --ink: #17202a;
  --muted: #667085;
  --line: #d5dbe3;
  --line-strong: #aeb8c6;
  --accent: #0f766e;
  --accent-2: #be123c;
  --gold: #b45309;
  --blue: #2563eb;
  --shadow: 0 18px 38px rgba(20, 31, 44, 0.12);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), transparent 280px),
    var(--bg);
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

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

.topbar {
  align-items: center;
  background: #111827;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  min-height: 78px;
  padding: 14px 18px;
}

.topbar h1,
.panel h2,
.score-panel h2 {
  margin: 0;
}

.topbar h1 {
  font-size: 1.65rem;
  font-weight: 760;
  line-height: 1;
}

.eyebrow {
  color: #9ed7d1;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.transport {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.workspace-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(290px, 360px) minmax(0, 1fr);
  margin-top: 14px;
}

.panel,
.score-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  min-width: 0;
  padding: 16px;
}

.panel-header,
.score-header {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel h2,
.score-panel h2 {
  font-size: 1rem;
  font-weight: 780;
}

.panel-section {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 14px;
}

.section-title {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.section-title h3 {
  font-size: 0.84rem;
  margin: 0;
  text-transform: uppercase;
}

.icon-button,
.text-button {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  display: inline-flex;
  font-weight: 760;
  justify-content: center;
  min-height: 38px;
  text-decoration: none;
  transition:
    transform 0.12s ease,
    border-color 0.12s ease,
    background 0.12s ease;
}

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

.text-button {
  padding: 0 13px;
}

.icon-button:hover,
.text-button:hover {
  background: #f7fbfb;
  border-color: var(--accent);
}

.icon-button:active,
.text-button:active {
  transform: translateY(1px);
}

.primary,
.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.primary:hover,
.accent:hover {
  background: #0b615b;
  color: #ffffff;
}

.disabled-link {
  cursor: not-allowed;
  opacity: 0.56;
  pointer-events: none;
}

.count-pill {
  background: #e7f5f3;
  color: #0b615b;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 8px;
  white-space: nowrap;
}

.upload-panel {
  align-self: start;
}

.upload-dropzone {
  align-items: center;
  background: #23303d;
  border: 1px solid #18232d;
  color: #ffffff;
  display: grid;
  gap: 8px;
  justify-items: center;
  min-height: 180px;
  padding: 18px;
  text-align: center;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    transform 0.12s ease;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragging {
  background: #2c3a48;
  border-color: var(--accent);
}

.upload-dropzone:active {
  transform: translateY(1px);
}

.upload-dropzone input {
  height: 1px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 1px;
}

.upload-dropzone strong {
  font-size: 1.05rem;
  font-weight: 820;
}

.upload-dropzone small {
  color: #c9d3dd;
  font-size: 0.78rem;
  font-weight: 700;
}

.upload-mark {
  align-items: center;
  background: #ffffff;
  border: 1px solid #c9d3dd;
  color: var(--ink);
  display: inline-flex;
  font-size: 1rem;
  font-weight: 850;
  height: 58px;
  justify-content: center;
  width: 58px;
}

.file-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
}

.file-card strong {
  display: block;
  font-size: 0.94rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.meta-label {
  color: var(--muted);
  display: block;
  font-size: 0.76rem;
  font-weight: 800;
  margin-bottom: 4px;
  text-transform: uppercase;
}

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

.action-button {
  margin-top: 12px;
  width: 100%;
}

.status-banner {
  display: none;
  line-height: 1.45;
  margin-top: 12px;
  padding: 10px 12px;
}

.status-banner.show {
  display: block;
}

.status-banner.warn {
  background: #fff8df;
  border: 1px solid #e7c15d;
}

.status-banner.error {
  background: #fff0f0;
  border: 1px solid #ef9a9a;
}

.status-banner.ok {
  background: #e8f7ef;
  border: 1px solid #84c9a4;
}

.step-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.step-item {
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
  padding: 9px 10px;
}

.step-item.active {
  background: #fff8df;
  border-color: #e7c15d;
  color: var(--ink);
}

.step-item.done {
  background: #e8f7ef;
  border-color: #84c9a4;
  color: #0b615b;
}

.score-panel {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 110px);
}

.score-actions {
  display: flex;
  gap: 8px;
}

.segmented-actions {
  background: var(--panel-2);
  border: 1px solid var(--line);
  padding: 4px;
}

.segmented-actions .text-button {
  border-color: transparent;
  min-height: 32px;
}

.segmented-actions .text-button.selected {
  background: #e7f5f3;
  border-color: var(--accent);
  color: #0b615b;
}

.muted {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 4px 0 0;
}

.pdf-shell {
  background: #f9fafb;
  border: 1px solid var(--line);
  display: grid;
  flex: 1;
  min-height: 640px;
  overflow: hidden;
  position: relative;
}

.pdf-frame {
  background: #ffffff;
  border: 0;
  display: block;
  height: 100%;
  min-height: 640px;
  width: 100%;
}

.pdf-frame[hidden],
.empty-state[hidden] {
  display: none;
}

.empty-state {
  align-items: center;
  color: var(--muted);
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 24px;
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.empty-state span {
  font-size: 0.82rem;
  font-weight: 700;
}

@media (max-width: 980px) {
  .workspace-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .score-panel {
    min-height: 620px;
  }
}

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

  .topbar,
  .panel-header,
  .score-header {
    align-items: stretch;
    flex-direction: column;
  }

  .transport,
  .score-actions {
    justify-content: flex-start;
  }

  .pdf-shell,
  .pdf-frame {
    min-height: 520px;
  }

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