/* My Journal — neon classified dossier
   Android/Wix: document scroll only. No nested max-height overflow traps.
   Never overflow-x:hidden on html/body (kills vertical scroll on many Android browsers). */

html.journal-page,
body:has(.journal-wrap) {
  height: auto !important;
  max-height: none !important;
  overflow-x: visible !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: auto;
}

.journal-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 14px 56px;
  overflow: visible !important;
  max-height: none !important;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 10px var(--neon);
}
.storage-note {
  color: var(--muted);
  font-size: 0.72rem;
  opacity: 0.75;
  margin: 0 0 20px;
}

.stats-header {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.stat-card {
  background: linear-gradient(165deg, rgba(12, 18, 28, 0.98), rgba(6, 10, 16, 1));
  border: 1px solid rgba(57, 255, 20, 0.22);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 0 20px rgba(57, 255, 20, 0.06);
}
.stat-label {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
  font-weight: 700;
  margin-bottom: 6px;
}
.stat-value {
  font-family: Orbitron, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

/* Notebook left + ticker rail right — keep tabs on the RIGHT even on narrow Android */
.journal-layout {
  display: grid;
  grid-template-columns: 1fr minmax(72px, 96px);
  gap: 12px;
  align-items: start;
  overflow: visible !important;
  max-height: none !important;
}

.journal-notebook {
  min-width: 0;
  overflow: visible !important;
  max-height: none !important;
}

.panel-block {
  margin-bottom: 28px;
  overflow: visible !important;
  max-height: none !important;
}
.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: Orbitron, sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--neon);
  margin: 0 0 8px;
}
.neon-bar {
  display: inline-block;
  width: 4px;
  height: 1.1em;
  background: linear-gradient(#39ff14, #00e5ff);
  box-shadow: 0 0 12px #39ff14;
  border-radius: 2px;
}
.panel-hint {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0 0 14px;
  line-height: 1.45;
}
.panel-hint code {
  color: var(--cyan);
  font-size: 0.74rem;
}

.composer-panel {
  position: relative;
  border-radius: 18px;
  border: 1px solid rgba(57, 255, 20, 0.32);
  background:
    linear-gradient(165deg, rgba(10, 16, 14, 0.97) 0%, rgba(6, 10, 16, 0.99) 55%, rgba(12, 10, 18, 1) 100%);
  box-shadow:
    0 0 0 1px rgba(0, 229, 255, 0.06),
    0 0 36px rgba(57, 255, 20, 0.08),
    inset 0 0 48px rgba(57, 255, 20, 0.03);
  padding: 18px 16px 20px;
}
.composer-panel::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.1) 2px,
    rgba(0, 0, 0, 0.1) 4px
  );
  opacity: 0.28;
  z-index: 0;
}
.composer-panel > * {
  position: relative;
  z-index: 1;
}

.composer-stamps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.stamp {
  display: inline-block;
  font-family: Orbitron, sans-serif;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 9px;
  border: 2px solid;
  border-radius: 4px;
  transform: rotate(-2deg);
}
.stamp-secret {
  color: #39ff14;
  border-color: #39ff14;
  text-shadow: 0 0 12px rgba(57, 255, 20, 0.7);
  box-shadow: 0 0 14px rgba(57, 255, 20, 0.25);
}
.stamp-eyes {
  color: #00e5ff;
  border-color: rgba(0, 229, 255, 0.7);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
  transform: rotate(1.5deg);
}
.stamp-clearance {
  color: #ffb020;
  border-color: rgba(255, 176, 32, 0.65);
  transform: rotate(-1deg);
}

.add-field {
  margin-bottom: 12px;
}
.add-field label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
  font-weight: 700;
  margin-bottom: 6px;
}
.add-field label .opt {
  opacity: 0.65;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.add-field input,
.add-field textarea {
  width: 100%;
  box-sizing: border-box;
  background: rgba(6, 10, 16, 0.92);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.45;
  -webkit-appearance: none;
  appearance: none;
}
.add-field textarea {
  min-height: 140px;
  resize: vertical;
  background-image:
    linear-gradient(rgba(57, 255, 20, 0.035) 1px, transparent 1px);
  background-size: 100% 1.55em;
  background-attachment: local;
}
.add-field input:focus,
.add-field textarea:focus {
  outline: none;
  border-color: var(--neon);
  box-shadow: 0 0 0 1px var(--neon), 0 0 18px var(--neon-dim);
}

.ticker-preview {
  min-height: 1.4em;
  margin: 0 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.ticker-chip {
  display: inline-flex;
  align-items: center;
  font-family: Orbitron, sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(0, 229, 255, 0.45);
  color: #00e5ff;
  background: rgba(0, 229, 255, 0.08);
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.45);
}
.ticker-chip-muted {
  border-color: rgba(142, 160, 184, 0.35);
  color: var(--muted);
  background: transparent;
  text-shadow: none;
  font-family: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.composer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.autosave-meta {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.btn-neon {
  appearance: none;
  cursor: pointer;
  font-family: Orbitron, sans-serif;
  border: 1px solid #39ff14;
  background: linear-gradient(90deg, rgba(57, 255, 20, 0.2), rgba(0, 229, 255, 0.12));
  color: #39ff14;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 12px 18px;
  min-height: 44px;
  border-radius: 999px;
  box-shadow: 0 0 20px rgba(57, 255, 20, 0.25);
  transition: filter 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-neon:hover,
.btn-neon:focus-visible {
  filter: brightness(1.12);
  box-shadow: 0 0 28px rgba(57, 255, 20, 0.45);
}
.btn-ghost {
  appearance: none;
  cursor: pointer;
  font-family: inherit;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 12px 16px;
  min-height: 44px;
  border-radius: 999px;
  -webkit-tap-highlight-color: transparent;
}
.btn-ghost:hover,
.btn-ghost:focus-visible {
  border-color: var(--cyan);
  color: var(--cyan);
}

/* Entry cards — paper / dossier vibe */
.entry-card {
  position: relative;
  margin-bottom: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 193, 77, 0.22);
  background:
    linear-gradient(165deg, rgba(14, 18, 24, 0.98), rgba(8, 12, 18, 1));
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.25);
  padding: 14px 14px 12px;
  overflow: visible;
  transition: border-color 0.2s, box-shadow 0.2s;
  scroll-margin-top: 12px;
}
.entry-card::after {
  content: "";
  pointer-events: none;
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(#39ff14, #00e5ff);
  opacity: 0.55;
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.35);
}
.entry-card:hover {
  border-color: rgba(57, 255, 20, 0.35);
  box-shadow: 0 0 22px rgba(57, 255, 20, 0.1);
}
.entry-card.pulse-hit {
  animation: journal-pulse 1.1s ease-out;
  border-color: rgba(57, 255, 20, 0.75);
  box-shadow: 0 0 0 1px rgba(57, 255, 20, 0.45), 0 0 28px rgba(57, 255, 20, 0.35);
}
@keyframes journal-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(57, 255, 20, 0.55), 0 0 28px rgba(57, 255, 20, 0.4);
  }
  100% {
    box-shadow: 0 0 0 1px rgba(57, 255, 20, 0.2), 0 0 12px rgba(57, 255, 20, 0.12);
  }
}

.entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 8px;
  padding-left: 8px;
}
.entry-title {
  margin: 0;
  font-family: Orbitron, sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #ffc14d;
  text-shadow: 0 0 12px rgba(255, 193, 77, 0.25);
  word-break: break-word;
}
.entry-title.untitled {
  color: var(--muted);
  font-style: italic;
  letter-spacing: 0.04em;
  text-shadow: none;
}
.entry-meta {
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.entry-body {
  margin: 0 0 10px;
  padding-left: 8px;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.entry-body .hl-ticker {
  color: #00e5ff;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}
.entry-tickers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-left: 8px;
  margin-bottom: 10px;
}
.entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-left: 8px;
}
.btn-edit,
.btn-delete {
  appearance: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 14px;
  min-height: 40px;
  border-radius: 999px;
  -webkit-tap-highlight-color: transparent;
}
.btn-edit {
  border: 1px solid rgba(0, 229, 255, 0.55);
  background: rgba(0, 229, 255, 0.1);
  color: #00e5ff;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.12);
}
.btn-edit:hover {
  filter: brightness(1.12);
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.3);
}
.btn-delete {
  border: 1px solid rgba(255, 77, 109, 0.55);
  background: rgba(255, 77, 109, 0.1);
  color: #ff4d6d;
  box-shadow: 0 0 12px rgba(255, 77, 109, 0.12);
}
.btn-delete:hover {
  filter: brightness(1.12);
  box-shadow: 0 0 18px rgba(255, 77, 109, 0.3);
}

.empty {
  color: var(--muted);
  padding: 28px 18px;
  text-align: center;
  border: 1px dashed rgba(57, 255, 20, 0.28);
  border-radius: 14px;
  background: rgba(57, 255, 20, 0.03);
  font-family: Orbitron, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  line-height: 1.6;
}
.empty .empty-sub {
  display: block;
  margin-top: 8px;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  opacity: 0.85;
}

/* Right ticker rail — slim file-tab stack */
.journal-ticker-rail {
  position: sticky;
  top: 10px;
  align-self: start;
  padding: 8px 4px 16px;
  border-radius: 12px;
  border: 1px solid rgba(0, 229, 255, 0.2);
  background: linear-gradient(180deg, rgba(8, 14, 20, 0.95), rgba(6, 10, 16, 0.98));
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.06);
  overflow: visible;
  max-height: none;
}
.rail-label {
  font-family: Orbitron, sans-serif;
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-align: center;
  color: var(--cyan);
  margin-bottom: 10px;
  opacity: 0.9;
}
.ticker-tabs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}
.ticker-tab {
  appearance: none;
  cursor: pointer;
  font-family: Orbitron, sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
  color: #041018;
  background: linear-gradient(180deg, #39ff14, #1ecf08);
  border: 1px solid rgba(57, 255, 20, 0.85);
  border-radius: 8px 0 0 8px;
  padding: 10px 4px;
  min-height: 40px;
  box-shadow:
    0 0 14px rgba(57, 255, 20, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  writing-mode: horizontal-tb;
  word-break: break-all;
  line-height: 1.15;
  transition: filter 0.15s, box-shadow 0.15s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.ticker-tab:nth-child(3n + 2) {
  background: linear-gradient(180deg, #00e5ff, #00b8d4);
  border-color: rgba(0, 229, 255, 0.85);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.ticker-tab:nth-child(3n) {
  background: linear-gradient(180deg, #ffc14d, #e0a020);
  border-color: rgba(255, 193, 77, 0.9);
  box-shadow: 0 0 14px rgba(255, 193, 77, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.ticker-tab:hover,
.ticker-tab:focus-visible {
  filter: brightness(1.08);
  transform: translateX(-2px);
}
.ticker-tab.active {
  outline: 2px solid #fff;
  outline-offset: 1px;
  transform: translateX(-3px);
}
.ticker-tabs-empty {
  font-size: 0.58rem;
  text-align: center;
  color: var(--muted);
  letter-spacing: 0.06em;
  line-height: 1.35;
  padding: 6px 2px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(2, 6, 10, 0.72);
  backdrop-filter: blur(4px);
}
.modal-backdrop[hidden] {
  display: none !important;
}
.modal {
  width: min(420px, 100%);
  border-radius: 16px;
  border: 1px solid rgba(57, 255, 20, 0.35);
  background: linear-gradient(165deg, rgba(12, 18, 28, 0.98), rgba(6, 10, 16, 1));
  padding: 20px 18px;
  box-shadow: 0 0 40px rgba(57, 255, 20, 0.15);
}
.modal-eyebrow {
  margin: 0 0 6px;
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  color: var(--cyan);
  font-weight: 700;
}
.modal-title {
  margin: 0 0 10px;
  font-family: Orbitron, sans-serif;
  font-size: 1rem;
  color: var(--text);
}
.modal-body {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1300;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  background: rgba(12, 18, 28, 0.95);
  border: 1px solid rgba(57, 255, 20, 0.45);
  color: #39ff14;
  box-shadow: 0 0 24px rgba(57, 255, 20, 0.2);
  max-width: calc(100vw - 32px);
  text-align: center;
}
.toast[hidden] {
  display: none !important;
}
.toast.toast-err {
  border-color: rgba(255, 77, 109, 0.55);
  color: #ff4d6d;
  box-shadow: 0 0 24px rgba(255, 77, 109, 0.25);
}

@media (min-width: 720px) {
  .journal-layout {
    grid-template-columns: 1fr minmax(88px, 110px);
    gap: 16px;
  }
  .journal-wrap {
    padding: 14px 18px 56px;
  }
  .ticker-tab {
    font-size: 0.7rem;
    padding: 12px 6px;
    border-radius: 10px 0 0 10px;
  }
  .composer-panel {
    padding: 22px 20px 24px;
  }
}

/* Very narrow: keep RIGHT column; shrink rail a touch */
@media (max-width: 420px) {
  .journal-layout {
    grid-template-columns: 1fr minmax(64px, 78px);
    gap: 8px;
  }
  .journal-wrap {
    padding: 12px 10px 52px;
  }
  .ticker-tab {
    font-size: 0.55rem;
    padding: 9px 2px;
    min-height: 38px;
  }
  .rail-label {
    font-size: 0.48rem;
  }
}

/* Prefer document scroll; never trap list in nested scroll */
#entriesList,
.ticker-tabs {
  overflow: visible !important;
  max-height: none !important;
}

/* Sticky rail only on fine pointers — Android sticky + page scroll can fight */
@media (pointer: coarse) {
  .journal-ticker-rail {
    position: static;
    top: auto;
  }
}
