:root {
  --bg: #0c0d0f;
  --bg-elevated: #16171a;
  --bg-soft: #1f2024;
  --accent: #f5b45c;
  --accent-soft: rgba(245, 180, 92, 0.18);
  --accent-strong: #ffcb7a;
  --text: #f5f5f3;
  --text-soft: #a5a7ab;
  --border-subtle: #2b2c31;
  --danger: #f27c7c;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.55);
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Helvetica Neue", Arial, sans-serif;
}

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
}

body {
  -webkit-font-smoothing: antialiased;
}

#app {
  height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at top, #191a1e 0, #050506 60%);
  padding: 10px 12px 12px;
}

/* Identity / Seed strip */
.identity-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  background: linear-gradient(
      120deg,
      rgba(245, 180, 92, 0.07),
      rgba(245, 180, 92, 0.0)
    ),
    rgba(10, 10, 12, 0.85);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  margin-bottom: 8px;
  min-height: 56px;
}

.identity-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.identity-name {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.identity-role {
  font-size: 12px;
  color: var(--text-soft);
  opacity: 0.9;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.identity-reroll {
  border: none;
  outline: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  background: rgba(245, 180, 92, 0.16);
  color: var(--accent-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

/* Main Layout */
.main {
  flex: 1;
  display: flex;
  position: relative;
  margin-top: 6px;
  margin-bottom: 8px;
}

.panel {
  position: absolute;
  inset: 0;
  padding: 8px 2px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(10px);
  transition: opacity 200ms ease, transform 200ms ease;
  display: flex;
  flex-direction: column;
}

.panel-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

/* Prompt / Today */
.prompt-card {
  background: radial-gradient(circle at top left, #26272e 0, #111217 60%);
  border-radius: var(--radius-lg);
  padding: 14px 14px 12px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(245, 180, 92, 0.2);
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.prompt-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-strong);
  margin-bottom: 6px;
}

.prompt-text {
  font-size: 15px;
  line-height: 1.35;
  color: var(--text);
}

/* Response Area */
.response-area {
  margin-top: 10px;
  background: rgba(17, 18, 23, 0.95);
  border-radius: var(--radius-lg);
  padding: 10px 12px 10px;
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.choice-btn {
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(245, 180, 92, 0.25);
  background: rgba(10, 10, 12, 0.7);
  color: var(--text-soft);
  font-size: 13px;
  padding: 6px 10px;
  text-align: left;
  cursor: pointer;
}

.choice-btn.choice-btn-selected {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.response-input {
  width: 100%;
  resize: none;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: rgba(7, 8, 10, 0.9);
  padding: 7px 9px;
  color: var(--text);
  font-size: 13px;
  outline: none;
}

.response-input::placeholder {
  color: rgba(165, 167, 171, 0.65);
}

.response-actions {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.primary-btn,
.ghost-btn {
  flex: 1;
  height: 34px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  border: none;
  outline: none;
  cursor: pointer;
}

.primary-btn {
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: #231409;
  font-weight: 600;
}

.ghost-btn {
  background: rgba(20, 21, 25, 0.95);
  color: var(--text-soft);
  border: 1px solid var(--border-subtle);
}

/* Status */
.system-status {
  margin-top: 6px;
  min-height: 20px;
  font-size: 11px;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  gap: 6px;
}

.system-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-strong);
  box-shadow: 0 0 8px rgba(245, 180, 92, 0.8);
}

.system-status-dot.system-status-dot-busy {
  animation: pulse 1.1s ease-in-out infinite;
}

.system-status-err {
  color: var(--danger);
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.95;
  }
  50% {
    transform: scale(0.85);
    opacity: 0.4;
  }
  100% {
    transform: scale(1);
    opacity: 0.95;
  }
}

/* Timeline */
.timeline-list {
  flex: 1;
  border-radius: var(--radius-lg);
  background: rgba(14, 15, 19, 0.95);
  padding: 10px 10px 8px;
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden; /* avoid scrolling page; list is compact */
}

.timeline-empty {
  font-size: 13px;
  color: var(--text-soft);
  opacity: 0.8;
}

.timeline-item {
  border-radius: 12px;
  background: rgba(24, 25, 30, 0.95);
  padding: 8px 9px;
  border: 1px solid rgba(245, 180, 92, 0.12);
}

.timeline-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.timeline-tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-strong);
}

.timeline-time {
  font-size: 10px;
  color: var(--text-soft);
}

.timeline-narrative {
  font-size: 12px;
  line-height: 1.35;
  color: var(--text);
}

.timeline-choice {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-soft);
}

/* Seed Panel */
.seed-intro {
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 8px;
}

.seed-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.seed-custom {
  margin-top: 10px;
  padding: 9px 10px 10px;
  border-radius: var(--radius-lg);
  background: rgba(11, 12, 15, 0.95);
  border: 1px dashed var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.seed-custom-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-soft);
}

.seed-custom-row {
  display: flex;
  gap: 6px;
}

.seed-input {
  flex: 1;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
  background: rgba(6, 7, 9, 0.95);
  padding: 6px 8px;
  font-size: 12px;
  color: var(--text);
  outline: none;
}

.seed-input::placeholder {
  color: rgba(165, 167, 171, 0.7);
}

.seed-input-full {
  width: 100%;
}

.seed-custom-btn {
  margin-top: 2px;
  height: 32px;
  font-size: 12px;
}

.seed-card {
  border-radius: 14px;
  padding: 8px;
  background: rgba(18, 19, 23, 0.95);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.seed-card-title {
  font-size: 13px;
  font-weight: 600;
}

.seed-card-sub {
  font-size: 11px;
  color: var(--text-soft);
}

.seed-card-tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-strong);
}

/* Bottom nav */
.bottom-nav {
  display: flex;
  border-radius: var(--radius-pill);
  padding: 3px;
  background: rgba(10, 10, 12, 0.9);
  border: 1px solid rgba(33, 34, 39, 0.95);
}

.nav-btn {
  flex: 1;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--text-soft);
  font-size: 13px;
  padding: 7px 0;
  cursor: pointer;
}

.nav-btn-active {
  background: rgba(245, 180, 92, 0.18);
  color: var(--accent-strong);
}

/* Utility */
button:active {
  transform: translateY(0.5px);
}