:root {
  color-scheme: light;
  --page-bg: radial-gradient(circle at top right, #fff4dc 0%, transparent 60%),
    radial-gradient(circle at 10% 20%, #d5eff7 0%, transparent 55%),
    linear-gradient(140deg, var(--bg-1), var(--bg-2));
  --blob-bg: linear-gradient(120deg, rgba(255, 144, 86, 0.15), rgba(60, 140, 136, 0.12));
  --bg-1: #f7f7f2;
  --bg-2: #e6f1f5;
  --bg-3: #fbf8f1;
  --ink: #1f1d1a;
  --muted: #6e6a63;
  --accent: #ff9056;
  --accent-2: #3c8c88;
  --accent-3: #f2d5a5;
  --card: #ffffff;
  --card-border: #e6ded1;
  --shadow: 0 20px 40px rgba(22, 18, 12, 0.12);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page-bg);
  font-family: "Space Grotesk", "Noto Sans SC", "Noto Sans TC", sans-serif;
  color: var(--ink);
}

.app {
  background: transparent;
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 24px clamp(16px, 4vw, 40px) 28px;
  gap: 20px;
}

.start-screen {
  position: fixed;
  inset: 0;
  background: rgba(247, 247, 242, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10;
  overflow-y: auto;
}

.start-screen.hidden {
  display: none;
}

.start-card {
  width: min(960px, 100%);
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  padding: 24px;
  display: grid;
  gap: 18px;
}

.start-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}

.start-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}

.start-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.start-controls select {
  border: 1px solid rgba(43, 111, 106, 0.25);
  background: rgba(247, 247, 242, 0.85);
  border-radius: 12px;
  padding: 8px 10px;
  font-weight: 600;
}

.start-header h1 {
  margin: 0;
  font-size: 26px;
}

.start-subtitle-inline {
  color: var(--muted);
  font-weight: 600;
}

.start-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.start-topline {
  grid-column: 1 / -1;
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(60, 140, 136, 0.08);
  border: 1px solid rgba(43, 111, 106, 0.2);
  color: #2f2b25;
  font-weight: 650;
}

.start-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

@media (max-width: 560px) {
  .start-header {
    grid-template-columns: 1fr;
  }

  .start-controls {
    justify-content: flex-start;
  }
}

.start-block h3,
.start-block h4 {
  margin: 0 0 10px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.start-list {
  margin: 0 0 16px;
  padding-left: 18px;
  color: #2f2b25;
  font-size: 14px;
}

.start-stats {
  display: grid;
  gap: 10px;
}

.stat-control {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #f8f1e4;
  border-radius: 12px;
  border: 1px solid #f0e1ca;
}

.stat-control .stat-name {
  font-weight: 600;
  font-size: 14px;
}

.stat-control .stat-value {
  font-weight: 700;
}

.stat-control .stat-buttons {
  display: flex;
  gap: 6px;
}

.stat-control button {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid #e0d2bc;
  background: #fff;
  font-weight: 700;
  padding: 0;
}

.start-remaining {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.start-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.start-hidden-list {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

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

.start-integrity-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.start-integrity select {
  flex: 1;
  min-width: 140px;
  max-width: 160px;
  margin-left: auto;
}

.start-integrity select {
  padding: 6px 10px;
}

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

.start-dev-branch-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.start-dev-branch select {
  flex: 1;
  min-width: 140px;
  max-width: 180px;
  margin-left: auto;
  padding: 6px 10px;
}

.start-hidden-item {
  display: flex;
  justify-content: space-between;
}

.app::before,
.app::after {
  content: "";
  position: fixed;
  width: 300px;
  height: 300px;
  border-radius: 999px;
  background: var(--blob-bg);
  filter: blur(2px);
  z-index: -1;
}

.app::before {
  top: -120px;
  left: -100px;
}

.app::after {
  bottom: -140px;
  right: -120px;
}

.app[data-lang="zh-Hans"] {
  font-family: "Noto Sans SC", "Space Grotesk", sans-serif;
}

.app[data-lang="zh-Hant"] {
  font-family: "Noto Sans TC", "Space Grotesk", sans-serif;
}

.app[data-lang="en"] {
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
}

body[data-theme="chibi"],
.app[data-theme="chibi"] {
  --page-bg: radial-gradient(circle at 15% 12%, rgba(255, 197, 228, 0.92) 0%, transparent 52%),
    radial-gradient(circle at 88% 18%, rgba(179, 231, 255, 0.92) 0%, transparent 54%),
    radial-gradient(circle at 18% 88%, rgba(200, 255, 214, 0.86) 0%, transparent 56%),
    radial-gradient(circle at 88% 86%, rgba(255, 245, 176, 0.78) 0%, transparent 58%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.9) 0%, transparent 60%),
    linear-gradient(140deg, #fff7fb, #f3fbff);
  --blob-bg: radial-gradient(circle at 30% 30%, rgba(255, 131, 204, 0.26), transparent 60%),
    radial-gradient(circle at 70% 70%, rgba(120, 214, 255, 0.24), transparent 62%),
    linear-gradient(120deg, rgba(255, 131, 204, 0.16), rgba(120, 214, 255, 0.14));
  --accent: #ff5fb0;
  --accent-2: #2bb8ff;
  --accent-3: #ffe07a;
  --card-border: rgba(31, 29, 26, 0.12);
  --shadow: 0 18px 42px rgba(22, 18, 12, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

body[data-theme="chibi"] .app::before,
body[data-theme="chibi"] .app::after {
  filter: blur(1px);
  opacity: 0.95;
}

body[data-theme="chibi"] .app::before {
  width: 240px;
  height: 240px;
  top: -110px;
  left: -120px;
}

body[data-theme="chibi"] .app::after {
  width: 260px;
  height: 260px;
  bottom: -160px;
  right: -150px;
}

.app[data-theme="chibi"] button.primary {
  box-shadow: 0 12px 26px rgba(255, 98, 182, 0.38);
}

.app[data-theme="chibi"] button.primary:hover {
  transform: translateY(-1px);
}

.app[data-theme="chibi"] button.primary:active {
  transform: translateY(0);
}

.app[data-theme="chibi"] .chat-message.is-you .chat-content {
  background: rgba(255, 98, 182, 0.13);
  border-color: rgba(255, 98, 182, 0.24);
}

.app[data-theme="chibi"] .chat-content {
  background: rgba(255, 255, 255, 0.94);
}

.app[data-theme="chibi"] .mention {
  background: rgba(52, 177, 255, 0.2);
  border-color: rgba(52, 177, 255, 0.24);
}

.app[data-theme="chibi"] .person {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(31, 29, 26, 0.1);
}

.app[data-theme="chibi"] .topbar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.82));
  border-color: rgba(31, 29, 26, 0.1);
}

.app[data-theme="chibi"] .topbar::after {
  content: "";
  position: absolute;
  top: -10px;
  right: 18px;
  width: 86px;
  height: 28px;
  border-radius: 999px;
  background: radial-gradient(circle at 12% 50%, rgba(255, 95, 176, 0.55) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(43, 184, 255, 0.45) 0%, transparent 42%),
    radial-gradient(circle at 86% 50%, rgba(255, 224, 122, 0.55) 0%, transparent 40%);
  opacity: 0.35;
  pointer-events: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
  position: relative;
  z-index: 8;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(140deg, var(--accent), #f1a56c);
  color: #fff;
  font-weight: 700;
  letter-spacing: 1px;
  display: grid;
  place-items: center;
}

.title {
  font-size: 20px;
  font-weight: 700;
}

.subtitle {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.status {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  text-align: center;
}

.day {
  font-weight: 600;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.career-pill {
  --career-h: 135;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: hsla(var(--career-h), 85%, 55%, 0.18);
  border: 1px solid hsla(var(--career-h), 75%, 45%, 0.28);
  color: hsl(var(--career-h), 40%, 22%);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.dev-estimate {
  font-size: 12px;
  font-weight: 600;
  color: rgba(18, 24, 38, 0.5);
  min-height: 16px;
}

#estimateToggleBtn {
  padding: 6px 10px;
}

.badges-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.badge {
  --badge-h: 24;
  padding: 4px 10px;
  border-radius: 999px;
  background: hsla(var(--badge-h), 85%, 55%, 0.18);
  border: 1px solid hsla(var(--badge-h), 75%, 45%, 0.25);
  color: hsl(var(--badge-h), 40%, 22%);
  font-size: 12px;
  font-weight: 600;
}

.badge-secondary {
  /* Keep for semantic grouping; color is driven by --badge-h. */
}

.controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.dev-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.75);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  user-select: none;
}

.dev-toggle input {
  width: 14px;
  height: 14px;
  accent-color: #27c93f;
}

select,
button {
  font-family: inherit;
}

select {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: #fff;
  font-weight: 600;
}

button {
  padding: 10px 16px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

button.small {
  padding: 8px 12px;
  font-size: 12px;
}

button.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(232, 106, 51, 0.35);
}

button.ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--card-border);
}

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

.layout {
  display: grid;
  grid-template-columns: minmax(228px, 270px) 1fr;
  gap: 18px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel {
  padding: 9px 9px 10px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
}

.panel-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}

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

.stat {
  display: grid;
  gap: 5px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
}

.integrity {
  display: grid;
  gap: 5px;
}

.integrity-line {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
}

.integrity-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
}

.stat-bar {
  height: 7px;
  border-radius: 999px;
  background: #efe8dc;
  overflow: hidden;
}

.stat-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--accent-2), #6bb0a8);
}

.stat-state {
  font-size: 11px;
  color: var(--muted);
}

.people,
.signals {
  display: grid;
  gap: 8px;
}

.person {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 8px;
  align-items: center;
  background: #fffaf1;
  padding: 6px 8px;
  border-radius: 12px;
  border: 1px solid #f3e9d6;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

.person-name {
  font-weight: 600;
  font-size: 13.5px;
}

.person-role {
  font-size: 12px;
  color: var(--muted);
}

.memory {
  margin-top: 4px;
  font-size: 11px;
  color: var(--accent-2);
}

.signal {
  font-size: 13px;
  background: #fffdf8;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px dashed #e2d7c3;
  color: var(--muted);
}

.main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stage {
  display: block;
}

.stage-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.scene {
  min-height: 140px;
}

.scene-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 8;
}

.scene-header-bar .scene-title {
  font-size: 18px;
  font-weight: 700;
}

.scene-header-bar .scene-meta {
  font-size: 12px;
  color: var(--muted);
}

.scene-header-bar .primary {
  padding: 10px 14px;
  min-width: 112px;
}

.scene-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  animation: floatIn 0.5s ease;
}

.scene-card.meeting::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: rgba(43, 111, 106, 0.08);
  right: -80px;
  top: -60px;
}

.scene-card.doc::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: rgba(232, 106, 51, 0.08);
  right: -80px;
  top: -60px;
}

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

.scene-title {
  font-size: 18px;
  font-weight: 700;
}

.scene-meta {
  font-size: 12px;
  color: var(--muted);
}

.scene-body {
  font-size: 14px;
  line-height: 1.5;
  color: #2f2b25;
}

.ending-skills-highlight {
  display: inline-block;
  margin-top: 4px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid rgba(232, 106, 51, 0.25);
  background: rgba(232, 106, 51, 0.08);
  font-weight: 700;
}

.scene-doc {
  margin-top: 12px;
  background: #f8f1e4;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #f0e1ca;
  font-size: 13px;
}

.scene-doc h4 {
  margin: 0 0 6px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.choices {
  display: grid;
  gap: 10px;
}

.choice {
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: #fffdf9;
  display: grid;
  gap: 6px;
  text-align: left;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.choice:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(22, 18, 12, 0.1);
}

.choice.locked {
  opacity: 0.6;
  cursor: not-allowed;
}

.choice-title {
  font-weight: 700;
  font-size: 14px;
}

.choice-desc {
  font-size: 13px;
  color: var(--muted);
}

.choice-lock {
  font-size: 11px;
  color: #b24a2e;
}

.outcome {
  min-height: 0;
}

.outcome-card {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(60, 140, 136, 0.08);
  border: 1px solid rgba(43, 111, 106, 0.2);
  font-size: 13px;
  animation: fadeIn 0.4s ease;
}

.outcome-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-message {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: start;
  animation: rise 0.5s ease;
}

.chat-message.is-you {
  grid-template-columns: 1fr 40px;
}

.chat-message.is-you .avatar {
  order: 2;
}

.chat-message.is-you .chat-content {
  order: 1;
  background: rgba(232, 106, 51, 0.08);
  border-color: rgba(232, 106, 51, 0.22);
  justify-self: end;
}

.chat-message.is-system .avatar {
  background: #2f2b25 !important;
}

.chat-content {
  background: #fffdf9;
  border-radius: 16px;
  padding: 10px 12px;
  border: 1px solid var(--card-border);
  box-shadow: 0 10px 24px rgba(22, 18, 12, 0.06);
  width: fit-content;
  max-width: min(640px, 78%);
}

.chat-header {
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
}

.chat-text {
  font-size: 13px;
  color: #2f2b25;
  white-space: pre-wrap;
  line-height: 1.45;
}

.chat-meta {
  font-size: 11px;
  color: var(--muted);
}

.chat-name {
  font-weight: 700;
  font-size: 13px;
}

.mention {
  display: inline-block;
  padding: 0 6px;
  border-radius: 8px;
  background: rgba(255, 144, 86, 0.16);
  border: 1px solid rgba(255, 144, 86, 0.2);
  font-weight: 700;
}

.chat-reactions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.chat-reaction {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(31, 29, 26, 0.06);
  border: 1px solid rgba(31, 29, 26, 0.08);
  font-size: 12px;
}

.chat-read {
  margin-top: 8px;
  font-size: 11px;
  color: rgba(110, 106, 99, 0.9);
}

.chat-typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.chat-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--muted);
  animation: pulse 1s ease infinite;
}

.chat-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.chat-dot:nth-child(3) {
  animation-delay: 0.4s;
}

.footer {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.94);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
}

.cliffhanger {
  font-size: 13px;
  color: var(--muted);
}

.skill-toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: 132px;
  width: min(560px, calc(100vw - 36px));
  border-radius: 18px;
  border: 1px solid rgba(43, 111, 106, 0.22);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 40px rgba(20, 20, 20, 0.18);
  backdrop-filter: blur(10px);
  padding: 16px 18px;
  z-index: 60;
}

.skill-toast .skill-toast-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(18, 24, 38, 0.12);
  background: rgba(255, 255, 255, 0.75);
  color: rgba(18, 24, 38, 0.7);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.skill-toast .skill-toast-close:hover {
  background: rgba(255, 255, 255, 0.9);
}

.skill-toast .skill-toast-title {
  font-weight: 800;
  font-size: 14px;
  margin: 0 0 6px;
}

.skill-toast .skill-toast-desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.skill-toast .skill-toast-meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.skill-toast.fade-out {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 260ms ease, transform 260ms ease;
}

.carrier-overlay {
  position: fixed;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.carrier-overlay.hidden {
  display: none;
}

.carrier-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 16, 0.35);
  backdrop-filter: blur(4px);
}

.carrier-panel {
  position: relative;
  width: min(980px, 96vw);
  max-height: min(86vh, 860px);
  overflow: auto;
  padding: 14px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.25);
}

.carrier-slot {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-overlay.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 16, 0.32);
  backdrop-filter: blur(5px);
}

.modal-panel {
  position: relative;
  width: min(720px, 96vw);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.22);
  padding: 16px 16px;
}

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

.modal-title {
  font-weight: 800;
  font-size: 16px;
}

.modal-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.modal-body {
  font-size: 13px;
  color: #2f2b25;
  line-height: 1.45;
}

.modal-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.modal-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(60, 140, 136, 0.08);
  border: 1px solid rgba(43, 111, 106, 0.18);
  font-weight: 650;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes pulse {
  0%,
  100% {
    transform: scale(0.8);
    opacity: 0.4;
  }
  50% {
    transform: scale(1);
    opacity: 0.9;
  }
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .status {
    align-items: flex-start;
    text-align: left;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .topbar {
    padding: 12px 14px;
  }

  .panel {
    padding: 12px;
  }

  .scene-card {
    padding: 14px 16px;
  }

  .choice {
    padding: 10px 12px;
  }

  .chat-message {
    grid-template-columns: 32px 1fr;
  }

  .chat-message.is-you {
    grid-template-columns: 1fr 32px;
  }

  .avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 12px;
  }
}
