@import url('/fonts.css');

:root {
  color-scheme: dark;
  font: 14px var(--ui-font);
  font-synthesis: none;
  color: #efecf2;
  background: #191721;
  --bg: #191721;
  --muted: #b4aabb;
  --line: #423b4d;
  --accent: #cfbde5;
  --gutter: clamp(20px, 5vw, 74px);
  --ui-font: Helvetica, 'Helvetica Neue', Arial, 'Noto Sans KR', 'Malgun Gothic', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
:is(button, a, input, select, textarea, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
a { color: inherit; }
svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: middle; }
.symbol-bank { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.app { position: relative; height: 100vh; height: 100dvh; min-height: 410px; display: flex; flex-direction: column; }
.topbar { position: absolute; inset: 0 0 auto; min-height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 8px var(--gutter); gap: 14px; pointer-events: none; z-index: 3; }
.topbar > * { pointer-events: auto; }
.brand, .published-brand { font-family: 'DM Sans', 'Noto Sans KR', 'Malgun Gothic', sans-serif; }
.brand { display: inline-flex; align-items: center; min-height: 32px; color: #eeebf0; font-size: 21px; font-weight: 700; line-height: 1; letter-spacing: -.035em; text-decoration: none; white-space: nowrap; }
.brand-o { width: 27px; height: 25px; margin-inline-end: -2px; }
.brand-letter { stroke-width: 2.7; }
.brand-orbit-back { stroke: #9a7db7; stroke-width: 1.35; }
.brand-orbit-front { stroke: #dfc3f8; stroke-width: 1.8; }
.brand-satellite { fill: #f2ddff; stroke: var(--bg); stroke-width: .65; }
.top-actions { display: flex; align-items: center; gap: 13px; }
.mode-label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.mode-label svg { width: 14px; height: 14px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 13px; border-radius: 7px; color: #eae3ee; background: #24202c; border: 1px solid var(--line); text-decoration: none; white-space: nowrap; font-size: 12px; font-weight: 600; transition: background .18s, border-color .18s, color .18s; }
.button:hover:not(:disabled) { background: #332b3d; border-color: #685a76; }
.button.primary { background: #dfd0ec; color: #2c2536; border-color: #dfd0ec; }
.button.primary:hover:not(:disabled) { background: #f0e4f8; border-color: #f0e4f8; }
.button.danger { color: #f5a8b8; }
.button svg { width: 15px; height: 15px; }
.button.subtle { background: transparent; border-color: transparent; color: var(--muted); }
.button.subtle:hover:not(:disabled) { color: #efecf2; background: #2a2334; border-color: transparent; }
.topbar .write-button { padding-inline: 17px; border-radius: 100px; min-height: 39px; }

.workspace { min-height: 0; flex: 1; display: flex; }
.map { flex: 1; min-width: 0; min-height: 0; display: flex; }
.spatial { flex: 1; position: relative; isolation: isolate; min-width: 0; min-height: 0; overflow: hidden; background: var(--bg); }
.atlas { position: absolute; inset: 0; }
.map-heading { position: absolute; z-index: 2; left: var(--gutter); top: clamp(90px, 15vh, 158px); width: min(58vw, 620px); pointer-events: none; }
.map-heading h1 { margin: 6px 0 0; color: #f2edf4; font: 500 clamp(32px, 4.75vw, 65px)/1.22 var(--ui-font); letter-spacing: -.085em; overflow-wrap: anywhere; }
.map-title { display: flex; align-items: center; gap: 12px; }
.map-title h1 { min-width: 0; }
.map-title .icon-button { flex: 0 0 33px; margin-top: 6px; pointer-events: auto; }
.map-count { margin: 14px 0 0; display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.map-private svg { width: 13px; height: 13px; opacity: .82; }
.breadcrumbs { display: flex; align-items: center; gap: 5px; padding: 4px; margin: -4px; overflow-x: auto; scrollbar-width: thin; color: var(--muted); font-size: 12px; line-height: 25px; white-space: nowrap; }
.breadcrumbs button { pointer-events: auto; border: 0; background: transparent; color: inherit; padding: 1px 3px; border-radius: 4px; white-space: nowrap; font-size: 12px; }
.breadcrumbs button:hover { background: #2e2937; color: #eee6f5; }
.breadcrumbs > svg { color: #8d8198; width: 11px; height: 11px; }
.breadcrumbs .icon-button { width: 25px; height: 25px; flex: 0 0 25px; }
.breadcrumbs .icon-button svg { width: 14px; height: 14px; }
.map-message { position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; width: min(300px, calc(100% - 48px)); pointer-events: none; }
.map-message h2 { font-size: 16px; font-weight: 500; margin: 0 0 9px; letter-spacing: -.035em; }
.map-message .button { pointer-events: auto; color: var(--accent); }
.map-empty-actions { display: flex; align-items: center; justify-content: center; gap: 9px; }
.map-empty-actions a.button { color: var(--muted); }

.map-actions, .map-tools { position: absolute; z-index: 2; bottom: clamp(18px, 4.2vh, 40px); display: flex; align-items: center; gap: 3px; }
.map-actions { left: var(--gutter); }
.map-actions .button { padding-inline: 9px; }
.map-actions .button:first-child { margin-left: -8px; }
.map-actions .button[aria-pressed='true'] { color: #f0e7f5; background: #34293f; border-color: #6e5b80; }
.map-tools { right: var(--gutter); gap: 7px; }
.map-view { display: flex; gap: 2px; padding: 3px; margin-right: 7px; border: 1px solid var(--line); border-radius: 8px; background: #1d1925d9; }
.map-view button { min-width: 35px; min-height: 26px; padding-inline: 6px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 600; }
.map-view button[aria-pressed='true'], .map-view button:hover:not(:disabled) { color: #f0e7f5; background: #34293f; }
.zoom-tools { display: flex; align-items: center; }
.icon-button { display: inline-grid; width: 33px; height: 33px; place-items: center; background: transparent; color: var(--muted); border: 0; border-radius: 6px; padding: 0; }
.icon-button:hover:not(:disabled) { background: #302839; color: #f0e7f5; }
.icon-button svg { width: 16px; height: 16px; }
.reset-view { margin-left: 6px; }
.zoom-tools output { text-align: center; min-width: 45px; font-size: 11px; font-variant-numeric: tabular-nums; color: var(--muted); }

.splash { min-height: 300px; flex: 1; display: grid; place-content: center; padding: 30px; text-align: center; }
.splash p { color: var(--muted); }
.splash h1 { font: 500 30px/1.4 var(--ui-font); letter-spacing: -.055em; margin: 0 0 12px; }
.splash .button { justify-self: center; margin: 9px 0 0; }
.dialog { padding: 0; width: min(540px, calc(100% - 28px)); max-height: calc(100dvh - 36px); color: #eee8f1; background: #221e2a; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 24px 85px #0b081276; scrollbar-width: thin; }
.dialog::backdrop { background: #14101bab; backdrop-filter: blur(4px); }
.dialog-inner { padding: 24px; }
.dialog-header { display: flex; align-items: start; justify-content: space-between; gap: 15px; margin: 0 0 20px; }
.dialog-header h2 { margin: 5px 0 0; font-size: 23px; letter-spacing: -.05em; line-height: 1.45; overflow-wrap: anywhere; }
.dialog-header p { margin: 3px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.dialog-header .icon-button { flex: none; }
.dialog-form { display: grid; gap: 14px; }
.dialog-form label:not(.check) { display: grid; gap: 6px; color: #d5c8e4; font-size: 12px; font-weight: 600; }
.field-line { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input:not([type='checkbox']), select, textarea { display: block; min-width: 0; width: 100%; color: #f1e9fa; border: 1px solid var(--line); background: #1b1722; padding: 9px 11px; border-radius: 7px; font-size: 14px; font-weight: 400; }
.check { display: flex; align-items: flex-start; gap: 8px; color: #d5c8e4; font-size: 13px; line-height: 1.5; cursor: pointer; }
.check input { accent-color: var(--accent); margin: 3px 0 0; flex: none; }
.dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 7px; flex-wrap: wrap; }
.dialog-actions .push-left { margin-right: auto; }
.circle-order { display: flex; flex-wrap: wrap; gap: 8px; }
.form-error { margin: 0; color: #f5a8b8; font-size: 12px; }
.intro-text, .share-note, .share-empty { color: var(--muted); font-size: 13px; line-height: 1.7; margin: 0; }
.share-list { display: grid; gap: 6px; max-height: min(310px, 39vh); overflow: auto; padding: 1px; }
.share-choice { padding: 9px 11px; background: #1b1722; border: 1px solid #393142; border-radius: 7px; }
.share-choice small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.share-output { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.index-list + .index-list { margin-top: 24px; }
.index-list h3 { margin: 0 0 4px; color: var(--muted); font-size: 12px; font-weight: 500; }
.index-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 4px; text-align: left; border: 0; border-bottom: 1px solid #393142; background: transparent; }
.index-row:hover { background: #2d2835; }
.index-row svg, .index-row small { color: var(--muted); }
.index-row small { margin-left: auto; white-space: nowrap; }
.entry-search-status { margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.entry-search-status:empty { margin: 0; }
.entry-search-results { max-height: min(44dvh, 350px); margin: 10px 0 0; padding: 0 4px; overflow-y: auto; scrollbar-width: thin; list-style: none; }
.entry-search-results .index-row > span { flex: 1; display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.entry-search-results .index-row small { margin: 0; white-space: normal; }
.entry-search-results .index-row:focus-visible { outline-offset: -2px; border-radius: 6px; }
.timeline-help, .timeline-empty { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.entry-timeline { max-height: min(56dvh, 500px); overflow-y: auto; padding: 0 4px; scrollbar-width: thin; }
.timeline-list { margin: 0; padding: 0; list-style: none; }
.timeline-list .index-row { align-items: start; }
.timeline-list .index-row > span { display: grid; flex: 1; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.timeline-list .index-row small { margin: 0; white-space: normal; font-size: 11px; }
.timeline-list .index-row time { flex: 0 0 76px; padding-top: 2px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.timeline-list .index-row > svg { width: 14px; height: 14px; margin-top: 3px; }
.timeline-list .index-row:focus-visible { outline-offset: -2px; border-radius: 6px; }
.timeline-undated h3 { margin: 22px 0 4px; color: var(--muted); font-size: 12px; font-weight: 500; }
.timeline-undated:first-child h3 { margin-top: 8px; }
.toast { position: fixed; z-index: 9; bottom: 32px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 10px 15px; border: 1px solid #61546d; background: #30283a; box-shadow: 0 8px 25px #0b081259; border-radius: 8px; color: #eee3f4; font-size: 13px; }

@media (min-width: 721px) and (max-width: 1000px) {
  .map-tools { bottom: calc(clamp(18px, 4.2vh, 40px) + 46px); }
}

@media (max-width: 720px) {
  .topbar { min-height: 60px; }
  .top-actions { gap: 3px; }
  .top-actions .button { padding-inline: 9px; min-height: 34px; }
  .topbar .write-button { padding-inline: 11px; min-height: 34px; }
  .map-heading { top: 86px; width: calc(100% - var(--gutter) * 2); }
  .map-heading h1 { font-size: clamp(28px, 7.4vw, 40px); }
  .map-count { margin-top: 8px; }
  .map-tools { bottom: 63px; }
  .map-actions, .map-tools { border-radius: 6px; background: #191721ed; }
  .map-actions { gap: 0; }
  .map-actions .button { padding-inline: 5px; }
  .dialog-inner { padding: 17px; }
}

@media (max-width: 600px) {
  .map-actions { flex-wrap: wrap; max-width: calc(100% - var(--gutter) * 2); }
  .map-tools { bottom: 108px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; }
}
