/* NiNP planetarij 1.0 — borderless, compact controls; mobile collapsible toolbar. */
:root {
  color-scheme: dark;
  font-family: var(
    --font-accent,
    Inter,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    sans-serif
  );
  color: #f1f3fa;
  background: #080e1b;
  --toolbar-height: 65px;
}
* {
  box-sizing: border-box;
}
html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}
#sky {
  display: block;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}
#sky.object-hover:not(.dragging) {
  cursor: pointer;
}
#sky.dragging {
  cursor: grabbing;
}
button,
input,
select {
  font: inherit;
  color: #eef2ff;
  background: #16243a;
  border: 0;
  border-radius: 4px;
  padding: 8px 10px;
  min-height: 35px;
}
button {
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
  transition: background 0.15s;
}
button:hover {
  background: #2d4663;
}
button:active {
  background: #486585;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #e2b677;
  outline-offset: 2px;
}
input {
  font-size: 12px;
  max-width: 185px;
}
select {
  font-size: 12px;
  max-width: 174px;
}
.toolbar {
  position: fixed;
  z-index: 5;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px max(14px, env(safe-area-inset-right)) 10px
    max(14px, env(safe-area-inset-left));
  background: linear-gradient(
    180deg,
    rgba(7, 13, 27, 0.97),
    rgba(7, 13, 27, 0.81)
  );
  backdrop-filter: blur(14px);
}
.toolbar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
}
.brand {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}
.brand small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: #92a3be;
}
.brand-star {
  color: #f9c979;
  font-size: 24px;
}
.toolbar-toggle {
  display: none;
  font-size: 19px;
  width: 37px;
  height: 37px;
  padding: 0;
}
.tools {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.toolgroup {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  background: #ffffff0d;
  border-radius: 5px;
}
.clockgroup,
.locationgroup {
  flex-wrap: wrap;
}
.toolgroup label {
  font-size: 11px;
  color: #a7b7d2;
  margin-right: 4px;
}
.toolgroup label small {
  display: block;
  color: #7087a7;
  font-size: 10px;
}
.stepgroup select {
  width: 77px;
  text-align: center;
}
.stepgroup button {
  min-width: 36px;
  padding-inline: 8px;
}
.stepgroup .transport {
  font-size: 10px;
  letter-spacing: -2px;
  padding-right: 11px;
}
.stepgroup .is-playing {
  background: #665136;
  color: #ffe0aa;
  box-shadow: inset 0 -2px #e5b974;
}
.sky-clock {
  position: fixed;
  top: calc(var(--toolbar-height) + 19px);
  left: 20px;
  z-index: 2;
  pointer-events: none;
  text-shadow: 0 1px 8px #000;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sky-clock strong {
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}
.sky-clock span {
  font-size: 11px;
  color: #bed1e6;
}
.sky-details {
  position: fixed;
  bottom: calc(66px + env(safe-area-inset-bottom));
  left: 20px;
  z-index: 2;
  pointer-events: none;
  color: #c4d2e5;
  font-size: 12px;
  text-shadow: 0 1px 7px #000;
  max-width: calc(100% - 100px);
  line-height: 1.6;
}
.sky-details > span {
  display: inline-block;
  margin-right: 15px;
}
.sky-details #heading {
  font-weight: 600;
  color: #eef2ff;
  font-size: 14px;
}
.sky-details #place {
  font-size: 11px;
  color: #9eb2ce;
}
.zoom {
  position: fixed;
  right: 20px;
  bottom: calc(95px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 3;
}
.zoom button {
  width: 40px;
  height: 40px;
  font-size: 22px;
  background: #101d30c9;
  backdrop-filter: blur(6px);
}
#hint {
  position: fixed;
  bottom: calc(43px + env(safe-area-inset-bottom));
  left: 20px;
  color: #9fb0c8;
  font-size: 11px;
  pointer-events: none;
  text-shadow: 0 1px 6px #000;
  max-width: calc(100% - 40px);
}
#status {
  position: fixed;
  bottom: calc(110px + env(safe-area-inset-bottom));
  left: 20px;
  max-width: min(450px, calc(100% - 95px));
  background: #142743ed;
  padding: 10px 13px;
  border-radius: 5px;
  font-size: 12px;
  z-index: 4;
  display: none;
}
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #09101cb8;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  text-align: center;
  color: #8091ae;
  font-size: 10px;
  z-index: 2;
}
footer a {
  color: #a9bbd1;
  text-decoration: none;
}
footer a:hover {
  text-decoration: underline;
}
.object-tooltip[hidden] {
  display: none !important;
}
.object-tooltip {
  position: fixed;
  z-index: 8;
  width: min(268px, calc(100vw - 16px));
  max-height: min(330px, calc(100dvh - 16px));
  overflow: auto;
  padding: 12px 13px;
  background: rgba(12, 24, 42, 0.97);
  border-radius: 6px;
  box-shadow: 0 10px 38px #000a;
  backdrop-filter: blur(12px);
  font-size: 12px;
}
.object-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #ffffff25;
  margin-bottom: 8px;
  padding-bottom: 7px;
}
.object-header strong {
  font-size: 16px;
  color: #ffdc9b;
  overflow-wrap: anywhere;
}
#object-close {
  font-size: 20px;
  line-height: 1;
  width: 30px;
  height: 30px;
  padding: 0;
  flex: none;
  min-height: 0;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 3px 0;
}
.detail-row span {
  color: #a8bbd4;
  flex: 1;
}
.detail-row strong {
  color: #f2f6fc;
  font-weight: 500;
  text-align: right;
  flex: 1;
  overflow-wrap: anywhere;
}
@media (max-width: 1050px) {
  .toolbar {
    gap: 9px;
  }
  .brand {
    font-size: 14px;
  }
  .brand small {
    display: inline;
    margin-left: 4px;
  }
  .tools {
    gap: 5px;
  }
  .toolgroup {
    padding: 4px;
    gap: 3px;
  }
  input,
  select,
  button {
    min-height: 32px;
    padding: 5px 6px;
  }
  .stepgroup button {
    min-width: 30px;
    padding-inline: 5px;
  }
}
@media (max-width: 760px) {
  .toolbar {
    display: block;
    padding: 8px max(10px, env(safe-area-inset-right)) 8px
      max(10px, env(safe-area-inset-left));
  }
  .toolbar-head {
    height: 38px;
  }
  .toolbar-toggle {
    display: block;
  }
  .tools {
    display: none;
    padding-top: 9px;
    padding-bottom: 4px;
    align-items: stretch;
    flex-direction: column;
    gap: 7px;
  }
  .toolbar.expanded .tools {
    display: flex;
  }
  .toolgroup {
    width: 100%;
    justify-content: flex-start;
    gap: 7px;
    padding: 6px 8px;
  }
  .toolgroup label {
    width: 85px;
    flex: none;
  }
  .clockgroup input {
    flex: 1;
    min-width: 0;
    max-width: none;
  }
  .locationgroup select {
    flex: 1;
    max-width: none;
    min-width: 0;
  }
  .stepgroup {
    justify-content: space-between;
  }
  .stepgroup select {
    flex: 1;
    max-width: none;
  }
  .stepgroup button {
    flex: none;
    min-width: 38px;
  }
  .sky-clock {
    left: 12px;
    top: calc(var(--toolbar-height) + 14px);
  }
  .sky-clock strong {
    font-size: 19px;
  }
  .sky-details {
    left: 12px;
    bottom: calc(80px + env(safe-area-inset-bottom));
    font-size: 11px;
  }
  .sky-details #heading {
    font-size: 13px;
  }
  .zoom {
    right: 11px;
    bottom: calc(108px + env(safe-area-inset-bottom));
  }
  .zoom button {
    width: 37px;
    height: 37px;
  }
  #hint {
    left: 12px;
    bottom: calc(47px + env(safe-area-inset-bottom));
    font-size: 10px;
    max-width: calc(100% - 24px);
  }
  footer {
    line-height: 1.4;
    font-size: 9px;
  }
  .object-tooltip {
    width: min(250px, calc(100vw - 16px));
    font-size: 11px;
  }
}
@media (max-width: 380px) {
  .toolgroup label {
    width: 65px;
    font-size: 10px;
  }
  .stepgroup button {
    min-width: 32px;
  }
  .sky-clock strong {
    font-size: 17px;
  }
}

/* v0.4: constellation overlay toggle and Bayer subtitle. */
.layer-button {
  background: #172b44;
  color: #a9bfdc;
  min-height: 35px;
}
.layer-button.active {
  color: #ffdc9b;
  background: #30425d;
}
.object-name {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.object-name small {
  color: #afc0da;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
}
.object-name small[hidden] {
  display: none;
}
.object-header {
  align-items: flex-start;
}

/* v0.8: mobile panels are docked to the free side of the view, never beside a tap. */
@media (max-width: 760px) {
  .object-tooltip {
    width: min(340px, calc(100vw - 24px));
    max-height: min(32dvh, 260px);
    overscroll-behavior: contain;
  }
}

/* v0.12: selected-object event times and center/track action */
.object-events {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid #ffffff26;
}
.object-events .detail-row strong {
  font-variant-numeric: tabular-nums;
}
.track-button {
  width: 100%;
  margin-top: 9px;
  background: #273e58;
  color: #dce8f9;
  min-height: 36px;
}
.track-button.active {
  background: #675034;
  color: #ffe2b0;
}
.object-tooltip {
  max-height: min(460px, calc(100dvh - 16px));
}
@media (max-width: 760px) {
  .object-tooltip {
    max-height: min(48dvh, 430px);
  }
}

/* v0.13 — crosshair tracking shortcut replaces the old south-reset button.
   Desktop: right-hand zoom stack. Mobile: next to the collapsed menu button. */
.track-shortcut svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
}
.track-shortcut.active {
  color: #ffe2b0;
  background: #675034;
}
.track-shortcut:disabled {
  opacity: 0.4;
  cursor: default;
}
.mobile-track {
  display: none;
}
.mobile-altaz {
  display: none;
}
@media (max-width: 760px) {
  .toolbar-head {
    justify-content: flex-start;
    gap: 7px;
  }
  .toolbar-head .brand {
    margin-right: auto;
  }
  .mobile-track {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 37px;
    height: 37px;
    padding: 7px;
  }
  .toolbar-toggle {
    flex: none;
  }
  .zoom #object-track {
    display: none;
  }
  /* Bottom sheet remains below the stars and above the device safe area. */
  .object-tooltip {
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    bottom: 0 !important;
    width: 100vw;
    max-width: none;
    max-height: min(52dvh, 430px);
    border-radius: 6px 6px 0 0;
    padding: 11px 15px calc(13px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 35px #000b;
  }
  .object-header {
    margin-bottom: 5px;
    padding-bottom: 5px;
  }
  .detail-row {
    padding: 2px 0;
  }
  #object-content .altitude-row,
  #object-content .azimuth-row {
    display: none;
  }
  .mobile-altaz {
    display: block;
    font-size: 11px;
    color: #dae6f7;
    padding: 4px 0;
    font-variant-numeric: tabular-nums;
    white-space: pre-wrap;
  }
  .object-events {
    margin-top: 6px;
    padding-top: 5px;
  }
}

/* v0.14 — persistent transport row on mobile, collapsible settings, no footer. */
.brand {
  color: inherit;
  text-decoration: none;
}
.brand:hover {
  color: #fff;
}
.brand-logo {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex: none;
}
/* v0.14 desktop: keep brand, always-visible time transport, and settings in one bar. */
@media (min-width: 761px) {
  .toolbar > .stepgroup {
    flex: none;
  }
  .toolbar > .tools {
    flex: 1;
    min-width: 0;
  }
}
@media (max-width: 760px) {
  /* Mobile hierarchy: logo/menu on first row; transport always visible on second;
     date, city, GPS and layers appear only in the expandable settings area. */
  .toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .toolbar-head {
    width: 100%;
    flex: none;
  }
  .toolbar > .stepgroup {
    display: flex;
    width: 100%;
    flex: none;
    justify-content: space-between;
    gap: 5px;
    padding: 5px 5px;
    margin-top: 6px;
  }
  .toolbar > .stepgroup button {
    flex: 0 0 auto;
    min-width: 34px;
  }
  .toolbar > .stepgroup select {
    flex: 1 1 58px;
    min-width: 58px;
    max-width: none;
  }
  .tools {
    display: none;
    width: 100%;
    padding-top: 8px;
    padding-bottom: 4px;
    align-items: stretch;
    flex-direction: column;
    gap: 7px;
  }
  .toolbar.expanded .tools {
    display: flex;
  }
  .brand-logo {
    width: 34px;
    height: 34px;
  }
  .sky-details {
    bottom: calc(24px + env(safe-area-inset-bottom));
  }
}
@media (max-width: 360px) {
  .toolbar > .stepgroup {
    gap: 3px;
    padding-inline: 3px;
  }
  .toolbar > .stepgroup button {
    min-width: 30px;
    padding-inline: 3px;
  }
}

/* v0.15 — One fixed, full-width information bar on desktop and mobile.
   Three horizontal desktop zones: object name, measurements, event times.
   Mobile keeps the compact stacked presentation with Alt/Az on one row. */
.object-tooltip {
  left: 0 !important;
  right: 0 !important;
  top: auto !important;
  bottom: 0 !important;
  width: 100% !important;
  max-width: none !important;
  border-radius: 5px 5px 0 0;
  max-height: min(43dvh, 380px);
  padding: 14px max(22px, env(safe-area-inset-right))
    calc(15px + env(safe-area-inset-bottom))
    max(22px, env(safe-area-inset-left));
  display: grid;
  grid-template-columns: minmax(145px, 1fr) minmax(230px, 1.7fr) minmax(
      235px,
      1.5fr
    );
  gap: 20px;
  align-items: start;
  box-shadow: 0 -8px 36px #000a;
  overflow-y: auto;
}
.object-tooltip .object-header {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
  align-items: flex-start;
}
.object-tooltip #object-content {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 14px;
  align-content: start;
}
.object-tooltip #object-content .detail-row {
  min-width: 0;
  gap: 8px;
}
.object-tooltip .object-events {
  border-top: 0;
  border-left: 1px solid #ffffff26;
  padding: 0 0 0 19px;
  margin: 0;
  min-width: 0;
}
/* Leave information visible when a selected object is centered near the floor. */
body.tooltip-open .sky-details {
  bottom: calc(168px + env(safe-area-inset-bottom));
}
body.tooltip-open .zoom {
  bottom: calc(195px + env(safe-area-inset-bottom));
}
@media (max-width: 900px) and (min-width: 761px) {
  .object-tooltip {
    grid-template-columns: minmax(120px, 0.8fr) minmax(190px, 1.4fr) minmax(
        190px,
        1.3fr
      );
    gap: 12px;
    padding-inline: 13px;
  }
  .object-tooltip #object-content {
    grid-template-columns: 1fr;
  }
  .object-tooltip .object-events {
    padding-left: 12px;
  }
}
@media (max-width: 760px) {
  .object-tooltip {
    display: block;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    bottom: 0 !important;
    width: 100vw !important;
    max-width: none !important;
    max-height: min(52dvh, 430px);
    padding: 11px 15px calc(13px + env(safe-area-inset-bottom));
  }
  .object-tooltip .object-header {
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid #ffffff25;
  }
  .object-tooltip #object-content {
    display: block;
  }
  .object-tooltip .object-events {
    border-left: 0;
    border-top: 1px solid #ffffff26;
    margin-top: 6px;
    padding: 5px 0 0;
  }
  body.tooltip-open .sky-details {
    bottom: calc(24px + env(safe-area-inset-bottom));
  }
  body.tooltip-open .zoom {
    bottom: calc(108px + env(safe-area-inset-bottom));
  }
}

/* v0.16: The bottom bar must honor the hidden attribute on EVERY breakpoint.
   An explicit rule avoids desktop grid-display overrides in future changes. */
#object-tooltip[hidden] {
  display: none !important;
  visibility: hidden !important;
}

/* v0.17 — compact desktop toolbar; descriptive labels remain accessible to
   screen readers, but consume no horizontal space. Both overlay toggles are
   icon-only and keep a visible active state. */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.icon-layer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-width: 34px;
  padding: 6px;
  background: #172b44;
}
.icon-layer svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.layergroup {
  flex: none;
  flex-wrap: nowrap;
}
@media (min-width: 761px) {
  .toolbar {
    gap: 8px;
  }
  .toolbar > .tools {
    gap: 6px;
    flex-wrap: nowrap;
  }
  .clockgroup,
  .locationgroup {
    flex-wrap: nowrap;
    min-width: 0;
  }
  .clockgroup input {
    min-width: 0;
    width: 166px;
    max-width: 166px;
  }
  .locationgroup select {
    min-width: 86px;
    max-width: 145px;
    width: clamp(86px, 10vw, 145px);
  }
}
@media (max-width: 1040px) and (min-width: 761px) {
  .brand small {
    display: none;
  }
  .brand {
    font-size: 13px;
    gap: 5px;
  }
  .brand-logo {
    width: 31px;
    height: 31px;
  }
  .toolbar {
    padding-inline: 8px;
    gap: 5px;
  }
  .toolbar > .tools {
    gap: 4px;
  }
  .toolgroup {
    padding: 3px 4px;
  }
  .clockgroup input {
    width: 152px;
    max-width: 152px;
  }
}

/* v0.18: the desktop close control sits at the far right of the fixed bar.
   Mobile retains the close button inside the compact title row. */
@media (min-width: 761px) {
  .object-tooltip {
    padding-right: 56px;
  }
  .object-tooltip .object-header {
    position: static;
  }
  .object-tooltip #object-close {
    position: absolute;
    right: max(18px, env(safe-area-inset-right));
    top: 9px;
  }
  /* Pair Alt/Az and apparent/absolute magnitude in the same horizontal rows,
     regardless of the order in which the information is appended. */
  .object-tooltip #object-content:has(.absolute-mag-row) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px 14px;
  }
  .object-tooltip #object-content:has(.absolute-mag-row) .altitude-row {
    grid-column: 1;
    grid-row: 1;
  }
  .object-tooltip #object-content:has(.absolute-mag-row) .azimuth-row {
    grid-column: 2;
    grid-row: 1;
  }
  .object-tooltip #object-content:has(.absolute-mag-row) .apparent-mag-row {
    grid-column: 1;
    grid-row: 2;
  }
  .object-tooltip #object-content:has(.absolute-mag-row) .absolute-mag-row {
    grid-column: 2;
    grid-row: 2;
  }
  .object-tooltip #object-content:has(.absolute-mag-row) .constellation-row {
    grid-column: 1;
    grid-row: 3;
  }
  .object-tooltip #object-content:has(.absolute-mag-row) .distance-row {
    grid-column: 2;
    grid-row: 3;
  }
}
@media (max-width: 900px) and (min-width: 761px) {
  .object-tooltip #object-content:has(.absolute-mag-row) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .object-tooltip #object-content .detail-row {
    display: block;
  }
  .object-tooltip #object-content .detail-row strong {
    display: block;
    text-align: left;
  }
}

/* v0.19: Keep the desktop close icon visually separated from the last
   rise/transit/set block. No change to mobile bottom-sheet spacing. */
@media (min-width: 761px) {
  .object-tooltip {
    padding-right: 100px;
  }
}

/* v0.20 — Four equally wide desktop content zones, plus a reserved 42px
   gutter at the far right for ×. #object-content contains TWO equal zones:
   main coordinates and magnitudes, grouped by the existing two-column grid.
   The mobile tooltip (<=760px) retains the previous layout unchanged. */
.label-desktop {
  display: none;
}
@media (min-width: 761px) {
  .object-tooltip {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    column-gap: 15px;
    padding-right: 66px;
  }
  .object-tooltip .object-header {
    grid-column: 1;
    min-width: 0;
  }
  .object-tooltip #object-content {
    grid-column: 2 / span 2;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 15px;
  }
  .object-tooltip .object-events {
    grid-column: 4;
    padding-left: 14px;
  }
  .object-tooltip #object-close {
    right: 18px;
  }
  .responsive-detail-label > .label-mobile {
    display: none;
  }
  .responsive-detail-label > .label-desktop {
    display: inline;
  }
}

/* v0.21: compact Messier layer toggle, aligned with the two SVG layer icons. */
.messier-toggle-letter {
  font-size: 15px;
  font-weight: 750;
  line-height: 1;
  letter-spacing: -0.03em;
}

/* v0.22 — compact equator/ecliptic overlay buttons. */
.coordinate-toggle-letter {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.25px;
  line-height: 1;
}

/* v0.26 — Read-only on-sky clock; calendar icon opens a native datetime-local
   picker in a small popup. Date display remains Croatian 24-hour regardless of
   browser-specific calendar formatting. */
.sky-clock {
  pointer-events: none;
}
.date-picker-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 35px;
  width: 35px;
  height: 35px;
  padding: 7px;
  background: #172b44;
}
.date-picker-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.date-picker-button[aria-expanded="true"] {
  background: #30425d;
  color: #ffdc9b;
}
.time-editor[hidden] {
  display: none !important;
}
.time-editor {
  position: fixed;
  z-index: 9;
  right: 16px;
  left: auto;
  top: calc(var(--toolbar-height) + 8px);
  width: min(315px, calc(100vw - 24px));
  padding: 12px;
  border-radius: 5px;
  background: rgba(12, 24, 42, 0.98);
  box-shadow: 0 12px 36px #000a;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.time-editor label {
  font-size: 12px;
  font-weight: 600;
  color: #dce9fa;
}
.time-editor input {
  width: 100%;
  max-width: none;
  min-height: 40px;
  font: 500 14px var(--font-accent, Inter, system-ui, sans-serif);
  color-scheme: dark;
}
.time-editor-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
#time-apply {
  background: #405c75;
  color: #fff;
}
@media (max-width: 760px) {
  .time-editor {
    right: auto;
  }
}

/* v0.26 — One compact information bar with three desktop content blocks:
   A name / type / apparent magnitude, B Alt+Az / RA+Dec, C chronologically
   sorted rise/transit/set. Close button gets its own reserved right gutter.
   Mobile retains a bottom sheet, using the same concise data rows. */
.object-meta,
.object-mag,
.object-extra {
  display: block;
  color: #a8bbd4;
  font-size: 11px;
  line-height: 1.4;
}
.object-mag {
  color: #f2e1ad;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.object-extra {
  font-size: 10px;
  color: #b3c5dc;
}
.object-meta[hidden],
.object-mag[hidden],
.object-extra[hidden] {
  display: none !important;
}
#object-content .coordinate-line {
  display: flex;
  align-items: baseline;
  gap: 5px 7px;
  padding: 4px 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
#object-content .coordinate-line > span {
  color: #a8bbd4;
  font-size: 11px;
}
#object-content .coordinate-line > strong {
  color: #f2f6fc;
  font-weight: 500;
  font-size: 12px;
  margin-right: 11px;
}
#object-content .coordinate-line > strong:last-child {
  margin-right: 0;
}

@media (min-width: 761px) {
  #object-tooltip {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
    bottom: 0 !important;
    top: auto !important;
    width: min(920px, calc(100vw - 30px)) !important;
    max-width: none !important;
    display: grid !important;
    grid-template-columns: minmax(155px, 0.95fr) minmax(255px, 1.4fr) minmax(
        220px,
        1.2fr
      ) !important;
    gap: 0 !important;
    align-items: start;
    padding: 14px 55px 15px 18px !important;
    border-radius: 6px 6px 0 0;
  }
  #object-tooltip .object-header {
    grid-column: 1;
    display: block;
    min-width: 0;
    min-height: 0;
    border: 0;
    padding: 0 16px 0 0;
    margin: 0;
  }
  #object-tooltip #object-content {
    grid-column: 2;
    display: block !important;
    min-width: 0;
    padding: 1px 13px 0 18px;
    margin: 0;
    border-left: 1px solid rgba(209, 224, 245, 0.18);
  }
  #object-tooltip .object-events {
    grid-column: 3;
    min-width: 0;
    display: block;
    margin: 0;
    padding: 0 0 0 18px;
    border: 0;
    border-left: 1px solid rgba(209, 224, 245, 0.18);
  }
  #object-tooltip .object-events .detail-row {
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 4px 9px;
    padding: 3px 0;
    flex-wrap: wrap;
  }
  #object-tooltip .object-events .detail-row span,
  #object-tooltip .object-events .detail-row strong {
    flex: none;
    width: auto;
    text-align: left !important;
  }
  #object-tooltip #object-close {
    position: absolute;
    top: 9px;
    right: 13px;
  }
}
@media (max-width: 760px) {
  #object-tooltip .object-header {
    display: flex;
    align-items: flex-start;
  }
  #object-tooltip #object-content {
    display: block !important;
    padding: 1px 0 0;
    border: 0;
  }
  #object-tooltip .object-events {
    margin-top: 7px;
    padding-top: 6px;
  }
  #object-content .coordinate-line {
    gap: 5px 7px;
    flex-wrap: wrap;
  }
  #object-content .coordinate-line > strong {
    margin-right: 9px;
  }
}

/* v0.27 — Keep the existing independent desktop toolbars. On mobile,
   date/time and location belong to ONE compact collapsible settings group. */
.settings-primary {
  display: contents;
}
@media (max-width: 760px) {
  .tools .settings-primary {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 7px 8px;
    border-radius: 5px;
    background: #ffffff0d;
  }
  .tools .settings-primary .toolgroup {
    padding: 0;
    margin: 0;
    border-radius: 0;
    background: transparent;
    width: auto;
    flex-wrap: nowrap;
    gap: 6px;
    min-width: 0;
  }
  .tools .settings-primary .clockgroup {
    flex: 0 0 auto;
  }
  .tools .settings-primary .locationgroup {
    flex: 1 1 160px;
  }
  .tools .settings-primary .locationgroup select {
    flex: 1 1 auto;
    min-width: 70px;
    max-width: none;
    width: 100%;
  }
  .tools .settings-primary .locationgroup #gps {
    flex: none;
  }
}

/* v0.27 — In-page calendar instead of an OS-positioned native popup.
   The entire calendar remains near its button on desktop or mobile. */
.time-editor {
  width: min(308px, calc(100vw - 24px));
  padding: 12px;
  gap: 9px;
}
.calendar-header {
  display: flex;
  align-items: center;
  gap: 6px;
}
.calendar-header button {
  flex: none;
  width: 30px;
  min-height: 31px;
  font-size: 22px;
  padding: 1px 4px;
}
.calendar-header select {
  flex: 1;
  min-width: 0;
  max-width: none;
  padding: 5px 3px;
  text-transform: capitalize;
}
.calendar-header input {
  flex: none;
  width: 68px;
  max-width: 68px;
  min-height: 31px;
  padding: 5px;
  font-size: 12px;
  appearance: textfield;
}
.calendar-header input::-webkit-inner-spin-button {
  appearance: none;
}
.calendar-weekdays,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}
.calendar-weekdays span {
  text-align: center;
  color: #92aac9;
  font-size: 10px;
  font-weight: 650;
  padding: 2px 0 5px;
}
.calendar-days button {
  min-width: 0;
  min-height: 34px;
  width: 100%;
  padding: 0;
  border-radius: 4px;
  background: #16243a;
  color: #dae6f9;
  font-size: 12px;
}
.calendar-days button:hover {
  background: #385470;
}
.calendar-days button.selected {
  background: #b58d53;
  color: #081425;
  font-weight: 750;
}
.calendar-days button.today:not(.selected) {
  box-shadow: inset 0 0 0 1px #9eaed0;
}
.calendar-time-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 3px;
}
.calendar-time-row label {
  font-size: 12px;
  flex: none;
}
.calendar-time-row input {
  flex: 0 1 75px;
  max-width: 75px;
  min-height: 33px;
  padding: 5px;
  text-align: center;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.calendar-timezone {
  font-size: 11px;
  color: #a7b9d4;
  margin-left: auto;
  white-space: nowrap;
}

/* Keep the date chooser accessible in landscape and with a virtual keyboard. */
.time-editor {
  max-height: calc(100dvh - 20px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* v0.28 — first-load progress. */
.loading-screen[hidden] {
  display: none !important;
}
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, #07101d, #111d35);
  color: #ebf0fc;
}
.loading-panel {
  width: min(310px, calc(100vw - 44px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  font: 13px var(--font-accent, Inter, system-ui, sans-serif);
  color: #c5d3e8;
}
.loading-panel strong {
  font-size: 19px;
  color: #f5f6fa;
}
.loading-panel progress {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  accent-color: #d9b674;
}
.loading-panel progress::-webkit-progress-bar {
  background: #24364f;
  border-radius: 4px;
}
.loading-panel progress::-webkit-progress-value {
  background: #d9b674;
  border-radius: 4px;
}
.loading-panel progress::-moz-progress-bar {
  background: #d9b674;
}
#loading-percent {
  font-variant-numeric: tabular-nums;
  min-height: 16px;
  color: #e2c48c;
}

/* v0.29 — WordPress and compact desktop tooltip. The theme's --font-accent
   variable is inherited if present; standalone mode retains a safe fallback.
   These selectors apply only when this app's stylesheet is loaded. */
html,
body {
  font-family: var(
    --font-accent,
    Inter,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif
  );
}
body.nebo-planetarium-page .toolbar,
body.nebo-planetarium-page .object-tooltip {
  font-family: var(--font-accent, Inter, system-ui, sans-serif);
}
/* Defense in depth if another plugin still injects admin-toolbar offset CSS. */
html:has(body.nebo-planetarium-page) {
  margin-top: 0 !important;
}
body.nebo-planetarium-page #wpadminbar {
  display: none !important;
}

@media (min-width: 761px) {
  /* Wider title block avoids wrapping "Betelgeuse (α Ori)" into extra rows. */
  #object-tooltip {
    width: min(990px, calc(100vw - 30px)) !important;
    grid-template-columns: minmax(210px, 1.15fr) minmax(255px, 1.2fr) minmax(
        230px,
        1.1fr
      ) !important;
    font-size: 13px;
  }
  #object-tooltip .object-header strong#object-title {
    font-size: 18px;
    line-height: 1.3;
  }
  #object-tooltip .object-meta,
  #object-tooltip .object-mag,
  #object-tooltip .object-extra {
    font-size: 12px;
  }
  #object-tooltip #object-content .coordinate-line > span {
    font-size: 12px;
  }
  #object-tooltip #object-content .coordinate-line > strong {
    font-size: 13px;
  }
  #object-tooltip .object-events .detail-row {
    font-size: 13px;
  }
  /* Name + constellation/type + apparent magnitude: three lines maximum
     for named stars, with the Bayer designation next to the proper name. */
  #object-tooltip.named-star #object-subtitle {
    display: none !important;
  }
}
@media (max-width: 760px) {
  /* Preserve the original mobile two-line star title exactly. */
  #object-tooltip .desktop-bayer {
    display: none;
  }
}

/* v0.31 — one-tap, zenith-centred entire-horizon view. */
.zoom .full-sky-button {
  display: flex;
  align-items: center;
  justify-content: center;
}
.zoom .full-sky-button svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linejoin: round;
}
.zoom .full-sky-button svg circle:last-child {
  fill: currentColor;
  stroke: none;
}
.zoom .full-sky-button.active {
  background: #314960e8;
  color: #ffe0a4;
  border-color: #ffdf9a90;
}

/* NiNP planetarij 1.0 — transport symbols match their behavior. */
.stepgroup button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.stepgroup .time-icon {
  width: 18px;
  height: 18px;
  display: block;
  flex: none;
}
.stepgroup .time-step .time-icon {
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.stepgroup .transport .time-icon {
  fill: currentColor;
  stroke: none;
}
.stepgroup .transport {
  letter-spacing: normal;
  padding-right: 8px;
}
@media (max-width: 1050px) {
  .stepgroup .transport {
    padding-right: 5px;
  }
}

/* Help button belongs to the collapsible desktop/mobile settings controls. */
.help-button {
  width: 34px;
  min-width: 34px;
  height: 35px;
  padding: 7px;
  background: #172b44;
  color: #d5e2f4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.help-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.help-button svg .help-dot {
  fill: currentColor;
  stroke: none;
}
@media (max-width: 760px) {
  .help-button {
    align-self: flex-start;
  }
}

/* In-app help/credits: modal, scrollable, readable on desktop and mobile. */
.help-overlay[hidden] {
  display: none !important;
}
.help-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  padding: clamp(12px, 3vh, 35px) 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 7, 17, 0.77);
  backdrop-filter: blur(6px);
}
.help-dialog {
  background: #0e1e34;
  color: #e9f0fb;
  border: 1px solid rgba(191, 212, 244, 0.25);
  width: min(740px, 100%);
  max-height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: 9px;
  box-shadow: 0 24px 75px #000b;
  overflow: hidden;
  font-family: var(--font-accent, Inter, system-ui, sans-serif);
}
.help-dialog:focus {
  outline: none;
}
.help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 19px 20px 15px;
  border-bottom: 1px solid #ffffff24;
  flex: none;
}
.help-header h1 {
  font-size: 21px;
  margin: 0;
  color: #ffdc9b;
  font-weight: 700;
}
.help-header span {
  display: block;
  margin-top: 3px;
  color: #9db2cd;
  font-size: 12px;
}
#help-close {
  width: 34px;
  height: 34px;
  min-height: 34px;
  line-height: 1;
  font-size: 24px;
  padding: 0;
  flex: none;
}
.help-content {
  overflow: auto;
  overscroll-behavior: contain;
  padding: 12px 24px 24px;
  line-height: 1.65;
  font-size: 13px;
}
.help-content h2 {
  font-size: 15px;
  font-weight: 700;
  margin: 19px 0 7px;
  color: #e3c894;
}
.help-content h2:first-child {
  margin-top: 6px;
}
.help-content p {
  margin: 6px 0 12px;
  color: #cfdaeb;
}
.help-content ul {
  margin: 6px 0 14px;
  padding-left: 21px;
  color: #cfdaeb;
}
.help-content li {
  margin: 6px 0;
}
.help-content p,
.help-content li {
  font-size: 0.9375rem;
}
.help-content strong {
  color: #f3f6ff;
}
.help-content a {
  color: #acd2ff;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.help-content a:hover {
  color: #f2e0b2;
}
.help-content code {
  font-size: 12px;
  color: #f0ce9d;
}
.help-license-note {
  font-size: 11px;
  color: #9daec4 !important;
}
@media (max-width: 760px) {
  .help-overlay {
    padding: 8px 8px max(8px, env(safe-area-inset-bottom));
  }
  .help-header {
    padding: 13px 15px 12px;
  }
  .help-header h1 {
    font-size: 18px;
  }
  .help-content {
    padding: 10px 16px 18px;
    font-size: 12px;
  }
}
