:root {
  color-scheme: dark;
  --ink: #eef4ff;
  --muted: #8e9bb2;
  --faint: #5f6b80;
  --night: #010208;
  --night-blue: #030710;
  --panel: rgba(12, 22, 40, 0.76);
  --panel-solid: #0d182a;
  --line: rgba(152, 176, 217, 0.16);
  --gold: #f6c76b;
  --cyan: #7bdff2;
  --violet: #a99cff;
  --rose: #ff91b8;
  --danger: #ff9e9e;
  --radius: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-width: 320px; background: var(--night); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 72% 8%, rgba(35, 61, 107, 0.13), transparent 38rem),
    linear-gradient(155deg, #030712 0%, #010208 58%, #040711 100%);
  font-size: 16px;
  line-height: 1.55;
}

button, input { font: inherit; }
button { color: inherit; }

.sky-glow {
  position: fixed;
  z-index: -1;
  width: 36rem;
  height: 36rem;
  border-radius: 50%;
  filter: blur(110px);
  opacity: .12;
  pointer-events: none;
}

.sky-glow-one { top: -16rem; left: -10rem; background: #5368ff; }
.sky-glow-two { right: -16rem; bottom: -18rem; background: #0ba6b5; }

.topbar {
  width: min(1520px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 4px 20px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(2rem, 4vw, 3rem); font-weight: 500; letter-spacing: .08em; }
h2 { margin-bottom: 0; font-size: 1.25rem; font-weight: 600; letter-spacing: .02em; }
h3 { margin-bottom: 8px; font-size: 1rem; }

.eyebrow, .section-kicker {
  margin-bottom: 2px;
  color: var(--cyan);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.section-kicker { color: #72829e; letter-spacing: .12em; }

.topbar-actions { display: flex; align-items: center; gap: 18px; }
.topbar-actions form { margin: 0; }
.as-of { margin: 0; color: var(--muted); font-size: .875rem; }

.view-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(4, 10, 21, .52);
}

.view-switch button {
  min-width: 62px;
  padding: 7px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: .78rem;
  cursor: pointer;
}

.view-switch button.active {
  background: rgba(123, 223, 242, .12);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(123, 223, 242, .12);
}

.quiet-button {
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.quiet-button:hover { border-color: rgba(246, 199, 107, .45); color: var(--ink); }

.workspace {
  width: min(1520px, calc(100% - 48px));
  margin: 22px auto 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.atlas, .stats-panel, .detail-panel, .list-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 20px 70px rgba(0, 0, 0, .2);
  backdrop-filter: blur(18px);
}

.atlas { position: relative; min-width: 0; padding: 0; overflow: hidden; border-color: rgba(166, 191, 231, .1); background: #010208; }
.atlas-head, .panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.atlas-head { position: absolute; z-index: 4; top: 16px; left: 16px; right: 146px; pointer-events: none; }
.atlas-head > div { display: none; }
.atlas-head .search-box { pointer-events: auto; }

.search-box {
  width: min(430px, 52%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(4, 10, 21, .58);
}

.search-box:focus-within { border-color: rgba(123, 223, 242, .5); box-shadow: 0 0 0 3px rgba(123, 223, 242, .08); }
.search-box.searching { border-color: rgba(169, 156, 255, .5); }
.search-box.searching::after { content: '正在寻找'; color: var(--violet); font-size: .68rem; white-space: nowrap; }
.search-box.no-results { border-color: rgba(255, 145, 184, .48); }
.search-box input { width: 100%; height: 44px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: .9rem; }
.search-box input::placeholder { color: #657188; }
kbd { padding: 2px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--faint); font-size: .72rem; white-space: nowrap; }

.legend { position: absolute; z-index: 4; right: 15px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 14px; margin: 0; padding: 7px 10px; border: 1px solid rgba(142, 163, 198, .09); border-radius: 999px; background: rgba(4, 9, 19, .58); color: #6d7a91; font-size: .72rem; pointer-events: none; backdrop-filter: blur(8px); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend-star { width: 7px; height: 7px; border-radius: 50%; background: white; box-shadow: 0 0 10px currentColor; }
.legend-star.core { width: 11px; height: 11px; color: var(--gold); background: var(--gold); }
.legend-star.important { width: 9px; height: 9px; color: var(--cyan); background: var(--cyan); }
.legend-star.ordinary { color: #94a3b8; background: #94a3b8; }
.legend-arc { width: 24px; height: 12px; border: 1px dashed rgba(169, 156, 255, .7); border-radius: 50%; background: rgba(169, 156, 255, .07); }
.legend-line { width: 22px; height: 1px; background: rgba(123, 223, 242, .48); }

.sky-panel {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius);
  background: #010208;
  box-shadow: inset 0 0 120px rgba(0, 0, 0, .72);
  cursor: grab;
  touch-action: none;
}

.sky-panel:active { cursor: grabbing; }
#star-map { display: block; width: 100%; height: clamp(680px, 82vh, 980px); user-select: none; touch-action: none; cursor: grab; }
#star-map:active { cursor: grabbing; }
.map-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); pointer-events: none; }
.map-controls { position: absolute; right: 14px; top: 14px; display: flex; align-items: center; overflow: hidden; border: 1px solid rgba(185, 207, 240, .12); border-radius: 11px; background: rgba(2, 5, 12, .72); box-shadow: 0 8px 30px #0009; backdrop-filter: blur(12px); }
.map-controls button { width: 42px; height: 40px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.map-controls button:last-child { border-right: 0; }
.map-controls button:hover { background: rgba(123, 223, 242, .09); color: var(--ink); }
.map-controls span { min-width: 58px; padding: 0 8px; color: #7f8ca4; font-size: .72rem; text-align: center; }
.map-hint { position: absolute; left: 18px; bottom: 14px; margin: 0; color: #647188; font-size: .72rem; pointer-events: none; opacity: .82; transition: opacity .35s; text-shadow: 0 1px 7px #000; }
.sky-panel.has-interacted .map-hint { opacity: 0; }
.mobile-hint { display: none; }

.timeline-view {
  min-height: 620px;
  padding: 84px clamp(18px, 4vw, 56px) 48px;
  background:
    linear-gradient(90deg, transparent 0, transparent 22px, rgba(123, 223, 242, .12) 23px, transparent 24px),
    radial-gradient(circle at 18% 12%, rgba(123, 223, 242, .075), transparent 25rem),
    #030711;
}

#timeline-list { width: min(920px, 100%); margin: 0 auto; }
.timeline-group { position: relative; padding-left: 42px; }
.timeline-group + .timeline-group { margin-top: 42px; }
.timeline-group::before { content: ''; position: absolute; top: 11px; bottom: -53px; left: 10px; width: 1px; background: linear-gradient(rgba(123, 223, 242, .35), rgba(169, 156, 255, .08)); }
.timeline-group:last-child::before { bottom: 8px; }
.timeline-group > h2 { margin-bottom: 15px; color: #99a8c1; font-family: Georgia, "Noto Serif SC", serif; font-size: 1rem; font-weight: 500; letter-spacing: .08em; }
.timeline-entries { display: grid; gap: 8px; }
.timeline-memory {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(142, 163, 198, .11);
  border-radius: 14px;
  background: rgba(6, 13, 26, .52);
  text-align: left;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.timeline-memory::before { content: ''; position: absolute; top: 20px; left: -37px; width: 9px; height: 9px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 14px rgba(123, 223, 242, .8); }
.timeline-memory:hover { transform: translateX(3px); border-color: rgba(123, 223, 242, .28); background: rgba(12, 24, 43, .72); }
.timeline-memory time { padding-top: 2px; color: #708098; font-size: .73rem; }
.timeline-memory.is-month::before,
.timeline-memory.is-season::before,
.timeline-memory.is-approximate::before,
.timeline-memory.is-recorded_context::before { opacity: .62; }
.timeline-memory.is-approximate time,
.timeline-memory.is-recorded_context time { color: #8790a6; font-style: italic; }
.timeline-copy { min-width: 0; display: grid; gap: 4px; }
.timeline-copy strong { overflow: hidden; color: #dbe5f7; font-size: .84rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.timeline-copy > span { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: .8rem; line-height: 1.6; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.timeline-undated { opacity: .72; }
.timeline-empty { padding: 120px 20px; color: var(--faint); text-align: center; }

.atlas.diary-mode .atlas-head { display: none; }
.diary-view {
  min-height: 620px;
  padding: clamp(28px, 5vw, 64px);
  background:
    radial-gradient(circle at 16% 4%, rgba(169, 156, 255, .09), transparent 28rem),
    linear-gradient(145deg, rgba(9, 16, 31, .97), rgba(3, 7, 17, .98));
}
.diary-view-head { display: flex; align-items: end; justify-content: space-between; gap: 28px; width: min(1040px, 100%); margin: 0 auto 38px; }
.diary-view-head > div > p:last-child { max-width: 440px; margin: 10px 0 0; color: var(--muted); font-size: .86rem; }
.diary-filters { display: flex; gap: 9px; }
.diary-filters input, .diary-filters select {
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  background: rgba(4, 10, 21, .72);
  color: var(--ink);
}
.diary-filters input { width: min(270px, 34vw); }
.diary-filters select { max-width: 150px; }
.diary-filters input:focus, .diary-filters select:focus { border-color: rgba(169, 156, 255, .5); box-shadow: 0 0 0 3px rgba(169, 156, 255, .07); }
.diary-book { width: min(1040px, 100%); margin: 0 auto; transition: opacity .16s; }
.diary-book.loading { opacity: .5; }
.diary-month + .diary-month { margin-top: 38px; }
.diary-month > h3 { margin-bottom: 13px; color: #9a9fc5; font-family: Georgia, "Noto Serif SC", serif; font-size: .95rem; font-weight: 500; letter-spacing: .08em; }
.diary-pages { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.diary-page {
  width: 100%;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  padding: 17px;
  border: 1px solid rgba(169, 156, 255, .14);
  border-radius: 16px;
  background: rgba(10, 16, 31, .56);
  text-align: left;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.diary-page:hover { transform: translateY(-2px); border-color: rgba(169, 156, 255, .34); background: rgba(17, 24, 45, .75); }
.diary-page > time { color: var(--gold); font-family: Georgia, serif; font-size: 1.28rem; text-align: center; }
.diary-page-copy { min-width: 0; display: grid; gap: 5px; }
.diary-page-copy strong { overflow: hidden; color: #e1e7f4; font-size: .91rem; text-overflow: ellipsis; white-space: nowrap; }
.diary-page-copy > span { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: .8rem; line-height: 1.6; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.diary-page-copy small { color: #777f9d; font-size: .7rem; }
.diary-summary { margin: 8px 0 18px; padding: 12px 14px; border-left: 2px solid rgba(246, 199, 107, .5); background: rgba(246, 199, 107, .045); color: #b9c4d6; font-size: .82rem; line-height: 1.65; }
.diary-detail-section { margin-top: 17px; padding: 15px; border: 1px solid rgba(142, 163, 198, .11); border-radius: 14px; background: rgba(4, 10, 21, .38); }
.diary-detail-section h3 { margin-bottom: 8px; color: #9eaac0; font-size: .78rem; font-weight: 600; letter-spacing: .06em; }
.diary-detail-section p { margin: 0; color: #cbd5e6; line-height: 1.78; white-space: pre-wrap; }
.diary-detail-section.reflection { border-color: rgba(169, 156, 255, .19); background: rgba(169, 156, 255, .045); }
.diary-detail-section.reflection p { color: #e2e5f2; font-family: Georgia, "Noto Serif SC", serif; font-size: .94rem; }
.diary-detail-section.uncertainties { border-style: dashed; }

.side-column { display: grid; grid-template-columns: 1fr; align-content: start; gap: 18px; }
.stats-panel, .detail-panel, .list-panel { padding: 21px; }
.live-dot { display: inline-flex; align-items: center; gap: 7px; color: #9fd8c4; font-size: .76rem; }
.live-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #5ee2ae; box-shadow: 0 0 10px #5ee2ae; }

.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-top: 18px; }
.stat { min-height: 82px; padding: 13px; border: 1px solid rgba(142, 163, 198, .11); border-radius: 14px; background: rgba(4, 10, 21, .45); }
.stat strong { display: block; font-family: Georgia, serif; font-size: 1.65rem; font-weight: 500; color: var(--gold); }
.stat span { color: var(--muted); font-size: .78rem; }

.emotion-block { margin-top: 20px; }
.emotion-block > p { margin-bottom: 10px; color: var(--muted); font-size: .8rem; }
.emotion-row { display: grid; grid-template-columns: 64px 1fr 32px; align-items: center; gap: 9px; margin: 8px 0; color: var(--muted); font-size: .72rem; }
.emotion-track { height: 4px; overflow: hidden; border-radius: 5px; background: rgba(255,255,255,.06); }
.emotion-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--violet), var(--cyan)); }
.emotion-row b { color: var(--faint); font-weight: 500; text-align: right; }

.detail-panel { min-height: 260px; max-height: calc(100vh - 36px); overflow-y: auto; overscroll-behavior: contain; scrollbar-color: rgba(142, 163, 198, .24) transparent; }
.detail-panel:not(.has-memory) { display: none; }
.detail-panel.has-memory { position: fixed; z-index: 30; top: 128px; right: max(24px, calc((100vw - 1520px) / 2)); width: min(410px, calc(100vw - 48px)); max-height: calc(100vh - 152px); border-color: rgba(169, 184, 221, .24); box-shadow: -18px 22px 80px #000b; }
.detail-placeholder { min-height: 216px; display: grid; place-content: center; text-align: center; color: var(--muted); }
.detail-placeholder > span { color: var(--gold); font-size: 1.8rem; }
.detail-placeholder h2 { margin: 8px 0; color: var(--ink); }
.detail-placeholder p { max-width: 260px; margin-bottom: 0; font-size: .84rem; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 7px; margin: 13px 0 17px; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.detail-head h2 { padding-top: 4px; }
.detail-close { flex: 0 0 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: rgba(255,255,255,.025); color: var(--muted); font-size: 1.45rem; line-height: 1; cursor: pointer; }
.detail-close:hover { color: var(--ink); border-color: rgba(246, 199, 107, .38); }
.tag { padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .72rem; }
.detail-body { color: #dbe5f8; white-space: pre-wrap; line-height: 1.75; }
.detail-date { color: var(--muted); font-size: .77rem; }
.arc-summary { margin-top: 18px; padding: 12px 13px; border-left: 2px solid rgba(169, 156, 255, .5); background: rgba(169, 156, 255, .045); color: var(--muted); font-size: .82rem; }
.revision-list, .association-list { margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--line); }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-title-row h3, .association-list h3 { margin: 0; color: #d7e0f0; font-size: .9rem; font-weight: 600; }
.section-title-row span { color: var(--faint); font-size: .75rem; }
.revision-item { position: relative; margin-top: 14px; padding: 14px; border: 1px solid rgba(142, 163, 198, .13); border-radius: 14px; background: rgba(4, 10, 21, .42); }
.revision-head { display: grid; gap: 3px; margin-bottom: 12px; }
.revision-head strong { color: var(--gold); font-size: .83rem; font-weight: 600; }
.revision-head time { color: var(--faint); font-size: .72rem; }
.revision-version { padding: 9px 10px; border-radius: 9px; background: rgba(255, 132, 152, .045); }
.revision-version + .revision-version { margin-top: 8px; }
.revision-version span { color: #aeb9cb; font-size: .7rem; font-weight: 700; letter-spacing: .08em; }
.revision-version p { margin: 4px 0 0; color: #abb7ca; font-size: .78rem; line-height: 1.58; white-space: pre-wrap; }
.revision-metadata { display: grid; gap: 7px; margin-top: 9px; }
.revision-field { padding: 8px 10px; border-radius: 9px; background: rgba(110, 154, 218, .055); }
.revision-field span { color: #8fa0ba; font-size: .68rem; font-weight: 700; letter-spacing: .06em; }
.revision-field p { margin: 3px 0 0; color: #b5c0d2; font-size: .76rem; line-height: 1.5; overflow-wrap: anywhere; }
.revision-after { background: rgba(123, 223, 242, .045); }
.revision-after p { color: #d6e2f5; }
.association { width: 100%; margin-top: 8px; padding: 10px; border: 1px solid transparent; border-radius: 10px; background: rgba(255,255,255,.025); color: #b9c6dc; text-align: left; font-size: .78rem; cursor: pointer; }
.association:hover { border-color: var(--line); color: var(--ink); }

.lower-grid { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.count-pill { min-width: 28px; padding: 3px 8px; border-radius: 999px; background: rgba(246, 199, 107, .1); color: var(--gold); font-size: .78rem; text-align: center; }
.card-list { display: grid; gap: 9px; margin-top: 17px; }
.memory-card { padding: 13px 14px; border: 1px solid rgba(142, 163, 198, .11); border-radius: 13px; background: rgba(4, 10, 21, .38); }
.clickable-card { width: 100%; color: inherit; text-align: left; cursor: pointer; }
.clickable-card:hover { border-color: rgba(169, 156, 255, .3); background: rgba(169, 156, 255, .045); }
.memory-card h3 { margin-bottom: 4px; }
.memory-card p { margin-bottom: 0; color: var(--muted); font-size: .82rem; }
.memory-card time { display: block; margin-top: 8px; color: var(--faint); font-size: .72rem; }
.diary-panel .memory-card { border-left: 2px solid rgba(169, 156, 255, .5); }
.empty-card { padding: 22px 0; color: var(--faint); text-align: center; }

.toast { position: fixed; right: 22px; bottom: 22px; z-index: 10; padding: 11px 16px; border: 1px solid var(--line); border-radius: 12px; background: #152239; box-shadow: 0 12px 35px #0007; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.login-page { display: grid; place-items: center; padding: 24px; }
.login-shell { width: min(440px, 100%); padding: 36px; border: 1px solid var(--line); border-radius: 26px; background: rgba(12, 22, 40, .88); box-shadow: 0 28px 100px #0008; }
.login-star { color: var(--gold); font-size: 2.2rem; text-shadow: 0 0 24px rgba(246, 199, 107, .7); }
.login-shell h1 { margin: 7px 0 10px; }
.login-copy { color: var(--muted); }
.login-shell label { display: block; margin: 25px 0 8px; color: #c5d0e2; font-size: .88rem; }
.login-shell input { width: 100%; height: 48px; padding: 0 13px; border: 1px solid var(--line); border-radius: 12px; outline: none; background: #070e1b; color: var(--ink); font-size: 1rem; }
.login-shell input:focus { border-color: rgba(123, 223, 242, .55); box-shadow: 0 0 0 3px rgba(123, 223, 242, .08); }
.login-shell button { width: 100%; margin-top: 15px; padding: 13px; border: 0; border-radius: 12px; background: linear-gradient(110deg, #f6c76b, #efad61); color: #152030; font-weight: 750; cursor: pointer; }
.login-shell small { display: block; margin-top: 17px; color: var(--faint); line-height: 1.5; }
.login-error { padding: 10px 12px; border: 1px solid rgba(255,158,158,.25); border-radius: 10px; background: rgba(255,158,158,.07); color: var(--danger); font-size: .84rem; }

@media (max-width: 980px) {
  .side-column { grid-template-columns: 1fr; }
  .lower-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .topbar, .workspace { width: min(100% - 24px, 1520px); }
  .topbar { padding-top: 18px; }
  .as-of { display: none; }
  .topbar-actions { gap: 8px; }
  .view-switch button { min-width: 52px; padding: 7px 9px; }
  .atlas, .stats-panel, .detail-panel, .list-panel { border-radius: 18px; }
  .atlas { padding: 0; }
  .atlas-head { top: 12px; left: 12px; right: 174px; align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .sky-panel, #star-map { min-height: 620px; height: 76dvh; }
  .timeline-view { min-height: 620px; padding: 78px 12px 34px; }
  .diary-view { min-height: 620px; padding: 28px 14px 40px; }
  .diary-view-head { align-items: stretch; flex-direction: column; gap: 18px; margin-bottom: 26px; }
  .diary-filters { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .diary-filters input { width: 100%; }
  .diary-pages { grid-template-columns: 1fr; }
  .diary-page { grid-template-columns: 42px minmax(0, 1fr); padding: 15px 13px; }
  .timeline-group { padding-left: 27px; }
  .timeline-group::before { left: 5px; }
  .timeline-memory { grid-template-columns: 62px minmax(0, 1fr); gap: 9px; padding: 13px 12px; }
  .timeline-memory::before { left: -26px; }
  .map-controls { right: 10px; top: 10px; }
  .map-controls button { width: 46px; height: 44px; }
  .map-hint { left: 12px; bottom: 9px; }
  .legend { right: 10px; bottom: 9px; gap: 9px; padding: 6px 8px; }
  .legend span { gap: 5px; }
  .desktop-hint { display: none; }
  .mobile-hint { display: inline; }
  .detail-panel.has-memory { position: fixed; z-index: 30; inset: auto 10px max(10px, env(safe-area-inset-bottom)) 10px; width: auto; max-height: min(72dvh, 650px); padding: 19px; border-color: rgba(169, 184, 221, .26); box-shadow: 0 -18px 70px #000c; animation: detail-rise .22s ease-out; }
  .side-column, .lower-grid { grid-template-columns: 1fr; }
  .login-shell { padding: 27px 22px; }
  kbd { display: none; }
}

@keyframes detail-rise {
  from { transform: translateY(18px); opacity: .25; }
  to { transform: translateY(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
