:root {
  color-scheme: light;
  --bg: #eef2f7;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --surface-strong: #e9f1ff;
  --ink: #121826;
  --muted: #667085;
  --line: #d6deea;
  --primary: #315cff;
  --primary-dark: #2443c1;
  --accent: #00a887;
  --gold: #d68500;
  --warn: #a65f00;
  --good: #178a5e;
  --danger: #b83b35;
  --dark: #101827;
  --shadow: 0 20px 55px rgba(29, 41, 57, 0.14);
  --soft-shadow: 0 10px 28px rgba(29, 41, 57, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(49, 92, 255, 0.12), transparent 34%),
    linear-gradient(225deg, rgba(0, 168, 135, 0.13), transparent 32%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 52%, #e9eef6 100%);
  color: var(--ink);
  font-family: "Avenir Next", "SF Pro Display", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(16, 24, 39, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 24, 39, 0.035) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 78%);
}

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

button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-solid);
  color: var(--ink);
  min-height: 42px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 750;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

button:hover:not(:disabled) {
  border-color: var(--primary);
  box-shadow: var(--soft-shadow);
  transform: translateY(-1px);
}

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

button.primary {
  background: linear-gradient(135deg, var(--primary), #673df5);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 14px 24px rgba(49, 92, 255, 0.22);
}

button.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-dark), #5230d7);
}

.install-button {
  min-height: 30px;
  border-color: rgba(13, 107, 110, 0.22);
  background: #e7f6ed;
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-weight: 750;
}

.app-shell {
  width: min(1500px, calc(100vw - 32px));
  min-height: calc(100vh - 32px);
  margin: 16px auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.topbar,
.consent-panel,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.topbar {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 132px;
  padding: 22px 24px;
  background:
    linear-gradient(135deg, rgba(16, 24, 39, 0.98), rgba(32, 43, 66, 0.96)),
    var(--dark);
  border-color: rgba(255, 255, 255, 0.1);
  color: white;
}

.brand-lockup {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 250px;
}

.brand-logo {
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.28));
}

.signal-art {
  position: absolute;
  right: 250px;
  top: 14px;
  width: min(38vw, 420px);
  height: 110px;
  object-fit: cover;
  opacity: 0.82;
}

.topbar .status-strip {
  position: relative;
  z-index: 1;
}

.menu-button {
  display: inline-grid;
  place-items: center;
  gap: 4px;
  width: 38px;
  min-height: 38px;
  padding: 8px;
  border-color: rgba(143, 230, 208, 0.32);
  background: rgba(16, 24, 39, 0.52);
  box-shadow: none;
}

.menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #8ff5df;
}

.topbar .menu-button:hover {
  background: rgba(29, 211, 176, 0.14);
  box-shadow: none;
}

.nav-menu {
  position: absolute;
  z-index: 4;
  top: 76px;
  right: 24px;
  display: grid;
  gap: 6px;
  width: min(240px, calc(100vw - 48px));
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(16, 24, 39, 0.96);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
  padding: 8px;
  backdrop-filter: blur(18px);
}

.nav-menu button {
  justify-content: flex-start;
  border-color: transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  text-align: left;
}

.nav-menu button:hover,
.nav-menu button.active {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  transform: none;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar .eyebrow {
  color: #8fe6d0;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 2.2vw, 2.2rem);
  letter-spacing: 0;
  font-weight: 850;
}

h2 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

h3 {
  margin-bottom: 8px;
  font-size: 0.92rem;
}

.status-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pill,
.metric,
.score {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.topbar .pill {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.82);
}

.pill.live {
  background: #dcfce7;
  color: var(--good);
}

.topbar .pill.live {
  background: rgba(29, 211, 176, 0.16);
  color: #8ff5df;
}

.pill.warning,
.score.warning {
  background: #fff4e2;
  color: var(--warn);
}

.pill.error {
  background: #fdeceb;
  color: var(--danger);
}

.consent-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
}

.screen {
  display: grid;
  gap: 12px;
}

.screen-panel {
  min-height: 560px;
}

.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.screen-header .eyebrow {
  color: var(--primary);
}

.meeting-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.meeting-grid .session-item {
  grid-template-columns: 1fr;
  align-items: stretch;
  min-height: 132px;
}

.meeting-grid .session-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.debrief-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(260px, 1fr);
  gap: 12px;
}

.debrief-grid .screen-header,
.debrief-grid .wide {
  grid-column: 1 / -1;
}

.settings-list {
  display: grid;
  gap: 10px;
  max-width: 760px;
}

.setting-row {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 14px;
}

.setting-row span {
  color: var(--muted);
}

.consent-panel p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.4;
}

.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 460px;
  color: var(--ink);
  font-weight: 650;
}

.consent-check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(360px, 1fr) minmax(300px, 390px);
  gap: 12px;
  min-height: 0;
  flex: 1;
}

.panel {
  min-height: 0;
  padding: 16px;
}

.control-panel,
.coach-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.transcript-panel {
  display: flex;
  flex-direction: column;
}

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

.icon-button {
  width: 38px;
  min-height: 38px;
  padding: 0;
  font-size: 1.2rem;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

textarea,
select,
input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  padding: 10px;
  resize: vertical;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

textarea:focus,
select:focus,
input[type="text"]:focus,
button:focus-visible {
  outline: 3px solid rgba(13, 107, 110, 0.18);
  outline-offset: 2px;
}

.button-row,
.export-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.help-box {
  display: grid;
  gap: 4px;
  border: 1px solid #f1c980;
  border-radius: 8px;
  background: #fff8ea;
  color: #6e4400;
  padding: 10px;
  line-height: 1.35;
}

.help-box span {
  color: #7c5a23;
  font-size: 0.9rem;
}

.session-tools {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.panel-header.compact {
  margin-bottom: 0;
}

.session-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.session-empty {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.session-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  padding: 8px;
}

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

.session-title strong,
.session-title span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-title span {
  color: var(--muted);
  font-size: 0.76rem;
  margin-top: 2px;
}

.session-item button {
  min-height: 32px;
  padding: 0 9px;
  font-size: 0.82rem;
}

.interim {
  min-height: 52px;
  border: 1px dashed #aebced;
  border-radius: 8px;
  padding: 12px;
  color: #536179;
  background: linear-gradient(135deg, rgba(233, 241, 255, 0.88), rgba(255, 255, 255, 0.72));
  line-height: 1.45;
}

.transcript-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  margin: 12px 0 0;
  padding: 0;
}

.transcript-item {
  border-left: 3px solid var(--primary);
  background: rgba(255, 255, 255, 0.82);
  border-radius: 0 8px 8px 0;
  padding: 10px 12px;
  line-height: 1.48;
  box-shadow: 0 8px 20px rgba(29, 41, 57, 0.06);
}

.timestamp {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  margin-bottom: 4px;
}

.coach-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 8px 22px rgba(29, 41, 57, 0.06);
}

.coach-card:first-of-type {
  border-color: rgba(49, 92, 255, 0.26);
  background: linear-gradient(135deg, rgba(49, 92, 255, 0.1), rgba(29, 211, 176, 0.08), rgba(255, 255, 255, 0.86));
}

.coach-card p {
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 0;
}

.signal-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.35;
}

.coverage-list {
  display: grid;
  gap: 8px;
}

.coverage-item,
.scorecard-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 8px;
  align-items: start;
  color: var(--muted);
  line-height: 1.35;
}

.coverage-dot,
.scorecard-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line);
  margin-top: 2px;
}

.coverage-item.hit .coverage-dot,
.scorecard-item.good .scorecard-dot {
  border-color: var(--good);
  background: var(--good);
  box-shadow: 0 0 0 4px rgba(23, 138, 94, 0.12);
}

.scorecard-item.warn .scorecard-dot {
  border-color: var(--gold);
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(214, 133, 0, 0.14);
}

.scorecard-list {
  display: grid;
  gap: 8px;
}

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

.card-title-row h3 {
  margin-bottom: 0;
}

.card-title-row button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.draft-box {
  min-height: 160px;
  resize: vertical;
  color: var(--ink);
  line-height: 1.45;
}

@media (max-width: 1100px) {
  .signal-art {
    display: none;
  }

  .topbar {
    min-height: auto;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .debrief-grid {
    grid-template-columns: 1fr;
  }

  .control-panel,
  .coach-panel,
  .transcript-panel {
    min-height: 360px;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100vw - 16px, 1500px);
    margin: 8px auto;
  }

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

  .status-strip {
    justify-content: flex-start;
  }

  .nav-menu {
    top: auto;
    right: 16px;
    bottom: 16px;
    position: fixed;
  }

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

  .meeting-grid {
    grid-template-columns: 1fr;
  }

  .button-row,
  .export-grid {
    grid-template-columns: 1fr;
  }
}
