:root {
  --bg0: #0b1020;
  --bg1: #0f1935;
  --card: rgba(255, 255, 255, 0.7);
  --card2: rgba(255, 255, 255, 0.55);
  --text: #0b1020;
  --muted: rgba(11, 16, 32, 0.65);
  --stroke: rgba(11, 16, 32, 0.14);
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.18);
  --accent: #7c3aed;
  --accent2: #f59e0b;
  --good: #16a34a;
  --danger: #dc2626;
  --radius: 18px;
  --radius2: 12px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
}

html[data-theme="dark"] {
  --card: rgba(18, 24, 45, 0.86);
  --card2: rgba(18, 24, 45, 0.7);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.62);
  --stroke: rgba(255, 255, 255, 0.12);
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(1200px 700px at 30% 10%, #dbeafe, transparent 60%),
    radial-gradient(1000px 700px at 90% 20%, #fce7f3, transparent 55%),
    radial-gradient(900px 700px at 30% 90%, #dcfce7, transparent 55%),
    linear-gradient(180deg, #fafafa, #f4f7ff);
  min-height: 100vh;
  position: relative;
}

body.has-modal {
  overflow: hidden;
}

html[data-theme="dark"] body {
  background: radial-gradient(1100px 720px at 20% 10%, rgba(124, 58, 237, 0.34), transparent 60%),
    radial-gradient(900px 660px at 90% 20%, rgba(245, 158, 11, 0.24), transparent 55%),
    radial-gradient(900px 650px at 30% 90%, rgba(34, 197, 94, 0.14), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}

.bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.85;
  z-index: 0;
}

.bg::before,
.bg::after {
  pointer-events: none;
}

.vibe-photo {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background-position: top center;
  background-size: cover;
  background-repeat: no-repeat;
  z-index: 1;
  transform: translate3d(0, 0, 0);
  transition: opacity 280ms ease;
}

/* Hide vibe backgrounds when a Fun Challenge background is active. */
html[data-challenge-bg] .vibe-photo {
  opacity: 0 !important;
  animation: none !important;
}

html[data-vibe-bg="standard"] .vibe-photo {
  opacity: 1;
  background-image: url("assets/standard.png");
  animation: photoFloat 20s ease-in-out infinite alternate;
}

html[data-vibe-bg="focused"] .vibe-photo {
  opacity: 1;
  background-image: url("assets/focused.png");
  animation: photoFloat 20s ease-in-out infinite alternate;
}

html[data-vibe-bg="productive"] .vibe-photo {
  opacity: 1;
  background-image: url("assets/productive.png");
  animation: photoFloat 20s ease-in-out infinite alternate;
}

html[data-vibe-bg="efficient"] .vibe-photo {
  opacity: 1;
  background-image: url("assets/efficient.png");
  animation: photoFloat 20s ease-in-out infinite alternate;
}

html[data-vibe-bg="balanced"] .vibe-photo {
  opacity: 1;
  background-image: url("assets/balanced.png");
  animation: photoFloat 20s ease-in-out infinite alternate;
}

html[data-vibe-bg="recovery"] .vibe-photo {
  opacity: 1;
  background-image: url("assets/recovery.png");
  animation: photoFloat 20s ease-in-out infinite alternate;
}

html[data-vibe-bg="reset"] .vibe-photo {
  opacity: 1;
  background-image: url("assets/reset.png");
  animation: photoFloat 20s ease-in-out infinite alternate;
}

html[data-vibe-bg="low-energy"] .vibe-photo {
  opacity: 1;
  background-image: url("assets/low-energy.png");
  animation: photoFloat 20s ease-in-out infinite alternate;
}

html[data-vibe-bg="cozy"] .vibe-photo {
  opacity: 1;
  background-image: url("assets/cozy.png");
  animation: photoFloat 20s ease-in-out infinite alternate;
}

.bg-photo {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background-position: top center;
  background-size: cover;
  background-repeat: no-repeat;
  z-index: 1;
  transform: translate3d(0, 0, 0);
  transition: opacity 280ms ease;
}

/* Extra safety: when modals are hidden, never let them block clicks. */
.welcome[aria-hidden="true"],
.auth[aria-hidden="true"],
.modal[aria-hidden="true"] {
  pointer-events: none;
}

html[data-challenge-bg="cleopatra"] .bg-photo {
  opacity: 1;
  background-image: url("assets/cleopatra_planner.png");
  animation: photoFloat 18s ease-in-out infinite alternate;
}

html[data-challenge-bg="elizabeth"] .bg-photo {
  opacity: 1;
  background-image: url("assets/elizabeth.png");
  animation: photoFloat 18s ease-in-out infinite alternate;
}

html[data-challenge-bg="einstein"] .bg-photo {
  opacity: 1;
  background-image: url("assets/einstein.png");
  animation: photoFloat 18s ease-in-out infinite alternate;
}

html[data-challenge-bg="taylor"] .bg-photo {
  opacity: 1;
  background-image: url("assets/taylor.png");
  animation: photoFloat 18s ease-in-out infinite alternate;
}

@keyframes photoFloat {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(0, -10px, 0);
  }
}

.welcome {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 60;
  background: rgba(0, 0, 0, 0.22);
}

.welcome.is-visible {
  display: flex;
  animation: welcomeIn 220ms ease both;
}

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

.welcome-card {
  width: min(620px, 96vw);
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  padding: 16px;
  text-align: center;
  animation: welcomeCardIn 260ms ease both;
}

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

.welcome-card lottie-player {
  width: min(320px, 72vw);
  height: min(320px, 72vw);
  margin: 0 auto 8px;
}

.welcome-title {
  font-weight: 860;
  letter-spacing: 0.2px;
  font-size: 18px;
}

.welcome-text {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.auth {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 66;
  background: rgba(0, 0, 0, 0.28);
}

.auth.is-visible {
  display: flex;
  animation: welcomeIn 220ms ease both;
}

.auth-card {
  width: min(640px, 96vw);
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  padding: 16px;
  text-align: center;
  animation: welcomeCardIn 260ms ease both;
}

.auth-title {
  font-weight: 900;
  letter-spacing: 0.2px;
  font-size: 20px;
}

.auth-text {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 65;
  background: rgba(0, 0, 0, 0.28);
}

.modal.is-visible {
  display: flex;
  animation: welcomeIn 220ms ease both;
}

.modal-card {
  width: min(560px, 96vw);
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  padding: 16px;
  text-align: center;
  animation: welcomeCardIn 260ms ease both;
}

/* Dedicated reset-password route (hide the dashboard behind the reset card). */
body.route-reset,
body.route-reset.has-modal {
  overflow: auto;
}

body.route-reset #app {
  display: none !important;
}

/* Nuclear option: on reset route, hide everything except the reset screen. */
/* Keep #fatalError visible so crashes are diagnosable even on this route. */
body.route-reset > :not(#resetModal):not(#fatalError):not(script):not(style) {
  display: none !important;
}

body.route-reset .vibe-photo,
body.route-reset .bg-photo,
body.route-reset .bg {
  display: none;
}

body.route-reset #resetModal {
  display: flex !important;
  min-height: 100vh;
  min-height: 100svh;
  padding: 32px 18px;
  background: radial-gradient(900px 600px at 18% 10%, rgba(124, 58, 237, 0.18), transparent 60%),
    radial-gradient(900px 650px at 85% 25%, rgba(245, 158, 11, 0.14), transparent 58%),
    radial-gradient(900px 650px at 35% 95%, rgba(34, 197, 94, 0.12), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 247, 255, 0.98));
  /* Remove the usual dark modal overlay look. */
  box-shadow: none;
  /* If aria-hidden accidentally remains "true", still allow interactions. */
  pointer-events: auto !important;
}

body.route-reset #resetModal[aria-hidden="true"] {
  pointer-events: auto !important;
}

html[data-theme="dark"] body.route-reset #resetModal {
  background: radial-gradient(900px 600px at 18% 10%, rgba(124, 58, 237, 0.28), transparent 60%),
    radial-gradient(900px 650px at 85% 25%, rgba(245, 158, 11, 0.22), transparent 58%),
    radial-gradient(900px 650px at 35% 95%, rgba(34, 197, 94, 0.16), transparent 60%),
    linear-gradient(180deg, rgba(9, 12, 22, 0.98), rgba(12, 18, 36, 0.98));
}

body.route-reset #resetModal .modal-card {
  width: min(520px, 94vw);
  padding: 22px;
  text-align: left;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(11, 16, 32, 0.12);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

html[data-theme="dark"] body.route-reset #resetModal .modal-card {
  background: rgba(18, 24, 45, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.55);
}

body.route-reset .reset-brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  font-weight: 900;
  letter-spacing: 0.2px;
  color: var(--text);
}

body.route-reset .reset-mark {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.22);
  font-size: 18px;
}

body.route-reset #resetModal .modal-title {
  font-size: 22px;
}

body.route-reset #resetModal .modal-text {
  font-size: 13px;
  margin-bottom: 8px;
}

/* Reset form layout: stack inputs like a modern auth screen. */
body.route-reset #resetModal .row.wrap {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

body.route-reset #resetModal label.grow {
  width: 100%;
}

body.route-reset #resetModal input[type="password"] {
  width: 100%;
}

/* Make the primary action feel like a SaaS auth CTA. */
body.route-reset #btnResetSubmit {
  width: 100%;
  justify-content: center;
}

body.route-reset #btnResetClose {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 10px 6px;
  color: var(--muted);
  text-decoration: underline;
  justify-content: center;
}

body.route-reset #resetModal .reset-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

body.route-reset #welcome {
  display: none !important;
}

body.route-reset #upgradeModal,
body.route-reset #authGate {
  display: none !important;
}

/* Extra safety: hide any other modals/overlays on reset route. */
body.route-reset .modal:not(#resetModal),
body.route-reset .auth,
body.route-reset .welcome {
  display: none !important;
}

.modal-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.14);
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 780;
  letter-spacing: 0.2px;
  margin-bottom: 10px;
}

.modal-title {
  font-weight: 900;
  letter-spacing: 0.2px;
  font-size: 22px;
}

.modal-text {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.paypal-wrap[hidden] {
  display: none;
}

.paypal-wrap {
  width: min(420px, 92vw);
  margin: 12px auto 0;
}

.billing-manage[hidden] {
  display: none;
}

.billing-manage {
  width: min(460px, 92vw);
  margin: 12px auto 0;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(245, 158, 11, 0.22);
  background: rgba(245, 158, 11, 0.08);
}

.welcome .row {
  justify-content: center;
  margin-top: 12px;
}

.bg::before,
.bg::after {
  content: "";
  position: absolute;
  width: 740px;
  height: 740px;
  border-radius: 999px;
  opacity: 0.55;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.bg::before {
  left: -220px;
  top: -260px;
  background: radial-gradient(circle at 30% 30%, rgba(124, 58, 237, 0.55), transparent 65%),
    radial-gradient(circle at 70% 60%, rgba(59, 130, 246, 0.45), transparent 62%),
    radial-gradient(circle at 40% 80%, rgba(245, 158, 11, 0.38), transparent 60%);
  animation: blobMove 18s ease-in-out infinite alternate;
}

.bg::after {
  right: -260px;
  bottom: -300px;
  width: 820px;
  height: 820px;
  background: radial-gradient(circle at 30% 30%, rgba(34, 197, 94, 0.45), transparent 62%),
    radial-gradient(circle at 60% 70%, rgba(244, 63, 94, 0.32), transparent 60%),
    radial-gradient(circle at 70% 30%, rgba(245, 158, 11, 0.34), transparent 62%);
  animation: blobMove2 24s ease-in-out infinite alternate;
}

@keyframes blobMove {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(120px, 60px, 0) scale(1.06);
  }
  100% {
    transform: translate3d(70px, 140px, 0) scale(1.02);
  }
}

@keyframes blobMove2 {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(-140px, -70px, 0) scale(1.05);
  }
  100% {
    transform: translate3d(-90px, -150px, 0) scale(1.02);
  }
}

.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
  padding: 18px;
  max-width: 1320px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.sidebar {
  position: sticky;
  top: 18px;
  height: calc(100vh - 36px);
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 10px 14px;
  border-bottom: 1px solid var(--stroke);
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.22), rgba(245, 158, 11, 0.18));
  border: 1px solid var(--stroke);
  font-size: 20px;
  animation: floatMark 6s ease-in-out infinite;
}

@keyframes floatMark {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.brand-name {
  font-weight: 780;
  letter-spacing: 0.2px;
}

.brand-tag {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.nav {
  display: grid;
  gap: 8px;
  padding: 14px 8px;
}

.nav-btn {
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: transparent;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.nav-btn:hover {
  transform: translateY(-1px);
  background: rgba(124, 58, 237, 0.08);
  border-color: rgba(124, 58, 237, 0.28);
}

.nav-btn.is-active {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.22), rgba(245, 158, 11, 0.12));
  border-color: rgba(124, 58, 237, 0.35);
}

.sidebar-footer {
  margin-top: auto;
  padding: 10px 8px 4px;
  border-top: 1px solid var(--stroke);
  display: grid;
  gap: 6px;
}

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

.main {
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  padding: 8px 4px 16px;
}

.title {
  font-weight: 820;
  font-size: 20px;
  letter-spacing: 0.2px;
}

.subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.topbar-right {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.chip {
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: var(--card2);
  color: var(--text);
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 650;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.chip:hover {
  transform: translateY(-1px);
  border-color: rgba(124, 58, 237, 0.3);
}

.chip.premium {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.14);
}

.content {
  display: block;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(320px, 520px);
  gap: 18px;
  align-items: start;
}

.panels {
  display: grid;
  gap: 18px;
}

.panel {
  display: none;
}

.panel.is-visible {
  display: block;
  animation: panelIn 220ms ease both;
}

.response-body.is-flash {
  animation: flash 520ms ease;
}

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

@keyframes flash {
  0% {
    box-shadow: 0 0 0 rgba(124, 58, 237, 0);
    border-color: rgba(124, 58, 237, 0.15);
  }
  50% {
    box-shadow: 0 22px 70px rgba(124, 58, 237, 0.22);
    border-color: rgba(124, 58, 237, 0.35);
  }
  100% {
    box-shadow: 0 0 0 rgba(124, 58, 237, 0);
    border-color: rgba(124, 58, 237, 0.15);
  }
}

.response-wrap {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 18px;
}

.card {
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  padding: 14px;
}

.card.soft {
  background: var(--card2);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.12);
}

.badge.premium {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.14);
}

.nav-btn.is-paywalled {
  opacity: 0.55;
  filter: blur(1.2px);
}

.panel.is-paywalled > .card:not(.paywall-card) {
  filter: blur(8px);
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
}

.paywall-card {
  border-color: rgba(245, 158, 11, 0.28);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.10), rgba(124, 58, 237, 0.08));
}

.paywall-body {
  display: grid;
  gap: 12px;
  padding: 2px;
}

.paywall-text {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 2px 2px 10px;
}

.card-head h2 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--muted);
}

.card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.badge {
  font-size: 12px;
  border: 1px solid var(--stroke);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.09);
}

.form {
  display: grid;
  gap: 10px;
  padding: 2px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

input,
select,
textarea {
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
  font: inherit;
  font-size: 14px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(124, 58, 237, 0.45);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
  background: rgba(255, 255, 255, 0.62);
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14);
}

.nav-btn:focus-visible,
.chip:focus-visible,
.pill:focus-visible,
.primary:focus-visible,
.secondary:focus-visible,
.icon-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.16);
  border-color: rgba(124, 58, 237, 0.45);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: rgba(255, 255, 255, 0.06);
}

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

.row {
  display: flex;
  gap: 10px;
  align-items: end;
}

.row.wrap {
  flex-wrap: wrap;
  align-items: center;
}

.grow {
  flex: 1;
}

.primary,
.secondary {
  border-radius: 14px;
  border: 1px solid var(--stroke);
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 720;
  color: var(--text);
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.primary {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.26), rgba(245, 158, 11, 0.14));
  border-color: rgba(124, 58, 237, 0.35);
}

.secondary {
  background: rgba(255, 255, 255, 0.45);
}

html[data-theme="dark"] .secondary {
  background: rgba(255, 255, 255, 0.06);
}

.primary:hover,
.secondary:hover {
  transform: translateY(-1px);
  border-color: rgba(124, 58, 237, 0.35);
}

.hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.figure-scroll {
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.25);
  overflow: auto;
  max-height: 320px;
  scrollbar-gutter: stable;
}

html[data-theme="dark"] .figure-scroll {
  background: rgba(0, 0, 0, 0.18);
}

.figure-scroll img {
  display: block;
  width: 100%;
  height: auto;
}

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

.lockbox {
  margin-top: 10px;
  padding: 12px;
  border-radius: 16px;
  border: 1px dashed rgba(255, 105, 180, 0.35);
  background: linear-gradient(135deg, rgba(255, 105, 180, 0.12), rgba(245, 196, 255, 0.12));
}

.lock-title {
  font-weight: 800;
  letter-spacing: 0.2px;
  margin-bottom: 6px;
}

.lock-text {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  margin-bottom: 10px;
}

.primary.is-locked {
  filter: grayscale(0.15) saturate(0.9);
  box-shadow: none;
  opacity: 0.92;
}

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

.pill {
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 9px 12px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.45);
  color: var(--text);
  font-weight: 650;
}

html[data-theme="dark"] .pill {
  background: rgba(255, 255, 255, 0.06);
}

.pill:hover {
  border-color: rgba(124, 58, 237, 0.35);
}

.nav-btn:active,
.chip:active,
.primary:active,
.secondary:active,
.pill:active,
.icon-btn:active {
  transform: translateY(0) scale(0.98);
}

.sidebar,
.card,
input,
select,
textarea {
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, box-shadow 180ms ease,
    transform 160ms ease;
}

.card:hover {
  transform: translateY(-1px);
  border-color: rgba(124, 58, 237, 0.22);
}

.response-body {
  min-height: 380px;
  border-radius: var(--radius2);
  padding: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.38);
  overflow: auto;
}

html[data-theme="dark"] .response-body {
  background: rgba(0, 0, 0, 0.18);
}

.response-body h3 {
  margin: 18px 0 10px;
  font-size: 13px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  color: var(--muted);
}

.response-body h3:first-child {
  margin-top: 0;
}

.response-body ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.response-body li {
  margin: 6px 0;
  line-height: 1.35;
}

.timetable {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  margin-top: 8px;
}

.timetable th,
.timetable td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--stroke);
  vertical-align: top;
  font-size: 14px;
}

.timetable th {
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.25px;
  background: rgba(124, 58, 237, 0.08);
}

.timetable tr:last-child td {
  border-bottom: none;
}

.sublist {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.sublist li {
  margin: 4px 0;
}

.block-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.block-sticker {
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
}

.block-label {
  font-weight: 740;
}

.custom-blocks {
  display: grid;
  gap: 10px;
  padding: 2px;
}

.ct-item {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.38);
}

html[data-theme="dark"] .ct-item {
  background: rgba(0, 0, 0, 0.14);
}

.ct-swatch {
  width: 12px;
  height: 44px;
  border-radius: 999px;
}

.ct-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ct-sticker {
  font-size: 16px;
}

.ct-title {
  font-weight: 820;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ct-time {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.ct-del {
  white-space: nowrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  color: var(--muted);
  margin-right: 6px;
  background: rgba(255, 255, 255, 0.36);
}

html[data-theme="dark"] .tag {
  background: rgba(255, 255, 255, 0.06);
}

.tag.premium {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.14);
  color: var(--text);
}

.tag.good {
  border-color: rgba(22, 163, 74, 0.35);
  background: rgba(22, 163, 74, 0.12);
  color: var(--text);
}

.tag.alert {
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.12);
  color: var(--text);
}

.habits {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.habit-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.38);
}

html[data-theme="dark"] .habit-row {
  background: rgba(0, 0, 0, 0.14);
}

.habit-name {
  font-weight: 700;
  color: var(--text);
}

.streak {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.habit-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.icon-btn {
  border: 1px solid var(--stroke);
  background: transparent;
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--text);
}

.icon-btn:hover {
  border-color: rgba(124, 58, 237, 0.35);
}

.today {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
  padding: 2px 2px 4px;
}

.quote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  padding: 2px 2px 4px;
}

.quote {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--quote-border, rgba(11, 16, 32, 0.12));
  border-radius: 18px;
  padding: 14px 14px;
  background: var(--quote-bg, linear-gradient(135deg, #e0e7ff, #ffe4e6));
  color: #0b1020;
  font-weight: 780;
  line-height: 1.35;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.1);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.quote::after {
  content: "“";
  position: absolute;
  right: 12px;
  top: 8px;
  font-size: 32px;
  opacity: 0.16;
  transform: rotate(8deg);
  pointer-events: none;
}

.quote:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.14);
}

.quote-grid .quote:nth-child(8n + 1) {
  --quote-bg: linear-gradient(135deg, #ede9fe, #dbeafe);
  --quote-border: rgba(124, 58, 237, 0.28);
}

.quote-grid .quote:nth-child(8n + 2) {
  --quote-bg: linear-gradient(135deg, #fef3c7, #dcfce7);
  --quote-border: rgba(245, 158, 11, 0.3);
}

.quote-grid .quote:nth-child(8n + 3) {
  --quote-bg: linear-gradient(135deg, #ffe4e6, #f3e8ff);
  --quote-border: rgba(244, 63, 94, 0.26);
}

.quote-grid .quote:nth-child(8n + 4) {
  --quote-bg: linear-gradient(135deg, #ccfbf1, #cffafe);
  --quote-border: rgba(20, 184, 166, 0.26);
}

.quote-grid .quote:nth-child(8n + 5) {
  --quote-bg: linear-gradient(135deg, #e0e7ff, #fae8ff);
  --quote-border: rgba(99, 102, 241, 0.24);
}

.quote-grid .quote:nth-child(8n + 6) {
  --quote-bg: linear-gradient(135deg, #ecfccb, #fef9c3);
  --quote-border: rgba(132, 204, 22, 0.24);
}

.quote-grid .quote:nth-child(8n + 7) {
  --quote-bg: linear-gradient(135deg, #e0f2fe, #fce7f3);
  --quote-border: rgba(14, 165, 233, 0.26);
}

.quote-grid .quote:nth-child(8n + 8) {
  --quote-bg: linear-gradient(135deg, #ffedd5, #f5f5f4);
  --quote-border: rgba(249, 115, 22, 0.24);
}

@media (prefers-reduced-motion: reduce) {
  .quote {
    transition: none;
  }
  .quote:hover {
    transform: none;
  }
}

.timer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.32);
}

html[data-theme="dark"] .timer {
  background: rgba(0, 0, 0, 0.14);
}

.timer-label {
  font-size: 12px;
  color: var(--muted);
}

.timer-value {
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  font-size: 24px;
  letter-spacing: 0.5px;
}

@media (max-width: 980px) {
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: relative;
    height: auto;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .response-wrap {
    position: relative;
    top: auto;
  }
}

@media print {
  .welcome {
    display: none !important;
  }
  .sidebar,
  .topbar,
  .response-wrap .card.soft {
    display: none !important;
  }
  .app {
    grid-template-columns: 1fr;
    padding: 0;
  }
  .card {
    box-shadow: none;
    background: white;
  }
  .response-body {
    border: none;
    background: white;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vibe-photo {
    animation: none !important;
  }
  .bg-photo {
    animation: none !important;
  }
  .bg::before,
  .bg::after {
    animation: none !important;
  }
  .brand-mark {
    animation: none !important;
  }
  .panel.is-visible {
    animation: none !important;
  }
  .response-body.is-flash {
    animation: none !important;
  }
}
