:root {
  color-scheme: light;
  --bg: #f8fafc;
  --bg-soft: rgba(255, 255, 255, 0.88);
  --card: rgba(255, 255, 255, 0.94);
  --line: rgba(148, 163, 184, 0.24);
  --text: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-2: #4f46e5;
  --success: #22c55e;
  --error: #ef4444;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 22rem),
    radial-gradient(circle at top right, rgba(79, 70, 229, 0.12), transparent 18rem),
    linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
  color: var(--text);
  font: 16px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: var(--accent);
  text-decoration: none;
}

.shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.topbar,
.card,
.auth-card,
.hero-card,
.alert {
  backdrop-filter: blur(18px);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-chip,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0 0.85rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.16);
  color: #1d4ed8;
  font-size: 0.92rem;
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
}

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

.small {
  font-size: 0.86rem;
}

.lead {
  max-width: 42rem;
  font-size: 1.05rem;
  color: #334155;
}

.auth-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.5rem;
  align-items: stretch;
}

.hero-card,
.auth-card,
.card {
  padding: 1.6rem;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
}

.hero-list {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
  color: #334155;
}

.stack {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field span {
  font-size: 0.94rem;
  color: #334155;
}

.field input {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 0.95rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
}

.field input[type="file"] {
  min-height: 3rem;
  padding: 0.5rem 0.75rem;
}

.field input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.65);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16);
}

.mode-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin: 0;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.mode-switch legend {
  padding: 0 0.3rem;
  font-size: 0.94rem;
  color: #334155;
}

.mode-switch label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  color: #334155;
}

.is-hidden {
  display: none !important;
}

.button {
  min-height: 3rem;
  padding: 0 1rem;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

.button-secondary {
  background: rgba(241, 245, 249, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: var(--text);
}

.alert {
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
}

.alert.compact {
  margin-bottom: 0;
}

.alert-success {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.2);
}

.alert-error {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.18);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.5rem;
}

.card-span-2 {
  grid-column: span 2;
}

.card-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.table-list,
.transcript-grid {
  display: grid;
  gap: 0.85rem;
}

.table-row,
.transcript-card {
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.9);
}

.result-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.result-link:hover {
  color: var(--accent-2);
}

.modal-open {
  overflow: hidden;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
}

.modal-dialog {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100% - 2rem));
  margin: 4rem auto;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 1rem 1rem 1.25rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.modal-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
}

.modal-content {
  margin: 0.8rem 0 0;
  max-height: 60vh;
  overflow: auto;
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(248, 250, 252, 0.96);
  color: #1e293b;
  white-space: pre-wrap;
  word-break: break-word;
}

.transcript-card code {
  display: block;
  margin-top: 0.75rem;
  color: #1d4ed8;
  word-break: break-all;
}

@media (max-width: 960px) {
  .auth-layout,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .card-span-2 {
    grid-column: span 1;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }
}
