:root {
  --bg: #091017;
  --panel: rgba(14, 22, 29, 0.94);
  --panel-soft: rgba(255, 255, 255, 0.035);
  --line: rgba(182, 210, 220, 0.12);
  --text: #f3f5f7;
  --muted: #96a8b4;
  --accent: #62d8b4;
  --accent-strong: #8ef4d2;
  --warning: #ffbe6a;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
  --radius-xl: 26px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --font-display: "Barlow Condensed", sans-serif;
  --font-body: "Inter", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(62, 140, 118, 0.18), transparent 28%),
    linear-gradient(180deg, #071018 0%, #09131b 48%, #071018 100%);
  color: var(--text);
  font-family: var(--font-body);
}

body {
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  padding: 16px 16px 8rem;
}

.ambient {
  position: fixed;
  border-radius: 999px;
  filter: blur(58px);
  opacity: 0.22;
  pointer-events: none;
}

.ambient-one {
  top: 0;
  left: -4rem;
  width: 12rem;
  height: 12rem;
  background: rgba(98, 216, 180, 0.2);
}

.ambient-two {
  right: -5rem;
  top: 5rem;
  width: 14rem;
  height: 14rem;
  background: rgba(130, 146, 255, 0.12);
}

.topbar,
.hero-card,
.stack-card,
.question-card,
.settings-panel,
.peek-sheet {
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 32rem;
  margin: 0 auto 14px;
  padding: 6px 0 10px;
}

.eyebrow,
.section-label,
.status-label,
.question-state {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.68rem;
  color: var(--muted);
}

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: 0.96;
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(2.3rem, 8vw, 3rem);
}

h2 {
  font-size: clamp(1.65rem, 6vw, 2rem);
}

h3 {
  font-size: clamp(1.3rem, 5vw, 1.6rem);
}

h4 {
  font-size: clamp(1.2rem, 5vw, 1.55rem);
}

.workspace {
  max-width: 32rem;
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

.hero-card,
.stack-card,
.question-card,
.settings-panel,
.peek-sheet {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-card,
.stack-card,
.question-card,
.settings-panel {
  padding: 18px;
}

.hero-card,
.hero-copy,
.session-banner-copy {
  display: grid;
  gap: 8px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-meta-item {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
}

.progress-shell {
  max-width: 32rem;
  margin: 0 auto;
}

.progress-bar {
  height: 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 25%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(98, 216, 180, 0.82), rgba(142, 244, 210, 1));
  transition: width 220ms ease;
}

.progress-label {
  margin-top: 8px;
  color: #d7e0e5;
  font-size: 0.9rem;
}

.flow-stack {
  display: grid;
  gap: 12px;
}

.panel-head {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.stage-card {
  opacity: 0.6;
  transition: opacity 180ms ease, border-color 180ms ease;
}

.stage-card.is-active {
  opacity: 1;
  border-color: rgba(142, 244, 210, 0.26);
}

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

label {
  display: grid;
  gap: 8px;
}

label span {
  color: #d8e0e5;
  font-size: 0.92rem;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(169, 199, 211, 0.18);
  border-radius: var(--radius-md);
  background: rgba(6, 13, 18, 0.72);
  color: var(--text);
  padding: 14px 15px;
  transition: border-color 180ms ease, background 180ms ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(142, 244, 210, 0.7);
  background: rgba(6, 14, 20, 0.92);
}

textarea {
  min-height: 104px;
  resize: vertical;
}

.quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.quick-tags button,
.options-grid button,
.ghost-button,
.primary-button,
.sheet-handle {
  border-radius: 16px;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.quick-tags button,
.options-grid button {
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--text);
  padding: 12px 14px;
}

.quick-tags button:hover,
.options-grid button:hover,
.ghost-button:hover,
.primary-button:hover,
.sheet-handle:hover {
  transform: translateY(-1px);
}

.voice-row,
.action-row,
.session-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.action-row {
  margin-top: 16px;
  justify-content: space-between;
}

.action-row.compact {
  margin-top: 0;
  justify-content: flex-end;
}

.primary-button,
.ghost-button,
.sheet-handle {
  border: 1px solid rgba(169, 199, 211, 0.18);
  padding: 13px 16px;
}

.primary-button {
  background: linear-gradient(135deg, rgba(98, 216, 180, 0.92), rgba(76, 174, 148, 0.92));
  color: #04110e;
  font-weight: 700;
  border-color: rgba(142, 244, 210, 0.45);
}

.ghost-button,
.sheet-handle {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.ghost-button.small,
.small-primary {
  padding: 10px 12px;
  font-size: 0.88rem;
}

.toggle {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: #dbe3e8;
}

.toggle input {
  width: auto;
  margin: 0;
}

.question-card {
  display: grid;
  gap: 14px;
}

#questionHint,
.case-text,
.summary-text {
  color: #d3dde3;
  line-height: 1.5;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.options-grid button {
  min-height: 72px;
  text-align: left;
  font-weight: 600;
}

.other-answer {
  display: grid;
  gap: 12px;
}

.peek-sheet {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 10px;
  z-index: 5;
  padding: 10px;
  border-radius: 24px;
  transform: translateY(calc(100% - 82px));
  transition: transform 240ms ease, border-color 180ms ease;
}

.peek-sheet.is-open {
  transform: translateY(0);
  border-color: rgba(142, 244, 210, 0.3);
}

.sheet-handle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  text-align: left;
}

.sheet-grab {
  width: 34px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  flex: 0 0 auto;
}

.sheet-title-group {
  display: grid;
  gap: 4px;
  flex: 1;
}

.sheet-toggle-text {
  color: var(--accent-strong);
  font-weight: 700;
}

.sheet-body {
  display: grid;
  gap: 14px;
  padding: 16px 6px 4px;
}

.likelihood-list {
  display: grid;
  gap: 12px;
}

.likelihood-item {
  display: grid;
  gap: 8px;
}

.likelihood-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.likelihood-title {
  font-weight: 600;
}

.likelihood-value {
  color: var(--accent-strong);
  font-weight: 700;
}

.likelihood-bar {
  overflow: hidden;
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.likelihood-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(98, 216, 180, 0.85), rgba(141, 244, 211, 1));
}

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

.estimate-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: #dce5ea;
}

.estimate-row strong {
  text-align: right;
}

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

.settings-dialog {
  width: min(36rem, calc(100vw - 2rem));
  padding: 0;
  border: none;
  background: transparent;
}

.settings-dialog::backdrop {
  background: rgba(3, 8, 11, 0.72);
  backdrop-filter: blur(8px);
}

.settings-panel {
  display: grid;
  gap: 16px;
}

.settings-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.settings-note {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-soft);
  color: #dbe4ea;
  line-height: 1.5;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

@media (min-width: 760px) {
  .app-shell {
    padding: 22px 22px 8rem;
  }

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

  .peek-sheet {
    left: max(22px, calc(50vw - 16rem));
    right: max(22px, calc(50vw - 16rem));
  }
}
