:root {
  --bg: #070a10;
  --card-bg: #101622;
  --card-border: rgba(147, 197, 253, 0.12);
  --parchment: #131a29;
  --parchment-border: rgba(217, 119, 6, 0.25);
  --parchment-text: #f1ede4;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent: #38bdf8;
  --accent-glow: rgba(56, 189, 248, 0.25);
  --teal-glow: #14b8a6;
  --purple-glow: #a855f7;
  --gold: #fbbf24;
  --leather: #291e14;
  --leather-border: #453220;
  --font-serif: 'Cinzel', serif;
  --font-quill: 'IM Fell DW Pica', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* Ambient glow */
.glow-bg {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.12) 0%, rgba(20, 184, 166, 0.08) 50%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

/* 6-DIGIT PIN AUTH OVERLAY */
.pin-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 16, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pin-modal {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.pin-sigil {
  font-size: 38px;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 12px var(--teal-glow));
}

.pin-title {
  font-family: var(--font-serif);
  font-size: 19px;
  letter-spacing: 2px;
  color: #fff;
  margin-bottom: 4px;
}

.pin-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.sigil-pill {
  background: rgba(20, 184, 166, 0.15);
  border: 1px solid rgba(20, 184, 166, 0.45);
  color: #5eead4;
  font-size: 12px;
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 6px 16px;
  border-radius: 20px;
  cursor: pointer;
  margin-bottom: 22px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sigil-pill:hover,
.sigil-pill:active {
  background: rgba(20, 184, 166, 0.35);
  box-shadow: 0 0 12px rgba(20, 184, 166, 0.5);
  transform: translateY(-1px);
}

.pin-dots {
  display: flex;
  gap: 14px;
  margin-bottom: 28px;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dot.filled {
  background: var(--teal-glow);
  border-color: var(--teal-glow);
  box-shadow: 0 0 10px var(--teal-glow);
  transform: scale(1.15);
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
}

.key-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  width: 68px;
  height: 68px;
  margin: 0 auto;
  font-size: 24px;
  font-weight: 500;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.key-btn:active,
.key-btn.btn-pressed {
  background: rgba(20, 184, 166, 0.4) !important;
  border-color: var(--teal-glow) !important;
  box-shadow: 0 0 12px var(--teal-glow) !important;
  transform: scale(0.92) !important;
}

.key-btn.key-action {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 16px;
  width: 68px;
  height: 68px;
}

.pin-error-msg {
  color: #f87171;
  font-size: 13px;
  margin-top: 18px;
  font-weight: 600;
}

@keyframes shakePinModal {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-10px); }
  40%, 80% { transform: translateX(10px); }
}

.shake-error {
  animation: shakePinModal 0.35s ease-in-out;
}

/* APP SHELL */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.app-header {
  position: sticky;
  top: 0;
  background: rgba(13, 17, 23, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  z-index: 100;
  padding: env(safe-area-inset-top, 8px) 16px 8px 16px;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
}

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

.brand-icon {
  font-size: 22px;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: 1.5px;
  color: #fff;
  font-weight: 700;
}

.brand-sub {
  font-size: 9.5px;
  letter-spacing: 1px;
  color: var(--teal-glow);
  font-family: var(--font-mono);
  display: block;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-era {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(251, 191, 36, 0.15);
  color: var(--gold);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.btn-lock {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* MAIN CONTENT */
.app-main {
  flex: 1;
  padding: 16px 16px calc(72px + env(safe-area-inset-bottom, 16px)) 16px;
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}

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

/* VOIRY SCRAPBOOK STYLING */
.voiry-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--card-border);
}

.section-title {
  font-family: var(--font-serif);
  font-size: 16px;
  color: #fff;
  letter-spacing: 0.5px;
}

.section-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-stitch {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.25) 0%, rgba(168, 85, 247, 0.25) 100%);
  border: 1px solid var(--teal-glow);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(20, 184, 166, 0.2);
}

.voiry-book-feed {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 12px;
}

.voiry-page-card {
  background: var(--parchment);
  border: 2px solid var(--leather-border);
  border-left: 8px solid var(--leather);
  border-radius: 12px;
  padding: 20px 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), inset 0 0 40px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.voiry-page-card::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: repeating-linear-gradient(to bottom, #d97706 0px, #d97706 4px, transparent 4px, transparent 10px);
  opacity: 0.4;
}

.page-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
  gap: 12px;
}

.page-meta-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.page-date {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--gold);
}

.page-loc {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
}

.btn-edit-page {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--font-sans);
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-edit-page:hover {
  background: rgba(20, 184, 166, 0.18);
  border-color: var(--teal-glow);
  color: #fff;
  box-shadow: 0 0 8px rgba(20, 184, 166, 0.25);
}

.btn-edit-page:active {
  transform: scale(0.95);
}

.page-title {
  font-family: var(--font-serif);
  font-size: 18px;
  color: #fff;
  margin-bottom: 12px;
}

.page-body {
  font-family: var(--font-quill);
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--parchment-text);
  white-space: pre-wrap;
}

/* GLUED MEMENTO CARDS */
.mementos-tray {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.memento-card {
  background: #1c1510;
  border: 1px solid #523b26;
  border-radius: 8px;
  padding: 12px;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  transform: rotate(-0.5deg);
}

/* Simulated Poison Glue Strip */
.memento-card::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 18px;
  width: 45px;
  height: 12px;
  background: rgba(45, 212, 191, 0.45);
  border: 1px solid rgba(45, 212, 191, 0.6);
  backdrop-filter: blur(2px);
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(45, 212, 191, 0.3);
}

.memento-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--teal-glow);
  font-weight: 700;
  margin-bottom: 4px;
}

.memento-caption {
  font-size: 12.5px;
  font-style: italic;
  color: #e2e8f0;
}

/* CHAT INTERFACES (BARI & MEERO & SYSTEM) */
.chat-header-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 12px 14px;
}

.chat-avatar {
  font-size: 28px;
}

.chat-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.chat-role {
  font-size: 11.5px;
  color: var(--text-muted);
}

.chat-status-pill {
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(20, 184, 166, 0.15);
  color: var(--teal-glow);
  border: 1px solid rgba(20, 184, 166, 0.3);
}

.chat-status-pill.meero-status {
  background: rgba(245, 158, 11, 0.15);
  color: var(--gold);
  border-color: rgba(245, 158, 11, 0.3);
}

.chat-status-pill.system-status {
  background: rgba(168, 85, 247, 0.15);
  color: var(--purple-glow);
  border-color: rgba(168, 85, 247, 0.3);
}

.chat-stream {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 280px;
  max-height: 55vh;
  overflow-y: auto;
  padding: 8px 4px;
}

.msg {
  display: flex;
  flex-direction: column;
  max-width: 85%;
}

.msg.bot-msg {
  align-self: flex-start;
}

.msg.user-msg {
  align-self: flex-end;
}

.msg-bubble {
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.msg.bot-msg .msg-bubble {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: #f1f5f9;
}

/* ANIMATED THINKING INDICATOR */
.msg-bubble.thinking-bubble {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-quill);
  font-size: 15px;
  font-style: italic;
  color: var(--teal-glow);
  background: rgba(13, 17, 23, 0.85);
  border: 1px solid rgba(45, 212, 191, 0.25);
  box-shadow: 0 0 16px rgba(45, 212, 191, 0.1);
  padding: 10px 14px;
}

.msg-bubble.thinking-bubble.meero-thinking {
  color: var(--gold);
  border-color: rgba(245, 158, 11, 0.3);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.1);
}

.msg-bubble.thinking-bubble.system-thinking {
  color: var(--purple-glow);
  border-color: rgba(168, 85, 247, 0.3);
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.1);
}

.thinking-sigil {
  display: inline-block;
  font-style: normal;
  font-size: 16px;
  line-height: 1;
}

.thinking-sigil.celestial-glow {
  animation: moonBreathe 2.4s ease-in-out infinite;
}

.thinking-sigil.quill-tilt {
  animation: quillDip 2s ease-in-out infinite;
}

.thinking-sigil.spark-pulse {
  animation: sparkPulse 1.8s ease-in-out infinite;
}

@keyframes moonBreathe {
  0%, 100% {
    transform: scale(1) rotate(-8deg);
    opacity: 0.85;
    filter: drop-shadow(0 0 3px rgba(45, 212, 191, 0.4));
  }
  50% {
    transform: scale(1.18) rotate(10deg);
    opacity: 1;
    filter: drop-shadow(0 0 10px rgba(45, 212, 191, 0.85));
  }
}

@keyframes quillDip {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.85;
    filter: drop-shadow(0 0 3px rgba(245, 158, 11, 0.4));
  }
  50% {
    transform: translateY(-2px) rotate(-15deg);
    opacity: 1;
    filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.85));
  }
}

@keyframes sparkPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
    filter: drop-shadow(0 0 2px rgba(168, 85, 247, 0.4));
  }
  50% {
    transform: scale(1.22);
    opacity: 1;
    filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.9));
  }
}

.thinking-text {
  letter-spacing: 0.02em;
}

.thinking-dots {
  display: inline-flex;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 1px;
}

.thinking-dots span {
  animation: dotSequence 1.4s infinite ease-in-out both;
  font-size: 16px;
  line-height: 1;
}

.thinking-dots .dot-1 {
  animation-delay: 0s;
}

.thinking-dots .dot-2 {
  animation-delay: 0.22s;
}

.thinking-dots .dot-3 {
  animation-delay: 0.44s;
}

@keyframes dotSequence {
  0%, 80%, 100% {
    opacity: 0.15;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.msg.user-msg .msg-bubble {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #fff;
  border-radius: 14px 14px 2px 14px;
}

.msg-meta {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 4px;
  padding: 0 4px;
}

.chat-input-bar {
  display: flex;
  gap: 8px;
  position: sticky;
  bottom: calc(64px + env(safe-area-inset-bottom, 12px));
  background: var(--bg);
  padding: 8px 0;
  z-index: 10;
}

.chat-input {
  flex: 1;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 12px 16px;
  color: #fff;
  font-size: 14px;
  outline: none;
}

.chat-input:focus {
  border-color: var(--teal-glow);
}

.btn-send {
  background: var(--teal-glow);
  color: #070a10;
  font-weight: 700;
  border: none;
  border-radius: 20px;
  padding: 0 16px;
  cursor: pointer;
}

.system-quick-actions {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.chip-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 11.5px;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}

/* BOTTOM NAVIGATION BAR */
.app-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(56px + env(safe-area-inset-bottom, 12px));
  background: rgba(13, 17, 23, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom, 12px);
  z-index: 200;
}

.nav-tab {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-dim);
  cursor: pointer;
  flex: 1;
  padding: 6px 0;
  transition: all 0.15s ease;
}

.nav-tab.active {
  color: var(--teal-glow);
}

.nav-icon {
  font-size: 19px;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* MODAL STYLING */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--card-border);
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 15px;
  color: #fff;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-label {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.form-input, .form-textarea {
  background: #090d14;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 10px 12px;
  color: #fff;
  font-size: 13.5px;
  outline: none;
}

.form-input:focus, .form-textarea:focus {
  border-color: var(--teal-glow);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.2);
}

.btn-cancel {
  background: none;
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.btn-stitch-confirm {
  background: var(--teal-glow);
  color: #070a10;
  font-weight: 700;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-stitch-confirm:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 12px rgba(20, 184, 166, 0.4);
}

.btn-stitch-confirm:active {
  transform: scale(0.96);
}

.btn-delete-page {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-delete-page:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fff;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.35);
}

.btn-delete-page:active {
  transform: scale(0.96);
}

/* VOIRY EMPTY STATE */
.voiry-empty-state {
  text-align: center;
  padding: 48px 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--card-border);
  border-radius: 12px;
  margin-top: 16px;
}

.voiry-empty-state .empty-icon {
  font-size: 36px;
  margin-bottom: 8px;
  opacity: 0.6;
}

.voiry-empty-state .empty-title {
  font-family: var(--font-serif);
  font-size: 16px;
  color: #fff;
  margin-bottom: 4px;
}

.voiry-empty-state .empty-desc {
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: 16px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

/* HARPTOS CALENDAR PICKER & DATE INPUT */
.date-input-group {
  display: flex;
  gap: 6px;
  align-items: center;
}

.date-input-group .form-input {
  flex: 1;
}

.btn-cal-picker {
  background: rgba(20, 184, 166, 0.12);
  border: 1px solid var(--teal-glow);
  color: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  height: 40px;
}

.btn-cal-picker:hover {
  background: rgba(20, 184, 166, 0.25);
  box-shadow: 0 0 10px rgba(20, 184, 166, 0.35);
}

.btn-cal-picker:active {
  transform: scale(0.94);
}

.harptos-cal-popover {
  background: #080d14;
  border: 1px solid rgba(20, 184, 166, 0.35);
  border-radius: 10px;
  padding: 12px;
  margin-top: 4px;
  margin-bottom: 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 14px rgba(20, 184, 166, 0.15);
  animation: fadeInDown 0.18s ease-out;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.harptos-popover-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}

.harptos-popover-title {
  font-family: var(--font-serif);
  font-size: 12.5px;
  color: var(--gold);
  letter-spacing: 0.5px;
}

.harptos-popover-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
}

.harptos-year-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.harptos-year-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 2px 6px;
}

.btn-year-step {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 4px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  transition: all 0.1s ease;
}

.btn-year-step:active {
  background: var(--teal-glow);
  color: #000;
}

.harptos-year-input {
  width: 64px;
  background: none;
  border: none;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
}

.harptos-year-input::-webkit-inner-spin-button,
.harptos-year-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.harptos-dr-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold);
  font-weight: 600;
}

.harptos-year-only-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.harptos-year-only-toggle input {
  accent-color: var(--teal-glow);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.harptos-year-name-display {
  font-family: var(--font-serif);
  font-size: 11.5px;
  color: var(--parchment-text);
  font-style: italic;
  padding: 3px 6px;
  background: rgba(251, 191, 36, 0.08);
  border-left: 2px solid var(--gold);
  border-radius: 0 4px 4px 0;
}

.harptos-section-sub {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  font-weight: 700;
  margin-bottom: 4px;
}

.harptos-calendar-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.harptos-months-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  max-height: 130px;
  overflow-y: auto;
  padding-right: 2px;
}

.harptos-month-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 5px 6px;
  font-size: 10.5px;
  color: #cbd5e1;
  text-align: left;
  cursor: pointer;
  transition: all 0.12s ease;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.harptos-month-chip .chip-name {
  font-weight: 600;
}

.harptos-month-chip .chip-alias {
  font-size: 8.5px;
  color: var(--text-dim);
}

.harptos-month-chip.is-festival {
  background: rgba(168, 85, 247, 0.08);
  border-color: rgba(168, 85, 247, 0.3);
  font-style: italic;
  color: #e9d5ff;
}

.harptos-month-chip:hover {
  background: rgba(20, 184, 166, 0.15);
  border-color: var(--teal-glow);
  color: #fff;
}

.harptos-month-chip.selected {
  background: rgba(20, 184, 166, 0.28) !important;
  border-color: var(--teal-glow) !important;
  color: #fff !important;
  box-shadow: 0 0 8px rgba(20, 184, 166, 0.35);
}

.harptos-days-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
}

.harptos-day-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 4px;
  padding: 6px 0;
  font-size: 11px;
  font-family: var(--font-mono);
  color: #cbd5e1;
  cursor: pointer;
  text-align: center;
  transition: all 0.1s ease;
}

.harptos-day-btn:hover {
  background: rgba(20, 184, 166, 0.2);
  border-color: var(--teal-glow);
  color: #fff;
}

.harptos-day-btn.selected {
  background: var(--teal-glow) !important;
  border-color: var(--teal-glow) !important;
  color: #041017 !important;
  font-weight: 700;
  box-shadow: 0 0 6px var(--teal-glow);
}

.harptos-accept-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 8px;
}

.harptos-live-preview {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--teal-glow);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.btn-accept-harptos {
  background: var(--teal-glow);
  color: #070a10;
  border: none;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn-accept-harptos:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 10px rgba(20, 184, 166, 0.4);
}

/* ==========================================================================
   MULTI-CHARACTER AUTHORSHIP & HANDWRITING THEMES
   ========================================================================== */
.author-chips-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.author-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.author-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
}

.author-chip.selected[data-author="rhylal"] {
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(168, 85, 247, 0.6);
  color: #d8b4fe;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.25);
}

.author-chip.selected[data-author="astarion"] {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.6);
  color: #fca5a5;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.25);
}

.author-chip.selected[data-author="barimar"] {
  background: rgba(20, 184, 166, 0.2);
  border-color: rgba(20, 184, 166, 0.6);
  color: #5eead4;
  box-shadow: 0 0 12px rgba(20, 184, 166, 0.25);
}

.author-chip.selected[data-author="meero"] {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.6);
  color: #fcd34d;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}

/* Card Author Badges */
.page-author-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: capitalize;
}

.page-author-badge.author-rhylal {
  background: rgba(168, 85, 247, 0.15);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.page-author-badge.author-astarion {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.page-author-badge.author-barimar {
  background: rgba(20, 184, 166, 0.15);
  color: #5eead4;
  border: 1px solid rgba(20, 184, 166, 0.3);
}

.page-author-badge.author-meero {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Handwriting Typography Flavors */
.voiry-page-card.author-astarion .page-body {
  font-style: italic;
  letter-spacing: 0.02em;
  color: #f8fafc;
  border-left: 2px solid rgba(239, 68, 68, 0.4);
  padding-left: 12px;
}

.voiry-page-card.author-barimar .page-body {
  color: #e2e8f0;
  border-left: 2px solid rgba(20, 184, 166, 0.4);
  padding-left: 12px;
}

.voiry-page-card.author-meero .page-body {
  font-family: var(--font-mono, monospace);
  font-size: 13.5px;
  line-height: 1.6;
  color: #fef3c7;
  border-left: 2px solid rgba(245, 158, 11, 0.4);
  padding-left: 12px;
}

/* Git Ledger Card Badge */
.git-ledger-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-family: var(--font-mono, monospace);
  color: var(--teal-glow);
  background: rgba(20, 184, 166, 0.08);
  border: 1px solid rgba(20, 184, 166, 0.2);
  padding: 2px 7px;
  border-radius: 4px;
  margin-left: 6px;
}

.git-ledger-badge.dirty {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
}

/* Floating Grimoire Toast Notification */
.voiry-toast {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(13, 17, 23, 0.95);
  border: 1px solid var(--teal-glow);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.7), 0 0 16px rgba(20, 184, 166, 0.25);
  color: #f1f5f9;
  font-size: 12.5px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 20px;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  animation: toastFadeIn 0.25s ease-out;
}

.voiry-toast.toast-info {
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.7), 0 0 16px rgba(168, 85, 247, 0.25);
}

.voiry-toast.toast-warning {
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.7), 0 0 16px rgba(245, 158, 11, 0.25);
  color: #fcd34d;
}

@keyframes toastFadeIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}



