:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f2f2f7;
  --surface-3: #e8e8ed;

  --border: rgba(0, 0, 0, 0.1);
  --border-warm: rgba(0, 113, 227, 0.25);

  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #86868b;

  --gold: #0071e3;
  --gold-light: #2997ff;
  --gold-dim: rgba(0, 113, 227, 0.08);
  --gold-focus: rgba(0, 113, 227, 0.5);

  --emerald: #34c759;
  --crimson: #ff3b30;
  --sapphire: #8e8e93;

  --r-sm: 7px;
  --r-md: 11px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 9999px;

  --font-display:
    'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body:
    'TASA Explorer', -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-float:
    0 0 0 1px rgba(0, 0, 0, 0.04), 0 24px 60px rgba(0, 0, 0, 0.12),
    0 8px 20px rgba(0, 0, 0, 0.08);

  --side-user: #0071e3;
  --side-user-line: rgba(0, 113, 227, 0.35);
  --side-ai: #d70015;
  --side-ai-soft: rgba(215, 0, 21, 0.07);
  --side-ai-line: rgba(215, 0, 21, 0.24);
}

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

html {
  height: 100%;
  width: 100%;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

html::-webkit-scrollbar {
  display: none;
}

body {
  height: 100%;
  width: 100%;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  overflow-x: hidden;
}

.app {
  position: relative;
  width: 100%;
  height: 100dvh;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

.app::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 80% 60% at 50% -10%,
    rgba(0, 113, 227, 0.05) 0%,
    transparent 60%
  );
  z-index: 0;
}

.screen {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-expo);
  z-index: 1;
  overflow-x: hidden;
}
.screen.active {
  opacity: 1;
  pointer-events: all;
}

.screen.active .intro-card,
.screen.active .debate-panel,
.screen.active .analysis-container {
  animation: screenRise 0.6s var(--ease-expo) both;
}

#introScreen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

.intro-card {
  position: relative;
  width: min(44rem, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: clamp(2rem, 1.5rem + 2.5vw, 2.75rem);
  box-shadow: var(--shadow-float);
  overflow: hidden;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.intro-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 6%,
    var(--gold) 38%,
    var(--gold-light) 50%,
    var(--gold) 62%,
    transparent 94%
  );
  opacity: 0.48;
}

.intro-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 180px;
  background: radial-gradient(
    ellipse 80% 100% at 50% 0%,
    rgba(0, 113, 227, 0.06) 0%,
    transparent 100%
  );
  pointer-events: none;
}

.eyebrow-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.8rem;
  position: relative;
  z-index: 1;
}

.eyebrow-line {
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, var(--gold), transparent);
  opacity: 0.35;
}

.eyebrow-line.right {
  background: linear-gradient(270deg, var(--gold), transparent);
}

.eyebrow-label {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pulse-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  animation: pulse 2.5s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 113, 227, 0.4);
  }
  50% {
    opacity: 0.7;
    transform: scale(0.85);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0);
  }
}

.intro-headline {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 2rem + 2.8vw, 3.2rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.intro-sub {
  font-size: clamp(0.9rem, 0.82rem + 0.32vw, 0.95rem);
  color: var(--ink-2);
  line-height: 1.65;
  margin-bottom: clamp(1.8rem, 1.2rem + 1.5vw, 2.4rem);
  max-width: 52ch;
  font-weight: 400;
  position: relative;
  z-index: 1;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  position: relative;
  z-index: 1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.field-label {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.text-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: var(--r-md);
  padding: 0.85rem 1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 400;
  outline: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
  appearance: none;
}

.text-input:focus {
  border-color: var(--gold-focus);
  box-shadow:
    0 0 0 3px rgba(0, 113, 227, 0.1),
    inset 0 1px 0 rgba(0, 113, 227, 0.05);
}

.text-input::placeholder {
  color: var(--ink-3);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.3rem;
}

.chip {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink-3);
  border-radius: var(--r-pill);
  padding: 0.3rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.chip:hover {
  border-color: var(--border-warm);
  color: var(--gold-light);
  background: var(--gold-dim);
}

.stance-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 3px;
  gap: 3px;
}

.stance-btn {
  background: transparent;
  border: none;
  color: var(--ink-3);
  border-radius: calc(var(--r-md) - 2px);
  padding: 0.7rem 1rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--ease-expo);
  position: relative;
  letter-spacing: 0.01em;
}

.stance-btn:hover:not(.active) {
  color: var(--ink-2);
  background: rgba(0, 0, 0, 0.04);
}

.stance-btn.active {
  background: var(--surface-3);
  color: var(--ink);
  box-shadow:
    0 1px 4px rgba(0, 0, 0, 0.1),
    inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.stance-btn.active[data-stance="FOR"]::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: var(--side-user);
}

.stance-btn.active[data-stance="AGAINST"]::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: var(--side-user);
}

.btn-primary {
  width: 100%;
  background: var(--side-user);
  color: #ffffff;
  border: none;
  border-radius: var(--r-md);
  padding: 0.92rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition:
    filter 0.15s ease,
    transform 0.12s ease,
    box-shadow 0.15s ease;
  box-shadow:
    0 6px 22px rgba(0, 0, 0, 0.18),
    0 1px 3px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
  margin-top: 0.15rem;
}

.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.14) 0%,
    transparent 60%
  );
  pointer-events: none;
}

.btn-primary:hover {
  filter: brightness(1.06);
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.22),
    0 1px 3px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: scale(0.98);
}
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: none;
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0.72rem 1.15rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.12s ease,
    box-shadow 0.16s ease;
  letter-spacing: 0.01em;
}

.btn-secondary:hover {
  background: var(--surface-3);
  border-color: rgba(0, 0, 0, 0.22);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.btn-secondary:active {
  transform: scale(0.98);
}

.error-box {
  display: none;
  padding: 0.75rem 1rem;
  border-radius: var(--r-md);
  border: 1px solid rgba(255, 59, 48, 0.3);
  background: rgba(255, 59, 48, 0.07);
  color: #d70015;
  font-size: 0.85rem;
  line-height: 1.5;
}
.error-box.show {
  display: block;
}

:focus-visible {
  outline: 2px solid var(--gold-focus);
  outline-offset: 2px;
}

#debateScreen {
  display: flex;
  flex-direction: column;
}

.debate-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  overflow: hidden;
  overflow-x: hidden;
  box-sizing: border-box;
}

.debate-header {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem clamp(1rem, 0.75rem + 1.2vw, 1.75rem);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.debate-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.debate-topic {
  font-family: var(--font-display);
  font-size: clamp(0.98rem, 0.85rem + 0.55vw, 1.08rem);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  word-break: break-word;
  flex: 1;
}

.round-tag {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.72rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
  flex-shrink: 0;
}

.debate-tags {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.stance-tag {
  background: transparent;
  border-color: var(--side-user-line);
  color: var(--side-user);
}

.progress-track {
  display: flex;
  gap: 4px;
  height: 2px;
}

.progress-pip {
  flex: 1;
  height: 100%;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.12);
  transition: background 0.4s ease;
  position: relative;
  overflow: hidden;
}

.progress-pip.done {
  background: rgba(29, 29, 31, 0.45);
}

.progress-pip.active {
  background: rgba(29, 29, 31, 0.1);
}

.progress-pip.active::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 35%;
  background: var(--ink);
  border-radius: inherit;
  animation: pipGlide 1.8s ease-in-out infinite alternate;
}

@keyframes pipGlide {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(186%);
  }
}

@keyframes screenRise {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: clamp(1.2rem, 0.9rem + 1vw, 1.6rem);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overscroll-behavior-y: contain;
  scroll-behavior: smooth;
  min-height: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.chat-area::-webkit-scrollbar {
  display: none;
}

.msg-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  animation: msgIn 0.35s var(--ease-expo) both;
}

@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.msg-row.ai {
  align-items: flex-start;
}
.msg-row.user {
  align-items: flex-end;
}

.msg-label {
  font-size: 0.63rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0 0.25rem;
}

.msg-row.ai .msg-label {
  color: var(--side-ai);
  opacity: 0.8;
}
.msg-row.user .msg-label {
  color: var(--side-user);
}

.bubble {
  max-width: min(68ch, 90%);
  padding: 0.85rem 1rem;
  line-height: 1.7;
  font-size: clamp(0.9rem, 0.83rem + 0.28vw, 0.94rem);
  white-space: pre-wrap;
  overflow-wrap: break-word;
  border-radius: var(--r-lg);
  font-weight: 400;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.bubble:hover {
  transform: translateY(-1px);
}

.msg-row.ai .bubble {
  background: var(--side-ai-soft);
  border: 1px solid var(--side-ai-line);
  border-bottom-left-radius: 3px;
  color: #1d1d1f;
}

.msg-row.user .bubble {
  background: var(--side-user);
  border: 1px solid var(--side-user);
  border-bottom-right-radius: 3px;
  color: #ffffff;
}

.thinking-bar {
  display: none;
  align-items: center;
  gap: 0.65rem;
  padding: 0 clamp(1.2rem, 0.9rem + 1vw, 1.6rem) 0.6rem;
  color: var(--ink-3);
  font-size: 0.8rem;
  font-weight: 400;
  flex-shrink: 0;
  letter-spacing: 0.01em;
}
.thinking-bar.show {
  display: flex;
}

.dots {
  display: inline-flex;
  gap: 3px;
}
.dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  animation: dotPulse 1.5s ease-in-out infinite both;
  opacity: 0.5;
}
.dots span:nth-child(2) {
  animation-delay: 0.18s;
}
.dots span:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes dotPulse {
  0%,
  80%,
  100% {
    transform: scale(0.5);
    opacity: 0.3;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.complete-banner {
  margin: 0 clamp(1.2rem, 0.9rem + 1vw, 1.6rem) 0.8rem;
  padding: 1.1rem 1.3rem;
  background: rgba(0, 113, 227, 0.08);
  border: 1px solid var(--border-warm);
  border-radius: var(--r-lg);
  flex-shrink: 0;
}

.complete-banner-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.complete-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1px solid var(--border-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.complete-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.complete-sub {
  font-size: 0.83rem;
  color: var(--ink-3);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.complete-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.complete-actions .btn-secondary,
.complete-actions .btn-primary {
  flex: 1;
  min-width: 9rem;
  width: auto;
  padding: 0.62rem 0.9rem;
  font-size: 0.84rem;
}

.debate-error-wrap {
  padding: 0 clamp(1.2rem, 0.9rem + 1vw, 1.6rem) 0.4rem;
  flex-shrink: 0;
}

.input-area {
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  flex-shrink: 0;
}

.input-row {
  display: flex;
  align-items: flex-end;
  gap: 0.65rem;
  padding: 0.85rem clamp(1rem, 0.75rem + 1vw, 1.5rem);
  padding-bottom: max(0.85rem, env(safe-area-inset-bottom, 0.85rem));
}

.msg-textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: var(--r-md);
  padding: 0.78rem 0.95rem;
  font-family: var(--font-body);
  font-size: 0.93rem;
  font-weight: 400;
  line-height: 1.6;
  outline: none;
  min-height: 2.9rem;
  max-height: 10rem;
  overflow-y: auto;
  scrollbar-width: none;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.msg-textarea:focus {
  border-color: var(--gold-focus);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.msg-textarea::placeholder {
  color: var(--ink-3);
}
.msg-textarea:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.send-btn {
  flex-shrink: 0;
  background: var(--side-user);
  color: #ffffff;
  border: none;
  border-radius: var(--r-md);
  width: 2.9rem;
  height: 2.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    filter 0.14s ease,
    transform 0.12s ease,
    box-shadow 0.14s ease;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.18);
  position: relative;
  overflow: hidden;
}

.send-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.18) 0%,
    transparent 60%
  );
}

.send-btn:hover:not(:disabled) {
  filter: brightness(1.1);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.24);
}

.send-btn:active:not(:disabled) {
  transform: scale(0.94);
}
.send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.send-btn img {
  position: relative;
  z-index: 1;
}

.input-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 clamp(1rem, 0.75rem + 1vw, 1.5rem) 0.55rem;
}

.hint-text {
  font-size: 0.66rem;
  color: var(--ink-3);
  letter-spacing: 0.03em;
}

.word-count {
  font-size: 0.66rem;
  color: var(--ink-3);
  opacity: 0;
  transition: opacity 0.15s ease;
  letter-spacing: 0.02em;
}
.word-count.visible {
  opacity: 1;
}

#analysisScreen {
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  box-sizing: border-box;
}

#analysisScreen::-webkit-scrollbar {
  display: none;
}

.analysis-container {
  width: min(58rem, 100%);
  margin: 0 auto;
  padding: clamp(1.5rem, 1rem + 2vw, 2.2rem);
  box-sizing: border-box;
  overflow-x: hidden;
}

.analysis-header {
  margin-bottom: clamp(1.75rem, 1.2rem + 2.2vw, 2.4rem);
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--border);
}

.analysis-kicker {
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.analysis-kicker::after {
  content: "";
  flex: 1;
  max-width: 3rem;
  height: 1px;
  background: var(--gold);
  opacity: 0.35;
}

.analysis-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 1.6rem + 2.4vw, 2.6rem);
  font-weight: 700;
  line-height: 1.04;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.analysis-lead {
  color: var(--ink-3);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-top: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.analysis-section {
  margin-bottom: 1.75rem;
}

.section-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.8rem;
}

.section-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.si-summary {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.14);
}
.si-strength {
  background: rgba(52, 199, 89, 0.12);
  border: 1px solid rgba(52, 199, 89, 0.2);
}
.si-weakness {
  background: rgba(255, 59, 48, 0.1);
  border: 1px solid rgba(255, 59, 48, 0.18);
}
.si-fallacy {
  background: rgba(0, 113, 227, 0.1);
  border: 1px solid rgba(0, 113, 227, 0.2);
}
.si-improve {
  background: rgba(142, 142, 147, 0.1);
  border: 1px solid rgba(142, 142, 147, 0.18);
}
.si-verdict {
  background: rgba(0, 113, 227, 0.12);
  border: 1px solid rgba(0, 113, 227, 0.22);
}

.section-label {
  font-size: 0.67rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.section-text {
  color: var(--ink);
  line-height: 1.75;
  font-size: 0.93rem;
  font-weight: 400;
}

.analysis-divider {
  height: 1px;
  background: var(--border);
  margin: 1.75rem 0;
}

.item-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  list-style: none;
}

.item-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--r-md);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink);
  font-weight: 400;
}

.item-list.strengths li {
  background: rgba(52, 199, 89, 0.06);
  border: 1px solid rgba(52, 199, 89, 0.14);
}
.item-list.weaknesses li {
  background: rgba(255, 59, 48, 0.05);
  border: 1px solid rgba(255, 59, 48, 0.13);
}
.item-list.fallacies li {
  background: rgba(0, 113, 227, 0.08);
  border: 1px solid rgba(0, 113, 227, 0.16);
}
.item-list.improve li {
  background: rgba(142, 142, 147, 0.05);
  border: 1px solid rgba(142, 142, 147, 0.12);
}

.item-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.55rem;
}

.strengths .item-dot {
  background: var(--emerald);
}
.weaknesses .item-dot {
  background: var(--crimson);
}
.fallacies .item-dot {
  background: var(--gold);
}
.improve .item-dot {
  background: var(--sapphire);
}

.score-hero {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.4rem 1.6rem;
  position: relative;
  overflow: hidden;
}

.score-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 60% 80% at 0% 50%,
    rgba(0, 113, 227, 0.08) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.score-ring {
  position: relative;
  width: 82px;
  height: 82px;
  flex-shrink: 0;
}

.score-ring svg {
  transform: rotate(-90deg);
}
.score-ring-track {
  fill: none;
  stroke: rgba(0, 0, 0, 0.16);
  stroke-width: 4;
}
.score-ring-fill {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  transition:
    stroke-dashoffset 1.5s var(--ease-expo),
    stroke 0.3s ease;
}

.score-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
}

.score-info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.score-eyebrow {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.score-big {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1;
}

.score-big.high {
  color: var(--emerald);
}
.score-big.mid {
  color: var(--gold-light);
}
.score-big.low {
  color: var(--crimson);
}
.score-big.none {
  color: var(--ink-3);
}

.score-caption {
  font-size: 0.83rem;
  color: var(--ink-2);
  line-height: 1.5;
}

.verdict-callout {
  background: rgba(0, 113, 227, 0.1);
  border: 1px solid var(--border-warm);
  border-left: 3px solid var(--gold);
  border-radius: var(--r-lg);
  padding: 1.1rem 1.25rem;
  color: var(--ink);
  line-height: 1.75;
  font-size: 0.93rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.analysis-nav {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  background: var(--bg);
  padding-bottom: max(1.2rem, env(safe-area-inset-bottom, 1.2rem));
  margin-top: 2rem;
}

.analysis-nav .btn-secondary {
  flex: 1;
  min-width: 11rem;
  text-align: center;
}

.retry-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--gold-dim);
  border: 1px solid var(--border-warm);
  color: var(--gold-light);
  border-radius: var(--r-sm);
  padding: 0.45rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  margin-top: 0.75rem;
  transition:
    background 0.14s ease,
    border-color 0.14s ease;
}

.retry-btn:hover {
  background: rgba(0, 113, 227, 0.16);
  border-color: rgba(0, 113, 227, 0.4);
}

.load-dots {
  display: inline-flex;
  gap: 3px;
  vertical-align: middle;
  margin-left: 4px;
}

.load-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink-3);
  animation: dotPulse 1.5s ease-in-out infinite both;
}

.load-dots span:nth-child(2) {
  animation-delay: 0.18s;
}
.load-dots span:nth-child(3) {
  animation-delay: 0.36s;
}

@media (max-width: 600px) {
  body {
    overflow: hidden;
  }

  .app {
    height: 100svh;
    height: 100dvh;
  }

  #introScreen {
    align-items: flex-start;
    padding: 0;
  }

  .intro-card {
    min-height: 100svh;
    border-radius: 0;
    border: none;
    box-shadow: none;
    overflow-y: auto;
    width: 100%;
    padding: 1.75rem 1.25rem 2.5rem;
  }

  .intro-card::before,
  .intro-card::after {
    display: none;
  }

  .bubble {
    max-width: 95%;
  }

  .complete-actions .btn-secondary,
  .complete-actions .btn-primary {
    min-width: 100%;
  }

  .analysis-nav .btn-secondary {
    min-width: 100%;
  }

  #analysisScreen .analysis-container {
    padding: 1.5rem 1.1rem;
  }

  .score-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

@media (min-width: 1025px) {
  .debate-panel {
    padding: 0.75rem 0.75rem 0;
    max-width: 900px;
  }

  .debate-header {
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }

  .chat-area,
  .thinking-bar,
  .debate-error-wrap,
  .complete-banner,
  .input-area {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }

  .input-area {
    border-radius: 0 0 var(--r-lg) var(--r-lg);
    border-bottom: 1px solid var(--border);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .app::after {
    display: none;
  }
}
