/* 30-rotations-hub.css
   Rotations hub: pulse system, swipe cards, lightning monitor, thermometers and phone layout.
   Files in css/ load in filename order and the cascade depends on it: see docs/CSS.md. */

/* ----------------------------
      WEATHER WIDGET
-----------------------------*/
#weather-widget {
  position: relative;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  min-height: 180px;
  padding: 0;
  display: flex;
  flex-direction: column;
  font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
  margin-bottom: 0;
  overflow: hidden;
}

.wx-top-label {
  background: #1a2c46;
  color: #9ec3ff;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 1px;
  text-align: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.wx-cols {
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
  margin-top: 4px;
}

.wx-left,
.wx-right {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.wx-temp {
  font-size: 78px;
  font-weight: 900;
  margin: 0;
}

.wx-delta {
  font-size: 28px;
  font-weight: 900;
  margin: 3px 0 0;
}
.wx-delta.warmer {
  color: #ff7043;
}
.wx-delta.cooler {
  color: #79c7ff;
}
.wx-delta.neutral {
  color: #fff;
}
:root[data-theme="light"] .wx-delta.neutral {
  color: #253142;
}

.wx-sub {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  margin: 0 0 -4px;
}

.wx-zone {
  font-size: 36px;
  font-weight: 900;
  margin: 0;
}

.wx-zone-label {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-top: 4px;
  margin-bottom: 20px;
}

.wx-rules {
  font-size: 18px;
  font-weight: 700;
  margin-top: 4px;
  line-height: 1.1;
}

.wx-forecast {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.wx-forecast-hour {
  min-height: 58px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 3px;
  padding: 8px 6px;
  border-left: 1px solid var(--line);
  text-align: center;
}

.wx-forecast-hour:first-child {
  border-left: 0;
}

.wx-forecast-time {
  color: #9ec3ff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.wx-forecast-temp {
  color: var(--text);
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
}

.wx-forecast-zone {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}

.wx-forecast-empty {
  grid-column: 1 / -1;
  padding: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.wx-refresh-status {
  --wx-progress: 0%;
  position: absolute;
  z-index: 3;
  top: 2px;
  right: 8px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #9ec3ff;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.wx-refresh-status::before,
.wx-refresh-status::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.wx-refresh-status::before {
  inset: 0;
  background: conic-gradient(#4da3ff var(--wx-progress), rgba(77, 163, 255, 0.16) 0);
}

.wx-refresh-status::after {
  inset: 4px;
  background: #1a2c46;
}

.wx-refresh-status > span {
  position: relative;
  z-index: 1;
}

.wx-refresh-status.is-loading::before {
  background: conic-gradient(transparent 0 22%, #4da3ff 22% 100%);
  animation: wx-refresh-spin 0.8s linear infinite;
}

.wx-refresh-status.is-error {
  color: #ff9a9a;
}

.wx-refresh-status.is-error::before {
  background: #ff6f6f;
}

.wx-refresh-status.is-override {
  color: var(--muted);
}

.wx-refresh-status.is-override::before {
  background: rgba(142, 163, 176, 0.28);
}

@keyframes wx-refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

/* PULSE SYSTEM */

.card-inner::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  pointer-events: none;
  opacity: 0.25;
  background: transparent;
  border: 2px solid transparent;
  z-index: 5;
}

.card.pulse-yellow .card-inner::after {
  background: rgba(255, 255, 0, 0.25);
  border-color: rgba(255, 255, 0, 0.9);
  animation: exposurePulse 2.2s ease-in-out infinite;
}

.card.pulse-red .card-inner::after {
  background: rgba(255, 0, 0, 0.25);
  border-color: rgba(255, 0, 0, 0.9);
  animation: exposurePulse 2.2s ease-in-out infinite;
}

@keyframes exposurePulse {
  0%,
  100% {
    opacity: 0.25;
  }
  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card.pulse-yellow .card-inner::after,
  .card.pulse-red .card-inner::after {
    animation: none;
    opacity: 0.7;
  }
}

/* ============================================
   DEBUG PANEL STYLES
============================================ */
#debug-panel {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100vh;
  background: #0f1120;
  border-left: 2px solid #1c2238;
  padding: 20px;
  color: #d0dae7;
  font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
  transition: right 0.25s ease;
  z-index: 9999;
}

#debug-panel.open {
  right: 0;
}

#debug-open-btn,
#roster-open-btn {
  position: fixed;
  bottom: 20px;
  height: 50px;
  width: 50px;
  background: #1a1f33;
  border: 1px solid #2d3552;
  padding-bottom: 3px;
  border-radius: 8px;
  color: #cbd8ef;
  font-size: 30px;
  cursor: pointer;
  z-index: 9999;
}

#debug-close {
  position: absolute;
  top: 10px;
  right: 10px;
  color: #cbd8ef;
  font-size: 26px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10000;
}

.dbg-title {
  margin: 40px 0 15px;
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dbg-tools-toggle {
  font-size: 12px;
  padding: 2px 8px;
}

.dbg-section {
  margin: 20px 0;
  padding-bottom: 15px;
  border-bottom: 1px solid #232a44;
}

.dbg-section:last-child {
  border-bottom: none;
}

.dbg-section.disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* Toggle switch */
.dbg-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dbg-toggle input {
  display: none;
}

.dbg-toggle .slider {
  width: 45px;
  height: 22px;
  background: #2b334d;
  border-radius: 22px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
}

.dbg-toggle .slider::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.dbg-toggle input:checked + .slider {
  background: #4da3ff;
}

.dbg-toggle input:checked + .slider::after {
  transform: translateX(23px);
}

.dbg-row {
  display: grid;
  grid-template-columns: 70px 1fr 40px;
  align-items: center;
  margin-bottom: 10px;
}

.dbg-row input[type="range"] {
  width: 100%;
}

.dbg-zones {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.dbg-zone {
  flex: 1 1 45%;
  padding: 8px;
  background: #1b2033;
  border: 1px solid #2d3553;
  border-radius: 6px;
  color: #cdd7ef;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.dbg-zone:hover {
  background: #223056;
}

.dbg-btn {
  width: 100%;
  padding: 10px;
  background: #283053;
  border: 1px solid #3a456d;
  color: #d0d8ea;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  transition: opacity 0.2s;
}

.dbg-btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}

#leadership-open-btn {
  margin-top: 10px;
}

.history-row {
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
}

#debug-open-btn {
  right: 20px;
}

#roster-open-btn {
  z-index: 9998;
}

/* Toggle container */
.dbg-tools-toggle-wrap {
  position: relative;
  width: 54px;
  height: 26px;
  background: #222a;
  border-radius: 20px;
  display: flex;
  align-items: center;
  padding: 0;
  justify-content: space-between;
  overflow: hidden;
  transform: translateY(8px);
}

.dbg-tools-toggle-slider {
  position: absolute;
  width: 26px;
  height: 26px;
  background: var(--accent, #4da3ff);
  border-radius: 50%;
  left: 0;
  top: 0;
  transition: transform 0.25s ease;
}

.dbg-tools-toggle-btn {
  width: 50%;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.modal-row {
  margin-bottom: 12px;
}

.modal-input,
.modal-select {
  background: #101321;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 6px 8px;
  color: #f5f7fb;
  font-size: 18px;
}

.modal-select {
  height: 40px; /* collapsed height */
}

.modal-input:focus,
.modal-select:focus {
  outline: none;
  border-color: var(--accent, #4da3ff);
}

.modal-actions {
  display: flex;
  gap: 8px;
}

.leadership-box {
  width: min(360px, calc(100vw - 40px));
  max-height: min(650px, calc(100vh - 40px));
  overflow-y: auto;
}

.leadership-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0;
}

.leadership-row,
.leadership-add-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.leadership-name,
#leadership-name {
  flex: 1;
  min-width: 0;
}

.leadership-remove,
.leadership-add {
  flex: 0 0 42px;
  height: 42px;
  border: 1px solid #3a456d;
  border-radius: 8px;
  color: #fff;
  font-size: 26px;
  cursor: pointer;
}

.leadership-remove {
  background: #8f334f;
}

.leadership-add {
  background: #283053;
}

.leadership-add-row {
  margin: 14px 0;
}

.leadership-empty {
  padding: 14px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed #3a456d;
  border-radius: 8px;
}

.roster-box {
  width: min(520px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  max-height: min(760px, calc(100dvh - 32px));
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.roster-sections {
  overflow-y: auto;
  margin: 12px 0;
  padding-right: 4px;
}

.roster-section + .roster-section {
  margin-top: 16px;
}

.roster-heading {
  margin: 0 0 6px;
  padding-bottom: 5px;
  border-bottom: 1px solid #3a456d;
  color: var(--accent);
  font-size: 18px;
}

.roster-row {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.9fr) minmax(132px, 0.85fr);
  column-gap: 16px;
  align-items: center;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 6px;
}

.roster-row:nth-of-type(odd) {
  background: rgba(255, 255, 255, 0.035);
}

.roster-name {
  min-width: 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
}

.roster-name.roster-leader {
  color: var(--leader);
}

.roster-job {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-shift {
  color: var(--muted);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.roster-empty {
  padding: 6px 8px;
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
}

@media (max-width: 480px) {
  #roster-modal {
    align-items: stretch;
    box-sizing: border-box;
    padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
  }

  .roster-box {
    width: 100%;
    max-height: 100%;
    min-height: 0;
    margin: auto;
  }

  .roster-row {
    column-gap: 8px;
    padding-inline: 4px;
  }

  .roster-name {
    font-size: 16px;
  }

  .roster-shift {
    font-size: 13px;
  }

  .roster-row {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.8fr) minmax(108px, 0.9fr);
  }

  .roster-job {
    font-size: 12px;
  }
}

/* =========================================
   SWIPE TO DELETE
========================================= */

/* card we can slide */
.card.swipe-card {
  position: relative;
  overflow: hidden;
  padding: 0;
  background: transparent;
  border-radius: 14px; /* match your card corner radius */
  touch-action: pan-y;
}

/* Inner card that actually slides (already added earlier) */
.card-inner {
  position: relative;
  z-index: 1;
  background: var(--card);
  border-radius: 14px;
  padding: 8px;
  padding-right: 15px;
  min-height: 87px;
  height: auto;
}

.card.off-soon .card-inner {
  background: #3a2438;
  box-shadow: inset 0 0 0 1px rgba(255, 132, 188, 0.55);
}

/* Red delete strip “under” the card — completely stationary */
.card.swipe-card::before {
  content: "Delete ✕";
  position: absolute;
  top: 1px;
  bottom: 1px;
  right: 1px;
  width: calc(50% - 1px);
  background: #ff4d4f;
  color: #fff;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 16px;
  z-index: 0;
  transform: none;
  transition: none;
  border-top-right-radius: 14px;
  border-bottom-right-radius: 14px;
}

/* Optional: you can still style “active” state without sliding */
.card.swipe-card.swipe-active::before {
  /* maybe a tiny visual change, but NOT movement */
  filter: brightness(1.05);
}

/* Card snapping back after swipe */
.card.swipe-card.swipe-animating .card-inner {
  transition: transform 0.15s ease-out;
}

/* Confirm Delete button — same style as cancel, but red */
.modal-confirm-delete {
  width: 100%;
  padding: 10px 14px;
  height: 44px;
  background: #ff4d4f; /* 🔥 red background */
  border: 1px solid #8c2f30; /* darker red border */
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    transform 0.15s ease;
  margin-bottom: 10px;
}

.modal-confirm-delete:hover {
  background: #e54446; /* slightly darker red on hover */
}

.modal-add {
  width: 100%;
  padding: 10px 14px;
  height: 44px;
  background: var(--accent);
  border: 1px solid #303a55;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    transform 0.15s ease;
}

.modal-add:hover {
  filter: brightness(1.06);
}

.custom-select {
  position: relative;
  background: #101321;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 6px 8px;
  color: #f5f7fb;
  cursor: pointer;
  user-select: none;
}

.custom-select-display {
  font-size: 14px;
}

.custom-select-options {
  position: absolute;
  top: calc(100% + 4px); /* always below */
  left: 0;
  width: 100%;
  background: #101321;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  max-height: 200px; /* 🔥 fixed dropdown height */
  overflow-y: auto; /* scroll instead of expanding */
  display: none;
  z-index: 999999;
}

.custom-select.open .custom-select-options {
  display: block;
}

.custom-select-option {
  padding: 8px;
  font-size: 14px;
  cursor: pointer;
}

.custom-select-option:hover {
  background: #1c2438;
}

.modal-row {
  display: flex;
  gap: 12px;
}

.modal-row .modal-field {
  flex: 1; /* each column = 50% */
}

.modal-row .modal-field .custom-select {
  width: 100%; /* fill full half */
  margin: 0;
}

/* ==============================
   WEATHER ROW — BASE (DESKTOP DEFAULT)
   - Full-width row
   - Widget aligned to inside column cards
============================== */

#weather-row {
  padding: 20px 20px 0; /* match #app padding */
  display: block;
  pointer-events: none;
}

/*
  Cards in inside column:
    left = 20px (#app padding) + 10px (.column padding-left) = 30px
  So we match that frame.
*/
#weather-row #weather-widget {
  width: calc(50% - 20px);
  margin-left: 10px; /* 20 (app) + 10 = 30px total offset */
}

/* ============================================================
   DESKTOP (DEFAULT) ALIGNMENT
   - Right column top flush with widget top
   - Inside column starts just BELOW widget
   - Gap under widget ~= card gap (8px)
============================================================ */

body[data-layout="default"] #weather-row {
  position: relative;
  z-index: 2;
}

/* Pull columns up so OUTSIDE top aligns with widget top */
body[data-layout="default"] #app {
  margin-top: -230px; /* ≈ widget height; tweak if needed */
}

body[data-layout="default"] #inside-column {
  padding-top: 218px;
}

body[data-layout="default"] #outside-column {
  padding-top: 8px;
}

/* ============================================================
   PORTRAIT PHONE LAYOUT
   - Weather centered above columns
   - Same inner width as two-column area
   - Gap under widget = card gap (8px)
============================================================ */

body[data-layout="phone-portrait"] #weather-row {
  padding: 8px 8px 0; /* match phone #app padding: 8px 8px */
  display: block;
}

body[data-layout="phone-portrait"] #weather-row #weather-widget {
  width: calc(100% - 16px);
  margin: 0 auto 8px;
}

/* Lightning monitoring prototype */
.lightning-widget {
  width: calc(50% - 20px);
  margin: 0 0 10px 10px;
  overflow: hidden;
  border: 1px solid rgba(250, 204, 21, 0.55);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
}
.lightning-widget.hidden {
  display: none;
}
.lightning-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 14px;
  background: linear-gradient(90deg, rgba(250, 204, 21, 0.18), rgba(250, 204, 21, 0.035));
}
.lightning-header > div:first-child {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 8px;
}
.lightning-header strong {
  font-size: 17px;
}
.lightning-header small {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}
.lightning-bolt {
  grid-row: 1 / 3;
  color: #facc15;
  font-size: 26px;
}
.lightning-countdown {
  display: grid;
  justify-items: end;
}
.lightning-countdown span {
  color: #facc15;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.09em;
}
.lightning-countdown strong {
  color: #facc15;
  font-size: 24px;
  line-height: 1;
}
.lightning-live-map {
  min-height: 170px;
  border-top: 1px solid rgba(250, 204, 21, 0.25);
  background: #202833;
}
.lightning-map-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 11px;
}
.lightning-map-footer strong {
  color: #facc15;
  white-space: nowrap;
}
.lightning-choice-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.countdown-choices {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.lightning-radius-control {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.lightning-radius-readout {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.lightning-radius-readout strong {
  color: #facc15;
  font-size: 24px;
}
.lightning-radius-readout span {
  color: var(--muted);
  font-size: 12px;
}
.lightning-radius-slider {
  width: 100%;
  accent-color: #facc15;
  cursor: pointer;
}
.lightning-radius-scale {
  position: relative;
  height: 15px;
  margin: 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.lightning-radius-scale span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
}
.lightning-radius-scale span:first-child {
  left: 0;
  transform: none;
}
.lightning-radius-scale span:nth-child(2) {
  left: 44.444%;
}
.lightning-radius-scale span:last-child {
  right: 0;
  transform: none;
}
.lightning-setting-choice {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 46px;
  border: 1px solid #4a4d54;
  border-radius: 8px;
  background: #35373c;
  cursor: pointer;
}
.lightning-setting-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.lightning-setting-choice.selected {
  border-color: #facc15;
  background: rgba(250, 204, 21, 0.14);
  color: #ffe879;
  box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.22);
}
.lightning-settings-body.disabled {
  opacity: 0.42;
  pointer-events: none;
  filter: grayscale(0.4);
}
.settings-card.lightning-coming-soon-card {
  position: relative;
  overflow: hidden;
  padding: 14px 16px;
  border: 1px solid #484b52;
  border-radius: 7px;
  background: #313338;
}
.settings-card.lightning-coming-soon-card .settings-switch-row {
  margin: 0;
}
.lightning-coming-soon-card::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background: rgba(25, 27, 31, 0.42);
  pointer-events: none;
}
.lightning-coming-soon-ribbon {
  position: absolute;
  z-index: 2;
  top: 9px;
  right: -34px;
  width: 132px;
  padding: 4px 0 5px;
  transform: rotate(36deg);
  background: #d7193f;
  color: #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.28);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.08em;
  line-height: 1.15;
  text-align: center;
  text-transform: uppercase;
}
:root[data-theme="light"] .lightning-coming-soon-card::after {
  background: rgba(226, 229, 234, 0.58);
}
:root[data-theme="light"] .settings-card.lightning-coming-soon-card {
  border-color: #c9cdd3;
  background: #e5e7eb;
}
.lightning-settings-preview {
  position: relative;
  width: min(100%, 600px);
  min-height: 292px;
  margin: 12px 0;
  overflow: hidden;
  border: 1px solid #494c52;
  border-radius: 9px;
  background: #202833;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}
.lightning-map-example > img {
  position: absolute;
  z-index: 0;
  inset: 62px 0 0;
  width: 100%;
  height: calc(100% - 62px);
  object-fit: cover;
  transition: filter 0.2s ease;
}
:root:not([data-theme="light"]) .lightning-map-example > img {
  filter: invert(0.86) hue-rotate(176deg) saturate(0.62) brightness(1.24) contrast(0.94);
}
.lightning-map-example::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 58% 0 0;
  background: linear-gradient(transparent, rgba(8, 10, 14, 0.84));
  pointer-events: none;
}
.lightning-preview-alert {
  position: absolute;
  z-index: 5;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(100deg, #d97706, #f59e0b 65%, #fbbf24);
  color: #17130a;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.lightning-preview-alert-copy {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.lightning-preview-alert-copy > b {
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 27px;
  line-height: 1;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}
.lightning-preview-alert-copy > span {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.lightning-preview-alert-copy strong {
  font-size: 16px;
  letter-spacing: -0.01em;
}
.lightning-preview-alert-copy small {
  overflow: hidden;
  font-size: 10px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lightning-preview-countdown {
  display: grid;
  flex: 0 0 auto;
  justify-items: end;
}
.lightning-preview-countdown span {
  font-size: 8px;
  font-weight: 950;
  letter-spacing: 0.08em;
}
.lightning-preview-countdown strong {
  color: #fff;
  font-size: 24px;
  line-height: 1;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.28);
}
.lightning-preview-radius {
  position: absolute;
  z-index: 2;
  top: 59%;
  left: 50%;
  width: clamp(120px, 32%, 174px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 3px solid #facc15;
  border-radius: 50%;
  background: rgba(250, 204, 21, 0.14);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.38),
    0 0 18px rgba(250, 204, 21, 0.22);
}
.lightning-preview-radius i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  transform: translate(-50%, -50%);
  border: 2px solid #fff;
  border-radius: 50%;
  background: #facc15;
}
.lightning-preview-radius > b {
  position: absolute;
  width: 8px;
  height: 8px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #facc15;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}
.lightning-preview-radius .strike-one {
  top: 22%;
  left: 66%;
}
.lightning-preview-radius .strike-two {
  top: 61%;
  left: 23%;
}
.lightning-preview-radius .strike-three {
  top: 72%;
  left: 68%;
}
.lightning-example-copy {
  position: absolute;
  z-index: 3;
  left: 12px;
  bottom: 10px;
  display: grid;
  gap: 2px;
  color: #fff;
  text-shadow: 0 1px 3px #000;
}
.lightning-example-copy span {
  color: #e6e8ec;
  font-size: 11px;
}
.lightning-map-attribution {
  position: absolute;
  z-index: 3;
  right: 8px;
  bottom: 7px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 8px;
  text-shadow: 0 1px 2px #000;
}
@media (max-width: 560px) {
  .lightning-preview-alert-copy small {
    display: none;
  }
  .lightning-settings-preview {
    min-height: 270px;
  }
}
:root[data-theme="light"] .lightning-widget {
  background: #fff;
}
:root[data-theme="light"] .lightning-setting-choice {
  border-color: #c8cdd4;
  background: #f3f4f6;
}
:root[data-theme="light"] .lightning-setting-choice.selected {
  border-color: #b58a00;
  background: #fff7cc;
  color: #715500;
}
body[data-layout="phone-portrait"] #weather-row .lightning-widget {
  width: calc(100% - 16px);
  margin: 0 auto 8px;
}
@media (max-width: 620px) {
  .lightning-choice-grid {
    grid-template-columns: repeat(5, minmax(44px, 1fr));
  }
}

body[data-layout="phone-portrait"] .wx-rules {
  font-size: 13px;
}

body[data-layout="phone-portrait"] .wx-zone {
  font-size: 25px;
}

body[data-layout="phone-portrait"] .wx-temp {
  font-size: 62px;
}

body[data-layout="phone-portrait"] .wx-forecast-hour {
  min-height: 50px;
  padding: 7px 4px;
}

body[data-layout="phone-portrait"] .wx-forecast-time {
  font-size: 10px;
}

body[data-layout="phone-portrait"] .wx-forecast-temp {
  font-size: 18px;
}

body[data-layout="phone-portrait"] .wx-forecast-zone {
  font-size: 9px;
}

/* Slightly tighten app padding on phone */
body[data-layout="phone-portrait"] #app {
  padding: 0px 8px 16px;
}

/* Optional: slightly smaller column titles on phone */
body[data-layout="phone-portrait"] .column-title {
  font-size: 18px;
  margin-bottom: 8px;
}

body[data-layout="phone-portrait"] .card-name {
  font-size: 16px;
}

body[data-layout="phone-portrait"] .card-shift {
  font-size: 10px;
}

body[data-layout="phone-portrait"] .role-pill {
  font-size: 8px;
}

body[data-layout="phone-portrait"] .status-bar {
  width: 20px;
  font-size: 10px;
}

body[data-layout="phone-portrait"] .status-bar.role-change-edge {
  font-size: 8px;
  letter-spacing: 0.2px;
}

body[data-layout="phone-portrait"] .status-bar.secondary-status-bar {
  font-size: 10px;
  letter-spacing: 2px;
}

body[data-layout="phone-portrait"] .role-edge-words {
  font-size: 10px;
  line-height: 0.9;
  letter-spacing: 0.1px;
}

body[data-layout="phone-portrait"] .card.dual-status .status-bar:not(.secondary-status-bar) {
  right: 20px;
}

body[data-layout="phone-portrait"] .card.dual-status .card-header-grid {
  width: calc(100% - 20px);
}

body[data-layout="phone-portrait"] .mini-cover-label {
  display: none !important;
}

/* Global top breathing room so widget + columns aren't crammed to top */
body {
  padding-top: 8px;
}

/* =========================================
   PHONE PORTRAIT — 
   Row 1: name + shift
   Row 2: buttons (side-by-side) + timer
========================================= */
body[data-layout="phone-portrait"] .card-header-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 8px;
  row-gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 0;
}

/* Row 1 — identity on the left, timer/exposure on the right */
body[data-layout="phone-portrait"] .col-role-name {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  align-self: center;
}

/* Hide history on mobile */
body[data-layout="phone-portrait"] .col-history {
  display: none !important;
}

/* Row 2 — full-width touch-friendly action strip */
body[data-layout="phone-portrait"] .col-buttons {
  grid-column: 1 / 3;
  grid-row: 2;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 6px;
  row-gap: 0;
  margin-top: 0;
  align-items: center;
  width: 100%;
  padding-right: 24px;
  align-self: center;
}

/* Large touch targets while preserving the existing symbols */
body[data-layout="phone-portrait"] .col-buttons .icon-btn {
  width: 100%;
  height: 30px;
  font-size: 22px;
  padding: 0;
  border-radius: 8px;
}

/* =========================================
   Row 2 — RIGHT SIDE: TIMER
========================================= */
body[data-layout="phone-portrait"] .col-timer {
  grid-column: 2;
  grid-row: 1;
  display: flex; /* enable centering */
  align-items: flex-end;
  justify-content: center;
  text-align: right;
  padding-right: 12px;
  font-size: 20px;
  align-self: center;
}

body[data-layout="phone-portrait"] .exposure-rating {
  font-size: clamp(8px, 2.5vw, 10px);
}

/* ============================================================
   GENERALIZED STORE SETTINGS
============================================================ */
#settings-modal {
  padding: 24px;
  box-sizing: border-box;
}

.settings-shell {
  width: min(980px, 100%);
  height: min(760px, 100%);
  max-height: calc(100dvh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.settings-header,
.settings-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid #29314b;
}

.settings-header h2 {
  margin: 2px 0 0;
}

.settings-eyebrow {
  font-weight: 800;
}

.settings-close {
  border: 1px solid #39435f;
  cursor: pointer;
}

.settings-layout {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
}

.settings-nav {
  border-right: 1px solid #29314b;
}

.settings-nav button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.settings-content {
  min-height: 0;
  overflow-y: auto;
}

.settings-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.settings-section-header h3 {
  margin: 0 0 5px;
}

.settings-section-header p,
.settings-help {
  margin: 0;
  line-height: 1.45;
}

.settings-card h4 {
  margin: 0 0 14px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.settings-field {
  display: flex;
  flex-direction: column;
  font-weight: 700;
}

.settings-field input,
.settings-field select,
.position-setting-row input,
.position-setting-row select {
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid #35405f;
  padding: 8px 10px;
}

.settings-field input[type="color"],
.position-setting-row input[type="color"] {
  padding: 4px;
}

.settings-secondary,
.settings-add-position,
.settings-tool-grid button {
  min-height: 42px;
  padding: 9px 13px;
  font-weight: 700;
  cursor: pointer;
}

.position-settings-list {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
}

.position-setting-row {
  display: grid;
  gap: 8px;
  align-items: center;
}

.position-drag {
  display: grid;
  place-items: center;
  font-weight: 800;
}

.position-delete {
  height: 42px;
  font-size: 24px;
  cursor: pointer;
}

.position-delete:disabled,
.settings-add-position:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.settings-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.settings-switch-row span {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-switch-row small {
  font-weight: 400;
}

.settings-permission-grid {
  display: grid;
  gap: 2px;
  margin-bottom: 4px;
}
.settings-permission-grid-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px 64px;
  align-items: center;
  gap: 12px;
  padding: 0 2px 6px;
  color: #91a2bb;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.settings-permission-grid-head span:not(:first-child) {
  text-align: center;
}
.settings-permission-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px 64px;
  align-items: center;
  gap: 12px;
  padding: 8px 2px;
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.settings-permission-row:first-of-type {
  border-top: 0;
}
.settings-permission-row input {
  justify-self: center;
  width: 22px;
  height: 22px;
}
.settings-permission-row input:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.settings-color-field input {
  width: 90px;
}

.settings-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.settings-footer {
  border-bottom: 0;
}

.settings-footer button {
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 700px) {
  #settings-modal {
    align-items: stretch;
    padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom));
  }

  .settings-shell {
    max-height: 100%;
  }

  .settings-header {
    padding: 12px 14px;
  }

  .settings-header h2 {
    font-size: 23px;
  }

  .settings-layout {
    display: flex;
    flex-direction: column;
  }

  .settings-nav {
    flex: 0 0 auto;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid #29314b;
  }

  .settings-nav button {
    width: auto;
    flex: 0 0 auto;
    margin: 0;
    font-size: 13px;
  }

  .settings-section-header {
    flex-direction: column;
    gap: 10px;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .position-setting-row select {
    grid-column: 2 / 5;
  }

  .settings-footer button {
    flex: 1;
    min-width: 0;
  }
}

/* Clean three-row thermometer layout */

@media (max-width: 700px) {
}

/* Tighter thermometer range with labels above and values below */

.thermometer-boundary {
  bottom: auto;
}

.thermometer-labels,
.thermometer-values {
  inset: 0;
}

.thermometer-labels span,
.thermometer-values span {
  text-align: center;
}

.thermometer-labels span {
  top: 0;
}

.thermometer-labels span.staggered {
  top: 13px;
}

.thermometer-values span {
  top: 68px;
}

.thermometer-values span.staggered {
  top: 82px;
}

@media (max-width: 700px) {
  .thermometer-labels span,
  .thermometer-values span {
    width: 74px;
    font-size: 9px;
  }
}

/* ============================================================
   VISUAL SETTINGS CONTROLS
============================================================ */
.settings-close svg {
  width: 18px;
  height: 18px;
  display: block;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  transform: translateY(2px);
}

.zone-thermometer {
  padding: 18px 12px 10px;
  border: 1px solid #3f4147;
  border-radius: 7px;
  background: #2b2d31;
}

.thermometer-scale {
  position: relative;
  margin: 0 10px;
}

.thermometer-scale::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: linear-gradient(90deg, #475db5 0%, #6259c7 25%, #2878c8 38%, #247847 52%, #b56f15 68%, #c65f25 82%, #c83f49 100%);
}

.thermometer-boundary {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 42px;
  margin: 0;
  appearance: none;
  background: transparent;
  pointer-events: none;
}

.thermometer-boundary::-webkit-slider-runnable-track {
  height: 14px;
  background: transparent;
}

.thermometer-boundary::-webkit-slider-thumb {
  width: 18px;
  height: 28px;
  margin-top: -7px;
  appearance: none;
  border: 3px solid #f2f3f5;
  border-radius: 5px;
  background: #1e1f22;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.48);
  cursor: ew-resize;
  pointer-events: auto;
}

.thermometer-boundary::-moz-range-track {
  height: 14px;
  background: transparent;
}

.thermometer-boundary::-moz-range-thumb {
  width: 14px;
  height: 24px;
  border: 3px solid #f2f3f5;
  border-radius: 5px;
  background: #1e1f22;
  cursor: ew-resize;
  pointer-events: auto;
}

.thermometer-endpoints {
  display: flex;
  justify-content: space-between;
  margin: -2px 8px 12px;
  color: #949ba4;
  font-size: 11px;
}

.thermometer-readouts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.thermometer-readouts span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 4px;
  background: #202225;
}

.thermometer-readouts strong {
  overflow: hidden;
  color: #b5bac1;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thermometer-readouts b {
  color: #f2f3f5;
  font-size: 11px;
}

.outside-time-groups > div > label {
  width: min(260px, calc(50% - 7px));
}

.outside-time-groups > div > .outside-time-minimum {
  justify-self: start;
}

.outside-time-groups > div > .outside-time-maximum {
  justify-self: end;
}

.outside-time-groups .time-pair label {
  width: auto;
}

.outside-time-groups .time-pair .outside-time-minimum {
  justify-self: stretch;
}

.outside-time-groups .time-pair .outside-time-maximum {
  justify-self: stretch;
}

.visual-color-picker {
  position: relative;
  width: 48px;
}

.color-picker-trigger {
  width: 44px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #4b4e55;
  border-radius: 6px;
  background: #1e1f22;
  cursor: pointer;
}

.color-picker-trigger > span {
  width: 24px;
  height: 24px;
  display: block;
  border: 2px solid rgba(255, 255, 255, 0.65);
  border-radius: 50%;
  background: var(--selected-color);
}

.color-swatch-popover {
  position: absolute;
  z-index: 40;
  top: calc(100% + 7px);
  left: 0;
  width: 218px;
  display: grid;
  grid-template-columns: repeat(6, 28px);
  gap: 7px;
  padding: 10px;
  border: 1px solid #4b4e55;
  border-radius: 7px;
  background: #1e1f22;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.48);
}

.color-swatch-popover.hidden {
  display: none;
}

.color-swatch {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--swatch);
  cursor: pointer;
  transition:
    transform 0.12s ease,
    border-color 0.12s ease;
}

.color-swatch:hover {
  border-color: #9ca5ff;
}

.color-swatch.selected {
  border-color: #fff;
  box-shadow: 0 0 0 2px #5865f2;
}

:root[data-theme="light"] .zone-thermometer {
  border-color: #d9dde3;
  background: #f2f3f5;
}

:root[data-theme="light"] .thermometer-scale::before {
  border-color: rgba(32, 36, 42, 0.18);
}

:root[data-theme="light"] .thermometer-boundary::-webkit-slider-thumb {
  border-color: #fff;
  background: #303640;
}

:root[data-theme="light"] .thermometer-boundary::-moz-range-thumb {
  border-color: #fff;
  background: #303640;
}

:root[data-theme="light"] .thermometer-readouts span {
  background: #fff;
}

:root[data-theme="light"] .thermometer-readouts strong {
  color: #5f6670;
}

:root[data-theme="light"] .thermometer-readouts b {
  color: #20242a;
}

:root[data-theme="light"] .color-picker-trigger,
:root[data-theme="light"] .color-swatch-popover {
  border-color: #c4ccd5;
  background: #fff;
}

:root[data-theme="light"] .color-picker-trigger > span {
  border-color: rgba(255, 255, 255, 0.85);
}

@media (max-width: 700px) {
  .thermometer-readouts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .outside-time-groups > div > label {
    width: 50%;
  }

  .outside-time-groups .time-pair label {
    width: 100%;
  }

  .color-swatch-popover {
    right: 0;
    left: auto;
  }
}

/* ============================================================
   SETTINGS REFINEMENT
============================================================ */
.settings-close {
  line-height: 1;
}

.settings-close > span {
  display: block;
  line-height: 1;
  transform: translateY(-1px);
}

.location-search-field {
  position: relative;
}

.location-search-results {
  position: absolute;
  z-index: 20;
  top: calc(100% - 10px);
  left: 0;
  right: 0;
  overflow: hidden;
  border: 1px solid #4b4e55;
  border-radius: 6px;
  background: #1e1f22;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.42);
}

.location-search-results.hidden {
  display: none;
}

.location-result {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  border: 0;
  border-bottom: 1px solid #35373c;
  background: transparent;
  color: #f2f3f5;
  text-align: left;
  cursor: pointer;
}

.location-result:last-child {
  border-bottom: 0;
}

.location-result:hover {
  background: #404249;
}

.location-result span {
  color: #949ba4;
  font-size: 12px;
}

.location-search-empty {
  padding: 12px;
  color: #949ba4;
  font-size: 13px;
}

.zone-boundary-list {
  overflow: hidden;
  border: 1px solid #3f4147;
  border-radius: 7px;
}

.zone-boundary-row,
.zone-boundary-derived {
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 16px;
  align-items: center;
  padding: 7px 12px;
  border-bottom: 1px solid #3f4147;
  background: #2b2d31;
}

.zone-boundary-row:nth-child(1) {
  box-shadow: inset 3px 0 #c83f49;
}
.zone-boundary-row:nth-child(2) {
  box-shadow: inset 3px 0 #c65f25;
}
.zone-boundary-row:nth-child(3) {
  box-shadow: inset 3px 0 #b56f15;
}
.zone-boundary-row:nth-child(4) {
  box-shadow: inset 3px 0 #247847;
}
.zone-boundary-row:nth-child(5) {
  box-shadow: inset 3px 0 #2878c8;
}
.zone-boundary-row:nth-child(6) {
  box-shadow: inset 3px 0 #6259c7;
}
.zone-boundary-derived {
  box-shadow: inset 3px 0 #475db5;
}

.zone-boundary-row > span:first-child,
.zone-boundary-derived > span {
  color: #dbdee1;
  font-size: 14px;
  font-weight: 700;
}

.zone-boundary-derived {
  border-bottom: 0;
}

.zone-boundary-derived strong {
  color: #949ba4;
  font-size: 11px;
  font-weight: 500;
  text-align: right;
}

.unit-input {
  position: relative;
  display: flex;
  align-items: center;
}

.unit-input input {
  width: 100%;
  height: 36px;
  padding: 7px 34px 7px 10px;
  border: 1px solid #1e1f22;
  border-radius: 4px;
  background: #1e1f22;
  color: #f2f3f5;
  font-size: 14px;
}

.unit-input b {
  position: absolute;
  right: 10px;
  color: #949ba4;
  font-size: 12px;
  pointer-events: none;
}

.outside-time-groups {
  overflow: hidden;
  border: 1px solid #3f4147;
  border-radius: 7px;
}

.outside-time-groups > div {
  min-height: 62px;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #3f4147;
  background: #2b2d31;
}

.outside-time-groups > div:last-child {
  border-bottom: 0;
}

.outside-time-groups > div > strong {
  color: #dbdee1;
  font-size: 14px;
}

.outside-time-groups label {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: #949ba4;
  font-size: 12px;
}

.time-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.position-setting-row {
  grid-template-columns: 32px minmax(110px, 1fr) 130px 145px 42px;
}

.role-color-select {
  padding-left: 34px !important;
  background:
    linear-gradient(var(--selected-color), var(--selected-color)) 9px center / 16px 16px no-repeat,
    #1e1f22 !important;
}

.settings-subsection-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.settings-subsection-title > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-subsection-title strong {
  color: #f2f3f5;
  font-size: 16px;
}

.settings-subsection-title small {
  color: #949ba4;
  font-size: 12px;
}

.leader-color-select {
  width: 180px;
}

:root[data-theme="light"] .location-search-results {
  border-color: #c4ccd5;
  background: #fff;
  box-shadow: 0 12px 28px rgba(40, 51, 65, 0.2);
}

:root[data-theme="light"] .location-result {
  border-color: #e0e4e9;
  color: #20242a;
}

:root[data-theme="light"] .location-result:hover {
  background: #e8eaed;
}

:root[data-theme="light"] .zone-boundary-list,
:root[data-theme="light"] .outside-time-groups {
  border-color: #d9dde3;
}

:root[data-theme="light"] .zone-boundary-row,
:root[data-theme="light"] .zone-boundary-derived,
:root[data-theme="light"] .outside-time-groups > div {
  border-color: #d9dde3;
  background: #f2f3f5;
}

:root[data-theme="light"] .zone-boundary-row > span:first-child,
:root[data-theme="light"] .zone-boundary-derived > span,
:root[data-theme="light"] .outside-time-groups > div > strong,
:root[data-theme="light"] .settings-subsection-title strong {
  color: #20242a;
}

:root[data-theme="light"] .unit-input input {
  border-color: #b9c1cb;
  background: #fff;
  color: #20242a;
}

:root[data-theme="light"] .role-color-select {
  background:
    linear-gradient(var(--selected-color), var(--selected-color)) 9px center / 16px 16px no-repeat,
    #fff !important;
}

@media (max-width: 700px) {
  .zone-boundary-row,
  .zone-boundary-derived {
    grid-template-columns: minmax(0, 1fr) 100px;
  }

  .outside-time-groups > div {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .time-pair {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .position-setting-row .role-color-select,
  .position-setting-row select[data-position-field="exposure"] {
    grid-column: 2 / 4;
  }
}
