:root {
  --bg: #030303;
  --bg-elevated: rgba(14, 16, 24, 0.78);
  --bg-faint: rgba(255, 255, 255, 0.04);
  --stroke: rgba(255, 255, 255, 0.12);
  --stroke-strong: rgba(255, 255, 255, 0.22);
  --text: #f4f5f7;
  --muted: #8d97ac;
  --accent: #ff4b55;
  --accent-soft: rgba(255, 75, 85, 0.18);
  --line: #7be4ff;
  --line-soft: rgba(123, 228, 255, 0.18);
  --gold: #ffbd66;
  --mint: #61f0d0;
  --violet: #9da8ff;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  --blur: blur(26px);
  color-scheme: dark;
  font-family: "Avenir Next", "Helvetica Neue", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(123, 228, 255, 0.12), transparent 28%),
    radial-gradient(circle at bottom right, rgba(255, 75, 85, 0.1), transparent 30%),
    linear-gradient(180deg, #070708 0%, #020203 55%, #050607 100%);
  color: var(--text);
}

body {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: var(--line);
}

.app-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  --hud-clearance: 108px;
}

.ambient {
  position: absolute;
  inset: auto;
  pointer-events: none;
  filter: blur(18px);
}

.ambient-a {
  top: 12%;
  left: 18%;
  width: 28vw;
  height: 28vw;
  min-width: 280px;
  min-height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(123, 228, 255, 0.12), transparent 72%);
}

.ambient-b {
  right: 6%;
  bottom: 8%;
  width: 34vw;
  height: 34vw;
  min-width: 320px;
  min-height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 189, 102, 0.12), transparent 70%);
}

.hud {
  position: fixed;
  inset: 0 0 auto;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 28px 28px 0;
  pointer-events: none;
}

.brand,
.controls {
  pointer-events: auto;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 250px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(8, 11, 16, 0.46);
  backdrop-filter: blur(14px);
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  font-size: 0.68rem;
}

.brand__summary {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: rgba(244, 245, 247, 0.95);
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.brand-link {
  align-self: flex-start;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(123, 228, 255, 0.88);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-link:hover {
  color: var(--text);
  transform: none;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
}

.mode-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.mode-toggle,
.plan-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(8, 11, 16, 0.52);
  backdrop-filter: blur(14px);
}

.mode-toggle--auth {
  width: 100%;
  justify-content: space-between;
  margin-bottom: 12px;
}

.mode-toggle--auth .mode-button {
  flex: 1 1 auto;
}

.mode-button,
.plan-nav__button {
  min-width: 0;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  transition:
    background 180ms ease,
    color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.mode-button {
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.plan-nav__button {
  width: 36px;
  padding: 0;
  font-size: 1rem;
}

.mode-button.is-active,
.mode-button:hover,
.plan-nav__button:hover {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.plan-nav[hidden] {
  display: none;
}

.control-button,
.text-button,
.icon-button {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    opacity 180ms ease;
}

.control-button,
.text-button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  backdrop-filter: var(--blur);
}

.control-button {
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
}

.control-button--primary {
  border-color: rgba(255, 75, 85, 0.35);
  background:
    linear-gradient(135deg, rgba(255, 75, 85, 0.24), rgba(255, 75, 85, 0.08)),
    rgba(255, 255, 255, 0.06);
}

.control-button--danger {
  border-color: rgba(255, 118, 123, 0.3);
  background:
    linear-gradient(135deg, rgba(255, 75, 85, 0.18), rgba(255, 75, 85, 0.06)),
    rgba(255, 255, 255, 0.04);
}

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.25rem;
}

.control-button:hover,
.text-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
  border-color: var(--stroke-strong);
}

.control-button:disabled,
.text-button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.text-button--danger {
  color: rgba(255, 142, 149, 0.92);
  border-color: rgba(255, 118, 123, 0.22);
}

.timeline-stage {
  position: relative;
  min-height: 100vh;
  touch-action: none;
}

.app-shell.is-map-mode .timeline-stage {
  touch-action: auto;
}

.app-shell.is-plan-mode .timeline-stage {
  cursor: grab;
}

.app-shell.is-panning .timeline-stage {
  cursor: grabbing;
}

#timelineCanvas,
.events-layer {
  position: absolute;
  inset: 0;
}

.events-layer {
  z-index: 2;
}

.map-view {
  position: absolute;
  inset: calc(var(--hud-clearance) + 14px) 22px 22px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.map-view[hidden] {
  display: none;
}

.map-view__toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  background: rgba(8, 11, 16, 0.68);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.map-view__intro {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 300px;
  min-width: 0;
}

.map-view__title {
  margin: 0;
  color: rgba(244, 245, 247, 0.95);
  font-size: 0.92rem;
  line-height: 1.32;
}

.map-view__filters {
  display: flex;
  flex: 1 1 580px;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  align-items: end;
  min-width: 0;
}

.map-viewport {
  position: relative;
  flex: 1;
  min-height: 380px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 30px;
  overflow: hidden;
  background: rgba(7, 10, 14, 0.94);
  box-shadow: 0 36px 96px rgba(0, 0, 0, 0.34);
}

.map-viewport__fallback,
.map-grid,
.map-tiles,
.map-markers {
  position: absolute;
  inset: 0;
}

.map-viewport__fallback {
  background:
    radial-gradient(circle at 20% 24%, rgba(123, 228, 255, 0.12), transparent 24%),
    radial-gradient(circle at 82% 72%, rgba(255, 189, 102, 0.12), transparent 26%),
    linear-gradient(180deg, rgba(9, 13, 18, 0.92), rgba(6, 8, 12, 0.98));
}

.map-grid {
  width: 100%;
  height: 100%;
  opacity: 0.28;
}

.map-grid__lines {
  stroke: rgba(214, 223, 236, 0.28);
  stroke-width: 1;
}

.map-tiles {
  overflow: hidden;
}

.map-tile {
  position: absolute;
  width: 256px;
  height: 256px;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
  opacity: 0.92;
}

.map-markers {
  pointer-events: none;
}

.map-marker {
  position: absolute;
  transform: translate(-50%, calc(-100% - 12px));
  width: min(220px, calc(100vw - 72px));
  padding: 10px 12px 12px;
  border: 1px solid var(--stroke);
  border-radius: 20px;
  background: rgba(15, 18, 25, 0.9);
  color: var(--text);
  text-align: left;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
  pointer-events: auto;
}

.map-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -13px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(6, 9, 15, 0.38);
}

.map-marker--experience,
.map-marker--note,
.map-marker--geolocation {
  color: var(--line);
}

.map-marker--task {
  color: var(--gold);
}

.map-marker__type {
  display: block;
  margin-bottom: 6px;
  color: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.9;
}

.map-marker__title {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.24;
  letter-spacing: -0.02em;
}

.map-marker__time {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.map-empty {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 1;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
  width: min(90%, 420px);
  pointer-events: none;
}

.map-empty[hidden] {
  display: none;
}

.map-empty p,
.map-empty span {
  margin: 0;
}

.map-empty p {
  font-size: 1.05rem;
}

.map-empty span {
  color: var(--muted);
  line-height: 1.45;
}

.map-attribution {
  position: absolute;
  right: 16px;
  bottom: 12px;
  z-index: 1;
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(7, 10, 16, 0.7);
  color: rgba(214, 223, 236, 0.72);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.center-marker {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: opacity 180ms ease;
}

.center-marker.is-offscreen {
  opacity: 0;
}

.center-marker::before {
  content: "";
  position: absolute;
  inset: -34vh auto auto -1px;
  width: 2px;
  height: 68vh;
  background: linear-gradient(180deg, transparent 0%, rgba(255, 75, 85, 0.95) 26%, transparent 100%);
  box-shadow:
    0 0 18px rgba(255, 75, 85, 0.9),
    0 0 46px rgba(255, 75, 85, 0.18);
}

.center-marker__pulse {
  position: absolute;
  inset: -10px auto auto -10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(255, 75, 85, 0.75);
  background: radial-gradient(circle, rgba(255, 75, 85, 0.6), rgba(255, 75, 85, 0.08));
  box-shadow: 0 0 24px rgba(255, 75, 85, 0.5);
}

.center-marker__label {
  position: absolute;
  top: -46px;
  left: 12px;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 142, 149, 0.92);
}

.status-panel {
  position: fixed;
  left: 28px;
  bottom: 22px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.status-panel p {
  margin: 0;
}

.status-panel__time {
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  letter-spacing: -0.02em;
}

.status-panel__zoom {
  color: var(--muted);
}

.empty-state {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  transform: translate(-50%, calc(-50% + 112px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  pointer-events: none;
}

.empty-state p,
.empty-state span {
  margin: 0;
}

.empty-state p {
  font-size: 1.15rem;
}

.empty-state span {
  max-width: 32ch;
  color: var(--muted);
  line-height: 1.45;
}

.empty-state[hidden] {
  display: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 5;
  transform: translateX(-50%) translateY(18px);
  opacity: 0;
  min-width: 220px;
  max-width: min(90vw, 420px);
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(9, 11, 16, 0.82);
  color: var(--text);
  text-align: center;
  backdrop-filter: var(--blur);
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.event-bubble {
  position: absolute;
  display: flex;
  align-items: stretch;
  width: clamp(138px, 15.5vw, 182px);
  border: 1px solid var(--stroke);
  border-radius: 22px;
  padding: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(6, 8, 11, 0.9);
  color: var(--text);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  cursor: pointer;
  transform: translate(-50%, -50%);
  will-change: left, top, transform, opacity;
}

.event-bubble:hover {
  border-color: var(--stroke-strong);
}

.event-bubble--conflict {
  border-color: rgba(255, 116, 120, 0.42);
  box-shadow:
    0 0 0 1px rgba(255, 116, 120, 0.14),
    var(--shadow);
}

.event-bubble.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.event-bubble__photo {
  width: 46px;
  flex: 0 0 46px;
  background-position: center;
  background-size: cover;
  opacity: 0.82;
}

.event-bubble__body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  min-height: 74px;
  padding: 11px 12px 14px;
}

.event-bubble__body::before {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.78;
}

.event-bubble__type,
.event-bubble__time {
  display: block;
}

.event-bubble__type {
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.72;
}

.event-bubble__title {
  font-size: 0.86rem;
  line-height: 1.22;
  text-align: left;
}

.event-bubble__time {
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.18;
  padding-bottom: 1px;
}

.event-bubble--compact {
  align-items: center;
  min-width: 0;
  padding: 0 12px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(8, 10, 15, 0.94);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.event-bubble__compact-text {
  display: block;
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.76rem;
  line-height: 1;
  letter-spacing: 0.01em;
  text-align: left;
}

.event-bubble--task {
  color: var(--gold);
}

.event-bubble--experience {
  color: var(--line);
}

.event-bubble--note {
  color: var(--violet);
}

.event-bubble--geolocation {
  color: var(--mint);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(12px);
}

.modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 600px);
  max-height: calc(100dvh - 32px);
  margin: auto 0;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(9, 11, 18, 0.9);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(24px);
  overflow-y: auto;
  scrollbar-gutter: stable both-edges;
}

.modal__panel--detail {
  width: min(92vw, 640px);
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 9;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 460px);
  gap: 28px;
  padding: 28px;
  background:
    radial-gradient(circle at 18% 22%, rgba(123, 228, 255, 0.08), transparent 26%),
    radial-gradient(circle at 82% 76%, rgba(255, 75, 85, 0.08), transparent 26%),
    rgba(4, 6, 10, 0.92);
  backdrop-filter: blur(18px);
}

.auth-screen[hidden] {
  display: none;
}

.auth-screen__hero,
.auth-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    rgba(8, 11, 16, 0.78);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(22px);
}

.auth-screen__hero {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  min-width: 0;
  padding: clamp(24px, 3vw, 40px);
  overflow: hidden;
}

.auth-screen__copy {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 34rem;
}

.auth-screen__title,
.auth-card__title {
  margin: 0;
  letter-spacing: -0.04em;
  line-height: 0.98;
}

.auth-screen__title {
  font-size: clamp(2.3rem, 5.8vw, 4.7rem);
}

.auth-screen__quote,
.auth-screen__support,
.auth-card__description {
  margin: 0;
}

.auth-screen__quote {
  max-width: 38rem;
  color: rgba(244, 245, 247, 0.94);
  font-size: clamp(1.02rem, 1.6vw, 1.25rem);
  line-height: 1.5;
}

.auth-screen__support,
.auth-card__description {
  color: var(--muted);
  line-height: 1.55;
}

.auth-preview {
  --auth-preview-line-top: 64%;
  position: relative;
  min-height: 360px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 28%, rgba(123, 228, 255, 0.12), transparent 28%),
    radial-gradient(circle at 82% 72%, rgba(255, 189, 102, 0.14), transparent 32%),
    linear-gradient(180deg, rgba(8, 11, 16, 0.92), rgba(4, 6, 10, 0.98));
}

.auth-preview__halo {
  position: absolute;
  width: 42%;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(22px);
  opacity: 0.34;
}

.auth-preview__halo--left {
  top: 14%;
  left: 10%;
  background: radial-gradient(circle, rgba(123, 228, 255, 0.35), transparent 70%);
}

.auth-preview__halo--right {
  right: 8%;
  bottom: 10%;
  background: radial-gradient(circle, rgba(255, 98, 104, 0.28), transparent 70%);
}

.auth-preview__line,
.auth-preview__line-core {
  position: absolute;
  left: 8%;
  right: 8%;
  border-radius: 999px;
}

.auth-preview__line {
  top: var(--auth-preview-line-top);
  height: 18px;
  background: rgba(255, 255, 255, 0.14);
}

.auth-preview__line-core {
  top: calc(var(--auth-preview-line-top) + 6px);
  height: 6px;
  background: linear-gradient(90deg, rgba(246, 237, 194, 0.94), rgba(123, 228, 255, 0.98), rgba(255, 98, 104, 0.96), rgba(246, 237, 194, 0.94));
}

.auth-preview__tick {
  position: absolute;
  top: calc(var(--auth-preview-line-top) - 10px);
  width: 2px;
  background: rgba(244, 245, 247, 0.36);
}

.auth-preview__tick--major {
  height: 34px;
}

.auth-preview__tick--minor {
  height: 24px;
  top: calc(var(--auth-preview-line-top) - 5px);
}

.auth-preview__tick--one {
  left: 16%;
}

.auth-preview__tick--two {
  left: 31%;
}

.auth-preview__tick--three {
  left: 48%;
}

.auth-preview__tick--four {
  left: 64%;
}

.auth-preview__tick--five {
  left: 81%;
}

.auth-preview__now {
  position: absolute;
  inset: 16% auto 10% 54%;
  width: 0;
}

.auth-preview__now-line {
  position: absolute;
  left: -1px;
  width: 2px;
  height: 210px;
  background: linear-gradient(180deg, transparent 0%, rgba(255, 75, 85, 0.9) 24%, transparent 100%);
  box-shadow: 0 0 18px rgba(255, 75, 85, 0.5);
}

.auth-preview__now-dot {
  position: absolute;
  top: 120px;
  left: -10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(255, 75, 85, 0.76);
  background: radial-gradient(circle, rgba(255, 75, 85, 0.54), rgba(255, 75, 85, 0.08));
}

.auth-preview__now-label {
  position: absolute;
  top: 80px;
  left: 14px;
  color: rgba(255, 142, 149, 0.9);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-preview__node {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 168px;
  max-width: 196px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  background: rgba(10, 13, 19, 0.82);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  transform: translateX(-50%);
}

.auth-preview__node strong,
.auth-preview__node span {
  display: block;
}

.auth-preview__node strong {
  color: var(--text);
  font-size: 0.94rem;
  line-height: 1.22;
}

.auth-preview__node > span:last-child {
  color: var(--muted);
  font-size: 0.76rem;
}

.auth-preview__node-type {
  color: inherit;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-preview__branch {
  position: absolute;
  width: 2px;
  background: currentColor;
  opacity: 0.9;
  box-shadow: 0 0 14px color-mix(in srgb, currentColor 26%, transparent);
}

.auth-preview__anchor {
  position: absolute;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  margin-top: -5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(8, 11, 16, 0.32);
}

.auth-preview__node--recorded {
  top: 14%;
  left: 22%;
  color: var(--line);
}

.auth-preview__node--note {
  top: 28%;
  left: 43%;
  color: var(--mint);
}

.auth-preview__node--planned {
  top: 72%;
  left: 77%;
  color: var(--gold);
}

.auth-preview__branch--recorded,
.auth-preview__anchor--recorded {
  left: 22%;
  color: var(--line);
}

.auth-preview__branch--recorded {
  top: 37%;
  height: 85px;
}

.auth-preview__anchor--recorded {
  top: calc(var(--auth-preview-line-top) + 9px);
}

.auth-preview__branch--note,
.auth-preview__anchor--note {
  left: 43%;
  color: var(--mint);
}

.auth-preview__branch--note {
  top: 48%;
  height: 45px;
}

.auth-preview__anchor--note {
  top: calc(var(--auth-preview-line-top) + 9px);
}

.auth-preview__branch--planned,
.auth-preview__anchor--planned {
  left: 77%;
  color: var(--gold);
}

.auth-preview__branch--planned {
  top: calc(var(--auth-preview-line-top) + 9px);
  height: 46px;
}

.auth-preview__anchor--planned {
  top: calc(var(--auth-preview-line-top) + 9px);
}

.auth-screen__panel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.auth-card {
  width: min(100%, 460px);
  max-height: calc(100dvh - 56px);
  padding: clamp(24px, 3vw, 34px);
  overflow-y: auto;
}

.auth-card__title {
  font-size: clamp(1.8rem, 3vw, 2.45rem);
}

.mode-toggle--auth {
  width: 100%;
  justify-content: space-between;
  margin: 18px 0 12px;
}

.auth-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.auth-form[hidden] {
  display: none;
}

.auth-form__links {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-top: -2px;
}

.auth-form__links--spread {
  justify-content: space-between;
  flex-wrap: wrap;
}

.auth-inline-link {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(123, 228, 255, 0.9);
  font-size: 0.82rem;
  letter-spacing: 0.01em;
}

.auth-inline-link:hover {
  transform: none;
  color: var(--text);
}

.auth-form__actions {
  margin-top: 4px;
  padding-bottom: 0;
  background: none;
  position: static;
}

.auth-form__hint {
  margin: -2px 0 0;
}

.modal__heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  position: sticky;
  top: -24px;
  z-index: 2;
  padding: 24px 0 16px;
  background:
    linear-gradient(180deg, rgba(9, 11, 18, 0.98), rgba(9, 11, 18, 0.9) 78%, rgba(9, 11, 18, 0));
}

.entry-form {
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(0, 0.86fr);
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.field span {
  color: var(--muted);
  font-size: 0.88rem;
}

.field__hint {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.auth-error {
  color: rgba(255, 119, 119, 0.95);
  margin: 0 0 10px;
}

.field--wide {
  grid-column: 1 / -1;
}

.field--time {
  min-width: 0;
}

.field--category {
  min-width: 0;
}

.field--map {
  grid-column: auto;
  gap: 7px;
  flex: 1 1 264px;
  min-width: 240px;
  max-width: 312px;
}

.field--map span {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field--map input {
  min-height: 42px;
  padding: 10px 2.4rem 10px 12px;
  border-radius: 16px;
  font-size: 0.87rem;
  line-height: 1.15;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

#mapStartInput::-webkit-date-and-time-value,
#mapEndInput::-webkit-date-and-time-value {
  min-height: 1.1em;
  text-align: left;
  min-width: 0;
}

#mapStartInput::-webkit-datetime-edit,
#mapStartInput::-webkit-datetime-edit-fields-wrapper,
#mapEndInput::-webkit-datetime-edit,
#mapEndInput::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
  min-width: 0;
}

#mapStartInput::-webkit-datetime-edit-fields-wrapper,
#mapEndInput::-webkit-datetime-edit-fields-wrapper {
  display: flex;
  align-items: center;
  gap: 0;
}

#mapStartInput::-webkit-datetime-edit-text,
#mapStartInput::-webkit-datetime-edit-year-field,
#mapStartInput::-webkit-datetime-edit-month-field,
#mapStartInput::-webkit-datetime-edit-day-field,
#mapStartInput::-webkit-datetime-edit-hour-field,
#mapStartInput::-webkit-datetime-edit-minute-field,
#mapStartInput::-webkit-datetime-edit-ampm-field,
#mapEndInput::-webkit-datetime-edit-text,
#mapEndInput::-webkit-datetime-edit-year-field,
#mapEndInput::-webkit-datetime-edit-month-field,
#mapEndInput::-webkit-datetime-edit-day-field,
#mapEndInput::-webkit-datetime-edit-hour-field,
#mapEndInput::-webkit-datetime-edit-minute-field,
#mapEndInput::-webkit-datetime-edit-ampm-field {
  padding: 0;
}

#mapStartInput::-webkit-calendar-picker-indicator,
#mapEndInput::-webkit-calendar-picker-indicator {
  margin-left: 4px;
}

.map-view__filters > .text-button {
  flex: 0 0 auto;
  align-self: end;
}

.field-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 13px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  outline: none;
  font-size: clamp(0.94rem, 1.05vw, 1.02rem);
  line-height: 1.2;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(123, 228, 255, 0.4);
  box-shadow: 0 0 0 3px rgba(123, 228, 255, 0.08);
}

.field textarea {
  resize: vertical;
  min-height: 112px;
}

#eventTimeInput {
  padding-right: 2.5rem;
  font-size: clamp(0.84rem, 0.92vw, 0.93rem);
  line-height: 1.15;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

#eventTimeInput::-webkit-date-and-time-value {
  min-height: 1.1em;
  text-align: left;
  min-width: 0;
}

#eventTimeInput::-webkit-datetime-edit,
#eventTimeInput::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
  min-width: 0;
}

#eventTimeInput::-webkit-datetime-edit-fields-wrapper {
  display: flex;
  align-items: center;
  gap: 0;
}

#eventTimeInput::-webkit-datetime-edit-text,
#eventTimeInput::-webkit-datetime-edit-year-field,
#eventTimeInput::-webkit-datetime-edit-month-field,
#eventTimeInput::-webkit-datetime-edit-day-field,
#eventTimeInput::-webkit-datetime-edit-hour-field,
#eventTimeInput::-webkit-datetime-edit-minute-field,
#eventTimeInput::-webkit-datetime-edit-ampm-field {
  padding: 0;
}

#eventTimeInput::-webkit-calendar-picker-indicator {
  margin-left: 4px;
}

.modal__actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
  position: sticky;
  bottom: -24px;
  z-index: 2;
  padding: 16px 0 calc(env(safe-area-inset-bottom, 0px) + 2px);
  background:
    linear-gradient(180deg, rgba(9, 11, 18, 0), rgba(9, 11, 18, 0.88) 24%, rgba(9, 11, 18, 0.98));
}

.text-button {
  background: transparent;
}

.detail-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.detail-content h2,
.detail-content p {
  margin: 0;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.detail-card {
  padding: 16px 18px;
  border: 1px solid var(--stroke);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
}

.detail-card span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-card p + p {
  margin-top: 8px;
}

.detail-card__raw-link {
  overflow-wrap: anywhere;
}

.detail-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(123, 228, 255, 0.22);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  background: rgba(123, 228, 255, 0.08);
}

.detail-link:hover {
  border-color: rgba(123, 228, 255, 0.42);
  background: rgba(123, 228, 255, 0.12);
}

.detail-photo {
  width: 100%;
  border-radius: 24px;
  max-height: 300px;
  object-fit: cover;
  border: 1px solid var(--stroke);
}

.detail-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 12px;
}

.archive-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.archive-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--stroke);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
}

.archive-toolbar__summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.archive-toolbar__summary span,
.archive-toolbar__summary p {
  margin: 0;
}

.archive-toolbar__summary span {
  color: var(--text);
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.archive-toolbar__summary p {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.archive-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.archive-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--stroke);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
}

.archive-item__select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.archive-item__select input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.archive-item__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.archive-item__title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}

.archive-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.archive-item__meta span {
  display: inline-flex;
  align-items: center;
}

.archive-item__actions {
  display: flex;
  flex-wrap: wrap;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.detail-card--warning {
  border-color: rgba(255, 118, 123, 0.2);
  background: rgba(255, 75, 85, 0.08);
}

.app-shell.is-vertical .center-marker::before {
  inset: -1px auto auto -34vw;
  width: 68vw;
  max-width: 78vw;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 75, 85, 0.95) 26%, transparent 100%);
}

.app-shell.is-vertical .center-marker__label {
  top: 12px;
  left: -12px;
}

.app-shell.is-vertical .empty-state {
  transform: translate(calc(-50% + 104px), -50%);
}

@media (max-width: 820px) {
  body {
    overflow: auto;
  }

  .auth-screen {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
    overflow-y: auto;
  }

  .auth-screen__hero {
    padding: 20px;
    gap: 18px;
  }

  .auth-screen__title {
    font-size: clamp(2rem, 10vw, 3.1rem);
  }

  .auth-preview {
    min-height: 240px;
  }

  .auth-preview__node {
    min-width: 124px;
    max-width: 156px;
    padding: 10px 12px;
  }

  .auth-preview__node strong {
    font-size: 0.82rem;
  }

  .auth-screen__panel {
    align-items: stretch;
  }

  .auth-card {
    width: 100%;
    max-height: none;
    padding: 22px 18px;
  }

  .hud {
    padding: 20px 18px 0;
    gap: 18px;
  }

  .brand {
    max-width: 220px;
    padding: 10px 12px;
  }

  .brand__summary {
    font-size: 0.82rem;
  }

  .hint {
    font-size: 0.7rem;
  }

  .archive-item {
    flex-direction: column;
    align-items: stretch;
  }

  .archive-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .archive-toolbar__actions {
    justify-content: stretch;
  }

  .archive-toolbar__actions .text-button,
  .archive-toolbar__actions .control-button {
    width: 100%;
  }

  .archive-item__actions {
    justify-content: flex-end;
  }

  .controls {
    gap: 10px;
  }

  .mode-controls {
    gap: 8px;
  }

  .control-button {
    min-height: 42px;
    padding: 0 15px;
  }

  .mode-button,
  .plan-nav__button {
    min-height: 34px;
  }

  .status-panel {
    left: 18px;
    bottom: 16px;
  }

  .map-view {
    inset: calc(var(--hud-clearance) + 12px) 14px 18px;
  }

  .map-view__toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .map-view__filters {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
  }

  .field--map {
    min-width: 0;
    max-width: none;
  }

  .map-view__filters > .text-button {
    align-self: stretch;
  }

  .map-marker {
    width: min(188px, calc(100vw - 56px));
  }

  .modal__panel {
    width: min(100%, 560px);
    max-height: calc(100dvh - 20px);
    padding: 20px;
    border-radius: 24px;
  }

  .modal {
    padding: 10px;
  }

  .modal__heading {
    top: -20px;
    padding: 20px 0 14px;
  }

  .modal__actions {
    bottom: -20px;
  }

  .entry-form,
  .field-row,
  .detail-meta {
    grid-template-columns: 1fr;
  }

  .event-bubble {
    width: min(140px, calc(100vw - 34px));
  }
}
