:root {
  --bg: #07111d;
  --bg2: #0c1c2f;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-strong: rgba(255, 255, 255, 0.1);
  --stroke: rgba(255, 255, 255, 0.12);
  --stroke-strong: rgba(85, 180, 255, 0.26);
  --text: #f6fbff;
  --muted: #a9bfd5;
  --blue: #55b4ff;
  --cyan: #6ff3ff;
  --green: #43d38d;
  --pink: #ff7ab6;
  --gold: #ffcd4d;
  --danger: #ff8f8f;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(85, 180, 255, 0.16), transparent 24%),
    radial-gradient(circle at bottom right, rgba(111, 243, 255, 0.12), transparent 30%),
    linear-gradient(135deg, #08121f 0%, #0c1c2f 48%, #06111d 100%);
  color: var(--text);
}

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

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

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.shell {
  display: grid;
  grid-template-columns: 420px 1fr;
  min-height: 100vh;
}

.sidebar,
.content {
  padding: 28px;
}

.sidebar {
  background: rgba(3, 10, 18, 0.72);
  border-right: 1px solid var(--stroke);
  backdrop-filter: blur(20px);
  overflow-y: auto;
}

.content {
  display: grid;
  gap: 18px;
  align-content: start;
  overflow-y: auto;
}

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

.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  font-weight: 900;
  color: #07203a;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 16px 36px rgba(85, 180, 255, 0.26);
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 32px;
}

h2 {
  font-size: 34px;
  line-height: 1.06;
  letter-spacing: -0.03em;
}

h3 {
  font-size: 20px;
}

.text-blue {
  color: var(--blue);
}

.sidebar-copy,
.support-copy,
.hero-copy,
.result-text,
.stack-list,
.history-list,
.field span,
.status-card p {
  color: var(--muted);
}

.sidebar-copy {
  line-height: 1.6;
  margin: 18px 0 24px;
  font-size: 15px;
}

.support-copy,
.hero-copy {
  line-height: 1.55;
  margin-top: 12px;
}

.panel,
.hero-card,
.status-card,
.result-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel {
  padding: 20px;
  margin-bottom: 18px;
}

.hero-card,
.status-card,
.result-card {
  padding: 22px;
}

.panel-head,
.audio-header,
.result-header,
.hero-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.hero-top {
  align-items: start;
}

.hero-card {
  display: grid;
  gap: 18px;
}

.hero-badge {
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(85, 180, 255, 0.1);
  border: 1px solid rgba(85, 180, 255, 0.22);
  color: #dff2ff;
  font-weight: 700;
  white-space: nowrap;
}

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

.hero-point,
.mini-stat,
.directory-card,
.stack-item,
.history-item {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
}

.hero-point {
  padding: 16px;
}

.hero-point strong {
  display: block;
  margin-bottom: 6px;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(3, 10, 18, 0.58);
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--text);
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(85, 180, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(85, 180, 255, 0.12);
}

.badge,
.status-pill {
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 13px;
}

.badge {
  background: rgba(67, 211, 141, 0.12);
  border: 1px solid rgba(67, 211, 141, 0.24);
  color: #d7ffee;
}

.badge.neutral {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--muted);
}

.badge.recording {
  background: rgba(255, 122, 182, 0.12);
  border-color: rgba(255, 122, 182, 0.3);
  color: #ffe3f1;
}

.audio-actions,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

button {
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 120ms ease, border-color 120ms ease, opacity 120ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

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

.primary {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #07203a;
}

.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px dashed rgba(255, 255, 255, 0.16);
}

.compact {
  padding: 11px 14px;
  border-radius: 14px;
}

.wide {
  width: 100%;
}

.upload {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
}

.audio-preview {
  width: 100%;
  margin-bottom: 14px;
}

.directory-list,
.history-list,
.stack-list,
.stat-strip,
.result-grid,
.detail-grid,
.patient-board {
  display: grid;
  gap: 14px;
}

.directory-list {
  max-height: 340px;
  overflow-y: auto;
  padding-right: 4px;
}

.directory-card {
  width: 100%;
  padding: 16px;
  text-align: left;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.directory-card:hover {
  border-color: rgba(85, 180, 255, 0.24);
}

.directory-card.active {
  border-color: var(--stroke-strong);
  background: linear-gradient(180deg, rgba(85, 180, 255, 0.16), rgba(255, 255, 255, 0.06));
  box-shadow: 0 14px 32px rgba(85, 180, 255, 0.12);
}

.directory-card strong,
.stack-item strong,
.history-item strong {
  display: block;
  margin-bottom: 6px;
}

.directory-top,
.history-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.directory-meta,
.history-meta {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}

.directory-summary {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 14px;
}

.status-pill {
  padding: 7px 10px;
  border: 1px solid transparent;
}

.status-complete {
  background: rgba(67, 211, 141, 0.12);
  border-color: rgba(67, 211, 141, 0.26);
  color: #c8f9df;
}

.status-processing,
.status-transcribing {
  background: rgba(85, 180, 255, 0.12);
  border-color: rgba(85, 180, 255, 0.24);
  color: #d9f0ff;
}

.status-failed {
  background: rgba(255, 143, 143, 0.14);
  border-color: rgba(255, 143, 143, 0.28);
  color: #ffd4d4;
}

.status-draft,
.status-default {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--muted);
}

.patient-board {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.patient-card-wide {
  grid-column: 1 / -1;
}

.stat-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.mini-stat {
  padding: 16px;
}

.mini-stat span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.mini-stat strong {
  font-size: 18px;
}

.status-card {
  display: grid;
  gap: 12px;
}

.result-grid,
.detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.soap-pill {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #08131f;
}

.soap-s { background: #ffc2d7; }
.soap-o { background: #bce4ff; }
.soap-a { background: #ffe0a8; }
.soap-p { background: #bff5d8; }

.result-text {
  white-space: pre-wrap;
  line-height: 1.58;
  margin-top: 14px;
}

.stack-item,
.history-item {
  padding: 14px 16px;
}

.history-meta {
  margin-top: 4px;
}

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

.empty {
  color: #8ea5bb;
}

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

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

  .sidebar,
  .content {
    overflow: visible;
  }

  .hero-top,
  .panel-head,
  .audio-header,
  .result-header,
  .history-top,
  .directory-top {
    flex-direction: column;
    align-items: start;
  }

  .hero-points,
  .patient-board,
  .result-grid,
  .detail-grid,
  .stat-strip {
    grid-template-columns: 1fr;
  }
}
