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

body {
  font-family: 'Righteous', sans-serif;
  background: #0a0a0a;
  color: #e0e0e0;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-text-size-adjust: 100%;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overscroll-behavior: none;
}

/* Lock scrolling only when actively writing */
body.writing-active, body.chat-active {
  overflow: hidden;
  height: 100vh;
  height: var(--vh, 100vh);
}

a { color: #c4a0ff; text-decoration: none; }
a:hover { color: #e0c8ff; }

/* ==================== Focus-visible ==================== */
:focus-visible {
  outline: 2px solid #7b2ff7;
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

.gallery-item:focus-visible {
  border-color: #7b2ff7;
  outline: 2px solid #7b2ff7;
  outline-offset: -2px;
}

code {
  background: #1a1a1a;
  padding: 2px 6px;
  border-radius: 3px;
  color: #c4a0ff;
}

/* ==================== Navbar ==================== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  height: 52px;
  flex-shrink: 0;
  border-bottom: 1px solid #222;
  background: #0a0a0a;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 22px;
  font-weight: bold;
  color: #fff;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-hamburger {
  display: block;
  background: none;
  border: none;
  color: #888;
  font-size: 26px;
  cursor: pointer;
  padding: 4px 8px;
  flex-shrink: 0;
}
.nav-hamburger:hover { color: #fff; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* ANKY TV button — psychedelic */
.anky-tv-btn {
  font-family: 'Righteous', sans-serif;
  font-size: 16px;
  padding: 6px 16px;
  border: 2px solid;
  text-decoration: none;
  font-weight: bold;
  letter-spacing: 1px;
  animation: anky-tv-glow 3s ease-in-out infinite;
  white-space: nowrap;
}

@keyframes anky-tv-glow {
  0%   { color: #ff3cac; border-color: #ff3cac; text-shadow: 0 0 8px #ff3cac44; }
  25%  { color: #784ba0; border-color: #784ba0; text-shadow: 0 0 8px #784ba044; }
  50%  { color: #2b86c5; border-color: #2b86c5; text-shadow: 0 0 8px #2b86c544; }
  75%  { color: #00ffa3; border-color: #00ffa3; text-shadow: 0 0 8px #00ffa344; }
  100% { color: #ff3cac; border-color: #ff3cac; text-shadow: 0 0 8px #ff3cac44; }
}

.anky-tv-btn:hover {
  background: #fff1;
  text-shadow: 0 0 16px currentColor;
}

/* ==================== Drawer ==================== */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 999;
}
.drawer-overlay.open { display: block; }

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  background: #0d0d0d;
  border-right: 1px solid #222;
  z-index: 1000;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.drawer.open { transform: translateX(0); }

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #222;
}

.drawer-logo {
  font-size: 24px;
  font-weight: bold;
  color: #fff;
  text-decoration: none;
}

.drawer-close {
  background: none;
  border: none;
  color: #666;
  font-size: 28px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.drawer-close:hover { color: #fff; }

.drawer-links {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}

.drawer-links a {
  padding: 14px 24px;
  color: #888;
  font-size: 16px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  border-bottom: 1px solid #1a1a1a;
}

.drawer-links a:hover {
  background: #1a1a2e;
  color: #c4a0ff;
}

.navbar a:focus-visible, .navbar button:focus-visible { outline: none; color: #c4a0ff; }

/* Nav auth — wallet button */
.nav-auth {
  font-size: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}


.wallet-btn {
  background: transparent;
  border: 1px solid #333;
  color: #666;
  font-family: 'Righteous', sans-serif;
  font-size: 12px;
  padding: 6px 14px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.wallet-btn:hover {
  color: #c4a0ff;
  border-color: #7b2ff7;
}

.wallet-btn.connected {
  color: #8a8;
  background: rgba(123, 47, 247, 0.08);
  border-color: #2a2a3a;
}

/* ==================== Writing ==================== */
.writing-container {
  height: calc(var(--vh, 100vh) - 52px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.writing-main {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#writing-area {
  flex: 1;
  min-height: 0;
  width: 100%;
  background: transparent;
  border: none;
  color: #e0e0e0;
  font-family: 'Righteous', sans-serif;
  font-size: 20px;
  padding: 40px;
  resize: none;
  outline: none;
  line-height: 1.8;
  overflow-y: auto;
  z-index: 2;
}

/* Applied from JS on first keystroke — inquiry stays above, reduce top gap */
#writing-area.writing-engaged {
  padding-top: 4px !important;
}

body.writing-active #writing-area,
body.chat-active #writing-area {
  padding-top: 12px;
}

/* ==================== Hero copy ==================== */
.hero-copy {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding-top: 20vh;
  text-align: center;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.hero-title {
  font-size: 32px;
  color: #c4a0ff;
  font-weight: normal;
  margin-bottom: 12px;
}

.hero-sub {
  font-size: 16px;
  color: #555;
  line-height: 1.6;
}

body.writing-active .hero-copy,
body.chat-active .hero-copy {
  opacity: 0;
  pointer-events: none;
  display: none;
}

@media (max-width: 768px) {
  .hero-copy { padding-top: 15vh; }
  .hero-title { font-size: 24px; }
  .hero-sub { font-size: 14px; padding: 0 20px; }
}

/* Backspace / blocked key flash */
@keyframes blocked-flash {
  0% { box-shadow: inset 0 0 0 0 rgba(123, 47, 247, 0); }
  30% { box-shadow: inset 0 0 30px 0 rgba(123, 47, 247, 0.08); }
  100% { box-shadow: inset 0 0 0 0 rgba(123, 47, 247, 0); }
}
#writing-area.blocked-flash {
  animation: blocked-flash 0.4s ease-out;
}

#writing-area::placeholder { color: #333; }

/* ==================== Session bottom bar ==================== */
.session-bar {
  flex-shrink: 0;
  height: 0;
  overflow: hidden;
  background: rgba(10,10,10,0.92);
  border-top: 1px solid #1a1a1a;
  position: relative;
  transition: height 0.3s;
}

body.writing-active .session-bar { height: 44px; }

.session-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #4a2ff7, #7b2ff7, #a06fff);
  transition: width 0.5s linear;
}

.session-progress.complete {
  box-shadow: 0 0 12px #7b2ff7, 0 0 24px rgba(123,47,247,0.4);
}

.session-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 24px;
  position: relative;
}

.session-comments {
  font-size: 14px;
  color: #4a9;
  margin-right: auto;
  opacity: 0;
  transition: opacity 0.5s;
}

.session-comments.visible { opacity: 1; }

.draft-recovery-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  background: rgba(4, 6, 11, 0.56);
  backdrop-filter: blur(12px);
}

.draft-recovery-banner {
  width: min(520px, 100%);
  padding: 20px;
  border-radius: 22px;
  border: 1px solid rgba(196, 160, 255, 0.2);
  background:
    radial-gradient(circle at top right, rgba(123, 47, 247, 0.18), rgba(123, 47, 247, 0) 36%),
    linear-gradient(180deg, rgba(15, 17, 28, 0.98), rgba(9, 10, 18, 0.98));
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
  color: #f4efff;
}

.draft-recovery-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.draft-recovery-kicker {
  color: #c4a0ff;
  font-family: 'Righteous', sans-serif;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.draft-recovery-message {
  margin: 0;
  color: #f7f3ff;
  font-size: 18px;
  line-height: 1.45;
}

.draft-recovery-preview-wrap {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.draft-recovery-preview-label {
  color: #998ab6;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.draft-recovery-preview {
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(196, 160, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #ddd3f1;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}

.draft-recovery-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.draft-resume-btn,
.draft-dismiss-btn {
  flex: 1;
  min-height: 46px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: 'Righteous', sans-serif;
  font-size: 14px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.draft-resume-btn {
  background: linear-gradient(135deg, #7b2ff7, #9a65ff);
  border-color: rgba(196, 160, 255, 0.46);
  color: #fff;
  box-shadow: 0 12px 28px rgba(123, 47, 247, 0.28);
}

.draft-resume-btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #8a47ff, #ab7bff);
}

.draft-dismiss-btn {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(196, 160, 255, 0.16);
  color: #d6cce8;
}

.draft-dismiss-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(196, 160, 255, 0.28);
}

.session-pause-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  z-index: 1;
}

.session-pause-btn[hidden] { display: none; }

.session-pause-btn span {
  width: 5px;
  height: 18px;
  border-radius: 999px;
  background: #b8b1c8;
  transition: background 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.session-pause-btn:hover span,
.session-pause-btn:focus-visible span {
  background: #c4a0ff;
}

.session-pause-btn.is-paused span {
  background: #7b2ff7;
  box-shadow: 0 0 10px rgba(123, 47, 247, 0.45);
}

.session-pause-btn:disabled:not(.is-paused) span {
  opacity: 0.45;
}

.session-stats {
  display: flex;
  gap: 18px;
  font-size: 22px;
  color: #777;
  align-items: center;
}

.session-stats .stat-dim { color: #555; }
.session-stats .stat-time-done { color: #c4a0ff; }

/* "anky accomplished" badge in session bar */
.anky-accomplished {
  color: #c4a0ff;
  font-size: 16px;
  letter-spacing: 1px;
  animation: accomplishedGlow 2s ease-in-out infinite alternate;
}

@keyframes accomplishedGlow {
  0% { text-shadow: 0 0 4px rgba(123, 47, 247, 0.3); }
  100% { text-shadow: 0 0 12px rgba(123, 47, 247, 0.6), 0 0 24px rgba(196, 160, 255, 0.2); }
}

/* Legacy .writing-stats — hidden, replaced by session-bar */
.writing-stats { display: none; }
.stat-dim { color: #333; }

.checkpoint-msg { display: none; }

/* ==================== Life bar ==================== */
#life-bar {
  position: absolute;
  top: 0;
  right: 0;
  height: 6px;
  width: 100%;
  z-index: 10;
  opacity: 0;
  transition: width 0.08s linear, opacity 0.3s ease;
  background: linear-gradient(90deg, #ff2200 0%, #ff6600 30%, #ffcc00 60%, #44ff00 100%);
  border-radius: 0 0 0 2px;
  box-shadow: 0 0 6px rgba(255, 68, 0, 0.5);
}

/* ==================== Immersive writing mode ==================== */
body.writing-active { overflow: hidden; }
body.writing-active .navbar { display: none; }
body.writing-active .drawer, body.writing-active .drawer-overlay { display: none; }
body.writing-active .landing { display: none; }
body.writing-active .writing-container {
  height: var(--vh, 100vh);
}

/* Chat mode — navbar visible, landing hidden, contained scroll */
body.chat-active .landing { display: none; }
body.chat-active .writing-container {
  height: calc(var(--vh, 100vh) - 52px);
  display: flex;
  flex-direction: column;
}
body.chat-active .writing-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* ==================== Chat bubbles ==================== */
.chat-container {
  display: none;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  flex: 1;
  min-height: 0;
  padding: 24px 40px 24px;
}

.chat-bubble {
  max-width: 85%;
  padding: 16px 20px;
  line-height: 1.8;
  font-size: 17px;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
  border-radius: 12px;
}

.chat-bubble.anky {
  white-space: normal;
  min-width: min(100%, 520px);
}

.chat-bubble.user {
  align-self: flex-end;
  background: #111;
  border: 1px solid #222;
  color: #999;
  font-size: 16px;
  border-bottom-right-radius: 4px;
}

.chat-bubble.user.collapsed {
  max-height: 200px;
  overflow: hidden;
  position: relative;
}

.chat-bubble.user.collapsed::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(transparent, #111);
  pointer-events: none;
}

.chat-bubble-expand {
  display: block;
  align-self: flex-end;
  background: none;
  border: 1px solid #333;
  color: #666;
  font-family: inherit;
  font-size: 12px;
  padding: 4px 12px;
  cursor: pointer;
  margin-top: 4px;
  transition: color 0.2s, border-color 0.2s;
}

.chat-bubble-expand:hover {
  color: #c4a0ff;
  border-color: #7b2ff7;
}

.chat-bubble.anky {
  align-self: flex-start;
  background: rgba(123, 47, 247, 0.06);
  border: 1px solid rgba(123, 47, 247, 0.15);
  color: #ccc;
  border-bottom-left-radius: 4px;
}

.anky-response-text { line-height: 1.8; }

.anky-notice-inline {
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(123, 47, 247, 0.15);
  border: 1px solid #7b2ff7;
  color: #c4a0ff;
}

.processing {
  color: #666;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.new-session-btn {
  align-self: center;
  margin-top: 8px;
  padding: 10px 24px;
  background: #7b2ff7;
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.new-session-btn:hover { background: #6020d0; }

/* Chat input area — pinned at bottom */
.chat-input-area {
  display: flex;
  gap: 8px;
  padding: 12px 40px;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  align-items: flex-end;
  flex-shrink: 0;
  background: #0a0a0a;
  border-top: 1px solid #1a1a1a;
}

.chat-input {
  flex: 1;
  padding: 10px 14px;
  background: #0f0f0f;
  border: 1px solid #222;
  color: #c4a0ff;
  font-family: 'Righteous', sans-serif;
  font-size: 15px;
  outline: none;
  resize: none;
  min-height: 44px;
  max-height: 200px;
  line-height: 1.6;
  border-radius: 8px;
  transition: border-color 0.2s;
  overflow-y: auto;
}

.chat-input:focus {
  border-color: #333;
}

.chat-input::placeholder {
  color: #333;
}

.chat-send-btn {
  padding: 10px 18px;
  background: #7b2ff7;
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  border-radius: 8px;
  flex-shrink: 0;
  height: 44px;
}

.chat-send-btn:hover { background: #6020d0; }
.chat-send-btn:disabled { opacity: 0.25; cursor: default; background: #333; }

/* Reply options */
.reply-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
  max-width: 680px;
  width: 100%;
  align-self: center;
}

.reply-options-loading {
  text-align: center;
  padding: 8px;
}

.reply-option-btn {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: rgba(123, 47, 247, 0.08);
  border: 1px solid rgba(123, 47, 247, 0.25);
  color: #c4a0ff;
  font-family: 'Righteous', sans-serif;
  font-size: 14px;
  cursor: pointer;
  border-radius: 10px;
  text-align: left;
  transition: background 0.2s, border-color 0.2s;
  line-height: 1.4;
}

.reply-option-btn:hover {
  background: rgba(123, 47, 247, 0.18);
  border-color: #7b2ff7;
}

.reply-option-custom {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: 1px dashed #333;
  color: #555;
  font-family: 'Righteous', sans-serif;
  font-size: 13px;
  cursor: pointer;
  border-radius: 10px;
  text-align: left;
  transition: color 0.2s, border-color 0.2s;
}

.reply-option-custom:hover {
  color: #888;
  border-color: #555;
}

.reply-custom-input {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

/* Anky chat title */
.anky-chat-title {
  font-size: 20px;
  font-weight: 600;
  color: #c4a0ff;
  margin-bottom: 14px;
}

/* Share link */
.anky-share-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  color: #7b2ff7;
  cursor: pointer;
  transition: color 0.2s;
}

.anky-share-link:hover { color: #c4a0ff; }

/* Session summary (shown when reflection fails) */
.session-summary {
  text-align: left;
}
.session-summary-header {
  font-size: 18px;
  font-weight: 600;
  color: #c4a0ff;
  margin-bottom: 12px;
}
.session-summary-stats {
  display: flex;
  gap: 6px;
  font-size: 14px;
  color: #a0a0b0;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.session-summary-stats .stat-dot { color: #555; }
.session-summary-writing {
  background: rgba(124, 47, 247, 0.08);
  border-left: 3px solid #7b2ff7;
  padding: 14px 16px;
  border-radius: 0 8px 8px 0;
  font-size: 14px;
  line-height: 1.7;
  color: #d0d0e0;
  margin-bottom: 16px;
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.session-summary-writing .writing-toggle {
  display: block;
  margin-top: 8px;
  background: none;
  border: none;
  color: #7b2ff7;
  cursor: pointer;
  font-size: 13px;
  padding: 0;
}
.session-summary-writing .writing-full-text { white-space: pre-wrap; }
.session-summary-note {
  font-size: 13px;
  color: #888;
  line-height: 1.5;
  margin-bottom: 14px;
}
.session-summary-retry {
  background: #7b2ff7;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}
.session-summary-retry:hover { background: #6520d0; }
.session-summary-retry:disabled { background: #444; cursor: default; }

.anky-share-link .copied { color: #4a9; }

/* Inline share buttons (replaces overlay on home page) */
.anky-inline-share {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.anky-inline-share-btn {
  padding: 8px 18px;
  background: #7b2ff7;
  color: #fff;
  border: none;
  font-family: 'Righteous', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.anky-inline-share-btn:hover { background: #6020d0; }

.anky-inline-share-dim {
  background: transparent;
  border: 1px solid #333;
  color: #888;
}

.anky-inline-share-dim:hover {
  background: transparent;
  border-color: #555;
  color: #ccc;
}

.reflection-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -4px 0 6px;
  padding-left: 2px;
}

.anky-detail-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.reflection-download-btn {
  padding: 9px 18px;
  background: rgba(123, 47, 247, 0.14);
  border: 1px solid rgba(123, 47, 247, 0.34);
  color: #d7c3ff;
  font-family: 'Righteous', sans-serif;
  font-size: 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.reflection-download-btn:hover:not(:disabled) {
  background: rgba(123, 47, 247, 0.24);
  border-color: #7b2ff7;
  color: #fff;
}

.reflection-download-btn:disabled {
  cursor: default;
  opacity: 0.55;
}

.reflection-download-hint {
  color: #7f7691;
  font-size: 12px;
}

/* Collapsible writing bubble */
.writing-collapsed { position: relative; }

.writing-toggle {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  color: #7b2ff7;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  padding: 0;
}

.writing-toggle:hover { color: #c4a0ff; }

/* Slide-in animation for chat bubbles */
@keyframes slideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-bubble { animation: slideIn 0.3s ease-out; }

/* Inline anky image */
.anky-chat-img {
  max-width: 100%;
  max-height: 400px;
  display: block;
}

.anky-image-skeleton {
  width: 300px;
  height: 300px;
  background: #111;
  border: 1px solid #222;
  position: relative;
  overflow: hidden;
}

.anky-image-skeleton .skeleton-pulse {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(123,47,247,0.08), transparent);
  animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ==================== Page headers ==================== */
.page-header {
  padding: 30px 40px 20px;
  border-bottom: 1px solid #222;
}

.page-header h2 { color: #fff; margin-bottom: 4px; }
.subtitle { color: #666; font-size: 14px; }

/* ==================== Gallery ==================== */
.gallery-filters {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.filter-btn {
  background: transparent;
  border: 1px solid #333;
  color: #888;
  padding: 4px 14px;
  border-radius: 14px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn:hover {
  border-color: #555;
  color: #ccc;
}

.filter-btn.active {
  background: #1a1a2e;
  border-color: #7b2ff7;
  color: #c4a0ff;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  padding: 30px 40px;
}

.gallery-item {
  border: 1px solid #222;
  overflow: hidden;
  transition: border-color 0.2s;
}

.gallery-item a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.gallery-item:hover { border-color: #7b2ff7; }

.gallery-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.gallery-item .placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-caption {
  padding: 12px;
  border-top: 1px solid #222;
}

.gallery-title {
  display: block;
  color: #fff;
  margin-bottom: 4px;
}

.gallery-thinker {
  display: block;
  color: #666;
  font-size: 12px;
}

.gallery-badge {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 3px;
  margin-bottom: 4px;
}

.gallery-badge.generated {
  background: #1a1a2e;
  color: #7b68ee;
  border: 1px solid #333;
}

.gallery-prompt {
  display: block;
  color: #999;
  font-size: 12px;
  line-height: 1.3;
}

/* Gallery tabs */
.gallery-tabs {
  display: flex;
  gap: 0;
  padding: 0 40px;
  border-bottom: 1px solid #222;
}

.gallery-tab {
  padding: 10px 20px;
  color: #555;
  font-size: 13px;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.gallery-tab:hover { color: #888; }
.gallery-tab.active { color: #c4a0ff; border-bottom-color: #7b2ff7; }

/* Written badge */
.gallery-badge.written {
  background: #0d1a12;
  color: #6ab07a;
  border: 1px solid #1a3322;
}

/* ==================== Slideshow / Lightbox ==================== */
.slideshow-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.slideshow-overlay.active {
  display: flex;
}

.slideshow-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: #888;
  font-size: 36px;
  cursor: pointer;
  z-index: 1001;
  line-height: 1;
  padding: 4px 8px;
  transition: color 0.2s;
}

.slideshow-close:hover { color: #fff; }

.slideshow-prev,
.slideshow-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #666;
  font-size: 48px;
  cursor: pointer;
  z-index: 1001;
  padding: 8px 16px;
  line-height: 1;
  transition: color 0.2s;
}

.slideshow-prev:hover,
.slideshow-next:hover { color: #fff; }

.slideshow-prev { left: 12px; }
.slideshow-next { right: 12px; }

.slideshow-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 700px;
  width: 90%;
  gap: 20px;
}

.slideshow-image-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}

.slideshow-image-wrap img {
  max-height: 65vh;
  max-width: 100%;
  object-fit: contain;
  border: 1px solid #222;
}

.slideshow-info {
  text-align: center;
  width: 100%;
}

.slideshow-info h3 {
  color: #fff;
  font-size: 16px;
  margin: 8px 0;
  line-height: 1.4;
}

.slideshow-info p {
  color: #888;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 12px;
}

.slideshow-badge {
  display: inline-block;
  margin-bottom: 4px;
}

.slideshow-detail-link {
  color: #7b2ff7;
  font-size: 13px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.slideshow-detail-link:hover {
  border-bottom-color: #7b2ff7;
  color: #c4a0ff;
}

.anky-image-prompt {
  color: #ccc;
  line-height: 1.5;
  font-style: italic;
}

/* ==================== Writings — two-panel layout ==================== */

.writings-layout {
  display: flex;
  height: calc(100vh - 60px);
  height: calc(100dvh - 60px);
}

.writings-sidebar {
  width: 360px;
  flex-shrink: 0;
  border-right: 1px solid #222;
  overflow-y: auto;
  background: #0a0a0a;
}

.writings-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #222;
}

.writings-sidebar-header h2 { color: #fff; font-size: 18px; }
.writings-count { color: #555; font-size: 13px; }

.writing-sidebar-item {
  padding: 14px 20px;
  border-bottom: 1px solid #181818;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  outline: none;
}

.writing-sidebar-item:hover { background: #0d0d14; }
.writing-sidebar-item.active {
  background: #0d0d18;
  border-left: 2px solid #7b2ff7;
}

.writing-sidebar-item:focus-visible { border-left: 2px solid #c4a0ff; }

.writing-sidebar-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.writing-sidebar-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border: 1px solid #222;
  flex-shrink: 0;
}

.writing-sidebar-text { min-width: 0; flex: 1; }

.writing-sidebar-firstline {
  color: #ccc;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.writing-sidebar-meta {
  color: #555;
  font-size: 12px;
}

.anky-badge {
  color: #c4a0ff;
  font-weight: bold;
}

/* Detail panel */
.writings-detail {
  flex: 1;
  overflow-y: auto;
  min-width: 0;
}

.writings-detail-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 30px 40px 60px;
}

.writings-detail-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #222;
}

.writings-detail-title {
  color: #c4a0ff;
  font-size: 22px;
  margin-bottom: 8px;
}

.writings-detail-meta {
  color: #666;
  font-size: 13px;
}

.writings-detail-content {
  color: #bbb;
  line-height: 2;
  font-size: 15px;
  white-space: pre-wrap;
  word-break: break-word;
}

.writings-detail-response {
  border-top: 1px solid #222;
  padding-top: 20px;
  margin-top: 24px;
  color: #888;
  font-style: italic;
  line-height: 1.8;
  font-size: 14px;
  white-space: pre-wrap;
}

.writings-conversation {
  margin-top: 20px;
}

.writings-conversation .chat-bubble {
  margin-bottom: 10px;
}

.writings-reply-options {
  margin-top: 12px;
}

.writings-detail-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #444;
}

.writings-back-btn {
  display: none;
  background: none;
  border: none;
  color: #666;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  margin-bottom: 12px;
}

.writings-back-btn:hover { color: #c4a0ff; }

/* ==================== Poiesis console ==================== */
.poiesis-dashboard {
  height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
}

.poiesis-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  border-bottom: 1px solid #222;
  flex-wrap: wrap;
  gap: 8px;
}

.poiesis-header h2 { color: #fff; }

.poiesis-stats {
  display: flex;
  gap: 24px;
  font-size: 14px;
  color: #666;
  flex-wrap: wrap;
}

.poiesis-stats strong { color: #c4a0ff; }

.console {
  flex: 1;
  background: #050508;
  padding: 20px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.6;
}

.console-line {
  padding: 2px 0;
  color: #8a8;
  white-space: pre-wrap;
  word-break: break-all;
}

.console-line.dim { color: #444; }

/* ==================== Dashboard ==================== */
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  border-bottom: 1px solid #222;
  flex-wrap: wrap;
  gap: 8px;
}

.dash-header h2 { color: #fff; }

.dash-stats {
  display: flex;
  gap: 16px;
  font-size: 14px;
  color: #666;
  align-items: center;
  flex-wrap: wrap;
}

.dash-stats strong { color: #c4a0ff; }

.dash-toggle {
  color: #555;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}

.dash-toggle input { margin-right: 4px; }

/* ==================== $ANKY coin page ==================== */
.ankycoin-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}

.ankycoin-page h1 {
  font-size: 28px;
  color: #c4a0ff;
  margin-bottom: 28px;
}

.ankycoin-page h2 {
  font-size: 16px;
  color: #888;
  margin: 32px 0 12px;
  letter-spacing: 0.5px;
}

.ankycoin-page p {
  font-size: 15px;
  line-height: 1.7;
  color: #aaa;
  margin-bottom: 16px;
}

.ankycoin-links {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid #1a1a1a;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  font-size: 13px;
}

.ankycoin-links a {
  color: #c4a0ff;
  border: 1px solid #2a2a3a;
  padding: 6px 14px;
  transition: border-color 0.2s;
}

.ankycoin-links a:hover {
  border-color: #7b2ff7;
}

.ankycoin-ca {
  color: #444;
  font-size: 11px;
  word-break: break-all;
}

/* ==================== Help tabs ==================== */
.help-tabs {
  display: flex;
  gap: 0;
  padding: 0 40px;
  border-bottom: 1px solid #222;
  max-width: 800px;
  margin: 0 auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.help-tab {
  padding: 10px 20px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #555;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.help-tab:hover { color: #888; }
.help-tab.active { color: #e0e0e0; border-bottom-color: #e0e0e0; }

.help-tab.agent-tab {
  color: #444;
}

.help-tab.agent-tab:hover { color: #7b2ff740; }
.help-tab.agent-tab.active { color: #c4a0ff; border-bottom-color: #7b2ff7; }

.kannada-text {
  font-size: 13px;
  opacity: 0.6;
}

/* ==================== Help content ==================== */
.help-content {
  padding: 40px;
  max-width: 800px;
  margin: 0 auto;
  line-height: 2;
}

.help-content h2 {
  margin-top: 30px;
  margin-bottom: 15px;
  color: #fff;
}

.help-content h3 {
  margin-top: 20px;
  margin-bottom: 8px;
  color: #c4a0ff;
  font-size: 15px;
}

.help-content ul, .help-content ol {
  padding-left: 24px;
  margin-bottom: 16px;
}

.help-content li { margin-bottom: 4px; }

.help-content pre {
  background: #111;
  padding: 12px;
  border: 1px solid #222;
  overflow-x: auto;
  margin: 8px 0 16px;
  font-size: 12px;
  line-height: 1.6;
}

.help-content pre code {
  background: transparent;
  padding: 0;
}

/* ==================== Sleeping ==================== */
.sleeping-container {
  text-align: center;
  padding: 80px 40px;
  max-width: 600px;
  margin: 0 auto;
}

.sleeping-icon {
  position: relative;
  display: inline-block;
  margin-bottom: 30px;
}

.pulse-ring {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 2px solid #7b2ff7;
  animation: pulse-expand 2s infinite;
  margin: 0 auto;
}

@keyframes pulse-expand {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1.3); opacity: 0; }
}

.sleeping-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #c4a0ff;
  font-size: 14px;
}

.sleeping-container h2 {
  color: #fff;
  margin-bottom: 8px;
}

.sleeping-container p {
  color: #888;
  margin-bottom: 16px;
}

/* ==================== Progress bar ==================== */
.progress-bar {
  height: 8px;
  background: #1a1a1a;
  border-radius: 4px;
  margin: 20px 0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #7b2ff7, #c4a0ff, #d4a0ff);
  border-radius: 4px;
  transition: width 0.5s;
}

.progress-text {
  text-align: center;
  color: #666;
  font-size: 14px;
}

/* ==================== Notify signup ==================== */
.notify-signup {
  margin-top: 40px;
  padding: 24px;
  border: 1px solid #222;
}

.notify-signup h3 {
  color: #fff;
  margin-bottom: 12px;
  font-size: 16px;
}

.notify-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.notify-input {
  background: #111;
  border: 1px solid #333;
  color: #e0e0e0;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 14px;
  flex: 1;
  min-width: 180px;
  outline: none;
}

.notify-input:focus { border-color: #7b2ff7; }

.notify-btn {
  padding: 10px 20px;
  background: #7b2ff7;
  color: #fff;
  border: none;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
}

.notify-btn:hover { background: #6020d0; }

/* ==================== Collection ==================== */
.collection-container {
  padding: 40px;
  max-width: 800px;
  margin: 0 auto;
}

.collection-container h2 {
  color: #fff;
  margin-bottom: 16px;
}

.cost-estimate {
  font-size: 18px;
  margin: 16px 0;
}

.cost-estimate strong { color: #c4a0ff; }

.tx-input {
  background: #111;
  border: 1px solid #333;
  color: #e0e0e0;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 14px;
  width: 100%;
  margin-bottom: 12px;
  outline: none;
}

.tx-input:focus { border-color: #7b2ff7; }

.payment-section {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid #222;
}

/* ==================== Mint ==================== */
.mint-container {
  padding: 80px 40px;
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.mint-container h2 {
  color: #fff;
  margin-bottom: 16px;
}

/* ==================== Empty state ==================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #666;
  grid-column: 1 / -1;
}

/* ==================== Scrollbar ==================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

.poiesis-link { margin-top: 20px; }
.poiesis-link a { color: #7b2ff7; }

/* ==================== Credits page ==================== */
.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 40px;
  line-height: 1.8;
}

.container h1 {
  color: #fff;
  margin-bottom: 8px;
}

.credits-section {
  margin-top: 32px;
  padding: 20px;
  border: 1px solid #222;
}

.credits-section h2 {
  color: #fff;
  margin-bottom: 12px;
  font-size: 16px;
}

.credits-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(123, 47, 247, 0.1);
  border: 1px solid #7b2ff7;
  padding: 12px 16px;
  margin-top: 16px;
  font-size: 14px;
  color: #c4a0ff;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-small {
  padding: 4px 12px;
  background: transparent;
  border: 1px solid #666;
  color: #666;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}

.btn-small:hover { border-color: #c4a0ff; color: #c4a0ff; }

.key-create,
.key-login,
.verify-payment,
.usage-check {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.credits-section input[type="text"],
.credits-section input[type="number"] {
  background: #111;
  border: 1px solid #333;
  color: #e0e0e0;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 13px;
  flex: 1;
  min-width: 0;
  outline: none;
}

.credits-section input:focus { border-color: #7b2ff7; }

.credits-section button {
  padding: 8px 16px;
  background: #7b2ff7;
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
}

.credits-section button:hover { background: #6020d0; }

.input-wide { flex: 2; }

.mega-prompt-input {
  width: 100%;
  min-height: 100px;
  background: #111;
  border: 1px solid #333;
  color: #e0e0e0;
  font-family: inherit;
  font-size: 13px;
  padding: 10px;
  resize: vertical;
  outline: none;
}

.mega-prompt-input:focus { border-color: #7b2ff7; }

.btn-generate {
  margin-top: 8px;
  padding: 8px 16px;
  background: #7b2ff7;
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

.btn-generate:hover { background: #6020d0; }

.key-display {
  margin-top: 12px;
  padding: 12px;
  background: rgba(123, 47, 247, 0.1);
  border: 1px solid #7b2ff7;
}

.key-display code {
  word-break: break-all;
  font-size: 13px;
}

.warning { color: #e0a040; font-size: 12px; margin-top: 4px; }

.treasury-address {
  display: block;
  margin: 8px 0;
  padding: 10px;
  font-size: 13px;
  word-break: break-all;
  background: #111;
  border: 1px solid #333;
}

.key-login { margin-top: 16px; }
.key-login p { color: #666; font-size: 13px; width: 100%; }

.success { color: #8a8; }
.error { color: #e05050; }

#auto-usage {
  padding: 12px;
  background: rgba(123, 47, 247, 0.05);
  border: 1px solid #222;
  margin-bottom: 12px;
}

#auto-usage strong { color: #c4a0ff; }
#auto-usage h3 { color: #fff; font-size: 14px; margin: 8px 0 4px; }
#auto-usage ul { padding-left: 16px; font-size: 12px; color: #888; }

/* ==================== Anky detail page ==================== */
.anky-detail {
  max-width: 720px;
  margin: 0 auto;
  padding: 30px 40px 60px;
}

.anky-image {
  margin-bottom: 30px;
}

.anky-image img {
  width: 100%;
  display: block;
  border: 1px solid #222;
}

.anky-generating {
  width: 100%;
  aspect-ratio: 1;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #222;
}

.anky-title {
  color: #fff;
  font-size: 28px;
  margin-bottom: 8px;
  line-height: 1.3;
}

.anky-meta {
  color: #666;
  font-size: 14px;
  margin-bottom: 4px;
}

.anky-thinker {
  color: #c4a0ff;
}

.anky-moment {
  margin-left: 8px;
  color: #555;
}

.anky-moment::before {
  content: "// ";
  color: #333;
}

.anky-created {
  color: #444;
  font-size: 12px;
  margin-bottom: 30px;
}

.anky-section {
  margin-top: 30px;
  border-top: 1px solid #1a1a1a;
  padding-top: 24px;
}

.anky-section h2 {
  color: #555;
  font-size: 13px;
  text-transform: lowercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
}

.anky-reflection {
  color: #bbb;
  line-height: 1.9;
  font-size: 15px;
}

.anky-reflection h3 { color: #c4a0ff; font-size: 15px; margin: 20px 0 8px; }
.anky-reflection h4 { color: #a888dd; font-size: 14px; margin: 16px 0 6px; }
.anky-reflection strong { color: #ddd; }
.anky-reflection em { color: #b8a0d0; }
.anky-reflection ul { padding-left: 20px; margin: 10px 0; }
.anky-reflection li { margin-bottom: 4px; }
.anky-reflection blockquote {
  border-left: 2px solid #7b2ff7;
  padding-left: 14px;
  margin: 12px 0;
  color: #999;
  font-style: italic;
}
.anky-reflection hr { border: none; border-top: 1px solid #222; margin: 20px 0; }
.anky-reflection p { margin-bottom: 12px; }

.anky-prompt-text {
  color: #ffd700;
  font-size: 18px;
  line-height: 1.5;
  font-style: italic;
}
.anky-prompt-text a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 215, 0, 0.3);
}
.anky-prompt-text a:hover {
  border-bottom-color: #ffd700;
}

.anky-writing {
  color: #888;
  line-height: 2;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}
.anky-writing-formatted {
  color: #ddd;
  line-height: 1.8;
  font-size: 16px;
}
.anky-writing-raw {
  color: #7b5ea7;
  font-size: 14px;
}
.anky-writing-toggle {
  cursor: pointer;
  transition: opacity 0.2s;
}
.anky-writing-toggle:hover {
  opacity: 0.85;
}


/* ==================== Feedback page ==================== */
.feedback-form {
  margin-top: 24px;
  margin-bottom: 32px;
}

.feedback-input {
  width: 100%;
  background: #111;
  border: 1px solid #333;
  color: #e0e0e0;
  font-family: 'Righteous', sans-serif;
  font-size: 14px;
  padding: 12px;
  resize: vertical;
  outline: none;
  min-height: 80px;
}

.feedback-input:focus { border-color: #7b2ff7; }

.feedback-meta-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.feedback-select {
  background: #111;
  border: 1px solid #333;
  color: #e0e0e0;
  font-family: inherit;
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
}

.feedback-select:focus { border-color: #7b2ff7; }

.feedback-author {
  background: #111;
  border: 1px solid #333;
  color: #e0e0e0;
  font-family: inherit;
  font-size: 13px;
  padding: 8px 12px;
  flex: 1;
  min-width: 120px;
  outline: none;
}

.feedback-author:focus { border-color: #7b2ff7; }

.feedback-btn {
  padding: 8px 20px;
  background: #7b2ff7;
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

.feedback-btn:hover { background: #6020d0; }
.feedback-btn:disabled { background: #333; color: #666; cursor: default; }

.feedback-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feedback-entry {
  border: 1px solid #222;
  padding: 16px;
}

.feedback-entry-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  flex-wrap: wrap;
}

.feedback-source-badge {
  padding: 2px 8px;
  font-size: 11px;
  text-transform: lowercase;
}

.badge-human { background: rgba(123, 47, 247, 0.15); color: #c4a0ff; }
.badge-agent { background: rgba(100, 200, 100, 0.12); color: #8a8; }

.feedback-author-name { color: #888; }
.feedback-date { color: #444; }

.feedback-status-badge {
  margin-left: auto;
  font-size: 11px;
}

.status-pending { color: #666; }
.status-acknowledged { color: #c4a0ff; }
.status-applied { color: #8a8; }

.feedback-entry-content {
  color: #ccc;
  line-height: 1.7;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ==================== Generate page ==================== */
.gen-section {
  margin-top: 20px;
}

.gen-label {
  display: block;
  color: #666;
  font-size: 12px;
  text-transform: lowercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.gen-modes {
  display: flex;
  gap: 8px;
}

.mode-btn {
  background: transparent;
  border: 1px solid #333;
  color: #555;
  font-family: inherit;
  font-size: 13px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-btn:hover { border-color: #555; color: #888; }
.mode-btn.active { border-color: #7b2ff7; color: #c4a0ff; background: rgba(123, 47, 247, 0.08); }

.model-toggle {
  display: flex;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  overflow: hidden;
}
.model-opt {
  flex: 1;
  background: transparent;
  border: none;
  border-right: 1px solid #2a2a2a;
  color: #555;
  font-family: inherit;
  font-size: 13px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.model-opt:last-child { border-right: none; }
.model-opt:hover { background: #111; color: #888; }
.model-opt.active { background: rgba(123, 47, 247, 0.12); color: #c4a0ff; }
.model-hint { font-size: 11px; color: #444; margin-top: 6px; margin-bottom: 0; }
.model-badge { font-size: 10px; font-weight: 700; letter-spacing: 0.04em; display: inline-block; padding: 1px 6px; border-radius: 3px; }
.model-badge.free { background: rgba(34, 197, 94, 0.15); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.3); }
.model-badge.paid { background: rgba(251, 191, 36, 0.12); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.25); }

.gen-input {
  width: 100%;
  background: #111;
  border: 1px solid #333;
  color: #e0e0e0;
  font-family: inherit;
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  resize: vertical;
}

.gen-input:focus { border-color: #7b2ff7; }

.gen-counts {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.count-btn {
  background: transparent;
  border: 1px solid #333;
  color: #555;
  font-family: inherit;
  font-size: 13px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.count-btn:hover { border-color: #555; color: #888; }
.count-btn.active { border-color: #7b2ff7; color: #c4a0ff; background: rgba(123, 47, 247, 0.08); }

.gen-input-sm {
  width: 60px;
  background: #111;
  border: 1px solid #333;
  color: #e0e0e0;
  font-family: inherit;
  font-size: 13px;
  padding: 6px 10px;
  outline: none;
}

.gen-input-sm:focus { border-color: #7b2ff7; }

.gen-cost {
  margin-top: 24px;
  padding: 14px;
  background: rgba(123, 47, 247, 0.06);
  border: 1px solid #222;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  color: #888;
}

.gen-cost strong { color: #c4a0ff; }
.cost-detail { font-size: 11px; color: #555; }

.gen-balance {
  margin-top: 10px;
  font-size: 13px;
}

.balance-ok { color: #6a8a6a; }
.balance-ok strong { color: #8aba8a; }
.balance-low { color: #c87040; }
.balance-low strong { color: #e09060; }
.balance-hint { color: #555; }

.gen-btn {
  margin-top: 20px;
  width: 100%;
  padding: 14px;
  background: #7b2ff7;
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s;
}

.gen-btn:hover { background: #6020d0; }
.gen-btn:disabled { background: #333; color: #666; cursor: default; }
.gen-prompt-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: #888;
  font-style: italic;
}

.gen-btn.generating {
  background: #b45309;
  color: #fff;
  cursor: wait;
  animation: gen-pulse 1.2s ease-in-out infinite;
}
@keyframes gen-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.gen-status {
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.8;
}

.gen-progress {
  margin-top: 24px;
}

.gen-skeleton {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}

.skeleton-pulse {
  width: 100%;
  height: 100%;
  background: linear-gradient(110deg, #1a1a1a 8%, #252525 18%, #1a1a1a 33%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s linear infinite;
}

@keyframes skeleton-shimmer {
  to { background-position: -200% 0; }
}

.gen-logs {
  max-height: 200px;
  overflow-y: auto;
  font-family: 'Righteous', sans-serif;
  font-size: 12px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 16px;
  padding: 8px;
  border: 1px solid #1a1a1a;
  border-radius: 4px;
}

.gen-log-line {
  white-space: pre-wrap;
  word-break: break-word;
}

.gen-result-image {
  max-width: 400px;
  margin-bottom: 16px;
}

.gen-result-image img {
  width: 100%;
  border-radius: 8px;
  animation: fadeIn 0.5s ease-in;
}

@media (max-width: 600px) {
  .gen-section { margin-top: 16px; }
  .model-opt { font-size: 12px; padding: 10px 8px; }
  .gen-modes { flex-wrap: wrap; }
  .mode-btn { flex: 1; text-align: center; padding: 10px 8px; font-size: 12px; }
  .gen-counts { gap: 6px; }
  .count-btn { padding: 8px 10px; font-size: 12px; }
  .gen-cost {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px;
    gap: 4px;
  }
  .gen-btn {
    margin-top: 16px;
    padding: 16px;
    font-size: 16px;
    letter-spacing: 0.02em;
  }
  .gen-skeleton { max-width: 100%; }
  .gen-result-image { max-width: 100%; }
  .gen-logs { font-size: 11px; max-height: 160px; }
}

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

.gen-result-prompt {
  color: #999;
  font-style: italic;
  font-size: 14px;
  margin-bottom: 12px;
}

.gen-result-link {
  display: inline-block;
  color: #7b68ee;
  text-decoration: none;
  border-bottom: 1px solid #7b68ee33;
}

.gen-result-link:hover {
  border-bottom-color: #7b68ee;
}

/* ==================== Landing page sections ==================== */
.landing {
  background: #0a0a0a;
  font-family: 'Righteous', sans-serif;
}

.land-section {
  padding: 100px 40px;
  border-top: 1px solid #181818;
}

.land-inner {
  max-width: 800px;
  margin: 0 auto;
}

.land-eyebrow {
  font-family: 'Righteous', sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #666;
  margin-bottom: 24px;
}

.land-heading {
  font-family: 'Righteous', sans-serif;
  font-size: 42px;
  font-weight: normal;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 32px;
}

.land-text {
  color: #bbb;
  font-size: 18px;
  line-height: 1.9;
  margin-bottom: 20px;
}

.land-dim { color: #777; font-size: 15px; }
.land-dim a { color: #7b2ff7; }

/* Steps grid */
.land-steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 40px;
}

.land-step {
  border-left: 1px solid #222;
  padding-left: 20px;
}

.step-num {
  font-family: 'Righteous', sans-serif;
  font-size: 28px;
  color: #7b2ff7;
  display: block;
  margin-bottom: 8px;
  opacity: 0.5;
}

.land-step h3 {
  font-family: 'Righteous', sans-serif;
  color: #c4a0ff;
  font-size: 15px;
  margin-bottom: 10px;
  text-transform: lowercase;
  letter-spacing: 1px;
}

.land-step p {
  color: #aaa;
  font-size: 16px;
  line-height: 1.8;
}

/* Code block */
.land-code {
  margin: 28px 0;
  background: #0d0d12;
  border: 1px solid #1a1a2a;
  padding: 20px;
  overflow-x: auto;
}

.land-code pre {
  margin: 0;
  font-family: 'Righteous', sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

.land-code code {
  background: transparent;
  padding: 0;
  color: #c4a0ff;
}

/* Mirror grid */
.land-mirror-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 36px;
}

.mirror-item h3 {
  font-family: 'Righteous', sans-serif;
  color: #c4a0ff;
  font-size: 15px;
  margin-bottom: 10px;
  text-transform: lowercase;
  letter-spacing: 1px;
}

.mirror-item p {
  color: #aaa;
  font-size: 16px;
  line-height: 1.9;
}

/* Pricing grid */
.land-price-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 36px;
}

.price-item {
  border: 1px solid #1a1a1a;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.price-label {
  font-family: 'Righteous', sans-serif;
  color: #777;
  font-size: 13px;
  text-transform: lowercase;
  letter-spacing: 1px;
}

.price-value {
  font-family: 'Righteous', sans-serif;
  font-size: 32px;
  color: #fff;
}

.price-note {
  color: #999;
  font-size: 14px;
  line-height: 1.6;
}

/* CTA */
.land-btn {
  display: inline-block;
  margin-top: 24px;
  padding: 14px 40px;
  background: #7b2ff7;
  color: #fff;
  font-family: 'Righteous', sans-serif;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.2s;
}

.land-btn:hover { background: #6020d0; color: #fff; }

/* Footer */
.land-footer {
  border-top: 1px solid #181818;
  padding: 30px 40px;
}

.land-footer .land-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Righteous', sans-serif;
  font-size: 13px;
  color: #444;
  flex-wrap: wrap;
  gap: 12px;
}

/* Scroll-triggered fade-up animation */
.land-section {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.land-section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==================== Share card overlay ==================== */
.share-card-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: #0a0a0a;
  z-index: 1100;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.share-card-overlay.active {
  display: flex;
}

.share-card-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: #555;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  transition: color 0.2s;
  z-index: 1101;
}

.share-card-close:hover { color: #fff; }

.share-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 400px;
  width: 90%;
  gap: 20px;
}

.share-card-image {
  width: 70%;
  max-width: 280px;
}

.share-card-image img {
  width: 100%;
  display: block;
  border: 1px solid #222;
}

.share-card-title {
  font-family: 'Righteous', sans-serif;
  font-size: 24px;
  color: #fff;
  line-height: 1.3;
  margin: 0;
}

.share-card-excerpt {
  font-size: 14px;
  color: #999;
  line-height: 1.7;
  max-width: 340px;
  margin: 0;
}

.share-card-brand {
  font-family: 'Righteous', sans-serif;
  font-size: 14px;
  color: #7b2ff7;
  letter-spacing: 2px;
  opacity: 0.7;
}

.share-card-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.share-card-btn {
  padding: 12px 28px;
  background: #7b2ff7;
  color: #fff;
  border: none;
  font-family: 'Righteous', sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.share-card-btn:hover { background: #6020d0; }

.share-card-btn-dim {
  background: transparent;
  border: 1px solid #333;
  color: #888;
}

.share-card-btn-dim:hover {
  background: transparent;
  border-color: #555;
  color: #ccc;
}

/* ============================================================
   RESPONSIVE — tablets and smaller (max-width: 768px)
   ============================================================ */
@media (max-width: 768px) {

  /* --- Navbar: mobile --- */
  .navbar {
    padding: 10px 12px;
  }

  .logo {
    font-size: 18px;
  }

  .anky-tv-btn {
    font-size: 13px;
    padding: 5px 10px;
  }

  /* --- Paddings --- */
  .page-header {
    padding: 20px 16px 14px;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    padding: 16px;
  }

  .gallery-caption {
    padding: 8px;
    font-size: 12px;
  }

  .gallery-title { font-size: 13px; }

  /* --- Gallery tabs --- */
  .gallery-tabs {
    padding: 0 16px;
  }

  .gallery-tab {
    padding: 10px 14px;
    font-size: 12px;
  }

  /* --- Slideshow --- */
  .slideshow-prev,
  .slideshow-next {
    font-size: 32px;
    padding: 4px 8px;
  }

  .slideshow-prev { left: 4px; }
  .slideshow-next { right: 4px; }

  .slideshow-close {
    top: 10px;
    right: 12px;
    font-size: 30px;
  }

  .slideshow-content {
    width: 95%;
  }

  .slideshow-image-wrap img {
    max-height: 55vh;
  }

  .slideshow-info h3 {
    font-size: 14px;
  }

  .slideshow-info p {
    font-size: 13px;
  }

  /* --- Writing --- */
  #writing-area {
    padding: 20px 16px;
    font-size: 16px;
  }

  #writing-area.writing-engaged {
    padding-top: 4px !important;
  }

  body.writing-active #writing-area,
  body.chat-active #writing-area {
    padding-top: 8px;
  }

  .writing-container {
    height: calc(var(--vh, 100vh) - 52px);
  }

  input,
  textarea,
  select {
    font-size: 16px;
  }

  body.writing-active {
    width: 100%;
    overscroll-behavior: none;
    touch-action: manipulation;
  }

  body.writing-active .writing-container {
    height: var(--vh, 100vh);
  }

  body.chat-active .writing-container {
    height: calc(var(--vh, 100vh) - 52px);
  }

  body.writing-active .session-bar { height: 40px; }

  .chat-container {
    padding: 16px 16px 0;
    max-width: 100%;
  }

  .chat-bubble {
    max-width: 92%;
    padding: 12px 14px;
    font-size: 14px;
  }

  .session-stats {
    font-size: 18px;
    gap: 14px;
  }

  .session-bar-inner {
    padding: 0 16px;
    height: 40px;
  }

  .session-pause-btn {
    width: 40px;
    height: 40px;
  }

  .session-pause-btn span {
    height: 14px;
  }

  .draft-recovery-overlay {
    padding: 18px 12px calc(18px + env(safe-area-inset-bottom, 0px));
  }

  .draft-recovery-banner {
    padding: 18px 16px 16px;
    border-radius: 18px;
  }

  .draft-recovery-message {
    font-size: 16px;
  }

  .draft-recovery-actions {
    flex-direction: column;
  }

  .chat-input-area {
    padding: 10px 16px;
  }

  .chat-input {
    font-size: 16px;
    min-height: 40px;
  }

  .chat-send-btn {
    height: 40px;
    padding: 8px 14px;
    font-size: 13px;
  }

  .anky-image-skeleton {
    width: 100%;
    max-width: 300px;
    height: 250px;
  }

  .reflection-actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  .reflection-download-btn {
    font-size: 12px;
    padding: 8px 16px;
  }

  /* --- Writings layout --- */
  .writings-layout {
    flex-direction: column;
    height: auto;
    min-height: calc(100dvh - 52px);
  }

  .writings-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #222;
    overflow-y: auto;
    max-height: none;
  }

  .writings-detail {
    display: none;
    overflow-y: auto;
  }

  .writings-layout.detail-open .writings-sidebar { display: none; }
  .writings-layout.detail-open .writings-detail { display: block; }

  .writings-back-btn { display: block; }

  .writings-detail-inner {
    padding: 20px 16px 40px;
  }

  .writing-sidebar-item {
    padding: 12px 16px;
  }

  /* --- Poiesis --- */
  .poiesis-header {
    padding: 14px 16px;
    flex-direction: column;
    align-items: flex-start;
  }

  .poiesis-stats {
    gap: 12px;
    font-size: 12px;
  }

  .console {
    padding: 12px;
    font-size: 12px;
  }

  /* --- Help --- */
  .help-tabs {
    padding: 0 16px;
  }

  .help-tab {
    padding: 10px 12px;
    font-size: 12px;
  }

  .help-content {
    padding: 20px 16px;
  }

  .help-content pre {
    font-size: 11px;
    padding: 8px;
  }

  /* --- Sleeping --- */
  .sleeping-container {
    padding: 40px 16px;
  }

  /* --- Collection --- */
  .collection-container {
    padding: 20px 16px;
  }

  /* --- Mint --- */
  .mint-container {
    padding: 40px 16px;
  }

  /* --- Container (credits, generate) --- */
  .container {
    padding: 20px 16px;
  }

  .credits-section {
    padding: 14px;
  }

  .credits-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 12px;
  }

  .key-create,
  .key-login,
  .verify-payment,
  .usage-check {
    flex-direction: column;
  }

  .credits-section input[type="text"],
  .credits-section input[type="number"] {
    min-width: 0;
    width: 100%;
  }

  .input-wide {
    flex: 1;
  }

  .credits-section button {
    width: 100%;
    padding: 12px 16px;
  }

  .btn-generate {
    width: 100%;
    padding: 12px 16px;
  }

  .treasury-address {
    font-size: 11px;
    padding: 8px;
  }

  /* --- Anky detail --- */
  .anky-detail {
    padding: 20px 16px 40px;
  }

  .anky-title {
    font-size: 22px;
  }

  .anky-reflection {
    font-size: 14px;
    line-height: 1.8;
  }

  .anky-writing {
    font-size: 13px;
    line-height: 1.8;
  }

  .anky-section {
    margin-top: 24px;
    padding-top: 18px;
  }

  /* --- Notify --- */
  .notify-signup {
    padding: 16px;
  }

  .notify-input {
    width: 100%;
    min-width: 0;
  }

  .notify-btn {
    width: 100%;
    margin-left: 0;
  }

  /* --- Feedback --- */
  .feedback-meta-row {
    flex-direction: column;
  }

  .feedback-btn {
    width: 100%;
    padding: 12px 16px;
  }

  .feedback-entry {
    padding: 12px;
  }

  /* --- Share card --- */
  .share-card-title { font-size: 22px; }
  .share-card-excerpt { font-size: 13px; }
  .share-card-image { width: 72%; }

  /* --- Landing --- */
  .land-section {
    padding: 60px 16px;
  }

  .land-heading {
    font-size: 28px;
  }

  .land-text {
    font-size: 16px;
  }

  .land-step p,
  .mirror-item p {
    font-size: 15px;
  }

  .land-steps {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .land-mirror-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .land-price-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .land-footer {
    padding: 24px 16px;
  }

  .land-footer .land-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}


/* ============================================================
   RESPONSIVE — small phones (max-width: 420px)
   ============================================================ */
@media (max-width: 420px) {

  .navbar {
    padding: 10px 12px;
  }

  .nav-key-input {
    width: 120px;
    font-size: 11px;
  }

  .nav-key-prompt {
    font-size: 11px;
    padding: 2px 6px;
  }

  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px;
  }

  .gallery-caption {
    padding: 6px;
  }

  .gallery-title {
    font-size: 12px;
  }

  .gallery-thinker {
    font-size: 11px;
  }

  #writing-area {
    padding: 16px 12px;
    font-size: 16px;
  }

  #writing-area.writing-engaged {
    padding-top: 4px !important;
  }

  body.writing-active #writing-area,
  body.chat-active #writing-area {
    padding-top: 6px;
  }

  .chat-container {
    padding: 12px 12px 0;
    max-width: 100%;
  }

  .chat-input-area {
    padding: 8px 12px;
  }

  .help-tab {
    padding: 8px 10px;
    font-size: 11px;
  }

  .help-content {
    padding: 16px 12px;
    line-height: 1.8;
  }

  .container {
    padding: 16px 12px;
  }

  .sleeping-container {
    padding: 30px 12px;
  }

  .pulse-ring {
    width: 80px;
    height: 80px;
  }

  .anky-detail {
    padding: 16px 12px 30px;
  }

  .anky-title {
    font-size: 20px;
  }

  .anky-reflection {
    font-size: 13px;
  }

  /* --- Share card --- */
  .share-card-title { font-size: 20px; }
  .share-card-image { width: 75%; }

  .anky-moment {
    display: block;
    margin-left: 0;
    margin-top: 2px;
  }

  .anky-moment::before {
    content: "// ";
  }
}

/* ==================== GO LIVE Button ==================== */
.go-live-btn {
  position: fixed;
  bottom: 60px;
  right: 24px;
  z-index: 50;
  padding: 10px 20px;
  background: #1a3a1a;
  border: 1px solid #2a5a2a;
  color: #6ab07a;
  font-family: 'Righteous', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 1px;
}

.go-live-btn:hover {
  background: #1a4a1a;
  border-color: #3a7a3a;
  color: #8ada8a;
}

.go-live-btn.live-active {
  background: #3a1a1a;
  border-color: #7a2a2a;
  color: #e05050;
  animation: live-pulse 1.5s infinite;
}

.go-live-btn.live-taken {
  background: #1a1a1a;
  border-color: #333;
  color: #555;
  cursor: default;
}

@keyframes live-pulse {
  0%, 100% { border-color: #7a2a2a; box-shadow: 0 0 0 0 rgba(224, 80, 80, 0); }
  50% { border-color: #e05050; box-shadow: 0 0 12px 2px rgba(224, 80, 80, 0.3); }
}

@media (max-width: 768px) {
  .go-live-btn {
    bottom: 52px;
    right: 12px;
    font-size: 12px;
    padding: 8px 14px;
  }
}

/* ==================== GO LIVE Navbar Button ==================== */
.go-live-navbar-btn {
  background: #1a3a1a;
  border: 1px solid #2a5a2a;
  color: #6ab07a;
  font-family: 'Righteous', sans-serif;
  font-size: 12px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 1px;
}

.go-live-navbar-btn:hover {
  background: #1a4a1a;
  border-color: #3a7a3a;
  color: #8ada8a;
}

.go-live-navbar-btn.live-active {
  background: #3a1a1a;
  border-color: #7a2a2a;
  color: #e05050;
  animation: live-pulse 1.5s infinite;
}

/* ==================== Countdown Overlay ==================== */
.countdown-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 10, 0.95);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

.countdown-number {
  font-size: 120px;
  font-family: 'Righteous', sans-serif;
  color: #7b2ff7;
  line-height: 1;
  animation: countdown-pulse 1s ease-in-out infinite;
}

.countdown-label {
  font-size: 18px;
  color: #666;
  font-family: 'Righteous', sans-serif;
  letter-spacing: 2px;
}

@keyframes countdown-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

/* ==================== X Login Button ==================== */
.x-login-btn {
  color: #666;
  font-size: 12px;
  border: 1px solid #333;
  padding: 6px 14px;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
  font-family: 'Righteous', sans-serif;
}

.x-login-btn:hover {
  color: #c4a0ff;
  border-color: #7b2ff7;
}

.x-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #888;
}

.x-user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.x-user-name {
  color: #c4a0ff;
}

.x-logout-btn {
  color: #555;
  font-size: 11px;
  text-decoration: none;
  margin-left: 4px;
}

.x-logout-btn:hover {
  color: #e05050;
}

/* ==================== Prompt Page ==================== */
.prompt-page {
  background: #0a0a0a;
  min-height: 100vh;
}

/* On the prompt page, writing-main needs flex layout for prompt-display + textarea */
.prompt-page .writing-main {
  display: flex;
  flex-direction: column;
}

.prompt-page .writing-main #life-bar {
  flex-shrink: 0;
}

.prompt-display {
  padding: 40px 40px 20px;
  font-size: 24px;
  font-weight: normal;
  color: #ffd700;
  line-height: 1.5;
  text-align: center;
  transition: all 0.5s ease;
  position: relative;
  z-index: 5;
}

.prompt-display.at-top {
  padding: 12px 40px;
  font-size: 16px;
  background: #0a0a0a;
  border-bottom: 1px solid #1a1a1a;
  position: sticky;
  top: 0;
  flex-shrink: 0;
  max-height: 32vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Prompt page — session bar always visible */
.prompt-page .session-bar { height: 44px; }
.prompt-page.writing-active .writing-container {
  height: 100vh;
  height: 100dvh;
  height: var(--vh, 100dvh);
}

/* Prompt page — chat mode: full viewport, input pinned to bottom */
.prompt-page.chat-active .writing-container {
  height: 100vh;
  height: 100dvh;
  height: var(--vh, 100dvh);
}
.prompt-page.chat-active .session-bar {
  display: none;
}
.prompt-page.chat-active .chat-input-area {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  max-width: 100%;
  box-sizing: border-box;
}
.prompt-page.chat-active .chat-container {
  padding-bottom: 80px;
}

/* Prompt background image with dark overlay */
.prompt-page .writing-container {
  position: relative;
  background-image: var(--prompt-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.prompt-page .writing-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 0;
  pointer-events: none;
}
.prompt-page .writing-container > * {
  position: relative;
  z-index: 1;
}

/* Challenge overlay also gets the prompt background */
.prompt-page .challenge-overlay {
  background-image: var(--prompt-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.prompt-page .challenge-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 0;
}
.prompt-page .challenge-overlay .challenge-inner {
  position: relative;
  z-index: 1;
}

/* Navbar slide-up */
.navbar.nav-hidden {
  transform: translateY(-100%);
  transition: transform 0.4s ease;
}

#prompt-writing-area {
  flex: 1;
  background: transparent;
  border: none;
  color: #c4a0ff;
  font-family: 'Righteous', sans-serif;
  font-size: 18px;
  padding: 20px 40px;
  resize: none;
  outline: none;
  line-height: 1.8;
  overflow-y: auto;
}

#prompt-writing-area::placeholder {
  color: #222;
}

.prompt-stat-bar {
  flex-shrink: 0;
  height: 36px;
  background: rgba(10,10,10,0.95);
  border-top: 1px solid #1a1a1a;
  position: relative;
}

.prompt-stat-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, #ffd700, #c4a0ff);
  transition: width 0.5s linear;
}

.prompt-stat-bar-inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 36px;
  padding: 0 24px;
  gap: 18px;
  font-size: 14px;
  color: #555;
}

/* Prompt completion overlay */
.prompt-complete-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,10,10,0.95);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.prompt-complete-overlay.active {
  display: flex;
}

.prompt-complete-inner {
  text-align: center;
  max-width: 400px;
  padding: 40px;
}

.prompt-complete-inner h2 {
  color: #fff;
  font-size: 24px;
  margin-bottom: 12px;
}

.prompt-complete-inner p {
  color: #c4a0ff;
  font-size: 18px;
}

/* ==================== Prompt Page Responsive ==================== */
@media (max-width: 768px) {
  .prompt-display {
    padding: 20px 16px 12px;
    font-size: 20px;
  }

  .prompt-display.at-top {
    padding: 10px 16px;
    font-size: 14px;
  }

  #prompt-writing-area {
    padding: 16px;
    font-size: 16px;
  }

  .prompt-page .session-bar { height: 40px; }
}

/* ==================== Challenge Overlay ==================== */
.challenge-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.97);
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
}

.challenge-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.challenge-inner {
  text-align: center;
  max-width: 500px;
  padding: 40px 24px;
}

.challenge-creator {
  color: #c4a0ff;
  font-size: 18px;
  margin-bottom: 24px;
}

.challenge-prompt {
  color: #ffd700;
  font-size: 26px;
  line-height: 1.5;
  margin-bottom: 28px;
}

.challenge-desc {
  color: #666;
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 36px;
}

.challenge-begin {
  background: #7b2ff7;
  color: #fff;
  border: none;
  font-family: 'Righteous', sans-serif;
  font-size: 16px;
  padding: 14px 40px;
  cursor: pointer;
  transition: background 0.2s;
}

.challenge-begin:hover {
  background: #6020d0;
}

@media (max-width: 768px) {
  .challenge-prompt {
    font-size: 22px;
  }

  .challenge-creator {
    font-size: 16px;
  }

  .challenge-inner {
    padding: 30px 16px;
  }
}

/* ==================== Light Theme ==================== */
body.theme-light {
  background: #f5f5f0;
  color: #222;
}

body.theme-light .navbar {
  background: #f5f5f0;
  border-bottom-color: #ddd;
}

body.theme-light .logo { color: #222; }
body.theme-light .drawer-links a { color: #888; }
body.theme-light .drawer-links a:hover { color: #7b2ff7; }

body.theme-light #prompt-writing-area {
  color: #333;
}

body.theme-light .prompt-display {
  color: #b8860b;
}

body.theme-light .prompt-display.at-top {
  background: #f5f5f0;
  border-bottom-color: #ddd;
}

body.theme-light .session-bar {
  background: rgba(245, 245, 240, 0.95);
  border-top-color: #ddd;
}

body.theme-light .session-stats { color: #888; }
body.theme-light .session-stats .stat-dim { color: #aaa; }

body.theme-light .challenge-overlay {
  background: rgba(245, 245, 240, 0.97);
}

body.theme-light .challenge-prompt { color: #b8860b; }
body.theme-light .challenge-creator { color: #7b2ff7; }
body.theme-light .challenge-desc { color: #999; }

body.theme-light .prompt-complete-overlay {
  background: rgba(245, 245, 240, 0.97);
}

body.theme-light .prompt-complete-inner h2 { color: #222; }

/* ==================== Settings Page ==================== */
.settings-form {
  max-width: 500px;
  margin: 0 auto;
  padding: 40px;
}

.settings-form h1 {
  color: #fff;
  margin-bottom: 32px;
}

.settings-group {
  margin-bottom: 28px;
}

.settings-label {
  display: block;
  color: #888;
  font-size: 13px;
  text-transform: lowercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.settings-input {
  width: 100%;
  background: #111;
  border: 1px solid #333;
  color: #e0e0e0;
  font-family: 'Righteous', sans-serif;
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
}

.settings-input:focus { border-color: #7b2ff7; }

.settings-select {
  width: 100%;
  background: #111;
  border: 1px solid #333;
  color: #e0e0e0;
  font-family: 'Righteous', sans-serif;
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  cursor: pointer;
}

.settings-select:focus { border-color: #7b2ff7; }

.settings-range {
  width: 100%;
  margin-top: 4px;
  accent-color: #7b2ff7;
}

.settings-range-value {
  color: #c4a0ff;
  font-size: 14px;
  margin-left: 8px;
}

.settings-hint {
  font-size: 12px;
  color: #666;
  margin: 4px 0 8px 0;
  line-height: 1.5;
}

.you-settings-link {
  font-size: 13px;
  color: rgba(255,255,255,0.35);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 4px 12px;
  border-radius: 6px;
  margin-top: 8px;
  transition: color 0.2s, border-color 0.2s;
}
.you-settings-link:hover {
  color: rgba(255,255,255,0.6);
  border-color: rgba(255,255,255,0.25);
}

.settings-toggle {
  display: flex;
  gap: 8px;
}

.settings-toggle-btn {
  background: transparent;
  border: 1px solid #333;
  color: #555;
  font-family: 'Righteous', sans-serif;
  font-size: 13px;
  padding: 8px 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.settings-toggle-btn:hover { border-color: #555; color: #888; }
.settings-toggle-btn.active { border-color: #7b2ff7; color: #c4a0ff; background: rgba(123, 47, 247, 0.08); }

.settings-preview {
  margin-top: 8px;
  padding: 16px;
  border: 1px solid #222;
  min-height: 60px;
  line-height: 1.8;
  color: #888;
}

.settings-save {
  width: 100%;
  padding: 14px;
  background: #7b2ff7;
  color: #fff;
  border: none;
  font-family: 'Righteous', sans-serif;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 16px;
}

.settings-save:hover { background: #6020d0; }
.settings-save:disabled { background: #333; color: #666; cursor: default; }

.settings-msg {
  text-align: center;
  margin-top: 12px;
  font-size: 14px;
}

body.theme-light .settings-form h1 { color: #222; }
body.theme-light .settings-input { background: #fff; border-color: #ddd; color: #222; }
body.theme-light .settings-select { background: #fff; border-color: #ddd; color: #222; }
body.theme-light .settings-preview { border-color: #ddd; color: #555; }

/* Waiting gallery (shown during prompt generation) */
.waiting-gallery {
  margin-top: 32px;
  animation: fadeIn 0.5s ease;
}
.waiting-gallery-label {
  color: #666;
  font-size: 14px;
  margin-bottom: 12px;
  text-align: center;
}
.waiting-gallery-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.waiting-gallery-scroll::-webkit-scrollbar {
  height: 4px;
}
.waiting-gallery-scroll::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 2px;
}
.waiting-gallery-item {
  flex: 0 0 auto;
  width: 160px;
  scroll-snap-align: start;
  text-decoration: none;
  transition: transform 0.2s ease;
}
.waiting-gallery-item:hover {
  transform: scale(1.05);
}
.waiting-gallery-item img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}
.waiting-gallery-title {
  display: block;
  color: #888;
  font-size: 11px;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== Changelog ==================== */
.changelog-page {
  max-width: 700px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  color: #c8c8d4;
}

.changelog-page h1 {
  font-size: 28px;
  color: #d4a853;
  margin-bottom: 8px;
}

.changelog-subtitle {
  color: #666;
  font-size: 14px;
  margin-bottom: 40px;
}

.changelog-entry {
  border-left: 2px solid #1a1a22;
  padding: 0 0 32px 20px;
  margin-bottom: 0;
}

.changelog-entry:last-child {
  padding-bottom: 0;
}

.changelog-date {
  font-size: 12px;
  color: #555;
  font-family: monospace;
  margin-bottom: 4px;
}

.changelog-title {
  font-size: 16px;
  color: #c8c8d4;
  margin-bottom: 8px;
}

.changelog-desc {
  font-size: 13px;
  color: #888;
  line-height: 1.7;
  margin-bottom: 8px;
}

.changelog-prompt-link {
  font-size: 12px;
  color: #8b5cf6;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.changelog-prompt-link:hover {
  border-bottom-color: #8b5cf6;
}

.changelog-permalink {
  font-size: 14px;
  color: #333;
  text-decoration: none;
  margin-left: 10px;
  transition: color 0.2s;
}

.changelog-permalink:hover {
  color: #d4a853;
}

.changelog-entry:target,
.changelog-highlight {
  border-left-color: #d4a853;
  background: rgba(212, 168, 83, 0.05);
  padding-left: 18px;
  margin-left: -18px;
  padding-top: 12px;
  padding-bottom: 12px;
  border-radius: 0 4px 4px 0;
}

/* ==================== Video Production Studio ==================== */
.studio-container {
  background: #08080c;
  min-height: 100vh;
  color: #c8c8d4;
}

/* Hide navbar during recording */
body.studio-recording-active .navbar { display: none; }
body.studio-recording-active { overflow: hidden; }

/* Phase containers */
.studio-phase {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

#phase-record {
  max-width: 100%;
  padding: 0;
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 1000;
}

.studio-title {
  font-size: 32px;
  color: #d4a853;
  margin-bottom: 8px;
}

.studio-subtitle {
  color: #666;
  font-size: 14px;
  margin-bottom: 24px;
}

.studio-actions-top {
  margin-bottom: 32px;
}

/* Buttons */
.studio-btn {
  padding: 12px 28px;
  border: none;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  letter-spacing: 1px;
}
.studio-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.studio-btn-primary {
  background: #d4a853;
  color: #08080c;
  font-weight: bold;
}
.studio-btn-primary:hover:not(:disabled) { background: #e0b85f; }

.studio-btn-secondary {
  background: #1a1a22;
  color: #c8c8d4;
}
.studio-btn-secondary:hover { background: #252530; }

.studio-btn-stop {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: #e53e3e;
  color: #fff;
  font-weight: bold;
  font-size: 16px;
  padding: 14px 40px;
  z-index: 1010;
  border-radius: 4px;
}
.studio-btn-stop:hover { background: #c53030; }

/* Section */
.studio-section {
  margin-bottom: 48px;
}

.studio-section-title {
  font-size: 18px;
  color: #d4a853;
  margin-bottom: 20px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.studio-gen-count {
  font-size: 13px;
  color: #8b5cf6;
  font-weight: normal;
  margin-left: 8px;
}

/* Script acts */
.studio-act {
  border: 1px solid #1a1a22;
  margin-bottom: 12px;
  background: #0c0c12;
}

.studio-act summary {
  padding: 14px 20px;
  color: #c8c8d4;
  font-size: 14px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.studio-act summary::-webkit-details-marker { display: none; }

.studio-act summary::after {
  content: "+";
  color: #555;
  font-size: 18px;
  transition: transform 0.2s;
}

.studio-act[open] summary::after { content: "-"; }

.studio-act-title {
  color: #d4a853;
  font-weight: bold;
}

.studio-act-time {
  color: #8b5cf6;
  font-size: 12px;
  margin-left: 12px;
}

.studio-act-content {
  padding: 0 20px 20px;
  font-size: 14px;
  line-height: 1.8;
  color: #999;
}

.studio-act-content p { margin-bottom: 10px; }
.studio-act-content .direction { color: #8b5cf6; font-style: italic; }

/* Image grid */
.studio-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.studio-img-card {
  border: 1px solid #1a1a22;
  background: #0c0c12;
  padding: 16px;
}

.studio-img-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.studio-img-id {
  color: #555;
  font-size: 11px;
  font-family: monospace;
}

.studio-img-name {
  color: #c8c8d4;
  font-size: 13px;
  font-weight: bold;
}

.studio-img-badge {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: auto;
}
.studio-img-badge.critical { background: rgba(212,168,83,0.15); color: #d4a853; border: 1px solid #d4a853; }
.studio-img-badge.important { background: rgba(139,92,246,0.15); color: #8b5cf6; border: 1px solid #8b5cf6; }
.studio-img-badge.optional { background: rgba(102,102,102,0.15); color: #888; border: 1px solid #555; }

.studio-img-preview {
  aspect-ratio: 16/9;
  background: #08080c;
  border: 1px solid #1a1a22;
  margin-bottom: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.studio-img-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.studio-gen-btn {
  padding: 8px 16px;
  background: #8b5cf6;
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
  width: 100%;
}
.studio-gen-btn:hover:not(:disabled) { background: #7c3aed; }
.studio-gen-btn:disabled { opacity: 0.5; cursor: wait; }

/* ===== Recording Phase ===== */

/* Countdown */
.studio-countdown {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1020;
}

.studio-countdown-number {
  font-size: 120px;
  color: #d4a853;
  font-weight: bold;
  animation: countPulse 1s ease-in-out infinite;
}

@keyframes countPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
}

/* Camera PIP */
.studio-camera-pip {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 200px;
  height: 150px;
  border: 2px solid #d4a853;
  border-radius: 8px;
  z-index: 1010;
  object-fit: cover;
  background: #000;
}

/* Timer overlay */
.studio-timer-overlay {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 1010;
  background: rgba(0,0,0,0.6);
  padding: 12px 24px;
  border-radius: 8px;
}

.studio-timer-elapsed {
  font-size: 36px;
  color: #d4a853;
  font-weight: bold;
  font-family: monospace;
}

.studio-timer-act {
  font-size: 13px;
  color: #8b5cf6;
  margin-top: 4px;
}

.studio-progress-bar {
  width: 300px;
  height: 4px;
  background: #1a1a22;
  margin-top: 8px;
  border-radius: 2px;
  overflow: hidden;
}

.studio-progress-fill {
  height: 100%;
  background: #d4a853;
  width: 0%;
  transition: width 0.3s linear;
}

/* Teleprompter */
.studio-teleprompter {
  position: fixed;
  inset: 80px 0 0 0;
  overflow: hidden;
  z-index: 1005;
  pointer-events: none;
}

.studio-teleprompter-text {
  padding: 40px 15%;
  transition: transform 0.1s linear;
}

.teleprompter-act {
  margin-bottom: 60px;
}

.teleprompter-act-label {
  font-size: 14px;
  color: #8b5cf6;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 20px;
}

.teleprompter-act p {
  font-size: 28px;
  line-height: 1.6;
  color: #e0e0e8;
  margin-bottom: 24px;
  text-align: center;
}

/* ===== Review Phase ===== */
.studio-review-player {
  margin: 24px 0;
}

.studio-review-video {
  width: 100%;
  max-height: 60vh;
  background: #000;
  border: 1px solid #1a1a22;
}

.studio-timeline {
  margin: 16px 0 24px;
}

.studio-timeline-bar {
  position: relative;
  height: 32px;
  background: #0c0c12;
  border: 1px solid #1a1a22;
}

.studio-timeline-marker {
  position: absolute;
  top: 0;
  width: 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #d4a853;
  border-left: 1px solid #d4a853;
  cursor: default;
}

.studio-review-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.studio-upload-status {
  padding: 12px 16px;
  font-size: 13px;
  background: #0c0c12;
  border: 1px solid #1a1a22;
}
.studio-upload-status.success { border-color: #38a169; color: #68d391; }
.studio-upload-status.error { border-color: #e53e3e; color: #fc8181; }

/* Mobile dropdown */
@media (max-width: 768px) {
  .nav-dropdown-menu {
    position: static;
    border: none;
    background: transparent;
    padding: 0;
    margin-top: 0;
  }

  .nav-dropdown-menu a {
    padding: 10px 0 10px 16px;
    border-bottom: 1px solid #181818;
    font-size: 13px;
  }

  .nav-dropdown {
    width: 100%;
  }

  .nav-dropdown-trigger {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid #181818;
  }

  .studio-phase {
    padding: 20px 16px 60px;
  }

  .studio-title {
    font-size: 24px;
  }

  .studio-camera-pip {
    width: 120px;
    height: 90px;
    bottom: 100px;
    right: 12px;
  }

  .teleprompter-act p {
    font-size: 22px;
  }

  .studio-teleprompter-text {
    padding: 40px 8%;
  }

  .studio-progress-bar {
    width: 200px;
  }

  .studio-image-grid {
    grid-template-columns: 1fr;
  }

  .studio-btn-stop {
    padding: 14px 32px;
    font-size: 14px;
  }
}

/* ==================== Meditation UI ==================== */
.med-scene {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050508;
  z-index: 50;
}

.med-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.med-timer {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 2px solid rgba(196, 160, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.3s, box-shadow 0.3s;
  user-select: none;
}

.med-timer:hover {
  border-color: rgba(196, 160, 255, 0.35);
}

.med-timer.active {
  border-color: rgba(196, 160, 255, 0.4);
  box-shadow: 0 0 40px rgba(196, 160, 255, 0.08);
  cursor: default;
  animation: med-pulse 6s ease-in-out infinite;
}

@keyframes med-pulse {
  0%, 100% { box-shadow: 0 0 40px rgba(196, 160, 255, 0.05); }
  50% { box-shadow: 0 0 60px rgba(196, 160, 255, 0.12); }
}

.med-time {
  font-size: 42px;
  font-family: 'Righteous', sans-serif;
  color: rgba(224, 224, 224, 0.9);
  letter-spacing: 2px;
}

.med-label {
  font-size: 16px;
  color: rgba(224, 224, 224, 0.4);
  letter-spacing: 1px;
}

.med-start-btn {
  background: transparent;
  border: 1px solid rgba(196, 160, 255, 0.3);
  color: #c4a0ff;
  font-family: 'Righteous', sans-serif;
  font-size: 16px;
  padding: 12px 48px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 2px;
}

.med-start-btn:hover {
  background: rgba(196, 160, 255, 0.08);
  border-color: rgba(196, 160, 255, 0.5);
}

.med-level {
  min-height: 20px;
}

.med-streak {
  font-size: 12px;
  color: rgba(212, 168, 83, 0.6);
  letter-spacing: 1px;
}

/* Timer picker */
.med-picker {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 5, 8, 0.95);
  z-index: 60;
}

.med-picker-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.med-picker-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.med-picker-arrow {
  background: none;
  border: none;
  color: rgba(196, 160, 255, 0.5);
  font-size: 20px;
  cursor: pointer;
  padding: 8px 16px;
  transition: color 0.2s;
}

.med-picker-arrow:hover { color: #c4a0ff; }

.med-picker-val {
  font-size: 48px;
  font-family: 'Righteous', sans-serif;
  color: #e0e0e0;
  min-width: 80px;
  text-align: center;
}

.med-picker-sep {
  font-size: 48px;
  color: rgba(224, 224, 224, 0.3);
  margin-bottom: 4px;
}

.med-picker-done {
  background: transparent;
  border: 1px solid rgba(196, 160, 255, 0.3);
  color: #c4a0ff;
  font-family: 'Righteous', sans-serif;
  font-size: 14px;
  padding: 10px 32px;
  cursor: pointer;
  margin-left: 16px;
  transition: all 0.2s;
}

.med-picker-done:hover {
  background: rgba(196, 160, 255, 0.08);
}

/* Breathing ring */
.med-breath {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
}

.med-breath-ring {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  border: 1px solid rgba(196, 160, 255, 0.06);
  animation: breathe 8s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(0.8); opacity: 0.3; }
  50% { transform: scale(1.15); opacity: 0.8; }
}

/* Meditating body state */
body.meditating .navbar,
body.meditating .bottom-live-bar,
body.meditating .med-fab {
  display: none !important;
}

/* Post-meditation options */
.med-options {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050508;
  z-index: 50;
}

.med-options-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  max-width: 400px;
  width: 100%;
  padding: 24px;
}

.med-done-msg {
  text-align: center;
  min-height: 24px;
}

.med-option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}

.med-option-btn {
  background: rgba(196, 160, 255, 0.04);
  border: 1px solid rgba(196, 160, 255, 0.15);
  color: #e0e0e0;
  font-family: 'Righteous', sans-serif;
  font-size: 15px;
  padding: 20px 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.med-option-btn:hover {
  background: rgba(196, 160, 255, 0.08);
  border-color: rgba(196, 160, 255, 0.3);
}

.med-option-btn.locked {
  opacity: 0.3;
  cursor: not-allowed;
}

.med-option-btn.locked:hover {
  background: rgba(196, 160, 255, 0.04);
  border-color: rgba(196, 160, 255, 0.15);
}

.med-option-btn.dim {
  opacity: 0.5;
}

.med-option-sub {
  font-size: 10px;
  color: rgba(224, 224, 224, 0.3);
}

/* Reflect / Journal panels */
.med-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050508;
  z-index: 50;
}

.med-panel-inner {
  max-width: 480px;
  width: 100%;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.med-panel-question {
  font-size: 18px;
  color: rgba(224, 224, 224, 0.85);
  line-height: 1.5;
}

.med-panel-answers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.med-reflect-answer {
  background: rgba(196, 160, 255, 0.04);
  border: 1px solid rgba(196, 160, 255, 0.12);
  color: #e0e0e0;
  font-family: 'Righteous', sans-serif;
  font-size: 14px;
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.med-reflect-answer:hover {
  background: rgba(196, 160, 255, 0.08);
  border-color: rgba(196, 160, 255, 0.3);
}

.med-reflect-answer.selected {
  border-color: #c4a0ff;
  background: rgba(196, 160, 255, 0.1);
}

.med-reflect-answer:disabled {
  opacity: 0.4;
  cursor: default;
}

.med-reflect-answer.selected:disabled {
  opacity: 1;
}

.med-panel-response {
  font-size: 14px;
  color: rgba(212, 168, 83, 0.7);
  font-style: italic;
  padding: 12px 0;
}

.med-panel-back {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(224, 224, 224, 0.5);
  font-family: 'Righteous', sans-serif;
  font-size: 13px;
  padding: 10px 24px;
  cursor: pointer;
  align-self: flex-start;
}

.med-panel-back:hover { color: #e0e0e0; border-color: rgba(255, 255, 255, 0.2); }

.med-journal-textarea {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(196, 160, 255, 0.12);
  color: #e0e0e0;
  font-family: 'Righteous', sans-serif;
  font-size: 15px;
  padding: 16px;
  resize: vertical;
  min-height: 120px;
  outline: none;
}

.med-journal-textarea:focus {
  border-color: rgba(196, 160, 255, 0.3);
}

.med-journal-actions {
  display: flex;
  gap: 12px;
}

.med-panel-submit {
  background: rgba(196, 160, 255, 0.1);
  border: 1px solid rgba(196, 160, 255, 0.3);
  color: #c4a0ff;
  font-family: 'Righteous', sans-serif;
  font-size: 14px;
  padding: 10px 24px;
  cursor: pointer;
}

.med-panel-submit:hover { background: rgba(196, 160, 255, 0.15); }
.med-panel-submit:disabled { opacity: 0.4; cursor: not-allowed; }

/* Meditation FAB */
.med-fab {
  position: fixed;
  bottom: 80px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(196, 160, 255, 0.12);
  border: 1px solid rgba(196, 160, 255, 0.3);
  color: #c4a0ff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 40;
  transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.med-fab:hover {
  background: rgba(196, 160, 255, 0.2);
  border-color: rgba(196, 160, 255, 0.5);
  transform: scale(1.05);
}

body.writing-active .med-fab,
body.chat-active .med-fab {
  display: none !important;
}

/* Inquiry prompt */
.inquiry-prompt {
  padding: 40px 40px 0;
  flex-shrink: 0;
  animation: inquiry-fade-in 1.2s ease-out;
}
.inquiry-prompt p.inquiry-question {
  font-family: 'Righteous', sans-serif;
  font-size: 16px;
  color: #c4a0ff;
  line-height: 1.4;
  margin: 0;
  padding: 0;
  letter-spacing: 0.3px;
  font-weight: 400;
  font-style: italic;
  opacity: 0.5;
}
body.writing-active .inquiry-prompt {
  padding: 12px 40px 0;
}
body.writing-active .inquiry-prompt p.inquiry-question {
  font-size: 14px;
  opacity: 0.35;
}
@keyframes inquiry-fade-in {
  0% { opacity: 0; transform: translateY(-8px); }
  100% { opacity: 1; transform: translateY(0); }
}
body.chat-active .inquiry-prompt { display: none; }
@media (max-width: 600px) {
  .inquiry-prompt { padding: 20px 16px 0; }
  .inquiry-prompt p.inquiry-question { font-size: 14px; }
  body.writing-active .inquiry-prompt { padding: 8px 16px 0; }
  body.writing-active .inquiry-prompt p.inquiry-question { font-size: 12px; }
}

/* Close button on meditation overlay */
.med-close-btn {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: rgba(224, 224, 224, 0.4);
  font-size: 32px;
  cursor: pointer;
  z-index: 55;
  line-height: 1;
  padding: 8px;
  transition: color 0.2s;
}
.med-close-btn:hover {
  color: rgba(224, 224, 224, 0.8);
}

/* Native number inputs for timer picker */
.med-picker-input {
  width: 80px;
  font-size: 48px;
  font-family: 'Righteous', sans-serif;
  color: #e0e0e0;
  background: transparent;
  border: none;
  border-bottom: 2px solid rgba(196, 160, 255, 0.3);
  text-align: center;
  -moz-appearance: textfield;
  padding: 4px 0;
}
.med-picker-input::-webkit-outer-spin-button,
.med-picker-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.med-picker-input:focus {
  outline: none;
  border-bottom-color: #c4a0ff;
}

@media (max-width: 600px) {
  .med-timer {
    width: 160px;
    height: 160px;
  }
  .med-time {
    font-size: 34px;
  }
  .med-picker-input {
    font-size: 40px;
    width: 64px;
  }
  .med-breath-ring {
    width: 240px;
    height: 240px;
  }
  .med-fab {
    bottom: 70px;
    right: 16px;
    width: 48px;
    height: 48px;
  }
  .med-option-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .med-option-btn {
    padding: 16px 12px;
    font-size: 14px;
  }
}

/* --- Video Gallery --- */
.vid-gallery-count {
  color: #888;
  font-size: 14px;
  margin-bottom: 16px;
}
.vid-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.vid-gallery-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid #222;
  border-radius: 8px;
  overflow: hidden;
  background: #111;
  transition: border-color 0.2s, transform 0.2s;
}
.vid-gallery-card:hover {
  border-color: #555;
  transform: translateY(-2px);
}
.vid-gallery-thumb {
  position: relative;
  aspect-ratio: 1;
  background: #1a1a1a;
  overflow: hidden;
}
.vid-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.vid-gallery-no-thumb {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: #444;
}
.vid-gallery-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.2s;
}
.vid-gallery-card:hover .vid-gallery-play {
  opacity: 1;
}
.vid-gallery-info {
  padding: 12px 14px;
}
.vid-gallery-title {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
/* ==================== Leaderboard ==================== */
.leaderboard-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.leaderboard-header {
  text-align: center;
  margin-bottom: 36px;
}

.leaderboard-header h1 {
  font-size: 36px;
  font-weight: normal;
  color: #fff;
  margin-bottom: 8px;
}

.leaderboard-subtitle {
  font-size: 14px;
  color: #555;
  margin-bottom: 24px;
}

.leaderboard-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lb-tab {
  padding: 6px 18px;
  border: 1px solid #333;
  color: #666;
  font-family: 'Righteous', sans-serif;
  font-size: 13px;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.lb-tab:hover {
  color: var(--tab-color, #c4a0ff);
  border-color: var(--tab-color, #c4a0ff);
  background: rgba(255,255,255,0.03);
}

.lb-tab.active {
  color: var(--tab-color, #c4a0ff);
  border-color: var(--tab-color, #c4a0ff);
  background: rgba(255,255,255,0.05);
}

.leaderboard-empty {
  text-align: center;
  padding: 60px 20px;
  color: #444;
}

.leaderboard-empty p {
  margin-bottom: 20px;
  font-size: 15px;
}

.leaderboard-table {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lb-row {
  display: grid;
  grid-template-columns: 44px 1fr repeat(5, 64px);
  align-items: center;
  padding: 12px 16px;
  border: 1px solid #1a1a1a;
  background: #111;
  transition: background 0.15s;
}

.lb-row:hover:not(.lb-header-row) {
  background: #161620;
}

.lb-header-row {
  background: transparent;
  border-color: #222;
  padding: 8px 16px;
  font-size: 11px;
  color: #444;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.lb-rank {
  font-size: 15px;
  color: #555;
  text-align: center;
}

.lb-name {
  font-size: 15px;
  color: #ccc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 12px;
}

.lb-stat {
  font-size: 14px;
  color: #888;
  text-align: right;
}

.lb-flow {
  color: #c4a0ff;
}

.lb-streak {
  color: #f39c12;
}

.lb-top-1 {
  border-color: #b8860b44;
  background: #181408;
}
.lb-top-1 .lb-name { color: #ffd700; }

.lb-top-2 {
  border-color: #80808033;
  background: #141414;
}
.lb-top-2 .lb-name { color: #c0c0c0; }

.lb-top-3 {
  border-color: #cd7f3233;
  background: #161210;
}
.lb-top-3 .lb-name { color: #cd7f32; }

@media (max-width: 520px) {
  .lb-row {
    grid-template-columns: 40px 1fr repeat(4, 56px);
  }
  .lb-hide-mobile { display: none; }
}

.vid-gallery-date {
  font-size: 12px;
  color: #888;
}
