/* Hansard AI - premium light interface */

:root {
  --page: #F6F8FB;
  --paper: #FFFFFF;
  --paper-soft: #F8FAFC;
  --panel: #FFFFFF;
  --ink: #111827;
  --ink-soft: #334155;
  --muted: #64748B;
  --faint: #94A3B8;
  --line: #E2E8F0;
  --line-strong: #CBD5E1;
  --brand: #2563EB;
  --brand-strong: #1D4ED8;
  --teal: #0F766E;
  --sage: #475569;
  --gold: #D97706;
  --blue: #1E3A8A;
  --raw: #F1F5F9;
  --shadow-sm: 0 2px 12px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 18px 48px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 24px 70px rgba(15, 23, 42, 0.12);
  --ring: 0 0 0 3px rgba(37, 99, 235, 0.16);

  --serif: "Lora", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

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

html {
  font-size: 14px;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0) 360px),
    radial-gradient(circle at 16% 0%, rgba(37, 99, 235, 0.12), transparent 340px),
    radial-gradient(circle at 86% 12%, rgba(15, 118, 110, 0.10), transparent 360px),
    var(--page);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button:focus-visible,
input:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.mono {
  font-family: var(--mono);
}

.serif {
  font-family: var(--serif);
}

.italic {
  font-style: italic;
}

.chrome-bar {
  min-height: 42px;
  padding: 8px clamp(16px, 4vw, 38px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(226, 232, 240, 0.86);
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(22px);
}

.chrome-title {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 15px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
  border: 1px solid rgba(226, 232, 240, 0.96);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.70);
  box-shadow: var(--shadow-sm);
}

.chrome-mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--teal));
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  flex: none;
}

.status-row {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 48px;
  padding: 9px clamp(16px, 4vw, 38px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.86);
  background: rgba(246, 248, 251, 0.84);
  backdrop-filter: blur(22px);
}

.status-left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.4;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
  flex: none;
}

.status-dot.live {
  background: var(--brand);
  animation: dot-pulse 1.8s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.14);
  }
}

.status-label {
  color: var(--ink-soft);
  font-weight: 600;
}

.status-label.live {
  color: var(--brand);
}

.status-sep {
  color: var(--line-strong);
}

.status-detail {
  min-width: 0;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-right {
  display: flex;
  align-items: center;
  flex: none;
}

.btn-stop {
  min-height: 36px;
  padding: 7px 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--brand);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.btn-stop svg {
  width: 10px;
  height: 10px;
}

.btn-stop:hover {
  border-color: rgba(37, 99, 235, 0.42);
  background: #FFFFFF;
  transform: translateY(-1px);
}

.content {
  width: min(100%, 1480px);
  min-height: 0;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 34px) clamp(14px, 4vw, 38px) 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.session-header {
  position: relative;
  margin-bottom: 20px;
  padding: clamp(18px, 2.8vw, 28px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  border: 1px solid rgba(226, 232, 240, 0.94);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.72)),
    var(--paper);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.session-header::after {
  content: "";
  position: absolute;
  inset: auto 22px 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(203, 213, 225, 0.84), transparent);
}

.session-copy {
  min-width: 0;
}

.eyebrow {
  margin-bottom: 9px;
  color: var(--brand);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.wordmark-row {
  margin-bottom: 7px;
}

.wordmark {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(36px, 4.5vw, 60px);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.feather {
  width: clamp(24px, 3.6vw, 36px);
  height: clamp(24px, 3.6vw, 36px);
  flex: none;
  color: var(--brand);
  filter: drop-shadow(0 7px 12px rgba(37, 99, 235, 0.14));
}

.subtitle {
  max-width: 48rem;
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.55;
}

.audio-notice {
  width: fit-content;
  max-width: min(100%, 46rem);
  margin-top: 12px;
  padding: 9px 12px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--ink-soft);
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.06);
  font-size: 12px;
  line-height: 1.45;
}

.notice-dot {
  width: 7px;
  height: 7px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
  flex: none;
}

.stats-line {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
}

.stat-dot {
  color: var(--line-strong);
}

.session-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tool-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(226, 232, 240, 0.96);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow-sm);
}

.tool-btn {
  min-height: 34px;
  padding: 7px 12px;
  color: var(--ink-soft);
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, opacity 0.16s ease;
}

.tool-btn:hover:not(:disabled) {
  color: var(--brand);
  background: rgba(37, 99, 235, 0.08);
}

.tool-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.control-row {
  display: flex;
  align-items: center;
}

.btn-start {
  min-height: 48px;
  padding: 12px 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.22);
  cursor: pointer;
  transition: box-shadow 0.16s ease, opacity 0.16s ease, transform 0.16s ease;
}

.btn-start svg {
  flex: none;
}

.btn-start:hover {
  box-shadow: 0 20px 38px rgba(37, 99, 235, 0.28);
  transform: translateY(-1px);
}

.btn-start:active {
  transform: translateY(0);
}

.btn-start:disabled {
  opacity: 0.56;
  cursor: wait;
  transform: none;
}

.waveform {
  height: 48px;
  min-width: 112px;
  padding: 8px 12px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  border: 1px solid rgba(226, 232, 240, 0.96);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.90);
  box-shadow: var(--shadow-sm);
}

.bar {
  width: 4px;
  height: 18%;
  flex: none;
  border-radius: 999px;
  background: var(--line-strong);
  opacity: 0.54;
  transition: height 0.08s ease, opacity 0.22s ease, background 0.22s ease;
}

.bar.live-0,
.bar.live-3,
.bar.live-6,
.bar.live-9 {
  background: var(--brand);
}

.bar.live-1,
.bar.live-4,
.bar.live-7,
.bar.live-10 {
  background: var(--teal);
}

.bar.live-2,
.bar.live-5,
.bar.live-8,
.bar.live-11 {
  background: #38BDF8;
}

.mobile-tabs {
  display: none;
}

.panels {
  min-height: 0;
  padding-bottom: 20px;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(280px, 0.88fr) minmax(360px, 1.32fr);
  gap: 20px;
}

.panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
}

.panel-head {
  min-height: 62px;
  padding: 14px 18px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: none;
}

.panel-title-group {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.panel-kicker {
  color: var(--faint);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.panel-label {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.1;
}

.scroll-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
}

.scroll-toggle input {
  width: 13px;
  height: 13px;
  accent-color: var(--brand);
}

.panel-body {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.panel-body::-webkit-scrollbar {
  width: 6px;
}

.panel-body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--line-strong);
}

.panel.raw {
  border: 1px solid rgba(226, 232, 240, 0.96);
  background: rgba(241, 245, 249, 0.92);
  box-shadow: var(--shadow-sm);
}

.panel.raw .panel-head {
  border-bottom: 1px solid rgba(226, 232, 240, 0.84);
  background: rgba(255, 255, 255, 0.68);
}

.panel.raw .panel-body {
  padding: 15px 18px 18px;
}

.raw-line {
  padding: 6px 0;
  color: #64748B;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
}

.raw-line:last-child.active::after {
  content: "|";
  margin-left: 2px;
  color: var(--brand);
  animation: cursor-blink 1s step-start infinite;
}

@keyframes cursor-blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.panel.clean {
  position: relative;
  border: 1px solid rgba(226, 232, 240, 0.96);
  background: var(--panel);
  box-shadow: var(--shadow-lg);
}

.panel.clean .panel-head {
  border-bottom: 1px solid rgba(226, 232, 240, 0.86);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.82));
}

.panel.clean .panel-kicker {
  color: var(--brand);
}

.panel.clean .panel-body {
  padding: 22px clamp(20px, 3.1vw, 36px) 28px;
  background: var(--paper);
}

.empty-state {
  min-height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.empty-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--brand);
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 14px;
  background: rgba(37, 99, 235, 0.07);
  font-size: 10px;
  font-weight: 800;
}

.empty-title {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.empty-copy {
  max-width: 23rem;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.clean-empty .empty-icon {
  color: var(--teal);
  border-color: rgba(15, 118, 110, 0.16);
  background: rgba(15, 118, 110, 0.07);
}

.clean-entry {
  position: relative;
  margin-bottom: 20px;
  padding-left: 16px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.82;
  overflow-wrap: anywhere;
  word-break: normal;
}

.clean-entry::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  bottom: 0.42em;
  width: 3px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.18);
}

.clean-entry:last-child {
  margin-bottom: 0;
}

.clean-speaker {
  color: var(--brand);
  font-weight: 700;
}

.placeholder {
  padding: 5px 0;
  color: var(--faint);
  font-size: 13px;
  line-height: 1.65;
}

.panel.clean .placeholder {
  color: var(--muted);
  font-family: var(--serif);
  font-size: 15px;
  font-style: italic;
}

.site-footer {
  min-height: 40px;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
  border-top: 1px solid rgba(226, 232, 240, 0.86);
  background: rgba(255, 255, 255, 0.76);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 50;
  max-width: calc(100vw - 32px);
  padding: 10px 14px;
  color: #FFFFFF;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.92);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.22);
  font-size: 11px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.footer-sep {
  color: var(--line-strong);
}

.footer-credit strong {
  color: var(--brand);
  font-weight: 700;
}

@media (max-width: 940px) {
  html,
  body {
    height: auto;
  }

  body {
    min-height: 100svh;
  }

  .content {
    overflow: visible;
    min-height: auto;
  }

  .session-header {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 18px;
    border-radius: 18px;
  }

  .session-actions {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .tool-actions {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }

  .tool-btn {
    flex: 1;
  }

  .mobile-tabs {
    margin-bottom: 13px;
    padding: 4px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    border: 1px solid rgba(226, 232, 240, 0.96);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow-sm);
  }

  .tab-btn {
    min-height: 38px;
    border: 0;
    border-radius: 999px;
    color: var(--muted);
    background: transparent;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
  }

  .tab-btn.active {
    color: #FFFFFF;
    background: linear-gradient(135deg, var(--ink), var(--blue));
    box-shadow: 0 8px 18px rgba(23, 32, 51, 0.18);
  }

  .panels {
    display: block;
    padding-bottom: 14px;
  }

  .panel {
    min-height: min(63svh, 640px);
  }

  .panel.raw {
    display: none;
  }

  .panels.show-raw .panel.raw {
    display: flex;
  }

  .panels.show-raw .panel.clean {
    display: none;
  }

  .clean-entry {
    font-size: 16px;
  }
}

@media (max-width: 560px) {
  .chrome-bar {
    justify-content: flex-start;
    padding-inline: 12px;
  }

  .chrome-title {
    padding-inline: 10px;
    font-size: 9px;
  }

  .status-row {
    align-items: flex-start;
    padding: 9px 12px;
  }

  .status-left {
    flex-wrap: wrap;
    row-gap: 4px;
  }

  .status-detail {
    max-width: 100%;
    white-space: normal;
  }

  .content {
    padding: 18px 12px 0;
  }

  .wordmark {
    font-size: 36px;
  }

  .audio-notice {
    width: 100%;
  }

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

  .tool-actions {
    order: 2;
  }

  .control-row {
    order: 1;
    width: 100%;
  }

  .btn-start {
    width: 100%;
  }

  .waveform {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .panel-head {
    min-height: 46px;
    padding-inline: 13px;
  }

  .panel.clean .panel-body {
    padding: 18px 16px 22px;
  }

  .clean-entry {
    padding-left: 13px;
    font-size: 15.5px;
    line-height: 1.74;
  }

  .site-footer {
    display: none;
  }

  .toast {
    bottom: 14px;
  }
}
