/* Globe app: chrome. Translucent material only on sticky chrome (sheet, panel, toolbars, scrubber, menus). */
.material {
  background: var(--material);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 0 0 0.5px var(--material-edge) inset, var(--shadow-2);
}
.app { position: fixed; inset: 0; }
.globe { position: absolute; inset: 0; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.globe.is-grabbing { cursor: grabbing; }
.globe:focus-visible { outline: none; }
.globe:focus-visible::after { content: ""; position: absolute; inset: 6px; border-radius: 18px; box-shadow: 0 0 0 3px var(--accent-ring); pointer-events: none; }
.globe canvas { display: block; }
.skip { position: fixed; left: 12px; top: 12px; z-index: 100; display: flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none; transform: translateY(-150%); transition: transform 200ms var(--ease); }
.skip:focus { transform: none; }

/* brand and map controls */
.brand { position: fixed; z-index: 10; top: calc(var(--safe-t) + 12px); left: 16px; height: 44px; display: flex; align-items: center; padding: 0 16px; border-radius: 999px; max-width: calc(100vw - 96px); }
.brand-name { font-size: var(--s-sub); line-height: var(--l-sub); font-weight: 600; letter-spacing: -0.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-ctl { position: fixed; z-index: 10; top: calc(var(--safe-t) + 12px); right: 16px; width: 48px; display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; }
.ctl { width: 48px; height: 46px; display: grid; place-items: center; color: var(--label); transition: background-color 160ms ease, opacity 160ms ease; }
.ctl .ph { font-size: 21px; }
.ctl-sep { height: 1px; margin: 0 10px; background: var(--sep); }
.ctl:active:not(:disabled) { background: var(--fill); }
.ctl:disabled { opacity: 0.35; }
.ctl:focus-visible { outline-offset: -4px; border-radius: 12px; }
@media (hover: hover) { .ctl:hover:not(:disabled) { background: var(--fill); } }
.brand, .map-ctl, .scrubber { transition: opacity 240ms ease; }
:root[data-layout="panel"] .brand { display: none; }
:root[data-layout="sheet"][data-detent="full"] .brand, :root[data-layout="sheet"][data-detent="full"] .map-ctl,
:root[data-stage] .map-ctl, :root[data-stage] .scrubber { opacity: 0; pointer-events: none; visibility: hidden; }
/* the stage: while the tree is on it, the globe steps back (and returns when the tree is left) */
.globe { transition: opacity 260ms ease, visibility 0s linear 0s; }
:root[data-stage] .globe { opacity: 0; visibility: hidden; transition: opacity 260ms ease, visibility 0s linear 260ms; }
/* the stage keeps the globe's air: its atmosphere rim lingers faintly in the top corner behind the tree */
.stage { position: fixed; inset: 0; z-index: 5; background: radial-gradient(ellipse 75% 65% at 100% 0, var(--atmo), transparent 72%) no-repeat, var(--stage); opacity: 0; transition: opacity 260ms ease; }
.stage.is-on { opacity: 1; }
.sheet.is-searching .sheet-nav { display: none; }

/* sheet (phone) and panel (wide) */
.sheet {
  position: fixed; z-index: 20; left: 0; right: 0; top: 0; height: 100%;
  display: flex; flex-direction: column;
  border-radius: var(--rad-sheet) var(--rad-sheet) 0 0;
  background: var(--material);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 0 0 0.5px var(--material-edge) inset, 0 -1px 0 rgba(0, 0, 0, 0.02), 0 -8px 32px rgba(22, 34, 51, 0.12);
  will-change: transform;
  outline: none;
}
.sheet-grab { position: relative; height: 22px; flex: none; }
.grabber { position: absolute; left: 50%; top: -12px; width: 120px; height: 44px; margin-left: -60px; display: grid; place-items: center; touch-action: none; }
.grabber span { width: 36px; height: 5px; border-radius: 3px; background: var(--fill-strong); transition: background-color 160ms ease, transform 200ms var(--ease); }
@media (hover: hover) { .grabber:hover span { background: var(--label-3); } }
.grabber:focus-visible { outline: none; }
.grabber:focus-visible::after { content: ""; position: absolute; left: 50%; top: 50%; width: 76px; height: 24px; margin: -12px 0 0 -38px; border-radius: 12px; box-shadow: 0 0 0 3px var(--accent-ring); pointer-events: none; }
.grabber:focus-visible span { transform: scaleX(1.33); background: var(--accent); }
.sheet-head { flex: none; padding: 6px 16px 0; touch-action: none; }
.panel-brand { display: none; }
:root[data-layout="panel"] .panel-brand { display: block; padding: 0 4px 16px; font-size: var(--s-t2); line-height: var(--l-t2); font-weight: 700; letter-spacing: -0.015em; text-wrap: balance; }
@media (max-height: 520px) { :root[data-layout="panel"] .panel-brand { display: none; } }
.search-row { display: flex; align-items: center; gap: 8px; }
.sheet-nav { padding: 12px 0 8px; }
.sheet-nav:empty { display: none; }
.sheet-body { flex: 1; min-height: 0; overflow: hidden; overscroll-behavior: contain; touch-action: none; position: relative; }
.sheet.is-full .sheet-body { overflow-y: auto; touch-action: auto; -webkit-overflow-scrolling: touch; }
.sheet-body:focus-visible { outline: none; }
:root { --panel-w: 400px; }
@media (max-width: 899px) { :root { --panel-w: 360px; } }
.sheet.is-panel { left: 16px; top: 16px; bottom: 16px; height: auto; width: var(--panel-w); border-radius: var(--rad-sheet); box-shadow: 0 0 0 0.5px var(--material-edge) inset, var(--shadow-2); }
.sheet.is-panel .sheet-grab { display: none; }
.sheet.is-panel .sheet-head { padding-top: 20px; width: var(--panel-w); max-width: 100%; }
@media (max-height: 480px) { .sheet.is-panel { top: 8px; bottom: 8px; } }

/* search field */
.search-field { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 6px 0 12px; border-radius: var(--rad-cell); background: var(--fill); transition: box-shadow 160ms ease, background-color 160ms ease; }
.search-field > .ph { color: var(--label-2); font-size: 20px; }
.search-field:focus-within { box-shadow: 0 0 0 3px var(--accent-ring); }
.search-field input { flex: 1; min-width: 0; height: 44px; border: 0; padding: 0; background: transparent; font-size: var(--s-body); outline: none; -webkit-appearance: none; appearance: none; }
.search-field input::placeholder { color: var(--label-2); opacity: 1; }
.search-field input::-webkit-search-cancel-button, .search-field input::-webkit-search-decoration { display: none; }
.search-clear { width: 44px; height: 44px; display: grid; place-items: center; color: var(--label-3); border-radius: 10px; }
.search-clear .ph { font-size: 20px; }
@media (hover: hover) { .search-clear:hover { color: var(--label-2); } }
.search-cancel { flex: none; }
.me-btn { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--accent); transition: transform 160ms var(--ease); }
.me-btn .ph { font-size: 30px; }
.me-btn .av { width: 36px; height: 36px; font-size: 13px; }
.me-btn:active { transform: scale(0.94); }
.me-btn:focus-visible { outline-offset: 1px; }

/* segmented control */
.seg { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 2px; border-radius: 10px; background: var(--fill); min-height: 48px; }
.seg-thumb { position: absolute; top: 2px; bottom: 2px; left: 2px; width: calc((100% - 4px) / var(--n, 4)); transform: translateX(calc(100% * var(--i, 0))); border-radius: var(--rad-thumb); background: var(--thumb); box-shadow: var(--shadow-thumb); transition: transform 320ms var(--ease); }
.seg-item { position: relative; z-index: 1; min-height: 44px; padding: 0 4px; border-radius: var(--rad-thumb); font-size: var(--s-sub); line-height: var(--l-sub); font-weight: 500; color: var(--label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity 160ms ease; }
.seg-item[aria-checked="true"] { font-weight: 600; }
.seg-item:active { opacity: 0.6; }
.seg-item:focus-visible { outline-offset: -2px; }
.seg.seg-fit { grid-auto-columns: auto; }
.seg.seg-fit .seg-item { padding: 0 10px; }
@media (hover: hover) { .seg-item[aria-checked="false"]:hover { opacity: 0.7; } }

/* nav bar of pushed pages */
/* three columns, the outer two flexible and equal where space allows, so the title is centred on the bar
   whatever width Back / Kembali takes */
.navbar { display: grid; grid-template-columns: minmax(max-content, 1fr) minmax(0, max-content) minmax(max-content, 1fr); align-items: center; min-height: 44px; margin: 0 -8px; }
.navbar .btn-text { display: inline-flex; align-items: center; gap: 2px; justify-self: start; }
.navbar .btn-text .ph { font-size: 22px; }
.nav-title { min-width: 0; text-align: center; font-weight: 600; opacity: 0; transition: opacity 200ms ease; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px; }
.navbar.is-scrolled .nav-title { opacity: 1; }
.nav-end { min-width: 44px; display: flex; justify-content: flex-end; justify-self: end; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--rad-cell); font-size: var(--s-body); font-weight: 600; line-height: 1.2; text-decoration: none; transition: transform 160ms var(--ease), background-color 160ms ease, opacity 160ms ease; white-space: nowrap; }
.btn .ph { font-size: 20px; }
.btn-fill { background: var(--accent); color: var(--accent-ink); }
.btn-tint { background: var(--accent-soft); color: var(--accent); }
.btn-gray { background: var(--fill); color: var(--label); }
.btn-block { width: 100%; min-height: 50px; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; }
.btn[aria-busy="true"] { opacity: 0.7; cursor: progress; }
@media (hover: hover) {
  .btn-fill:hover:not(:disabled) { background: var(--accent-hover); }
  .btn-tint:hover:not(:disabled), .btn-gray:hover:not(:disabled) { background: var(--fill-strong); }
}
.btn-text { min-height: 44px; min-width: 44px; padding: 0 8px; border-radius: 10px; color: var(--accent); font-size: var(--s-body); font-weight: 400; transition: opacity 160ms ease; }
.btn-text.strong { font-weight: 600; }
.btn-text:active:not(:disabled) { opacity: 0.5; }
.btn-text:disabled { color: var(--label-3); }
@media (hover: hover) { .btn-text:hover:not(:disabled) { opacity: 0.75; } }

/* time scrubber */
.scrubber { position: fixed; z-index: 15; left: 12px; right: 12px; top: 0; display: flex; align-items: center; gap: 12px; padding: 8px 18px 6px 10px; border-radius: 26px; opacity: 1; --tick-on: var(--accent); --tick-off: var(--fill-strong); }
.scrubber.is-hidden { opacity: 0; pointer-events: none; }
:root[data-layout="panel"] .scrubber { top: auto; bottom: 16px; left: calc(var(--panel-right, 432px) + 16px); right: 16px; margin: 0 auto; width: min(600px, calc(100vw - var(--panel-right, 432px) - 32px)); }
.scrub-play { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); transition: transform 160ms var(--ease), background-color 160ms ease; }
.scrub-play .ph { font-size: 22px; }
.scrub-play:active { transform: scale(0.94); }
@media (hover: hover) { .scrub-play:hover { background: var(--accent-hover); } }
.scrub-main { flex: 1; min-width: 0; }
.scrub-read { display: flex; align-items: baseline; gap: 10px; padding: 0 14px; white-space: nowrap; overflow: hidden; }
.scrub-year { flex: none; }
.scrub-meta { color: var(--label-2); overflow: hidden; text-overflow: ellipsis; }
.scrub-track { position: relative; height: 44px; margin-top: -6px; cursor: pointer; touch-action: none; border-radius: 12px; }
.scrub-ticks { position: absolute; left: 0; right: 0; bottom: 16px; width: 100%; height: 18px; }
.scrub-rule { position: absolute; left: 14px; right: 14px; bottom: 16px; height: 1px; background: var(--sep); }
.scrub-thumb { position: absolute; bottom: 4px; left: calc(14px + (100% - 28px) * var(--p, 1)); width: 24px; height: 24px; margin-left: -12px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.08), 0 3px 8px rgba(0, 0, 0, 0.18), 0 1px 1px rgba(0, 0, 0, 0.1); transition: transform 160ms var(--ease); }
.scrub-track.is-active .scrub-thumb { transform: scale(1.18); }
.scrub-track:focus-visible { outline-offset: 0; }

/* modal sheets */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.modal-scrim { position: absolute; inset: 0; background: var(--scrim); opacity: 0; transition: opacity 320ms var(--ease); }
.modal-sheet { position: relative; width: 100%; max-height: calc(100% - 24px - var(--safe-t)); display: flex; flex-direction: column; background: var(--bg); border-radius: var(--rad-sheet) var(--rad-sheet) 0 0; box-shadow: var(--shadow-2); transform: translateY(100%); transition: transform 420ms var(--ease); outline: none; }
.modal.is-open .modal-scrim { opacity: 1; }
.modal.is-open .modal-sheet { transform: none; }
.modal.is-closing { pointer-events: none; } /* a sheet on its way out lets the next tap reach what is behind it */
.modal.is-closing .modal-sheet { transition-duration: 300ms; }
.modal-grab { height: 16px; display: grid; place-items: center; touch-action: none; }
.modal-grab span { width: 36px; height: 5px; border-radius: 3px; background: var(--fill-strong); }
.modal-head { display: grid; grid-template-columns: minmax(64px, auto) 1fr minmax(64px, auto); align-items: center; gap: 8px; padding: 0 8px 8px; touch-action: none; }
.modal-title { text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal-cancel { justify-self: start; }
.modal-done, .modal-spacer { justify-self: end; }
.modal-body { overflow-y: auto; overscroll-behavior: contain; padding: 0 0 calc(24px + var(--safe-b)); }
@media (min-width: 700px) {
  .modal { align-items: center; }
  .modal-sheet { width: min(520px, calc(100vw - 48px)); max-height: min(780px, calc(100vh - 48px)); border-radius: var(--rad-sheet); transform: translateY(24px) scale(0.98); opacity: 0; transition: transform 380ms var(--ease), opacity 240ms ease; }
  .modal.is-open .modal-sheet { opacity: 1; }
  .modal-grab { visibility: hidden; height: 10px; }
}

/* menus */
.menu-layer { position: fixed; inset: 0; z-index: 70; }
.menu-layer.is-closing { pointer-events: none; }
.menu-scrim { position: absolute; inset: 0; }
.menu { position: absolute; border-radius: 14px; padding: 6px 0; background: var(--material-strong); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 0 0 0.5px var(--material-edge) inset, var(--shadow-2); transform: scale(0.92); opacity: 0; transition: transform 260ms var(--ease), opacity 160ms ease; max-height: calc(100vh - 24px); overflow-y: auto; }
.menu-layer.is-open .menu { transform: none; opacity: 1; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 0 16px 0 10px; text-align: left; font-size: var(--s-body); color: var(--label); }
.menu-item .ph { font-size: 20px; color: var(--label-2); }
.menu-check { width: 20px; flex: none; color: var(--accent); }
.menu-check .ph { color: var(--accent); font-size: 18px; }
.menu-label { flex: 1; }
.menu-item.is-danger, .menu-item.is-danger .ph { color: var(--danger); }
.menu-item:focus-visible { outline: none; background: var(--fill); }
.menu-item:active { background: var(--fill-strong); }
@media (hover: hover) { .menu-item:hover { background: var(--fill); } }
.menu-sep { height: 6px; margin: 4px 0; background: var(--fill); }

/* toast */
.toast { position: fixed; z-index: 80; left: 50%; top: calc(var(--safe-t) + 14px); min-height: 44px; display: flex; align-items: center; padding: 10px 20px; border-radius: 22px; text-align: center; font-size: var(--s-sub); font-weight: 600; transform: translate(-50%, -140%); opacity: 0; transition: transform 380ms var(--ease), opacity 200ms ease; pointer-events: none; width: max-content; max-width: min(560px, calc(100vw - 32px)); }
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }
:root[data-layout="panel"] .toast { left: calc(var(--panel-right, 432px) + (100vw - var(--panel-right, 432px)) / 2); }
/* while a sheet is open a notice rises from the bottom, clear of the sheet's header and its title */
body:has(#layers .modal.is-open) .toast { top: auto; left: 50%; bottom: calc(var(--safe-b) + 16px); transform: translate(-50%, 160%); }
body:has(#layers .modal.is-open) .toast.is-on { transform: translate(-50%, 0); }
/* the family name at the top left is the way home */
a.brand, a.brand-home { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
a.brand-home { display: inline-flex; align-items: center; min-height: 44px; margin: -6px -8px; padding: 6px 8px; border-radius: 12px; }
@media (hover: hover) { a.brand:hover, a.brand-home:hover { color: var(--accent, currentColor); } }
a.brand:active, a.brand-home:active { opacity: 0.7; }
a.brand:focus-visible, a.brand-home:focus-visible { outline: 3px solid var(--accent, #0a66d8); outline-offset: 2px; }
