:root {
  color-scheme: light;
  --bg: #f6f8f7;
  --surface: #ffffff;
  --surface-soft: #eef5f3;
  --text: #14211f;
  --muted: #586663;
  --line: #cbd8d4;
  --primary: #006b5f;
  --primary-strong: #004e46;
  --focus: #f2b705;
  --danger: #9b2f3a;
  --shadow: 0 12px 28px rgba(20, 33, 31, 0.08);
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

body[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101516;
  --surface: #172022;
  --surface-soft: #213034;
  --text: #e8f0ee;
  --muted: #b0c1bd;
  --line: #365058;
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

body[data-accent="teal"] {
  --primary: #006b5f;
  --primary-strong: #004e46;
}

body[data-accent="blue"] {
  --primary: #2b5ca7;
  --primary-strong: #1b3f79;
}

body[data-accent="gold"] {
  --primary: #b68b00;
  --primary-strong: #8b6800;
}

a {
  color: var(--primary-strong);
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.18em;
}

a:focus,
button:focus,
input:focus,
select:focus,
summary:focus {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.app-shell {
  min-height: 100vh;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -44px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  z-index: 10;
}

.skip-link:focus {
  top: 12px;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 2;
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
}

.hamburger-menu {
  display: none;
  position: relative;
}

.hamburger-summary,
.user-summary {
  list-style: none;
  cursor: pointer;
}

.hamburger-summary::-webkit-details-marker,
.user-summary::-webkit-details-marker {
  display: none;
}

.hamburger-lines {
  width: 18px;
  display: grid;
  gap: 4px;
}

.hamburger-lines span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}

.mobile-menu-panel,
.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  width: min(320px, calc(100vw - 24px));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 10px;
}

.mobile-menu-panel {
  left: 0;
}

.user-menu {
  right: 0;
}

.mobile-menu-panel a,
.menu-link {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}

.mobile-menu-panel a[aria-current="page"] {
  background: var(--surface-soft);
  border: 1px solid #9abdb6;
  font-weight: 700;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: url('/favicon.ico') center/cover no-repeat;
  border: 0;
  flex: 0 0 auto;
}

.brand-title,
.brand-subtitle {
  display: block;
}

.brand-title {
  font-size: 1.15rem;
  line-height: 1.1;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.9rem;
}

.subsystem-switcher {
  min-width: 210px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  padding: 6px 34px 6px 12px;
  font: inherit;
  font-weight: 700;
}

.top-actions {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: center;
}

.user-menu-wrap {
  position: relative;
}

.user-menu h2 {
  margin: 0;
  font-size: 1rem;
}

.user-menu p {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.icon-button,
.button {
  min-height: 40px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  font: inherit;
}

.icon-button {
  width: 42px;
  display: inline-grid;
  place-items: center;
  font-weight: 700;
}

.button {
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  text-decoration: none;
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  cursor: pointer;
}

.button.primary {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
  color: #ffffff;
}

.button--small {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 0.88rem;
}

.button:hover,
.button:focus-visible {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
  color: #ffffff;
}

.layout {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 16px 32px;
  display: grid;
  gap: 18px;
}

.page-head,
.card,
.table-wrap,
.form-panel,
.login-panel,
.collapsible-panel,
.callout,
.flash {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.page-head,
.card,
.form-panel,
.login-panel,
.callout,
.flash {
  padding: 16px;
}

.collapsible-panel {
  overflow: hidden;
}

.collapsible-panel summary {
  min-height: 52px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-weight: 700;
}

.collapsible-panel summary::-webkit-details-marker {
  display: none;
}

.collapsible-panel summary::before {
  content: "+";
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  background: var(--surface-soft);
  color: var(--primary-strong);
  border: 1px solid var(--line);
  flex: 0 0 auto;
}

.collapsible-panel[open] summary {
  border-bottom: 1px solid var(--line);
}

.collapsible-panel[open] summary::before {
  content: "-";
}

.collapsible-panel .form-panel {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary-strong);
  font-weight: 700;
  font-size: 0.9rem;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
}

h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

p {
  margin: 8px 0 0;
}

.muted {
  color: var(--muted);
}

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

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

.field {
  display: grid;
  gap: 5px;
}

.field label {
  font-weight: 700;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  color: var(--text);
  background: #ffffff;
}

textarea {
  min-height: 220px;
  resize: vertical;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.badge {
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 2px 7px;
  font-size: 0.78rem;
  background: #ffffff;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  background: var(--surface-soft);
}

.flash.success {
  border-color: #74a889;
  background: #eef8f2;
}

.flash.error {
  border-color: #d48a92;
  background: #fff1f3;
}

.control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.control-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.swatches {
  display: flex;
  gap: 6px;
}

.swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px var(--line);
  cursor: pointer;
}

.swatch.teal { background: #006b5f; }
.swatch.blue { background: #305c9b; }
.swatch.gold { background: #f2b705; }

body[data-theme="dark"] .swatch {
  border-color: #1a1a1a;
}

body[data-accent="teal"] .swatch.teal,
body[data-accent="blue"] .swatch.blue,
body[data-accent="gold"] .swatch.gold {
  box-shadow: 0 0 0 2px var(--focus);
}

.toggle {
  width: 52px;
  height: 30px;
  border-radius: 999px;
  background: var(--primary);
  padding: 3px;
  display: flex;
  justify-content: flex-start;
  border: 0;
  cursor: pointer;
}

.toggle-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 150ms ease;
}

.toggle[aria-pressed="true"] {
  justify-content: flex-end;
}

.cms-page-picker {
  margin-top: 12px;
}

.cms-rendered {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.cms-rendered h1,
.cms-rendered h2,
.cms-rendered h3 {
  margin-top: 16px;
}

.cms-rendered p,
.cms-rendered ul,
.cms-rendered table {
  margin-top: 10px;
}

.cms-bullets,
.cms-checklist {
  padding-left: 22px;
}

.cms-checklist {
  list-style: none;
  padding-left: 0;
}

.cms-checklist li {
  padding: 6px 0;
}

.cms-checklist label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
}

.cms-checklist input[type="checkbox"] {
  appearance: auto;
  display: inline-block;
  box-sizing: border-box;
  width: 14px !important;
  min-width: 14px;
  max-width: 14px;
  height: 14px !important;
  min-height: 14px;
  max-height: 14px;
  flex: 0 0 14px;
  margin: 0;
  padding: 0 !important;
  vertical-align: middle;
}

.cms-checklist li[data-completed="TRUE"] span {
  text-decoration: line-through;
  color: var(--muted);
}

.cms-table {
  min-width: 0;
  border: 1px solid var(--line);
}

.bookmark-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
}

.tag-pill-warning {
  border-color: #b68b00;
  background: #fff9dd;
}

.tag-pill input[type="checkbox"] {
  width: 14px;
  height: 14px;
  min-height: 14px;
  margin: 0;
}

.bookmark-card {
  display: grid;
  gap: 10px;
}

.bookmark-thumb {
  width: 100%;
  max-height: 140px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.bookmark-card h2 {
  font-size: 1.1rem;
}

.bookmark-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bookmark-actions {
  margin-top: 4px;
}

.weather-chart-wrap {
  width: 100%;
  min-height: 320px;
  height: 360px;
}

.weather-dial-card {
  min-height: 280px;
}

.weather-dial {
  --dial-fill: 50%;
  width: min(220px, 100%);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  margin: 8px auto 12px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, var(--surface) 0 52%, transparent 53% 100%),
    conic-gradient(var(--primary) 0 var(--dial-fill), var(--surface-soft) var(--dial-fill) 100%);
  border: 1px solid var(--line);
}

.weather-dial-center {
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
  padding: 0 12px;
}

.weather-trend {
  margin-top: 10px;
  font-weight: 700;
}

.weather-trend.up {
  color: #1f7a45;
}

.weather-trend.down {
  color: var(--danger);
}

.weather-trend.level {
  color: var(--muted);
}

@media (max-width: 880px) {
  .grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar-inner {
    grid-template-columns: auto 1fr auto;
  }

  .subsystem-switcher {
    display: none;
  }

  .hamburger-menu {
    display: block;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand-subtitle {
    display: none;
  }

  .layout {
    padding: 14px 12px 28px;
  }
}
