:root {
  --bg: #101114;
  --panel: #1a1c21;
  --panel-soft: #23262d;
  --line: #343842;
  --text: #f3f5f7;
  --muted: #aeb5c0;
  --brand: #27c4a6;
  --brand-dark: #15927b;
  --danger: #e85d5d;
  --warning: #f2c14e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

button,
.button-link {
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #061512;
  cursor: pointer;
  font-weight: 700;
  padding: 12px 16px;
  text-decoration: none;
}

button:hover,
.button-link:hover {
  background: #35d9ba;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #121419;
  color: var(--text);
  padding: 12px;
}

label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.home-body {
  display: grid;
  height: auto;
  min-height: 100vh;
  overflow: auto;
  place-items: center;
  padding: 24px;
}

.home-shell {
  width: min(980px, 100%);
}

.home-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(24px, 5vw, 56px);
}

.home-panel.compact {
  max-width: 560px;
  margin: 0 auto;
}

.eyebrow {
  color: var(--brand);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 8px;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.05;
}

.home-panel h1 {
  font-size: clamp(2.5rem, 8vw, 5.5rem);
}

.home-copy {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
  max-width: 650px;
}

.home-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.home-secondary-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.action-box {
  display: grid;
  gap: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.secondary {
  background: #2b3038;
  color: var(--text);
}

.secondary:hover {
  background: #3a404b;
}

.alert {
  background: rgba(232, 93, 93, 0.16);
  border: 1px solid rgba(232, 93, 93, 0.48);
  border-radius: 8px;
  color: #ffb4b4;
  margin-top: 18px;
  padding: 12px;
}

.meet-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  height: 100vh;
  max-height: 100vh;
  min-height: 0;
  padding: 16px;
  overflow: hidden;
}

.stage,
.transcript-panel {
  min-width: 0;
}

.stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 16px;
  min-height: 0;
  overflow: hidden;
}

.topbar,
.control-bar,
.transcript-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 16px 18px;
}

.topbar h1 {
  font-size: 1.35rem;
}

.session-meta {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 10px;
  font-weight: 700;
}

.topbar-link {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.9rem;
  padding: 7px 10px;
  text-decoration: none;
}

.topbar-link:hover {
  border-color: rgba(39, 196, 166, 0.55);
  color: #71f4dd;
}

.pill {
  background: rgba(39, 196, 166, 0.16);
  border: 1px solid rgba(39, 196, 166, 0.45);
  border-radius: 999px;
  color: #71f4dd;
  padding: 6px 10px;
  text-transform: capitalize;
}

.video-wrap {
  background: #07080a;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

video {
  background: #050608;
  display: block;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  width: 100%;
}

.permission-overlay {
  align-items: center;
  background: rgba(7, 8, 10, 0.88);
  display: grid;
  inset: 0;
  justify-items: center;
  padding: 24px;
  position: absolute;
  text-align: center;
}

.permission-overlay h2 {
  font-size: 1.5rem;
}

.permission-overlay p {
  color: var(--muted);
  max-width: 420px;
}

.hidden {
  display: none !important;
}

.timer {
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  font-size: 1.2rem;
  font-weight: 800;
  padding: 10px 12px;
  position: absolute;
  right: 16px;
  top: 16px;
}

.face-guide {
  border: 3px solid rgba(232, 93, 93, 0.88);
  border-radius: 999px;
  box-shadow: 0 0 0 999px rgba(232, 93, 93, 0.05), 0 0 22px rgba(232, 93, 93, 0.32);
  height: min(52%, 420px);
  left: 50%;
  pointer-events: none;
  position: absolute;
  top: 48%;
  transform: translate(-50%, -50%);
  width: min(34%, 320px);
  z-index: 1;
}

.face-guide-good {
  border-color: rgba(39, 196, 166, 0.95);
  box-shadow: 0 0 0 999px rgba(39, 196, 166, 0.04), 0 0 22px rgba(39, 196, 166, 0.42);
}

.face-guide-warn {
  border-color: rgba(39, 196, 166, 0.95);
  box-shadow: 0 0 0 999px rgba(39, 196, 166, 0.04), 0 0 22px rgba(39, 196, 166, 0.42);
}

.face-guide-bad {
  border-color: rgba(232, 93, 93, 0.95);
  box-shadow: 0 0 0 999px rgba(232, 93, 93, 0.06), 0 0 22px rgba(232, 93, 93, 0.4);
}

.recording-banner {
  align-items: center;
  background: rgba(16, 17, 20, 0.88);
  border: 1px solid rgba(39, 196, 166, 0.55);
  border-radius: 8px;
  bottom: 18px;
  display: flex;
  gap: 12px;
  left: 50%;
  max-width: min(520px, calc(100% - 36px));
  padding: 14px 16px;
  position: absolute;
  transform: translateX(-50%);
  z-index: 2;
}

.recording-banner p {
  color: var(--muted);
  line-height: 1.35;
  margin: 4px 0 0;
}

.recording-dot {
  background: var(--danger);
  border-radius: 999px;
  display: inline-block;
  height: 14px;
  width: 14px;
}

.face-warning {
  background: rgba(232, 93, 93, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
  left: 50%;
  max-width: min(520px, calc(100% - 36px));
  padding: 12px 16px;
  position: absolute;
  text-align: center;
  top: 18px;
  transform: translateX(-50%);
  z-index: 3;
}

.face-warning-good {
  background: rgba(39, 196, 166, 0.92);
  color: #061512;
}

.face-warning-warn {
  background: rgba(242, 193, 78, 0.94);
  color: #231b04;
}

.face-warning-bad {
  background: rgba(232, 93, 93, 0.92);
  color: #fff;
}

.control-bar {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 14px;
}

.control-btn,
.primary-control,
.danger-control,
.language-control {
  min-height: 46px;
}

.control-btn {
  background: #2b3038;
  color: var(--text);
}

.control-btn.off {
  background: var(--warning);
  color: #231b04;
}

.danger-control {
  background: var(--danger);
  color: #260707;
}

.danger-control:hover {
  background: #ff7777;
}

.language-control {
  max-width: 140px;
}

.transcript-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 14px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 16px;
}

.panel-header h2 {
  font-size: 1.2rem;
}

.share-box,
.answer-box,
.post-session-box {
  display: grid;
  gap: 10px;
}

.share-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.message {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.message.ai {
  background: rgba(39, 196, 166, 0.12);
}

.message.user {
  background: var(--panel-soft);
}

.message .role {
  color: var(--muted);
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.message p {
  line-height: 1.45;
  margin: 0;
  overflow-wrap: anywhere;
}

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

.post-session-box {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.post-session-box p {
  color: var(--muted);
  line-height: 1.35;
  margin: 0;
}

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

.preview-actions {
  grid-template-columns: 1fr 1fr 1fr;
  margin-top: 2px;
}

.preview-actions .button-link {
  text-align: center;
}

.sessions-panel h1 {
  font-size: clamp(2rem, 6vw, 4rem);
}

.sessions-header {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.session-list {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.session-card {
  align-items: center;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 16px;
}

.session-card p,
.empty-state {
  color: var(--muted);
  line-height: 1.4;
  margin: 6px 0 0;
}

.session-code {
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 800;
}

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

@media (max-width: 960px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .meet-shell {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .transcript-panel {
    height: min(620px, 80vh);
    min-height: 420px;
  }

  .video-wrap {
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 680px) {
  .home-actions,
  .answer-actions,
  .preview-actions,
  .session-card,
  .session-card-actions {
    grid-template-columns: 1fr;
  }

  .session-card-actions {
    display: grid;
  }

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

  .language-control {
    max-width: none;
  }

  .meet-shell {
    padding: 10px;
  }
}
