
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--gutter) 14px;
  width: 100%;
  box-sizing: border-box;
  position: sticky;
  top: 0;
  background: var(--theme-panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 10;
  isolation: isolate;
  transform: translateZ(0);
}

.logo {
  font-family: var(--ui-font);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.nav-links {
  display: flex;
  gap: 16px;
  font-family: var(--ui-font);
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
  white-space: nowrap;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-link {
  color: #f6dbc2;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 18px;
  transition: all 0.2s ease;
}

.logo,
.nav-link,
.hero-text h1,
.hero-text p,
.eyebrow,
.status-bar,
.sidebar-header h3,
.auth-panel h2,
.auth-sub,
.settings h2,
.chat-title,
.chat-subtitle {
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.58);
}

.nav-link:hover {
  background: var(--theme-hover-bg);
}

.nav-cta {
  background: var(--theme-accent-soft);
  border: 1px solid var(--theme-accent-soft-2);
}

.share-header {
  display: flex;
  gap: 8px;
  align-items: center;
}

.share-header input {
  width: 140px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
}

.page {
  padding: 28px var(--gutter) 80px;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 36px;
  align-items: center;
  margin-top: 30px;
}

.home-guest-note {
  margin-bottom: 20px;
  padding: 8px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #fbe7cf;
  font-family: var(--ui-font);
  font-size: 0.9rem;
  width: fit-content;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.home-guest-note a {
  color: #fff6dc;
  font-weight: 600;
}

.hero-text h1 {
  font-size: clamp(2.2rem, 3vw, 3.4rem);
  margin: 12px 0 12px;
}

.hero-text p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #f7dcc1;
}

.eyebrow {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: #f8b57a;
}

.hero-actions {
  margin-top: 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-meta {
  margin-top: 14px;
  font-family: var(--ui-font);
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.78);
  max-width: 52ch;
}

.btn {
  font-family: var(--ui-font);
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.primary {
  background: linear-gradient(135deg, var(--theme-accent), var(--theme-accent-2));
  color: var(--theme-accent-text);
  box-shadow: 0 10px 25px var(--theme-accent-soft);
  font-weight: 500;
}

.btn.primary:hover {
  box-shadow: 0 0 20px var(--theme-accent-soft-2), 0 10px 30px var(--theme-accent-soft);
}

.btn.ghost {
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #eae0de;
  background: rgba(255, 255, 255, 0.04);
  transition: all 0.25s ease;
}

.btn.ghost:hover {
  background: var(--theme-hover-bg);
  border-color: var(--theme-accent-soft-2);
  box-shadow: 0 0 12px var(--theme-accent-soft);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active:not(.disabled) {
  transform: translateY(1px) scale(0.98);
  box-shadow: none;
}

.btn:disabled,
.btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

button {
  transition: transform 0.12s ease, filter 0.12s ease;
}

button:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
  filter: brightness(0.98);
}

.hero-visual {
  display: flex;
  justify-content: center;
}

.campfire-card {
  width: min(360px, 90%);
  aspect-ratio: 4 / 5;
  background: linear-gradient(160deg, var(--theme-accent-soft), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--theme-panel-border);
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.campfire-glow {
  position: absolute;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, var(--theme-accent) 0%, var(--theme-accent-soft-2) 32%, transparent 70%);
  filter: blur(10px);
  animation: fireGlow 2.8s ease-in-out infinite;
  top: 44%;
  left: 50%;
}

.hero-symbol {
  position: absolute;
  bottom: 80px;
  left: 50%;
  width: min(270px, 84%);
  height: auto;
  transform: translateX(-50%);
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.35));
  animation: symbolFloat 3.6s ease-in-out infinite;
  pointer-events: none;
  user-select: none;
}

.campfire-text {
  position: absolute;
  bottom: 24px;
  left: 28px;
  right: 28px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1rem;
}

.campfire-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  margin-bottom: 10px;
}

.campfire-line {
  height: 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.2);
  margin-bottom: 8px;
}

.campfire-line.short {
  width: 65%;
}

@keyframes symbolFloat {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-8px); }
}

@keyframes fireGlow {
  0%, 100% { opacity: 0.55; transform: translate(-50%, -50%) scale(0.95); }
  50% { opacity: 0.95; transform: translate(-50%, -50%) scale(1.06); }
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 48px;
}

.feature-card {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.feature-card h3 {
  margin: 0 0 8px;
  font-family: var(--ui-font);
}

.feature-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.65;
}

.home-section {
  margin-top: 54px;
}

.home-section h2 {
  margin: 0 0 14px;
  font-family: var(--ui-font);
  font-size: 1.4rem;
}

.home-sub {
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.65;
  max-width: 75ch;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.home-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.home-card h3 {
  margin: 0 0 8px;
  font-family: var(--ui-font);
  font-size: 1.02rem;
}

.home-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.65;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.theme-pill {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.theme-pill:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--theme-accent-soft-2);
}

.theme-name {
  font-family: var(--ui-font);
  font-weight: 600;
}

.theme-desc {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.74);
}

.security-card {
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.12));
  border: 1px solid rgba(255, 255, 255, 0.08);
  max-width: 900px;
}

.security-card h2 {
  margin: 0 0 10px;
}

.security-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.65;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.entry-sidebar {
  background: var(--theme-panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 18px;
  padding: 18px;
  border: 1px solid var(--theme-panel-border);
  height: fit-content;
  max-width: 320px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sidebar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.sidebar-actions .btn {
  padding: 6px 14px;
  font-size: 0.85rem;
  min-width: 80px;
  white-space: nowrap;
}

.entry-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.entry-item {
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--ui-font);
  font-size: 0.9rem;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.entry-item:hover {
  background: var(--theme-hover-bg);
  border-color: var(--theme-panel-border);
}

.entry-item.active {
  border: 1px solid var(--theme-accent-soft-2);
  background: var(--theme-accent-soft);
  box-shadow: 0 0 12px var(--theme-accent-soft);
}

.book-area {
  position: relative;
  min-width: 0;
}

.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  color: #f7caa2;
}

.status-info {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.autosave-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  font-size: 0.75rem;
  color: #f7d1a9;
}

.autosave-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.autosave-track {
  width: 36px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  position: relative;
  transition: background 0.2s ease;
}

.autosave-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f7ead2;
  transition: transform 0.2s ease;
}

.autosave-toggle input:checked + .autosave-track {
  background: var(--theme-accent-2);
}

.autosave-toggle input:checked + .autosave-track::after {
  transform: translateX(18px);
}

.autosave-label {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.02em;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.tool-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.2);
  color: #f8ddbf;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  cursor: pointer;
}

.tool-btn:nth-of-type(2) {
  font-style: italic;
}

.tool-btn:nth-of-type(3) {
  text-decoration: underline;
}

.tool-btn.active {
  background: var(--theme-accent-soft);
  border-color: var(--theme-accent-soft-2);
  color: #fff4df;
}

.tool-size {
  margin-left: 6px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem;
  color: #f5cfa7;
}

.tool-select {
  min-width: 108px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(40, 22, 14, 0.92);
  color: #ffe9cc;
  padding: 0 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
}

.tool-select option {
  background: #f2e5cf;
  color: #2a1a11;
}

.book {
  position: relative;
  background:
    radial-gradient(circle at 14% 12%, rgba(255, 240, 205, 0.44), transparent 28%),
    radial-gradient(circle at 80% 18%, rgba(134, 84, 40, 0.18), transparent 34%),
    radial-gradient(circle at 30% 76%, rgba(118, 74, 36, 0.15), transparent 38%),
    radial-gradient(circle at 66% 58%, rgba(98, 62, 30, 0.11), transparent 40%),
    repeating-linear-gradient(43deg, rgba(108, 72, 38, 0.04) 0 2px, rgba(255, 246, 224, 0.02) 2px 5px),
    repeating-linear-gradient(-38deg, rgba(90, 58, 28, 0.03) 0 3px, rgba(255, 245, 220, 0.015) 3px 7px),
    linear-gradient(180deg, #f0e2c4 0%, #e8d4ad 46%, #dfc69b 100%);
  color: var(--ink);
  border-radius: 22px;
  padding: 34px;
  min-height: 680px;
  border: 12px solid var(--book-cover);
  box-shadow:
    0 28px 80px var(--shadow),
    inset 0 0 0 2px rgba(30, 14, 7, 0.45),
    inset 0 0 65px rgba(70, 40, 18, 0.24),
    inset 0 0 110px rgba(58, 31, 14, 0.14);
  overflow: hidden;
  width: 100%;
  perspective: 1200px;
  transition: border-color 0.35s ease;
}

.book::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 14px;
  border: 1px solid rgba(80, 48, 24, 0.42);
  background:
    radial-gradient(circle at 12% 82%, rgba(120, 76, 38, 0.12), transparent 30%),
    radial-gradient(circle at 84% 24%, rgba(126, 78, 40, 0.1), transparent 30%),
    radial-gradient(circle at 48% 52%, rgba(92, 56, 28, 0.06), transparent 44%),
    repeating-linear-gradient(0deg, rgba(255, 244, 215, 0.02) 0 1px, rgba(95, 60, 30, 0.02) 1px 2px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 230, 185, 0.28),
    inset 0 0 42px rgba(108, 64, 30, 0.26),
    inset 0 0 16px rgba(60, 34, 16, 0.18);
  pointer-events: none;
  z-index: 0;
  opacity: 0.9;
}

.book::after {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 50%;
  width: 16px;
  transform: translateX(-50%);
  border-radius: 7px;
  background:
    linear-gradient(90deg, rgba(54, 28, 14, 0.48), rgba(243, 208, 158, 0.28) 45%, rgba(54, 28, 14, 0.42));
  box-shadow:
    inset 0 0 10px rgba(35, 19, 10, 0.34),
    0 0 10px rgba(54, 28, 12, 0.14);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
  display: none;
}

.page {
  position: relative;
  z-index: 1;
}

.page-title {
  width: 100%;
  font-size: 1.6rem;
  font-family: var(--title-font);
  font-weight: 600;
  letter-spacing: -0.01em;
  border: none;
  background: transparent;
  margin-bottom: 18px;
  color: var(--ink);
}

.page-content {
  width: 100%;
  min-height: 100%;
  height: auto;
  border: none;
  background: transparent;
  font-family: var(--editor-font);
  font-size: 1.08rem;
  line-height: 1.85;
  color: var(--ink);
  white-space: pre-wrap;
  resize: none;
  overflow: hidden;
  padding-right: 12px;
  letter-spacing: 0.01em;
}

.page-scroll {
  min-height: 520px;
  max-height: 520px;
  overflow-y: scroll;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.page-title:focus,
.page-title:focus-visible,
.page-content:focus,
.page-content:focus-visible,
.page-title:active,
.page-content:active {
  outline: none;
  box-shadow: none;
  border-color: transparent;
}


.page-turn {
  position: absolute;
  top: auto;
  right: 0;
  left: auto;
  bottom: 0;
  width: 170px;
  height: 170px;
  background:
    linear-gradient(315deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.46) 45%, rgba(255, 255, 255, 0) 78%),
    linear-gradient(315deg, rgba(0, 0, 0, 0.24), rgba(0, 0, 0, 0) 70%);
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.12);
  clip-path: polygon(100% 100%, 0 100%, 100% 0);
  transform-origin: bottom right;
  transform: none;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  backface-visibility: hidden;
  transform-style: preserve-3d;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.2));
}

.page-turn.turn-next {
  transform-origin: bottom right;
  animation: pageTurnNext 0.72s cubic-bezier(0.22, 0.69, 0.14, 0.99);
}

.page-turn.turn-prev {
  left: 0;
  right: auto;
  clip-path: polygon(0 100%, 100% 100%, 0 0);
  transform-origin: bottom left;
  animation: pageTurnPrev 0.72s cubic-bezier(0.22, 0.69, 0.14, 0.99);
}

@keyframes pageTurnNext {
  0% { transform: rotateY(0deg) translate(0, 0) scale(1); opacity: 0.9; }
  45% { transform: rotateY(-50deg) translate(-4px, -6px) scale(1.03); opacity: 0.6; }
  100% { transform: rotateY(-82deg) translate(-8px, -10px) scale(1.08); opacity: 0; }
}

@keyframes pageTurnPrev {
  0% { transform: rotateY(0deg) translate(0, 0) scale(1); opacity: 0.9; }
  45% { transform: rotateY(50deg) translate(4px, -6px) scale(1.03); opacity: 0.6; }
  100% { transform: rotateY(82deg) translate(8px, -10px) scale(1.08); opacity: 0; }
}

.page-controls {
  margin-top: 16px;
  display: flex;
  gap: 12px;
}

.story-image-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  gap: 10px;
}

.field-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  color: #f3d1b2;
}

.image-actions {
  display: grid;
  gap: 8px;
}

.story-image-panel input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
}

.share-panel {
  display: grid;
  gap: 12px;
  padding: 14px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.share-panel-head {
  display: grid;
  gap: 3px;
}

.share-panel-head .field-label {
  margin: 0;
}

.share-panel-note {
  font-family: var(--ui-font);
  font-size: 0.78rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.58);
}

.share-controls {
  display: grid;
  gap: 8px;
}

.share-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.share-row input {
  min-width: 0;
  height: 48px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  font-size: 0.92rem;
  line-height: 1.2;
}

.share-row input[readonly] {
  color: var(--theme-accent);
  border-color: var(--theme-accent-soft-2);
  background: var(--theme-accent-soft);
  font-weight: 700;
}

.share-row input.is-error {
  border-color: rgba(255, 120, 110, 0.82);
  background: rgba(120, 24, 34, 0.28);
  color: #ffd9d4;
  box-shadow: 0 0 0 1px rgba(255, 120, 110, 0.18), 0 0 14px rgba(255, 120, 110, 0.18);
}

.share-row input.is-error::placeholder {
  color: #ffb4a8;
  opacity: 1;
}

.share-custom-row {
  margin-top: 0;
}

.share-custom-hint {
  min-height: 1.1rem;
  margin: -3px 0 0;
  font-size: 0.78rem;
  line-height: 1.3;
}

.share-custom-hint:empty {
  display: none;
}

.share-custom-hint[data-kind="error"] {
  color: #ffb4a8;
}

.share-custom-hint[data-kind="success"] {
  color: var(--theme-accent);
}

.share-row .btn,
.share-actions .btn,
.share-mode-btn {
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.86rem;
  line-height: 1.15;
  white-space: nowrap;
  transform: none;
}

.share-row .btn:hover,
.share-actions .btn:hover,
.share-mode-btn:hover {
  transform: none;
}

#shareGenerateBtn {
  width: 104px;
  white-space: nowrap;
}

.share-permission-row {
  padding: 10px 0 2px;
}

.share-checkbox-label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  font-family: var(--ui-font);
  font-size: 0.84rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.78);
}

.share-checkbox-label input {
  width: 14px;
  height: 14px;
  margin-top: 3px;
  accent-color: var(--theme-accent);
}

.share-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.share-mode-wrap {
  position: relative;
}

.share-mode-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--theme-accent-soft-2);
  background: var(--theme-accent-soft);
  color: var(--theme-accent);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.page-controls {
  margin-top: 16px;
  display: flex;
  gap: 12px;
}

.story-image-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  gap: 10px;
}

.field-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  color: #f3d1b2;
}

.image-actions {
  display: grid;
  gap: 8px;
}

.story-image-panel input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
}

.share-panel {
  display: grid;
  gap: 12px;
  padding: 14px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.share-panel-head {
  display: grid;
  gap: 3px;
}

.share-panel-head .field-label {
  margin: 0;
}

.share-panel-note {
  font-family: var(--ui-font);
  font-size: 0.78rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.58);
}

.share-controls {
  display: grid;
  gap: 8px;
}

.share-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.share-row input {
  min-width: 0;
  height: 48px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  font-size: 0.92rem;
  line-height: 1.2;
}

.share-row input[readonly] {
  color: var(--theme-accent);
  border-color: var(--theme-accent-soft-2);
  background: var(--theme-accent-soft);
  font-weight: 700;
}

.share-row input.is-error {
  border-color: rgba(255, 120, 110, 0.82);
  background: rgba(120, 24, 34, 0.28);
  color: #ffd9d4;
  box-shadow: 0 0 0 1px rgba(255, 120, 110, 0.18), 0 0 14px rgba(255, 120, 110, 0.18);
}

.share-row input.is-error::placeholder {
  color: #ffb4a8;
  opacity: 1;
}

.share-custom-row {
  margin-top: 0;
}

.share-custom-hint {
  min-height: 1.1rem;
  margin: -3px 0 0;
  font-size: 0.78rem;
  line-height: 1.3;
}

.share-custom-hint:empty {
  display: none;
}

.share-custom-hint[data-kind="error"] {
  color: #ffb4a8;
}

.share-custom-hint[data-kind="success"] {
  color: var(--theme-accent);
}

.share-row .btn,
.share-actions .btn,
.share-mode-btn {
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.86rem;
  line-height: 1.15;
  white-space: nowrap;
  transform: none;
}

.share-row .btn:hover,
.share-actions .btn:hover,
.share-mode-btn:hover {
  transform: none;
}

#shareGenerateBtn {
  width: 104px;
  white-space: nowrap;
}

.share-permission-row {
  padding: 10px 0 2px;
}

.share-checkbox-label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  font-family: var(--ui-font);
  font-size: 0.84rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.78);
}

.share-checkbox-label input {
  width: 14px;
  height: 14px;
  margin-top: 3px;
  accent-color: var(--theme-accent);
}

.share-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.share-mode-wrap {
  position: relative;
}

.share-mode-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--theme-accent-soft-2);
  background: var(--theme-accent-soft);
  color: var(--theme-accent);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.share-mode-btn:hover {
  background: var(--theme-accent-soft-2);
}

.chevron-icon {
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.share-mode-btn[aria-expanded="true"] .chevron-icon {
  transform: rotate(180deg);
}

.share-mode-btn:focus {
  outline: 2px solid var(--theme-focus);
  outline-offset: 2px;
}

.share-mode-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 150px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--theme-accent-soft-2);
  background: var(--theme-panel-bg-2);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.35);
  display: none;
  z-index: 10;
}

.share-mode-menu.open {
  display: grid;
  gap: 4px;
}

.share-mode-option {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.84);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
}

.share-mode-option:hover,
.share-mode-option:focus {
  background: var(--theme-accent-soft);
  border-color: var(--theme-accent-soft-2);
  outline: none;
}

.share-mode-option.is-active {
  background: var(--theme-accent-soft-2);
  border-color: var(--theme-accent-soft-2);
  color: var(--theme-accent);
}

.public-story {
  width: 100%;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
}

.public-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.public-sidebar {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  height: fit-content;
}

.public-page-count {
  margin-right: auto;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--theme-accent);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

.public-meta {
  margin-top: 16px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.78);
}

.public-mode {
  margin-left: 12px;
  font-size: 0.82rem;
  color: var(--theme-accent) !important;
  background: var(--theme-accent-soft) !important;
  border: 1px solid var(--theme-accent-soft-2);
  border-radius: 999px !important;
}

.public-notice {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.image-preview {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  padding: 10px;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-preview img {
  max-width: 100%;
  border-radius: 10px;
}

.page-illustration {
  position: absolute;
  top: 60px;
  left: 20px;
  width: 250px;
  display: none;
  border-radius: 24px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.04);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  cursor: grab;
  z-index: 20;
}

.page-illustration:active {
  cursor: grabbing;
}

.page-illustration img {
  width: 100%;
  height: auto; /* Natural aspect ratio by default */
  object-fit: cover;
  display: block;
  border-radius: 24px;
  pointer-events: none;
}

/* When user has set an explicit height via resize, fill the container */
.page-illustration[style*="height:"] img {
  height: 100%;
}

/* Mobile responsive illustration - Restores original responsive text while allowing image overflow via bottom scroll */
@media (max-width: 768px) {
  .book, 
  .public-story .book {
    padding: 12px 10px !important;
    min-height: auto !important;
    max-height: none !important; /* Move scroll constraint here */
    max-width: 100% !important;
    overflow-x: hidden !important; /* No horizontal scroll — image is clamped */
    overflow-y: auto !important;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    
    /* Force visible scrollbars on mobile */
    scrollbar-width: auto !important;
    scrollbar-color: var(--theme-accent) rgba(0,0,0,0.1) !important;
    
    /* Ensure background texture is stable and covers the entire visible area */
    background-attachment: scroll !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;

    /* Move important texture layers from ::before to the main background 
       to prevent them from scrolling and 'breaking' */
    background-image: 
      radial-gradient(circle at 14% 12%, rgba(255, 240, 205, 0.44), transparent 28%),
      radial-gradient(circle at 80% 18%, rgba(134, 84, 40, 0.18), transparent 34%),
      radial-gradient(circle at 30% 76%, rgba(118, 74, 36, 0.15), transparent 38%),
      radial-gradient(circle at 12% 82%, rgba(120, 76, 38, 0.12), transparent 30%),
      radial-gradient(circle at 84% 24%, rgba(126, 78, 40, 0.1), transparent 30%),
      linear-gradient(180deg, #f0e2c4 0%, #dfc69b 100%) !important;
  }

  .book::before,
  .public-story .book::before {
    display: none !important; /* Prevents the absolute positioned texture from scrolling away */
  }

  /* Webkit Scrollbar Styling for Mobile Visibility */
  .book::-webkit-scrollbar, 
  .public-story .book::-webkit-scrollbar {
    width: 8px !important; /* Slightly wider for touch */
    height: 8px !important;
    display: block !important;
  }
  .book::-webkit-scrollbar-track,
  .public-story .book::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.08) !important;
    border-radius: 10px !important;
    margin: 10px !important;
  }
  .book::-webkit-scrollbar-thumb,
  .public-story .book::-webkit-scrollbar-thumb {
    background: var(--theme-accent) !important;
    border-radius: 10px !important;
    border: 2px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 0 10px rgba(0,0,0,0.2) !important;
  }

  .public-main,
  .public-layout {
    max-width: 100% !important;
    overflow-x: hidden !important; /* Prevent the entire layout from swiping */
  }

  .page,
  .public-page {
    width: 100% !important;
    height: auto !important; /* Let content determine height */
    min-height: none !important;
    max-height: none !important;
    position: relative !important;
    overflow: visible !important; /* Let parent .book handle scrolling */
    display: block !important;
    padding: 20px 16px !important;
  }
  
  .public-content,
  .page-scroll {
    max-width: 100% !important;
    overflow-x: visible !important; 
    overflow-y: visible !important;
    display: block !important;
  }

  .page-scroll {
    width: 100% !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
  }

  .page-illustration {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 16px 0 !important;
    z-index: 20;
    overflow: hidden !important;
    border-radius: 16px !important;
  }

  .page-illustration img {
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    display: block;
  }

  .public-controls {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 8px !important;
  }

  .public-controls #publicSaveBtn {
    margin-left: 0 !important;
    width: auto !important;
    order: 0;
  }

  .public-layout {
    grid-template-columns: 1fr !important;
  }

  .entry-sidebar {
    max-width: 100% !important;
  }

  #resizeHandle {
    display: flex !important;
    width: 44px !important;
    height: 44px !important;
    bottom: 6px !important;
    right: 6px !important;
    background: rgba(0, 0, 0, 0.35) !important;
    border: 2px solid rgba(255, 255, 255, 0.6) !important;
    border-radius: 50% !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: nwse-resize !important;
  }

  .page-illustration {
    cursor: default !important;
  }
}

.resize-handle {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 24px;
  height: 24px;
  cursor: nwse-resize;
  background: linear-gradient(-45deg, rgba(0, 0, 0, 0.3) 15%, transparent 60%);
  border-bottom-right-radius: 14px;
  z-index: 30;
  transition: opacity 0.2s;
}

.resize-handle:hover {
  background: linear-gradient(-45deg, rgba(0, 0, 0, 0.5) 15%, transparent 60%);
}

/* Disable drag and resize on public view pages without edit permission */
.public-story[data-can-edit="false"] .page-illustration {
  cursor: default;
  pointer-events: none;
}

.public-story[data-can-edit="false"] .page-illustration:active {
  cursor: default;
}

.public-story[data-can-edit="false"] .resize-handle {
  display: none;
}

.public-sidebar-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  color: #f7caa2;
  margin-bottom: 10px;
}

.public-page-list {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}

.public-page-item {
  background: rgba(255, 255, 255, 0.06);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  color: #f6dbc0;
}

.public-page-item.is-active {
  border: 1px solid var(--theme-accent-soft-2);
  background: var(--theme-accent-soft);
}

.public-main {
  min-width: 0;
}

.public-story .book {
  padding: 42px;
  min-height: 70vh;
  scroll-margin-top: 96px;
}

.public-page {
  position: relative;
  min-height: 62vh;
  max-height: 62vh;
  overflow-y: auto;
  padding: 8px 14px 8px 4px;
  scrollbar-width: thin;
}

.public-title {
  font-size: 1.8rem;
  margin-top: 0;
  font-family: 'Space Grotesk', sans-serif;
}

.public-content {
  white-space: pre-wrap;
  line-height: 1.7;
  font-size: 1.05rem;
}

.public-controls {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.86);
}

.public-view-controls {
  flex-wrap: wrap;
}

.public-view-controls .public-page-count {
  flex: 0 0 auto;
  margin: 0;
  min-width: 52px;
  text-align: center;
}

.public-view-controls .btn {
  min-width: 120px;
}

.public-view-controls .btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.public-controls.is-hidden {
  display: none;
}
.image-modal-card {
  position: relative;
  max-width: min(90vw, 960px);
  max-height: 90vh;
  background: rgba(20, 12, 10, 0.98);
  border-radius: 16px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: auto;
}

.image-modal-card img {
  max-width: 100%;
  max-height: 80vh;
  display: block;
  border-radius: 12px;
}

.image-modal-close {
  position: absolute;
  right: 8px;
  top: 4px;
  background: transparent;
  border: none;
  color: #f3cda2;
  font-size: 1.5rem;
  cursor: pointer;
}

.image-placeholder {
  font-family: 'Space Grotesk', sans-serif;
  color: rgba(255, 255, 255, 0.6);
}

.image-placeholder.error {
  color: rgba(255, 190, 170, 0.9);
}

.auth-panel {
  max-width: 420px;
  margin: 30px auto;
  background: rgba(255, 255, 255, 0.05);
  padding: 32px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-panel h2 {
  margin-top: 0;
}

.auth-sub {
  color: #f3d1b2;
  margin-bottom: 16px;
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-form input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
}

.password-field {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 42px;
}

.password-field input {
  display: block;
  width: 100%;
  height: 42px;
  box-sizing: border-box;
  padding-right: 54px;
  padding-top: 10px;
  padding-bottom: 10px;
  line-height: 1.2;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.72);
  color: #111;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 0;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  font-size: 0.78rem;
  font-family: 'Space Grotesk', sans-serif;
  transition: background 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}

.password-toggle:hover {
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.82);
}

.password-toggle:active {
  transform: translateY(-50%);
}

.password-toggle:focus-visible {
  box-shadow: 0 0 0 2px rgba(17, 17, 17, 0.2);
}

.password-toggle svg {
  display: block;
  pointer-events: none;
}

.password-toggle .eye-slash {
  opacity: 0;
}

.password-field input[type="password"]::-ms-reveal,
.password-field input[type="password"]::-ms-clear {
  display: none;
}

.auth-error {
  background: rgba(255, 120, 80, 0.2);
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.auth-info {
  background: rgba(120, 200, 255, 0.16);
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.auth-footer {
  margin-top: 14px;
  font-family: 'Space Grotesk', sans-serif;
  color: #f3d1b2;
}

.auth-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-footer a,
.auth-footer a:visited {
  color: #f3c188;
  text-decoration-color: rgba(243, 193, 136, 0.6);
}

.auth-footer a:hover {
  color: #ffd7a8;
  text-decoration-color: rgba(255, 215, 168, 0.95);
}

.settings {
  max-width: 720px;
  margin: 0 auto;
  padding-top: 28px;
}

.settings-card {
  background: rgba(255, 255, 255, 0.05);
  padding: 24px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

.settings-subtitle {
  margin: 18px 0 10px;
  font-family: 'Space Grotesk', sans-serif;
}

.theme-form {
  display: grid;
  gap: 14px;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.theme-tile {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.12), transparent 38%),
    rgba(255, 255, 255, 0.04);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.theme-tile::after {
  content: "";
  position: absolute;
  inset: auto -20% -65% -20%;
  height: 90px;
  background: var(--tile-glow, rgba(255, 176, 116, 0.28));
  filter: blur(26px);
  opacity: 0.35;
  transform: translateY(16px);
  transition: opacity 0.25s ease;
}

.theme-tile input {
  display: none;
}

.theme-icon {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 233, 207, 0.9);
}

.theme-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.94rem;
  color: #f6d8b6;
}

.theme-desc {
  font-size: 0.78rem;
  color: rgba(246, 216, 182, 0.78);
}

.theme-progress {
  margin-top: 2px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.74rem;
  color: rgba(255, 228, 193, 0.86);
}

.theme-badge,
.theme-next {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
}

.theme-badge {
  color: #ffe7b8;
}

.theme-next {
  color: rgba(246, 216, 182, 0.62);
}

.theme-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 198, 146, 0.42);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}

.theme-tile:hover::after {
  opacity: 0.6;
}

.theme-tile:has(input:checked) {
  border-color: var(--theme-accent);
  background:
    radial-gradient(circle at top right, var(--theme-accent-soft-2), transparent 38%),
    var(--theme-accent-soft);
  box-shadow: 0 0 0 1px var(--theme-accent-soft-2);
}

.theme-campfire {
  --tile-glow: rgba(255, 145, 82, 0.44);
  background: linear-gradient(140deg, rgba(82, 32, 16, 0.58), rgba(42, 16, 10, 0.5));
}

.theme-water {
  --tile-glow: rgba(89, 188, 238, 0.42);
  background: linear-gradient(140deg, rgba(24, 73, 103, 0.62), rgba(14, 39, 67, 0.52));
}

.theme-wind {
  --tile-glow: rgba(173, 217, 242, 0.38);
  background: linear-gradient(140deg, rgba(72, 90, 106, 0.62), rgba(38, 52, 65, 0.52));
}

.theme-earth {
  --tile-glow: rgba(164, 130, 91, 0.42);
  background: linear-gradient(140deg, rgba(76, 55, 38, 0.62), rgba(46, 33, 24, 0.52));
}

.theme-ice {
  --tile-glow: rgba(184, 227, 247, 0.45);
  background: linear-gradient(140deg, rgba(44, 75, 96, 0.62), rgba(28, 47, 62, 0.52));
}

.theme-storm {
  --tile-glow: rgba(124, 154, 255, 0.42);
  background: linear-gradient(140deg, rgba(45, 43, 84, 0.62), rgba(28, 26, 54, 0.52));
}

.theme-space {
  --tile-glow: rgba(160, 141, 245, 0.42);
  background: linear-gradient(140deg, rgba(36, 38, 87, 0.62), rgba(22, 24, 53, 0.52));
}

.theme-garden {
  --tile-glow: rgba(140, 218, 151, 0.42);
  background: linear-gradient(140deg, rgba(34, 69, 50, 0.62), rgba(22, 43, 33, 0.52));
}

.theme-cherry {
  --tile-glow: rgba(255, 182, 193, 0.42);
  background: linear-gradient(140deg, rgba(89, 28, 40, 0.62), rgba(56, 14, 20, 0.52));
}

.theme-form .btn.primary {
  justify-self: start;
}

.activity-card {
  margin-top: 20px;
  background: rgba(255, 255, 255, 0.05);
  padding: 24px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.activity-sub {
  color: #f3d1b2;
  margin-top: 6px;
}

.heatmap-scroll {
  margin-top: 16px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.heatmap,
#activityHeatmap {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 12px);
  gap: 4px;
  --columns: 52;
  width: max-content;
}

.heatmap-cell {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.heatmap-cell.empty {
  background: transparent;
}

.heatmap-cell.level-0 { background: var(--heat-0); }
.heatmap-cell.level-1 { background: var(--heat-1); }
.heatmap-cell.level-2 { background: var(--heat-2); }
.heatmap-cell.level-3 { background: var(--heat-3); }
.heatmap-cell.level-4 { background: var(--heat-4); }

.heatmap-legend {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  color: #f3cda2;
}

.legend-scale {
  display: flex;
  gap: 4px;
}

.chat-launch {
  position: fixed;
  right: 24px;
  bottom: 60px;
  background: linear-gradient(120deg, var(--theme-accent), var(--theme-accent-2));
  color: var(--theme-accent-text);
  padding: 12px 16px;
  border-radius: 999px;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  box-shadow: 0 12px 30px var(--theme-accent-soft-2);
  z-index: 20;
}

.delete-ill-btn { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,0.5); color: #fff; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px; z-index: 31; backdrop-filter: blur(4px); transition: all 0.2s; } .delete-ill-btn:hover { background: rgba(0,0,0,0.7); transform: scale(1.1); }

.is-dragging {
  opacity: 0.8;
  filter: brightness(1.1);
  box-shadow: 0 15px 40px rgba(0,0,0,0.4) !important;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
