/* Shared controls inside the map workspace. */
#workspace #solar-altitude {
  border: 0; background: transparent; font-family: inherit; padding: 4px 6px; border-radius: 8px;
}
#workspace #solar-altitude:hover { background: var(--control-soft); }
#workspace .walk-heading .walk-light-settings {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  flex: none; margin-left: auto; padding: 0 10px; min-height: 34px; white-space: nowrap;
  background: #e7bc48; color: #191a17; border: 0; border-radius: 99px;
  font-family: inherit; font-size: 12px; font-weight: 600; line-height: 1;
}
#workspace .walk-light-settings .icon { width: 15px; height: 15px; }
#workspace .walk-heading .study-panel-link { margin-left: 0; }

#layers-dialog.light-settings {
  --ink: #1b1c19; --paper: #fff; --soft: #f1f2ef; --line: #dbdcd6; --gold: #e7bc48;
  box-sizing: border-box; width: min(710px, calc(100vw - 28px)); max-width: none;
  max-height: min(850px, calc(100dvh - 32px)); margin: auto; padding: 0;
  color: var(--ink); background: var(--soft); border: 1px solid #cbcdc5; border-radius: 24px;
  box-shadow: 0 24px 90px #12160e38; overflow: hidden; text-align: left; color-scheme: light;
}
#layers-dialog.light-settings[open] { display: flex; flex-direction: column; }
#layers-dialog.light-settings [hidden] { display: none !important; }
#layers-dialog.light-settings::backdrop { background: #191c1957; backdrop-filter: blur(3px); }
#layers-dialog.light-settings *, #layers-dialog.light-settings *::before { box-sizing: border-box; }
#layers-dialog.light-settings :is(button,input) { font-family: inherit; }
#layers-dialog.light-settings :is(button,input):focus-visible,
#workspace .walk-heading .walk-light-settings:focus-visible { outline: 3px solid #a77a0a; outline-offset: 2px; }
#layers-dialog.light-settings :is(.light-mode,.light-layers) :is(button,input):focus-visible { outline-color: #ffdb70; }
.light-settings-head {
  padding: 17px 23px 15px; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex: none; border-bottom: 1px solid var(--line); background: #fafbf8;
}
.light-wordmark { display: inline-flex; gap: 6px; align-items: center; font: 700 10px/1.2 Arial, sans-serif; letter-spacing: .08em; }
.light-wordmark::before { content: ''; width: 16px; height: 3px; background: var(--gold); }
#layers-dialog .light-settings-head h2 { color: var(--ink); margin: 4px 0 0; font-size: 25px; letter-spacing: -.055em; line-height: 1.2; }
#layers-dialog .light-close {
  display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line);
  border-radius: 50%; background: var(--paper); color: var(--ink);
}
.light-settings-body {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: stretch;
  grid-template-areas: 'mode solar' 'view solar' 'trip layers'; gap: 11px;
  padding: 14px; overflow: auto; min-height: 0; overscroll-behavior: contain;
}
.light-card {
  display: flex; flex-direction: column; min-width: 0; padding: 16px 18px;
  border: 1px solid #dedfd9; border-radius: 17px; background: var(--paper);
}
.light-card-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 12px; }
#layers-dialog .light-card-title h3 { font-size: 16px; line-height: 1.3; letter-spacing: -.035em; margin: 0; color: inherit; }
.light-card-title>small { color: #73766d; font: 600 9px/1.25 Arial, sans-serif; white-space: nowrap; letter-spacing: .085em; }
.light-card.light-mode, .light-card.light-layers { background: #1b1c19; color: #fafaf7; border-color: #1b1c19; }
:is(.light-mode,.light-layers) .light-card-title>small { color: #bdc0b6; }
.light-mode { grid-area: mode; }
.light-modes { display: grid; gap: 4px; }
#layers-dialog .light-modes button {
  min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 10px;
  background: #292a26; color: #fafaf7; border: 0; border-radius: 9px; text-align: left;
}
#layers-dialog .light-modes button:hover { background: #353630; }
.light-modes .icon { width: 19px; height: 19px; }
.light-modes button span { font-size: 14px; font-weight: 600; }
.light-modes button small { margin-left: 4px; color: #bfc2b9; font-size: 11px; font-weight: 400; }
#light-balanced { margin: 7px 0 0; font-size: 11px; color: #dfd3ad; }
#layers-dialog .light-switch, #layers-dialog.light-settings .switch {
  flex: none; position: relative; display: inline-block; width: 37px; height: 22px;
  margin: 0 0 0 auto; padding: 0; appearance: none; border: 0; border-radius: 20px; background: #676a61;
}
#layers-dialog .light-switch::before, #layers-dialog.light-settings .switch::before {
  content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; transition: transform .16s ease; transform: none;
}
#layers-dialog [aria-pressed=true]>.light-switch, #layers-dialog.light-settings .switch:checked { background: var(--gold); }
#layers-dialog [aria-pressed=true]>.light-switch::before, #layers-dialog.light-settings .switch:checked::before { background: #22231f; transform: translateX(15px); }
.light-solar { grid-area: solar; }
.light-instrument { position: relative; flex: 1; display: grid; place-items: center; margin: -2px 0 4px; }
.light-instrument>svg { display: block; width: min(100%, 235px); height: auto; }
.light-instrument line { stroke: #979a91; stroke-width: 1.4; }
.light-instrument .major { stroke: #252721; stroke-width: 2.1; }
.light-instrument #light-pointer { fill: #c29117; }
.light-scale-labels { font: 9px Arial, sans-serif; fill: #676b61; text-anchor: middle; }
.light-solar-reading { position: absolute; inset: 12% 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
#light-angle { font-size: clamp(42px,5vw,61px); line-height: 1; letter-spacing: -.07em; font-weight: 640; font-variant-numeric: tabular-nums; }
#light-angle-state { margin-top: 5px; font-size: 11px; color: #64675f; }
.light-time-strip { display: grid; grid-template-columns: 44px minmax(0,1fr) 44px; align-items: center; background: #f1f2ee; border-radius: 999px; }
#layers-dialog .light-time-strip button { display: grid; place-items: center; background: transparent; color: var(--ink); border: 0; border-radius: 50%; width: 44px; height: 44px; font-size: 19px; }
#layers-dialog .light-time-strip button:hover { background: #e7e8e2; }
#layers-dialog .light-time-strip button:disabled { opacity: .35; }
.light-time-strip .icon { width: 16px; height: 16px; }
#light-clock { width: auto; max-width: 100%; min-width: 0; justify-self: center; text-align: center; border: 0; padding: 4px 1px; background: transparent; color: var(--ink); font-size: 17px; line-height: 1.25; font-weight: 650; font-variant-numeric: tabular-nums; }
#light-clock::-webkit-calendar-picker-indicator { display: none; }
#light-clock::-webkit-date-and-time-value { text-align: center; }
.light-clock-place { display: flex; justify-content: space-between; gap: 6px; margin-top: 8px; font-size: 11px; line-height: 1.4; color: #60645a; }
#light-place { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#light-date { flex: none; font-variant-numeric: tabular-nums; }
.light-view { grid-area: view; }
.light-views { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#layers-dialog .light-views button { min-width: 0; padding: 3px; border: 1px solid #dcddd7; color: var(--ink); border-radius: 10px; background: #fff; text-align: left; }
#layers-dialog .light-views button[aria-pressed=true] { background: #232420; color: white; border-color: #232420; }
#layers-dialog .light-views button:disabled { opacity: .6; }
.light-view-preview { display: block; height: 37px; border-radius: 6px; background: #e7e8e1 51% 48% / 155% auto no-repeat; filter: grayscale(1); }
.light-view-preview.view-plan { background-image: url('/media/intro-map-2d.jpg'); }
.light-view-preview.view-model { background-image: url('/media/intro-map-3d.jpg'); }
.light-views button span { display: flex; align-items: center; gap: 4px; padding: 4px 6px 2px; font-size: 11px; }
.light-views button span::after { content: ''; margin-left: auto; width: 6px; height: 6px; border-radius: 50%; }
.light-views button[aria-pressed=true] span::after { background: var(--gold); }
.light-trip { grid-area: trip; }
.light-trip-figure { display: flex; gap: 10px; justify-content: space-between; align-items: center; }
#light-trip-value { display: block; font: 650 43px/1 Arial,sans-serif; letter-spacing: -.06em; }
#light-trip-value small { margin-left: 2px; font-size: 18px; }
#light-trip-metric { color: #595d52; font-size: 11px; }
#light-trip-sketch .walk-sketch { display: block; width: 106px; max-width: 100%; height: auto; color: #efc24a; background: #242620; }
#light-trip-sketch .walk-sketch circle { fill: #252721; }
.walk-sketch .walk-footprints { fill: #d2d4cb; stroke: none; }
:is(#light-trip-sketch,.walk-route-card.selected) .walk-footprints { fill: #3c3e38; }
#workspace .walk-route-card { padding: 12px; gap: 11px; border-radius: 13px; }
#workspace .walk-route-card .walk-shade-stat b { font-weight: 650; font-size: 32px; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
#light-trip-facts { margin: 10px 0 12px; font-size: 12px; color: #42463c; }
.light-trip-empty { flex: 1; display: flex; align-items: center; gap: 12px; padding: 4px 0 15px; }
.light-trip-empty .icon { flex: none; width: 36px; height: 36px; padding: 7px; background: #f1f2ed; border-radius: 50%; }
.light-trip-empty p { margin: 0; color: #53564d; font-size: 13px; line-height: 1.55; }
#layers-dialog #light-trip-open { display: flex; align-items: center; justify-content: space-between; gap: 5px; min-height: 44px; margin: auto 0 0; padding: 0 13px; border: 1px solid var(--line); background: #f5f6f2; color: var(--ink); border-radius: 9px; font-size: 13px; font-weight: 600; }
#light-trip-open .icon { width: 17px; height: 17px; }
.light-layers { grid-area: layers; }
.light-layers .light-card-title { margin-bottom: 4px; }
.light-layer-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 0; margin: 0; color: #f7f7f4; font-size: 13px; cursor: pointer; }
.light-layer-row + .light-layer-row { border-top: 1px solid #3b3d36; }
.light-opacity { display: flex; align-items: center; gap: 8px; padding-bottom: 5px; border-bottom: 1px solid #3b3d36; color: #c2c5bb; font-size: 11px; }
.light-opacity label, .light-opacity output { flex: none; }
#layers-dialog .light-opacity input { display: block; width: auto; min-width: 0; height: 22px; flex: 1; margin: 0; padding: 0; accent-color: var(--gold); }
.light-opacity output { width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; }
.light-opacity:has(input:disabled) { opacity: .5; }
@media (max-width: 850px), (pointer: coarse) {
  #workspace .walk-heading .walk-light-settings { min-height: 44px; }
  #workspace #solar-altitude { min-height: 44px; }
}
@media (max-width: 540px) {
  #layers-dialog.light-settings { width: min(410px, calc(100vw - 16px)); max-height: calc(100dvh - 16px); border-radius: 19px; }
  .light-settings-head { padding: 10px 16px; }
  #layers-dialog .light-settings-head h2 { font-size: 22px; }
  .light-settings-body { grid-template-columns: minmax(0,1fr); grid-template-areas: 'mode' 'solar' 'view' 'trip' 'layers'; padding: 9px; gap: 8px; }
  .light-card { padding: 13px 15px; border-radius: 13px; }
  .light-card-title { margin-bottom: 9px; }
  .light-instrument>svg { width: 207px; }
  #light-angle { font-size: 48px; }
  .light-view-preview { height: 49px; }
  #workspace .walk-heading { column-gap: 5px; }
  #workspace .walk-heading .walk-light-settings { gap: 4px; padding-inline: 9px; }
  .light-opacity input[type=range] { min-height: 38px; }
}
@media (max-width: 359px) {
  #workspace .walk-heading .walk-light-settings { padding-inline: 7px; }
  #workspace .walk-light-settings .icon { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  #layers-dialog.light-settings :is(.light-switch,.switch)::before { transition: none; }
}
