/*
  2026-07-16: Starter styles replaced with the shortcut dashboard and editor layout.
  Prior 2026-07-16 logic:
  :root{font-family:system-ui,-apple-system,Segoe UI,Roboto,'Helvetica Neue',Arial}
  body{margin:0;background:#f7f7f8;color:#222;display:flex;min-height:100vh;align-items:center;justify-content:center}
  main{max-width:720px;padding:24px;background:#fff;border-radius:8px;box-shadow:0 6px 24px rgba(0,0,0,.06);text-align:center}
  button{padding:8px 14px;border-radius:6px;border:1px solid #ccc;background:#0078d4;color:#fff;cursor:pointer}
  #out{margin-top:12px;color:#333}
*/

:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-strong: #2c3e50;
  --editor-width: 440px;
  --text: #333333;
  --muted: #637083;
  --line: #d8e0e8;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --blue: #3498db;
  --red: #e74c3c;
  --yellow: #f39c12;
  --green: #2ecc71;
  --grey: #7f8c8d;
  --orange: #ff441a;
  --brown: #331c04;
  --xfw-green: #2b9540;
  --xfw-dark-blue: #003366;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* 2026-07-19: Let section scroll-margin own bookmark offsets so html and section offsets do not add together.
     Prior 2026-07-19 logic:
     scroll-padding-top: 150px; */
  scroll-padding-top: 0;
  /* 2026-07-16: Match the old bookmark-anchor offset so sticky bookmark rows do not cover target tiles.
     Prior 2026-07-16 logic:
     scroll-padding-top: 120px; */
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body.is-changing-page .weather-tile,
body.is-changing-page .shortcut-nav,
body.is-changing-page .dashboard {
  visibility: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-header {
  /* 2026-07-16: Removed the app-style sticky title bar; the legacy page starts with weather.
     Prior 2026-07-16 logic:
     position: sticky;
     top: 0;
     display: flex;
     align-items: center;
     justify-content: center;
     gap: 16px;
     padding: 14px clamp(12px, 3vw, 28px);
     background: rgba(243, 246, 248, 0.94);
     border-bottom: 1px solid var(--line);
     backdrop-filter: blur(14px);
     text-align: center; */
  position: fixed;
  /* 2026-07-16: Move local-only tools below the weather/bookmark stack so they do not pile onto weather controls while scrolling.
     Prior 2026-07-16 logic:
     top: 24px; */
  /* 2026-07-16: Weather is back to one row, so the local tools can sit closer to the top again.
     Prior 2026-07-16 logic:
     top: 320px; */
  top: 168px;
  right: 32px;
  z-index: 60;
  display: block;
  padding: 0;
  background: transparent;
  border: 0;
}

.app-header > div:first-child {
  display: none;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.1;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(24px, 4vw, 42px);
}

h2 {
  font-size: 22px;
}

.header-actions,
.editor-toolbar,
.form-actions,
.two-column {
  display: flex;
  gap: 10px;
}

.header-actions {
  align-items: center;
  /* 2026-07-16: Edit action is now the only visible header control.
     Prior 2026-07-16 logic:
     position: absolute;
     right: clamp(12px, 3vw, 28px); */
  position: static;
  flex-direction: column;
}

.editor-toolbar button,
.form-actions button,
.card-form button,
.card-form input,
.card-form select {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.icon-button,
.local-tool-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-strong);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  box-shadow: var(--shadow);
}

.icon-button i {
  font-size: 18px;
}

.icon-button.secondary {
  background: #eef3f7;
  color: var(--text);
}

.shortcut-nav {
  position: sticky;
  /* 2026-07-16: Section bookmark shortcuts sit directly below the header again.
     Prior 2026-07-16 logic:
     top: 165px; */
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  /* 2026-07-19: Top-align wrapped bookmark rows while keeping the shelf compact.
     Prior 2026-07-19 logic:
     align-items: center; */
  align-items: flex-start;
  align-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  /* 2026-07-16: Match the legacy bookmark wrapper by wrapping centered chips instead of creating a mobile scroller.
     Prior 2026-07-16 logic:
     overflow-x: auto; */
  overflow: visible;
  /* 2026-07-16: Recentered and restyled bookmark wrapper from the legacy #bookmarkWrapper pattern.
     Prior 2026-07-16 logic:
     padding: 16px clamp(18px, 3vw, 34px); */
  /* 2026-07-19: Tighten the bookmark shelf toward the old site's compact wrapper.
     Prior 2026-07-19 logic:
     padding: 15px 82px 25px; */
  padding: 12px 72px 14px;
  background: rgba(243, 246, 248, 0.96);
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  /* 2026-07-19: Let content set the nav height instead of reserving a tall fixed shelf.
     Prior 2026-07-19 logic:
     min-height: 86px; */
  min-height: 0;
  /* 2026-07-19: Reduce the static gap below the bookmark shelf.
     Prior 2026-07-19 logic:
     margin: 0 clamp(18px, 3vw, 34px) 25px; */
  margin: 0 clamp(18px, 3vw, 34px) 18px;
}

.weather-tile {
  /* 2026-07-16: Weather renders as one reserved-height row, with the icon provider picked by config.
     Prior 2026-07-16 logic:
     display: flex; */
  display: block;
  justify-content: center;
  /* 2026-07-16: Tightened weather spacing so it behaves like the legacy top widget.
     Prior 2026-07-16 logic:
     padding: 18px clamp(12px, 3vw, 34px) 0; */
  /* 2026-07-19: Match the original WeatherWidget.io strip more closely: a 98px widget plus light outer breathing room.
     Prior 2026-07-19 logic:
     padding: 18px clamp(18px, 3vw, 34px) 10px; */
  padding: 14px clamp(18px, 3vw, 34px) 8px;
  /* 2026-07-16: Reserve weather height up front so forecast/icon loading does not nudge scroll position.
     Prior 2026-07-16 logic:
     no fixed minimum height for the weather wrapper */
  /* 2026-07-19: Reserve the compact original-style strip height instead of the taller modern weather band.
     Prior 2026-07-19 logic:
     min-height: 156px; */
  min-height: 120px;
  overflow-anchor: none;
}

.weather-tile[hidden] {
  display: none;
}

.weather-comparison {
  /* 2026-07-16: Use a column flex stack because grid auto-placement still allowed provider cards to sit side-by-side in wide views.
     Prior 2026-07-16 logic:
     display: grid; */
  display: flex;
  flex-direction: column;
  /* 2026-07-16: Force icon-provider comparisons to render as rows, never side-by-side columns.
     Prior 2026-07-16 logic:
     gap: 10px; */
  /* 2026-07-16: Grid columns are no longer used after switching provider comparisons to flex rows.
     Prior 2026-07-16 logic:
     grid-template-columns: 1fr; */
  gap: 10px;
  width: 100%;
}

.weather-comparison-actions {
  grid-area: auto;
  flex-direction: row;
  align-self: flex-end;
  /* 2026-07-16: Flex stacking uses align-self instead of grid justify-self.
     Prior 2026-07-16 logic:
     justify-self: end; */
  padding: 0 0 2px;
}

.weather-comparison > .weather-card {
  flex: 0 0 auto;
  width: 100%;
}

.weather-card {
  display: flex;
  position: relative;
  align-items: center;
  justify-content: center;
  /* 2026-07-16: Reworked weather into a full-width, segmented forecast card closer to the original widget.
     Prior 2026-07-16 logic:
     gap: 18px;
     width: min(760px, 100%);
     min-height: 104px;
     padding: 14px 18px; */
  gap: 12px;
  /* 2026-07-16: Let weather span the available page width like the legacy widget.
     Prior 2026-07-16 logic:
     width: min(1540px, 100%); */
  width: 100%;
  /* 2026-07-16: Shorten each comparison row so two animated icon rows still feel like a top weather bar.
     Prior 2026-07-16 logic:
     min-height: 125px; */
  /* 2026-07-19: The original embedded widget rendered at 98px high.
     Prior 2026-07-19 logic:
     min-height: 112px; */
  min-height: 98px;
  height: 98px;
  padding: 0;
  border: 1px solid rgba(23, 32, 42, 0.08);
  border-radius: 10px;
  /* 2026-07-16: Use a clean light surface for transparent animated weather SVGs.
     Prior 2026-07-16 logic:
     background: var(--surface); */
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(23, 32, 42, 0.09);
  overflow: hidden;
}

.weather-link {
  /* 2026-07-16: Use proportional columns like the legacy widget: current weather is wider, days divide the rest.
     Prior 2026-07-16 logic:
     display: flex;
     align-items: stretch;
     flex-wrap: wrap; */
  display: grid;
  /* 2026-07-16: Restore one standard weather row with actions in the right column.
     Prior 2026-07-16 logic:
     grid-template-columns: minmax(360px, 2.5fr) minmax(520px, 5fr);
     grid-template-areas: "current days"; */
  /* 2026-07-16: Give current conditions a wider share and reserve room for the icon picker button.
     Prior 2026-07-16 logic:
     grid-template-columns: minmax(360px, 2.5fr) minmax(520px, 5fr) minmax(118px, 0.72fr); */
  /* 2026-07-16: Keep the right-side Edit Weather button visible at medium desktop widths by reducing oversized forecast minimums.
     Prior 2026-07-16 logic:
     grid-template-columns: minmax(460px, 2.9fr) minmax(520px, 5fr) minmax(148px, 0.62fr); */
  /* 2026-07-19: Give current conditions enough desktop width so the temp and label do not clip.
     Prior 2026-07-19 logic:
     grid-template-columns: minmax(340px, 2.65fr) minmax(360px, 5fr) minmax(132px, 0.48fr); */
  grid-template-columns: minmax(390px, 2.9fr) minmax(0, 5fr) minmax(132px, 0.48fr);
  grid-template-areas: "current days actions";
  flex: 1;
  height: 100%;
  min-width: 0;
  /* 2026-07-16: Weather controls now live in their own grid/control area instead of overlaying forecast cells.
     Prior 2026-07-16 logic:
     padding-right: 210px; */
  padding-right: 0;
}

.weather-current {
  /* 2026-07-16: Current weather now lays out like the legacy widget: place, icon, and temp side-by-side.
     Prior 2026-07-16 logic:
     display: grid;
     gap: 4px;
     align-content: center;
     justify-items: center;
     min-width: 240px;
     padding: 18px;
     text-align: center; */
  /* 2026-07-16: Use explicit current-weather columns so location, icon, and temperature do not squeeze each other.
     Prior 2026-07-16 logic:
     display: flex; */
  display: grid;
  grid-area: current;
  /* 2026-07-19: Reduce the internal minimums so the desktop current-weather row fits inside its grid area.
     Prior 2026-07-19 logic:
     grid-template-columns: minmax(145px, 1fr) 106px minmax(118px, 1fr); */
  /* 2026-07-19: Use tighter current-weather tracks inside the 98px legacy-height strip.
     Prior 2026-07-19 logic:
     grid-template-columns: minmax(118px, 1fr) 88px minmax(104px, 1fr); */
  grid-template-columns: minmax(118px, 1fr) 76px minmax(104px, 1fr);
  align-items: center;
  justify-content: stretch;
  justify-items: center;
  /* 2026-07-19: Tighten current weather spacing so the temperature text has room to breathe.
     Prior 2026-07-19 logic:
     gap: 28px; */
  /* 2026-07-19: Fit current weather comfortably into the original 98px strip height.
     Prior 2026-07-19 logic:
     gap: 18px; */
  gap: 14px;
  min-width: 0;
  /* 2026-07-19: Match the original compact weather widget proportions and avoid desktop clipping.
     Prior 2026-07-19 logic:
     padding: 22px 28px; */
  /* 2026-07-19: Reduce vertical padding for the original 98px weather widget height.
     Prior 2026-07-19 logic:
     padding: 18px 22px; */
  padding: 12px 22px;
  text-align: center;
  background: linear-gradient(135deg, #c6e5f7 0%, #ddeef8 35%, #edf6fb 65%, #f6fbff 100%);
  --weather-icon-bg: transparent;
}

.weather-label,
.weather-place,
.weather-provider-label {
  color: var(--muted);
  font-size: 15px;
  /* 2026-07-16: Weather labels should read like the original widget, not heavy dashboard headings.
     Prior 2026-07-16 logic:
     font-weight: 800; */
  font-weight: 600;
  letter-spacing: 0;
}

.weather-provider-label {
  min-width: 124px;
  color: var(--text);
  font-size: 12px;
  text-align: center;
  text-transform: uppercase;
}

.weather-place {
  /* 2026-07-16: Let the explicit current-weather grid control width instead of a hard minimum.
     Prior 2026-07-16 logic:
     min-width: 150px; */
  min-width: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.weather-current strong {
  display: block;
  /* 2026-07-19: Keep the current temp close to the original widget scale inside the 98px strip.
     Prior 2026-07-19 logic:
     font-size: 34px; */
  font-size: 31px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}

.weather-now-text {
  /* 2026-07-19: Let text use the available grid track instead of forcing overflow at desktop widths.
     Prior 2026-07-19 logic:
     min-width: 118px; */
  min-width: 0;
  text-align: center;
}

.weather-now-text span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

.weather-now-text small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.weather-days {
  /* 2026-07-16: Forecast days now divide the available forecast area evenly.
     Prior 2026-07-16 logic:
     display: flex;
     flex: 2 1 640px; */
  display: grid;
  grid-area: days;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  justify-content: center;
  gap: 0;
}

.weather-day {
  display: grid;
  justify-items: center;
  align-content: center;
  /* 2026-07-19: Reclaim vertical room so the temperature row has bottom padding inside the 98px strip.
     Prior 2026-07-19 logic:
     gap: 8px; */
  gap: 4px;
  min-width: 0;
  /* 2026-07-19: Forecast cells now fit the original 98px strip height.
     Prior 2026-07-19 logic:
     padding: 14px 18px; */
  /* 2026-07-19: Add bottom padding after increasing icon sizes so forecast temperatures do not clip.
     Prior 2026-07-19 logic:
     padding: 10px 14px; */
  padding: 8px 14px 12px;
  color: var(--muted);
  font-size: 12px;
  /* 2026-07-16: Replace the gray forecast cell with a pale sky tint so fill/flat/line icons read better.
     Prior 2026-07-16 logic:
     background: #f7f7f7;
     --weather-icon-bg: #f7f7f7; */
  background: #f6fbff;
  --weather-icon-bg: #f6fbff;
}

.weather-day:nth-child(even) {
  background: #ffffff;
  --weather-icon-bg: #ffffff;
}

.weather-day strong {
  color: #f24848;
  font-size: 14px;
  font-weight: 500;
}

.weather-day small {
  color: #2689d9;
  font-size: 13px;
  /* 2026-07-16: Keep lows blue without making the forecast row feel bold.
     Prior 2026-07-16 logic:
     font-weight: 700; */
  font-weight: 500;
}

.weather-temps {
  display: flex;
  align-items: center;
  /* 2026-07-16: Spread high/low temperatures toward the forecast-cell edges like the legacy strip.
     Prior 2026-07-16 logic:
     justify-content: center;
     gap: 28px; */
  justify-content: space-between;
  /* 2026-07-16: Pull high/low back in slightly after edge-to-edge spacing felt too wide.
     Prior 2026-07-16 logic:
     gap: 18px;
     width: 100%; */
  gap: 14px;
  width: min(92px, 100%);
}

.weather-icon {
  /* 2026-07-16: Real animated SVGs replace the temporary CSS-built weather symbols.
     Prior 2026-07-16 logic:
     position: relative;
     display: inline-block; */
  display: block;
  /* 2026-07-16: Make forecast weather icons about 25% larger for mobile scanning.
     Prior 2026-07-16 logic:
     width: 54px;
     height: 42px; */
  /* 2026-07-19: Bring forecast icons closer to the original widget's calmer sizing.
     Prior 2026-07-19 logic:
     width: 68px;
     height: 53px; */
  /* 2026-07-19: Forecast icons are scaled for the original 98px WeatherWidget.io strip.
     Prior 2026-07-19 logic:
     width: 58px;
     height: 46px; */
  /* 2026-07-19: Use one proportional icon frame for all providers so SVGs stay undistorted.
     Prior 2026-07-19 logic:
     width: 50px;
     height: 38px; */
  width: 52px;
  height: 39px;
  object-fit: contain;
}

.weather-now-icon {
  /* 2026-07-16: Scale the current-weather icon in step with the larger forecast icons.
     Prior 2026-07-16 logic:
     width: 76px;
     height: 58px; */
  /* 2026-07-19: Keep current weather prominent without crowding the location and temperature text.
     Prior 2026-07-19 logic:
     width: 95px;
     height: 73px; */
  /* 2026-07-19: Current icon fits the compact 98px weather strip.
     Prior 2026-07-19 logic:
     width: 78px;
     height: 60px; */
  /* 2026-07-19: Match the shared 4:3 icon frame at a larger current-weather size.
     Prior 2026-07-19 logic:
     width: 66px;
     height: 50px; */
  width: 68px;
  height: 51px;
}

.weather-svg-icon {
  flex: 0 0 auto;
}

.weather-icon-climacons-like {
  /* 2026-07-19: Inline Climacons-style SVGs use a square 100x100 viewBox, so keep them square.
     Prior 2026-07-19 logic:
     width: 52px;
     height: 39px; */
  /* 2026-07-19: Local WeatherWidget.io-style SVGs use a wider 4:3 viewBox, so keep their natural proportions.
     Prior 2026-07-19 logic:
     opacity: 0.92; */
  /* 2026-07-19: Reduce WeatherWidget.io-style icons so they do not crowd the 98px strip.
     Prior 2026-07-19 logic:
     width: 58px;
     height: 44px; */
  width: 46px;
  height: 46px;
  opacity: 0.92;
}

.weather-now-icon.weather-icon-climacons-like {
  /* 2026-07-19: Keep the current inline Climacons-style icon square so it is not distorted.
     Prior 2026-07-19 logic:
     width: 68px;
     height: 51px; */
  /* 2026-07-19: Keep the current icon proportional but closer to the old widget scale.
     Prior 2026-07-19 logic:
     width: 76px;
     height: 57px; */
  width: 62px;
  height: 62px;
}

.weather-inline-icon {
  flex: 0 0 auto;
}

.weather-widget-inline-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 6px;
}

.weather-widget-cloud-outline {
  stroke: #7b7f83;
}

.weather-widget-cloud-fill {
  fill: #f6fbff;
  stroke: #7b7f83;
}

.weather-widget-sun {
  animation: weather-widget-spin 10s linear infinite;
  stroke: #f59e0b;
  transform-box: fill-box;
  transform-origin: center;
}

.weather-widget-sun circle {
  fill: #f59e0b;
}

.weather-widget-rain {
  animation: weather-widget-rain 0.95s ease-in-out infinite;
  stroke: #2689d9;
}

.weather-widget-snow {
  animation: weather-widget-snow 1.8s ease-in-out infinite;
  stroke: #7b7f83;
}

.weather-widget-bolt {
  animation: weather-widget-flash 1.4s ease-in-out infinite;
  fill: #f59e0b;
  stroke: #f59e0b;
}

@keyframes weather-widget-rain {
  0% {
    opacity: 0.35;
    transform: translateY(-3px);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.35;
    transform: translateY(4px);
  }
}

@keyframes weather-widget-snow {
  0%,
  100% {
    opacity: 0.45;
    transform: translateY(-2px);
  }
  50% {
    opacity: 1;
    transform: translateY(3px);
  }
}

@keyframes weather-widget-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes weather-widget-flash {
  0%,
  100% {
    opacity: 0.55;
  }
  45%,
  55% {
    opacity: 1;
  }
}

.weather-icon-skycons {
  width: 46px;
  height: 46px;
}

.weather-now-icon.weather-icon-skycons {
  width: 62px;
  height: 62px;
}

.weather-sun,
.weather-cloud,
.weather-rain,
.weather-bolt,
.weather-snow {
  position: absolute;
  display: block;
}

.weather-sun {
  top: 2px;
  left: 16px;
  width: 28px;
  height: 28px;
  border: 4px solid #f39c12;
  border-radius: 50%;
  box-shadow:
    0 -14px 0 -10px #f39c12,
    0 14px 0 -10px #f39c12,
    14px 0 0 -10px #f39c12,
    -14px 0 0 -10px #f39c12,
    10px 10px 0 -10px #f39c12,
    -10px -10px 0 -10px #f39c12,
    10px -10px 0 -10px #f39c12,
    -10px 10px 0 -10px #f39c12;
}

.weather-cloud {
  left: 5px;
  bottom: 3px;
  width: 42px;
  height: 24px;
  border: 4px solid #7b7f83;
  border-top-color: transparent;
  border-radius: 18px;
}

.weather-cloud::before,
.weather-cloud::after {
  content: "";
  position: absolute;
  background: var(--weather-icon-bg, #ffffff);
  border: 4px solid #7b7f83;
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
}

.weather-cloud::before {
  left: 2px;
  top: -17px;
  width: 18px;
  height: 18px;
}

.weather-cloud::after {
  right: 2px;
  top: -22px;
  width: 24px;
  height: 24px;
}

.weather-rain {
  bottom: -9px;
  width: 6px;
  height: 14px;
  border-radius: 999px;
  background: #2689d9;
  transform: rotate(25deg);
}

.weather-rain-one {
  left: 16px;
}

.weather-rain-two {
  left: 27px;
}

.weather-rain-three {
  left: 38px;
}

.weather-bolt {
  left: 27px;
  bottom: -10px;
  width: 14px;
  height: 22px;
  background: #f39c12;
  clip-path: polygon(48% 0, 100% 0, 58% 43%, 92% 43%, 28% 100%, 44% 56%, 0 56%);
}

.weather-snow {
  left: 24px;
  bottom: -15px;
  color: #2689d9;
  font-size: 24px;
  font-weight: 800;
}

.weather-clear .weather-cloud,
.weather-clear .weather-rain,
.weather-clear .weather-bolt,
.weather-clear .weather-snow,
.weather-partly .weather-rain,
.weather-partly .weather-bolt,
.weather-partly .weather-snow,
.weather-cloudy .weather-sun,
.weather-cloudy .weather-rain,
.weather-cloudy .weather-bolt,
.weather-cloudy .weather-snow,
.weather-rainy .weather-sun,
.weather-rainy .weather-bolt,
.weather-rainy .weather-snow,
.weather-thunder .weather-sun,
.weather-thunder .weather-rain,
.weather-thunder .weather-snow,
.weather-snowy .weather-sun,
.weather-snowy .weather-rain,
.weather-snowy .weather-bolt {
  display: none;
}

.weather-location-button {
  align-self: center;
  margin-right: 14px;
  width: 128px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 750;
  white-space: nowrap;
}

.weather-actions {
  /* 2026-07-16: Stack weather controls in a reserved area so they do not overlap weather tiles.
     Prior 2026-07-16 logic:
     display: flex;
     position: absolute;
     top: 12px;
     right: 86px; */
  display: flex;
  grid-area: actions;
  flex-direction: column;
  align-items: center;
  /* 2026-07-16: Pin the single Edit Weather control near the top of the weather strip instead of floating in the vertical middle.
     Prior 2026-07-16 logic:
     justify-content: center; */
  justify-content: flex-start;
  gap: 8px;
  /* 2026-07-16: One compact settings button replaces stacked Set/Detect/Icon controls.
     Prior 2026-07-16 logic:
     padding: 12px; */
  /* 2026-07-16: Add a little top breathing room while keeping the action column compact.
     Prior 2026-07-16 logic:
     padding: 8px; */
  padding: 14px 8px 8px;
}

.weather-actions .weather-location-button {
  margin-right: 0;
}

.weather-settings-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  /* 2026-07-16: Widen the single weather settings button now that it explicitly says Edit Weather.
     Prior 2026-07-16 logic:
     min-width: 112px; */
  min-width: 118px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(23, 32, 42, 0.08);
}

.weather-settings-pill i {
  color: #f39c12;
}

.weather-settings-button {
  display: none;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #ffffff;
  color: var(--muted);
  font-size: 17px;
  box-shadow: var(--shadow);
}

.weather-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(23, 32, 42, 0.28);
}

.weather-dialog::backdrop {
  background: rgba(23, 32, 42, 0.42);
}

.weather-dialog-form {
  display: grid;
  gap: 14px;
  padding: 24px;
}

.weather-dialog-caption {
  margin: 0;
}

.weather-dialog-title,
.weather-dialog-description {
  margin: 0;
}

.weather-dialog-title {
  font-size: 24px;
}

.weather-dialog-description {
  color: var(--muted);
  font-size: 14px;
}

.weather-dialog-options {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.weather-dialog-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  cursor: pointer;
}

.weather-dialog-option input {
  margin: 3px 0 0;
}

.weather-dialog-option-copy {
  display: grid;
  gap: 4px;
}

.weather-dialog-option-copy strong {
  font-size: 14px;
}

.weather-dialog-option-copy small {
  color: var(--muted);
  font-size: 12px;
}

.weather-dialog-text-field {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.weather-dialog-text-field span {
  font-size: 14px;
  font-weight: 700;
}

.weather-dialog-text-field input {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  font-size: 18px;
}

.weather-dialog-text-field small {
  color: var(--muted);
  font-size: 12px;
}

.weather-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.weather-dialog-button {
  min-width: 110px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--text);
  color: #ffffff;
  font-weight: 600;
}

.weather-dialog-button.secondary {
  background: #ffffff;
  color: var(--text);
}

/* The deploy workflow reuses the weather dialog's visual language while allowing
   enough room for project, folder, credential, and remediation controls. */
.deploy-dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.deploy-modal {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(23, 32, 42, 0.28);
}

.deploy-modal::backdrop {
  background: rgba(23, 32, 42, 0.42);
}

.deploy-dialog-form {
  display: grid;
  gap: 14px;
  padding: 24px;
}

.deploy-dialog-caption,
.deploy-dialog-title,
.deploy-dialog-description {
  margin: 0;
}

.deploy-dialog-title {
  font-size: 24px;
}

.deploy-dialog-description {
  color: var(--muted);
  font-size: 14px;
}

.deploy-dialog-options {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.deploy-dialog-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.deploy-dialog-option input {
  margin: 3px 0 0;
}

.deploy-dialog-option-copy {
  display: grid;
  gap: 4px;
}

.deploy-dialog-option-copy strong {
  font-size: 14px;
}

.deploy-dialog-option-copy small {
  color: var(--muted);
  font-size: 12px;
}

.deploy-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.deploy-dialog-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--text);
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
}

.deploy-dialog-button.secondary {
  background: #ffffff;
  color: var(--text);
}

.deploy-fields,
.deploy-status,
.deploy-file-actions {
  display: grid;
  gap: 10px;
}

.deploy-field {
  display: grid;
  gap: 6px;
}

.deploy-field > span {
  font-size: 14px;
  font-weight: 700;
}

.deploy-field input,
.deploy-field select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: #ffffff;
  font: inherit;
}

.deploy-help,
.deploy-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.deploy-token-link {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-self: start;
  margin-top: 2px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.deploy-token-link:hover,
.deploy-token-link:focus-visible {
  text-decoration: underline;
}

.deploy-status {
  padding: 12px;
  border-radius: 10px;
  background: #f3f6f8;
}

.deploy-status.is-success {
  color: #155b37;
  background: #e8f7ee;
}

.deploy-status.is-deployed {
  gap: 12px;
  color: #155b37;
  background: #e8f7ee;
}

.deploy-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.deploy-result-actions a {
  display: inline-flex;
  padding: 8px 12px;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}

.deploy-result-actions a:hover,
.deploy-result-actions a:focus-visible {
  background: rgba(21, 91, 55, 0.08);
}

.deploy-status.is-error {
  color: #8a2432;
  background: #fff0f2;
}

.deploy-status.is-warning {
  color: #6f4b00;
  background: #fff5d8;
}

.deploy-file-actions {
  /* 2026-07-21: Center the two remaining settings-file actions as one compact group.
     Prior 2026-07-21 logic:
     grid-template-columns: repeat(3, minmax(0, 1fr)); */
  grid-template-columns: repeat(2, minmax(0, 180px));
  justify-content: center;
}

.deploy-file-input {
  display: none;
}

@media (max-width: 560px) {
  .deploy-file-actions {
    grid-template-columns: 1fr;
  }

  .deploy-dialog .deploy-dialog-actions {
    flex-wrap: wrap;
  }
}

.weather-spin {
  animation: weather-spin 11s linear infinite;
}

.weather-loading-spinner {
  display: block;
  width: 32px;
  height: 32px;
  margin: 0 auto;
  border: 3px solid rgba(23, 32, 42, 0.12);
  border-top-color: var(--muted);
  border-radius: 50%;
  animation: weather-spin 0.8s linear infinite;
}

.weather-drift {
  animation: weather-drift 3.6s ease-in-out infinite;
}

.weather-bounce {
  animation: weather-bounce 1.9s ease-in-out infinite;
}

.weather-flash {
  animation: weather-flash 1.3s ease-in-out infinite;
}

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

@keyframes weather-drift {
  0%,
  100% {
    transform: translateX(-2px);
  }
  50% {
    transform: translateX(3px);
  }
}

@keyframes weather-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(3px);
  }
}

@keyframes weather-flash {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

.shortcut-nav a,
.weather-nav-button {
  flex: 0 0 auto;
  /* 2026-07-16: Restored legacy bookmark pill sizing/weight.
     Prior 2026-07-16 logic:
     padding: 7px 12px; */
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(23, 32, 42, 0.08);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.weather-nav-button {
  /* 2026-07-16: Desktop already has weather controls in the weather strip, so this chip is mobile-only.
     Prior 2026-07-16 logic:
     display: inline-flex; */
  display: none;
  align-items: center;
  gap: 8px;
}

.weather-nav-button i {
  color: #f39c12;
}

.shortcut-nav a:hover,
.weather-nav-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.hosted-link {
  /* 2026-07-16: Hosted-site icon moved from bookmark bar into the local tools group.
     Prior 2026-07-16 logic:
     position: absolute;
     right: 18px;
     top: 50%;
     transform: translateY(-50%); */
  padding: 0;
  text-decoration: none;
}

.hosted-link i {
  font-size: 24px;
}

.dashboard {
  /* 2026-07-16: Center rows like the original flex tile layout.
     Prior 2026-07-16 logic:
     display: grid; */
  display: flex;
  flex-direction: column;
  gap: 30px;
  /* 2026-07-16: Use the full page width so a single data row can wrap like the legacy layout.
     Prior 2026-07-16 logic:
     width: min(1480px, 100%); */
  width: 100%;
  margin: 0 auto;
  /* 2026-07-16: Reduced top gap so tiles begin closer to the bookmark bar like the legacy page.
     Prior 2026-07-16 logic:
     padding: 24px clamp(12px, 3vw, 34px) 80px; */
  padding: 18px clamp(18px, 3vw, 34px) 80px;
}

.section {
  display: grid;
  gap: 14px;
  justify-items: center;
  position: relative;
  /* 2026-07-16: Replaces the legacy hidden anchor with negative margin/padding used for sticky bookmark jumps.
     Prior 2026-07-16 logic:
     no section scroll offset */
  /* 2026-07-19: Use the measured bookmark nav height instead of a hardcoded value.
     Prior 2026-07-19 logic:
     scroll-margin-top: 150px; */
  scroll-margin-top: var(--bookmark-offset, 96px);
  padding-top: 25px;
}

.section-title {
  /* 2026-07-16: Hide in-page bookmark labels during normal browsing; the legacy site only showed them as top bookmark chips.
     Prior 2026-07-16 logic:
     display: block; */
  display: none;
  min-height: 24px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  text-align: center;
}

.tile-grid {
  /* 2026-07-16: Return tiles to centered wrapping rows instead of stretch-to-fill columns.
     Prior 2026-07-16 logic:
     display: grid;
     grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
     gap: 14px; */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 20px;
  width: 100%;
}

.card {
  display: grid;
  grid-template-rows: auto 1fr;
  /* 2026-07-16: Keep the legacy tile minimum while allowing data-driven widths to make a tile wider.
     Prior 2026-07-16 logic:
     width: var(--card-width, 165px);
     min-height: 170px; */
  width: var(--card-width, auto);
  min-width: 160px;
  /* 2026-07-16: Legacy card height comes from the header plus card-main minimums.
     Prior 2026-07-16 logic:
     min-height: 170px; */
  overflow: hidden;
  border: 1px solid rgba(23, 32, 42, 0.08);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 4px 14px rgba(23, 32, 42, 0.09);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

body.is-editing {
  /* 2026-07-16: Reserve room for the fixed editor pane so tiles shift left instead of sitting underneath it.
     Prior 2026-07-16 logic:
     no right-side page reservation for the editor pane */
  padding-right: var(--editor-width);
  background:
    linear-gradient(rgba(36, 119, 184, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 119, 184, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: 22px 22px;
}

body.is-editing .dashboard {
  padding-left: clamp(76px, 9vw, 130px);
}

body.is-editing .app-header {
  right: calc(var(--editor-width) + 32px);
}

body.is-editing .section {
  min-height: 190px;
  padding: 16px 12px 16px 22px;
  border-left: 4px solid var(--theme, var(--blue));
  background: rgba(255, 255, 255, 0.42);
  outline: 1px dashed rgba(23, 32, 42, 0.14);
  outline-offset: -1px;
}

body.is-editing .section::before {
  content: attr(data-section-name);
  position: absolute;
  top: 50%;
  left: clamp(-112px, -8vw, -72px);
  display: grid;
  place-items: center;
  width: 94px;
  min-height: 42px;
  padding: 8px;
  border: 1px solid rgba(23, 32, 42, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  color: var(--theme, var(--blue));
  font-size: 11px;
  font-weight: 850;
  line-height: 1.15;
  overflow-wrap: anywhere;
  text-align: center;
  text-transform: uppercase;
  transform: translateY(-50%);
  box-shadow: 0 3px 12px rgba(23, 32, 42, 0.08);
}

body.is-editing .section.is-selected-row {
  background: rgba(255, 255, 255, 0.72);
  outline: 2px solid var(--theme, var(--blue));
}

body.is-editing .card {
  cursor: pointer;
}

body.is-editing .card.is-selected-card {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
  box-shadow: 0 10px 24px rgba(214, 146, 32, 0.22);
}

.card:hover,
.card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  outline: none;
}

.card-header {
  display: grid;
  align-items: center;
  min-height: 44px;
  /* 2026-07-16: Match the legacy modern card header padding and weight.
     Prior 2026-07-16 logic:
     padding: 10px 12px; */
  padding: 12px;
  background: var(--surface-strong);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

.card-main {
  /* 2026-07-16: Match legacy card-main flex centering/padding.
     Prior 2026-07-16 logic:
     display: grid;
     align-content: center;
     justify-items: center;
     padding: 18px 12px; */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  /* 2026-07-16: Restore the original card-main minimum height from the legacy stylesheet.
     Prior 2026-07-16 logic:
     min-height: 118px; */
  min-height: 120px;
  padding: 20px;
}

.card-main img {
  /* 2026-07-16: Respect wider logo cards and explicit icon dimensions from the data file.
     Prior 2026-07-16 logic:
     max-width: min(170px, 100%);
     max-height: 84px; */
  max-width: min(calc(var(--card-width, 165px) - 24px), 100%);
  max-height: 110px;
  object-fit: contain;
}

.card.is-natural-logo .card-main img {
  /* 2026-07-16: Height-only image logos should keep their natural aspect ratio like the old renderer.
     Prior 2026-07-16 logic:
     max-width: min(calc(var(--card-width, 165px) - 24px), 100%); */
  max-width: none;
}

.card.is-featured-logo .card-main {
  padding: 14px;
}

.card.is-featured-logo .card-main img,
.card.is-featured-logo .card-main img[style*="height"] {
  max-height: 90px;
}

.card-main img[style*="height"] {
  max-height: none;
}

.fa-icon-wrapper {
  display: grid;
  place-items: center;
  min-height: 54px;
  color: var(--surface-strong);
  font-size: 40px;
}

/* Consolidated legacy brand icon colors from the old page-specific styles. */
.fa-facebook,
.fa-facebook-square {
  color: #3b5998 !important;
}

.fa-twitter,
.fa-twitter-square {
  color: #00aced !important;
}

.fa-google-plus,
.fa-google-plus-square {
  color: #dd4b39 !important;
}

.fa-youtube,
.fa-youtube-play,
.fa-youtube-square {
  color: #bb0000 !important;
}

.fa-tumblr,
.fa-tumblr-square {
  color: #32506d !important;
}

.fa-vine {
  color: #00bf8f !important;
}

.fa-flickr {
  color: #ff0084 !important;
}

.fa-vimeo-square {
  color: #aad450 !important;
}

.fa-pinterest,
.fa-pinterest-square {
  color: #cb2027 !important;
}

.fa-linkedin,
.fa-linkedin-square {
  color: #007bb6 !important;
}

.fa-instagram {
  color: #517fa4 !important;
}

.fa-spotify {
  color: #1ed760 !important;
}

.fa-football-ball {
  color: #643718 !important;
}

.fa-reddit {
  color: #ff4500 !important;
}

.fa-piggy-bank {
  color: #e78191 !important;
}

.fa-twitch {
  color: #6441a5 !important;
}

.fa-newspaper {
  color: #000000 !important;
}

.main-description {
  min-height: 18px;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
  text-align: center;
}

.main-description:empty {
  display: none;
}

/*
  2026-07-21: Theme variables now live only on the element carrying the color class.
  This prevents a section descendant selector from overwriting an explicit card color.
  Prior 2026-07-21 selectors:
  .blue, .blue .card-header, .shortcut-nav a.blue
  .red, .red .card-header, .shortcut-nav a.red
  .yellow, .yellow .card-header, .shortcut-nav a.yellow
  .green, .green .card-header, .shortcut-nav a.green
  .grey, .grey .card-header, .shortcut-nav a.grey
  .orange, .orange .card-header, .shortcut-nav a.orange
  .brown, .brown .card-header, .shortcut-nav a.brown
  .xfwg, .xfwg .card-header, .shortcut-nav a.xfwg
  .xfwb, .xfwb .card-header, .shortcut-nav a.xfwb
*/
.blue,
.shortcut-nav a.blue {
  --theme: var(--blue);
}

.red,
.shortcut-nav a.red {
  --theme: var(--red);
}

.yellow,
.shortcut-nav a.yellow {
  --theme: var(--yellow);
}

.green,
.shortcut-nav a.green {
  --theme: var(--green);
}

.grey,
.shortcut-nav a.grey {
  --theme: var(--grey);
}

.orange,
.shortcut-nav a.orange {
  --theme: var(--orange);
}

.brown,
.shortcut-nav a.brown {
  --theme: var(--brown);
}

.xfwg,
.shortcut-nav a.xfwg {
  --theme: var(--xfw-green);
}

.xfwb,
.shortcut-nav a.xfwb {
  --theme: var(--xfw-dark-blue);
}

.section.blue .card-header,
.section.red .card-header,
.section.yellow .card-header,
.section.green .card-header,
.section.grey .card-header,
.section.orange .card-header,
.section.brown .card-header,
.section.xfwg .card-header,
.section.xfwb .card-header,
.card.blue .card-header,
.card.red .card-header,
.card.yellow .card-header,
.card.green .card-header,
.card.grey .card-header,
.card.orange .card-header,
.card.brown .card-header,
.shortcut-nav a.blue,
.shortcut-nav a.red,
.shortcut-nav a.yellow,
.shortcut-nav a.green,
.shortcut-nav a.grey,
.shortcut-nav a.orange,
.shortcut-nav a.brown,
.shortcut-nav a.xfwg,
.shortcut-nav a.xfwb {
  background: var(--theme);
  color: #fff;
}

.card.blue .fa-icon-wrapper,
.card.red .fa-icon-wrapper,
.card.yellow .fa-icon-wrapper,
.card.green .fa-icon-wrapper,
.card.grey .fa-icon-wrapper,
.card.orange .fa-icon-wrapper,
.card.brown .fa-icon-wrapper,
.card.blue .main-description,
.card.red .main-description,
.card.yellow .main-description,
.card.green .main-description,
.card.grey .main-description,
.card.orange .main-description,
.card.brown .main-description {
  color: var(--theme);
}

.editor-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 40;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 14px;
  width: min(440px, 100vw);
  height: 100vh;
  padding: 18px;
  overflow-y: auto;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 40px rgba(23, 32, 42, 0.18);
}

.editor-panel[hidden] {
  display: none;
}

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.editor-toolbar {
  flex-wrap: wrap;
}

.editor-toolbar button,
.form-actions button,
.card-form button {
  padding: 9px 12px;
  background: var(--surface-strong);
  color: #fff;
  border-color: var(--surface-strong);
  font-weight: 700;
}

.form-actions button {
  flex: 1 1 0;
  background: #eef3f7;
  color: var(--text);
  border-color: var(--line);
}

.form-actions .danger {
  color: #b82924;
}

.status-text {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.card-form {
  display: grid;
  gap: 13px;
}

.editor-group {
  --group-accent: #7f8c8d;
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 14px 13px 15px;
  background: #f8fafc;
  border: 1px solid #d5dee7;
  border-left: 5px solid var(--group-accent);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(44, 62, 80, 0.06);
}

.editor-group legend {
  padding: 3px 9px;
  background: var(--group-accent);
  color: #fff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.editor-group-page {
  --group-accent: #607d8b;
  background: #f5f8fa;
}

.editor-group-section {
  --group-accent: #287eb8;
  background: #f1f8fc;
}

.editor-group-card {
  --group-accent: #2b8a57;
  background: #f2faf6;
}

.editor-group-appearance {
  --group-accent: #7455a6;
  background: #f8f5fc;
}

.card-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.card-form input,
.card-form select {
  width: 100%;
  padding: 10px 11px;
  background: #fbfcfd;
  color: var(--text);
}

.two-column {
  align-items: end;
}

.two-column > * {
  flex: 1;
}

.back-to-top {
  position: fixed;
  /* 2026-07-16: Match the legacy to-top button placement and size.
     Prior 2026-07-16 logic:
     right: 18px;
     bottom: 18px; */
  right: 30px;
  bottom: 20px;
  /* 2026-07-16: Restored original-style arrow plus TOP label.
     Prior 2026-07-16 logic:
     display: grid;
     place-items: center; */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* 2026-07-16: Original button was a 50px circle.
     Prior 2026-07-16 logic:
     width: 48px;
     height: 48px; */
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 18px;
  z-index: 99;
  cursor: pointer;
  /* 2026-07-16: Hide until the page has actually been scrolled.
     Prior 2026-07-16 logic:
     opacity: 0.82; */
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease-in, transform 0.2s ease-in, background-color 0.2s ease-in;
}

.back-to-top.is-visible {
  opacity: 0.82;
  pointer-events: auto;
  transform: none;
}

.back-to-top span {
  /* 2026-07-16: Soften the TOP label to match the original instead of the newer heavy label.
     Prior 2026-07-16 logic:
     font-size: 11px;
     font-weight: 800; */
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
}

.back-to-top:hover,
.back-to-top:focus-visible {
  opacity: 1;
  transform: translateY(-3px);
}

.is-hidden {
  display: none !important;
}

.scroll-debug-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  color: #111827;
  font: 12px/1.3 Consolas, "Courier New", monospace;
}

.scroll-debug-ruler {
  position: absolute;
  top: 0;
  right: 0;
  width: 58px;
  height: 100vh;
  border-left: 1px solid rgba(17, 24, 39, 0.35);
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(17, 24, 39, 0.9) 0 1px,
      transparent 1px 10px
    ),
    repeating-linear-gradient(
      to bottom,
      rgba(17, 24, 39, 0.25) 0 1px,
      rgba(255, 255, 255, 0.82) 1px 50px
    );
  opacity: 0.9;
}

.scroll-debug-line {
  position: absolute;
  right: 0;
  left: 0;
  height: 0;
  border-top: 3px solid;
}

.scroll-debug-line-nav {
  border-color: #2563eb;
}

.scroll-debug-line-target {
  border-color: #dc2626;
}

.scroll-debug-readout {
  position: absolute;
  top: 8px;
  right: 66px;
  max-width: min(680px, calc(100vw - 86px));
  padding: 8px 10px;
  border: 1px solid rgba(17, 24, 39, 0.35);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 18px rgba(17, 24, 39, 0.18);
  white-space: normal;
}

.weather-debug-panel {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 1001;
  width: min(420px, calc(100vw - 24px));
  max-height: 38vh;
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(42, 63, 82, 0.25);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 24px rgba(20, 36, 50, 0.18);
  color: #1f2d3a;
  font: 12px/1.4 Consolas, "Courier New", monospace;
}

.weather-debug-panel strong {
  display: block;
  margin-bottom: 6px;
}

.weather-debug-summary {
  margin-bottom: 8px;
  color: #2a3f52;
}

.weather-debug-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

.weather-debug-list li {
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(42, 63, 82, 0.12);
}

.weather-debug-list span,
.weather-debug-list code {
  display: block;
}

.weather-debug-list code {
  margin-top: 2px;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 720px) {
  body.is-editing {
    padding-right: 0;
  }

  .app-header {
    /* 2026-07-16: Keep the local edit icon floating instead of reserving mobile header space.
       Prior 2026-07-16 logic:
       align-items: center;
       min-height: 84px; */
    /* 2026-07-16: Keep local-only tools below the compact weather/header controls on narrow file previews.
       Prior 2026-07-16 logic:
       top: 10px; */
    /* 2026-07-16: Weather is back to one row on narrow screens too.
       Prior 2026-07-16 logic:
       top: 320px; */
    /* 2026-07-16: On phones, keep local-only tools near the bookmark card instead of over the weather strip.
       Prior 2026-07-16 logic:
       top: 148px; */
    top: 318px;
    right: 10px;
  }

  .header-actions {
    width: auto;
  }

  .page-nav {
    top: 84px;
    justify-content: flex-start;
  }

  .page-link {
    width: 78px;
    min-height: 64px;
  }

  .shortcut-nav {
    /* 2026-07-16: Section bookmarks no longer need to sit below a mobile page icon strip.
       Prior 2026-07-16 logic:
       top: 162px; */
    /* 2026-07-16: App header is no longer in page flow, so the bookmark bar sticks to the top.
       Prior 2026-07-16 logic:
       top: 84px; */
    top: 0;
    /* 2026-07-16: Restore legacy mobile bookmark behavior: centered wrapped chips, no horizontal clipping.
       Prior 2026-07-16 logic:
       justify-content: flex-start;
       padding: 12px 74px 18px 14px;
       margin: 0 10px 18px; */
    justify-content: center;
    align-items: flex-start;
    align-content: flex-start;
    gap: 12px;
    overflow: visible;
    /* 2026-07-19: Tighten mobile bookmark padding while preserving room for local tools.
       Prior 2026-07-19 logic:
       padding: 22px 58px 26px 18px; */
    padding: 14px 58px 16px 18px;
    /* 2026-07-19: Reduce the mobile gap below the bookmark shelf.
       Prior 2026-07-19 logic:
       margin: 0 16px 32px; */
    margin: 0 16px 20px;
  }

  .section {
    /* 2026-07-16: Mobile bookmark chips wrap taller, so anchor jumps need a larger sticky-menu offset.
       Prior 2026-07-16 logic:
       scroll-margin-top: 150px; */
    /* 2026-07-19: Use the measured bookmark nav height instead of a hardcoded mobile value.
       Prior 2026-07-19 logic:
       scroll-margin-top: 230px; */
    scroll-margin-top: var(--bookmark-offset, 140px);
  }

  .weather-nav-button {
    /* 2026-07-16: Show the weather settings chip only on mobile, where weather-card controls are hidden.
       Prior 2026-07-16 logic:
       display: none; */
    display: inline-flex;
  }

  .weather-card {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    /* 2026-07-19: Desktop uses the original 98px widget height, but mobile stacks current/days and needs natural height.
       Prior 2026-07-19 logic:
       inherited height: 98px; */
    height: auto;
  }

  .weather-link {
    grid-template-columns: 1fr;
    /* 2026-07-16: Hide detailed weather controls behind one compact settings button on mobile so the strip stays forecast-first.
       Prior 2026-07-16 logic:
       grid-template-areas:
         "current"
         "actions"
         "days"; */
    grid-template-areas:
      "current"
      "days";
    padding-right: 0;
  }

  .weather-current {
    /* 2026-07-16: Keep the mobile current-weather row close to the original three-part strip.
       Prior 2026-07-16 logic:
       grid-template-columns: minmax(96px, 1fr) 84px minmax(96px, 1fr); */
    grid-template-columns: minmax(128px, 1fr) 78px minmax(104px, 1fr);
    min-width: 0;
    gap: 10px;
    padding: 18px 22px 14px;
  }

  .weather-place {
    min-width: 0;
    text-align: center;
  }

  .weather-days {
    /* 2026-07-16: Fit all five forecast days on phone widths like the old weather widget.
       Prior 2026-07-16 logic:
       overflow-x: auto;
       justify-content: flex-start;
       grid-template-columns: repeat(5, minmax(120px, 1fr)); */
    overflow: visible;
    justify-content: stretch;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .weather-actions {
    /* 2026-07-16: Mobile weather settings moved to the bookmark row, so nothing overlays the forecast card.
       Prior 2026-07-16 logic:
       position: absolute;
       top: 10px;
       right: 10px;
       z-index: 2;
       padding: 0; */
    display: none;
  }

  .weather-location-button {
    display: none;
  }

  .weather-settings-button {
    /* 2026-07-16: Replaced the over-card mobile gear with the bookmark-row weather chip.
       Prior 2026-07-16 logic:
       display: grid; */
    display: none;
  }

  .weather-day {
    gap: 5px;
    padding: 12px 4px 10px;
    font-size: 13px;
  }

  .weather-icon {
    /* 2026-07-19: Keep mobile provider icons in the same undistorted 4:3 frame.
       Prior 2026-07-19 logic:
       width: 42px;
       height: 34px; */
    width: 44px;
    height: 33px;
  }

  .weather-icon-climacons-like {
    /* 2026-07-19: Keep mobile inline Climacons-style icons square so they are not distorted.
       Prior 2026-07-19 logic:
       width: 44px;
       height: 33px; */
    /* 2026-07-19: Keep mobile WeatherWidget.io-style forecast icons compact and proportional.
       Prior 2026-07-19 logic:
       width: 48px;
       height: 36px; */
    width: 40px;
    height: 40px;
  }

  .weather-now-icon {
    /* 2026-07-19: Keep mobile current icons proportional across providers.
       Prior 2026-07-19 logic:
       width: 76px;
       height: 58px; */
    width: 64px;
    height: 48px;
  }

  .weather-now-icon.weather-icon-climacons-like {
    /* 2026-07-19: Keep the mobile current inline Climacons-style icon square.
       Prior 2026-07-19 logic:
       width: 64px;
       height: 48px; */
    /* 2026-07-19: Keep the mobile current icon proportional without overpowering the row.
       Prior 2026-07-19 logic:
       width: 72px;
       height: 54px; */
    width: 56px;
    height: 56px;
  }

  .weather-icon-skycons {
    width: 40px;
    height: 40px;
  }

  .weather-now-icon.weather-icon-skycons {
    width: 56px;
    height: 56px;
  }

  .weather-current strong {
    /* 2026-07-16: Mobile current temperature should sit with the town/theme text instead of overpowering the strip.
       Prior 2026-07-16 logic:
       font-size: 34px; */
    color: var(--muted);
    font-size: 30px;
    /* 2026-07-16: Match the lighter weather typography used in the original mobile widget.
       Prior 2026-07-16 logic:
       font-weight: 600; */
    font-weight: 400;
  }

  .weather-now-text span {
    font-size: 14px;
  }

  .weather-now-text small {
    font-size: 12px;
  }

  .weather-temps {
    /* 2026-07-16: Keep mobile highs/lows on one row and separated like the legacy widget.
       Prior 2026-07-16 logic:
       flex-direction: column;
       gap: 2px; */
    flex-direction: row;
    gap: 6px;
    justify-content: space-between;
    width: min(72px, 100%);
  }

  .weather-day strong {
    /* 2026-07-16: Tone down mobile forecast temperatures so they read like the legacy widget instead of oversized badges.
       Prior 2026-07-16 logic:
       font-size: 18px; */
    color: #f24848;
    font-size: 15px;
    font-weight: 500;
  }

  .weather-day small {
    /* 2026-07-16: Restore the mobile low-temperature blue instead of muting both numbers.
       Prior 2026-07-16 logic:
       color: var(--muted);
       font-size: 15px;
       font-weight: 600; */
    color: #2689d9;
    font-size: 15px;
    font-weight: 500;
  }

  body.is-editing .dashboard {
    padding-left: 12px;
  }

  body.is-editing .app-header {
    right: 10px;
  }

  body.is-editing .section {
    padding: 48px 10px 12px;
  }

  body.is-editing .section::before {
    top: 10px;
    left: 10px;
    width: auto;
    max-width: calc(100% - 20px);
    min-height: 28px;
    transform: none;
  }

  .tile-grid {
    /* 2026-07-16: Use centered two-up phone tiles instead of CSS grid tracks.
       Prior 2026-07-16 logic:
       grid-template-columns: repeat(2, minmax(0, 1fr)); */
    gap: 10px;
  }

  .card {
    /* 2026-07-16: Keep mobile cards responsive while preserving the legacy 140px phone/tablet minimum.
     Prior 2026-07-16 logic:
     width: calc(50vw - 20px);
     max-width: 165px; */
    width: min(var(--card-width, 165px), calc(100vw - 28px));
    max-width: none;
    /* 2026-07-16: Restore original responsive card minimums.
       Prior 2026-07-16 logic:
       min-width: 135px;
       min-height: 150px; */
    min-width: 140px;
  }

  .card-header {
    min-height: 40px;
    padding: 8px;
    font-size: 13px;
  }

  .card-main {
    /* 2026-07-16: Match the original responsive card-main sizing.
       Prior 2026-07-16 logic:
       min-height: 104px; */
    min-height: 100px;
    padding: 12px 8px;
  }

  .card-main img {
    max-height: 90px;
  }

  .card-main img[style*="height"] {
    max-height: none;
  }

  .two-column {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .card {
    /* 2026-07-16: Restore the original narrow-phone card minimum from the legacy stylesheet. */
    min-width: 130px;
  }
}
