:root {
  --navy-950: #07192b;
  --navy-900: #0b2239;
  --navy-800: #102f4c;
  --navy-700: #164267;
  --navy-100: #dbe8f2;
  --red-700: #a61b29;
  --red-600: #be2434;
  --gold-500: #d6a635;
  --gold-300: #f1d486;
  --ink: #17212b;
  --muted: #5e6b78;
  --line: #d7dee5;
  --surface: #ffffff;
  --surface-2: #f4f7fa;
  --surface-3: #eaf0f5;
  --success: #17663b;
  --warning: #8a5a00;
  --danger: #9f1d2b;
  --shadow: 0 14px 34px rgba(7, 25, 43, 0.14);
  --radius: 12px;
  --sidebar-width: 244px;
  --topbar-height: 70px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--surface-2);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--surface-2);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea,
[tabindex] {
  outline-offset: 3px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #2c7be5;
}

button {
  cursor: pointer;
}

input[type="checkbox"] {
  width: 24px;
  min-width: 24px;
  height: 24px;
  margin: 0;
  flex: 0 0 24px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 0.5rem;
  left: 0.5rem;
  transform: translateY(-160%);
  padding: 0.7rem 1rem;
  border: 3px solid var(--gold-500);
  border-radius: 8px;
  color: #fff;
  background: var(--navy-950);
  font-weight: 800;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}


button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.45rem;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  line-height: 1.1;
}

h2 {
  margin-bottom: 0.35rem;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
}

h3 {
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
}

code {
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  background: var(--surface-3);
}

[hidden] {
  display: none !important;
}

.noscript {
  padding: 1rem;
  color: #fff;
  background: var(--danger);
  text-align: center;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 2rem;
  background:
    linear-gradient(145deg, rgba(7, 25, 43, 0.96), rgba(16, 66, 103, 0.93)),
    radial-gradient(circle at 15% 20%, rgba(214, 166, 53, 0.42), transparent 34%);
}

.login-card {
  width: min(100%, 520px);
  padding: clamp(1.5rem, 5vw, 2.6rem);
  border-top: 6px solid var(--red-600);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.28);
}

.brand-lockup,
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-mark {
  display: grid;
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  place-items: center;
  border: 3px solid var(--gold-500);
  border-radius: 50%;
  color: #fff;
  background: var(--navy-900);
  font-weight: 900;
  letter-spacing: 0.04em;
}

.brand-mark-small {
  width: 42px;
  height: 42px;
  border-width: 2px;
  font-size: 0.82rem;
}

.eyebrow {
  margin-bottom: 0.25rem;
  color: var(--red-700);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.form-stack {
  display: grid;
  gap: 1rem;
}

.form-stack label,
.form-grid label,
.field-label {
  display: grid;
  gap: 0.42rem;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.68rem 0.75rem;
  border: 1px solid #aeb9c5;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

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

input[type="checkbox"],
input[type="radio"] {
  width: 1.1rem;
  min-height: 1.1rem;
  margin: 0;
  accent-color: var(--navy-700);
}

.checkbox-row,
.radio-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: flex-start;
  gap: 0.55rem !important;
  font-weight: 600 !important;
}

.form-error {
  min-height: 1.4rem;
  margin: 0;
  color: var(--danger);
  font-weight: 700;
}

.demo-accounts {
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.demo-accounts p {
  margin-bottom: 0.35rem;
}

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

.topbar {
  position: fixed;
  z-index: 50;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.1rem;
  border-bottom: 4px solid var(--red-600);
  color: #fff;
  background: var(--navy-950);
  box-shadow: 0 4px 16px rgba(7, 25, 43, 0.24);
}

.topbar-brand strong,
.topbar-brand span {
  display: block;
}

.topbar-brand > div > span {
  color: var(--gold-300);
  font-size: 0.76rem;
}

.topbar-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.user-button {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.user-button > span:first-child {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 50%;
  color: var(--navy-950);
  background: var(--gold-300);
  font-size: 0.74rem;
  font-weight: 900;
}

.popover {
  position: absolute;
  z-index: 100;
  top: calc(100% + 0.65rem);
  right: 0;
  width: 260px;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  box-shadow: var(--shadow);
}

.popover p {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.87rem;
}

.sidebar {
  position: fixed;
  z-index: 40;
  top: var(--topbar-height);
  bottom: 0;
  left: 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
  color: #fff;
  background: var(--navy-900);
}

.sidebar nav {
  display: grid;
  gap: 0.25rem;
  padding: 1rem 0.65rem;
}

.nav-item {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 0.72rem;
  padding: 0.68rem 0.8rem;
  border: 0;
  border-radius: 8px;
  color: #dfeaf3;
  background: transparent;
  text-align: left;
}

.nav-item:hover,
.nav-item.is-active {
  color: #fff;
  background: var(--navy-700);
}

.nav-item.is-active {
  box-shadow: inset 4px 0 0 var(--gold-500);
}

.nav-item span {
  width: 1.2rem;
  text-align: center;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  color: #c7d5e2;
  font-size: 0.78rem;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #58c381;
  box-shadow: 0 0 0 3px rgba(88, 195, 129, 0.15);
}

.main-content {
  min-width: 0;
  max-width: calc(100vw - var(--sidebar-width));
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: calc(var(--topbar-height) + 1.6rem) clamp(1rem, 3vw, 2rem) 5rem;
}

.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.view-header p {
  max-width: 780px;
  margin-bottom: 0;
  color: var(--muted);
}

.header-actions,
.toolbar,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.button,
.icon-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.62rem 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.button-primary {
  color: #fff;
  background: var(--navy-700);
}

.button-primary:hover {
  background: var(--navy-800);
}

.button-secondary {
  color: var(--navy-900);
  border-color: #9aabba;
  background: #fff;
}

.button-danger {
  color: #fff;
  background: var(--danger);
}

.button-gold {
  color: var(--navy-950);
  background: var(--gold-300);
}

.button-small {
  min-height: 34px;
  padding: 0.38rem 0.62rem;
  font-size: 0.82rem;
}

.icon-button {
  width: 42px;
  padding: 0;
  color: inherit;
  background: transparent;
}

.topbar .icon-button {
  border-color: rgba(255, 255, 255, 0.35);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.card,
.panel,
.stat-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 4px 12px rgba(7, 25, 43, 0.05);
}

.stat-card {
  padding: 1.05rem;
}

.stat-card strong {
  display: block;
  margin-bottom: 0.15rem;
  color: var(--navy-800);
  font-size: 1.75rem;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.panel {
  min-width: 0;
  overflow: hidden;
}

.panel-header {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.panel-header h2,
.panel-header h3 {
  margin: 0;
}

.panel-body {
  padding: 1rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
  gap: 1rem;
  margin-top: 1rem;
}

.list-reset {
  margin: 0;
  padding: 0;
  list-style: none;
}

.activity-list li,
.simple-list li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
}

.activity-list li:last-child,
.simple-list li:last-child {
  border-bottom: 0;
}

.activity-list small,
.muted,
.metadata {
  color: var(--muted);
}

.metadata {
  font-size: 0.8rem;
}

.badge {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 0.15rem 0.52rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.badge-success {
  color: #0f5431;
  background: #d8f3e3;
}

.badge-warning {
  color: #6d4700;
  background: #fff0c6;
}

.badge-danger {
  color: #851726;
  background: #f9dce1;
}

.badge-info {
  color: #174b73;
  background: #dcecf9;
}

.badge-neutral {
  color: #4d5964;
  background: #e9edf1;
}

.table-wrap {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.data-table th,
.data-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: var(--navy-800);
  background: #f4f7fa;
  font-size: 0.78rem;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.data-table tbody tr:hover {
  background: #f9fbfd;
}

.data-table tbody tr[tabindex] {
  cursor: pointer;
}

.split-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 620px;
}

.split-sidebar {
  border-right: 1px solid var(--line);
  background: #f8fafc;
}

.split-sidebar-header {
  padding: 0.9rem;
  border-bottom: 1px solid var(--line);
}

.split-main {
  max-width: 100%;
  min-width: 0;
}

.folder-tree,
.calendar-list {
  padding: 0.6rem;
}

.tree-item,
.calendar-toggle {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.55rem;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.tree-item:hover,
.tree-item.is-active {
  background: var(--navy-100);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
  min-height: 48px;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.breadcrumbs button {
  min-height: 32px;
  padding: 0.3rem 0.45rem;
  border: 0;
  color: var(--navy-700);
  background: transparent;
  font-weight: 700;
}

.file-layout {
  display: grid;
  max-width: 100%;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
}

.preview-pane {
  min-height: 520px;
  padding: 1rem;
  border-left: 1px solid var(--line);
  background: #f8fafc;
}

.preview-pane iframe {
  width: 100%;
  min-height: 330px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.file-icon {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 5px;
  color: var(--navy-900);
  background: var(--gold-300);
  font-size: 0.75rem;
  font-weight: 900;
}

.calendar-shell {
  display: grid;
  grid-template-columns: 225px minmax(0, 1fr);
  min-height: 690px;
}

.calendar-sidebar {
  border-right: 1px solid var(--line);
  background: #f8fafc;
}

.calendar-main {
  min-width: 0;
  overflow: hidden;
}

.calendar-toolbar {
  display: flex;
  min-height: 60px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.calendar-title {
  min-width: 190px;
  margin: 0;
  text-align: center;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background: var(--line);
  gap: 1px;
}

.weekday {
  padding: 0.5rem;
  color: var(--navy-800);
  background: #edf2f6;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day {
  min-height: 120px;
  padding: 0.35rem;
  background: #fff;
}

.calendar-day.is-outside {
  color: var(--muted);
  background: #f5f7f9;
}

.calendar-day.is-today {
  box-shadow: inset 0 0 0 3px var(--gold-500);
}

.day-number {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  font-size: 0.82rem;
  font-weight: 800;
}

.calendar-day.is-today .day-number {
  color: #fff;
  background: var(--red-600);
}

.event-chip {
  display: block;
  min-height: 28px;
  width: 100%;
  margin-top: 0.26rem;
  overflow: hidden;
  padding: 0.3rem 0.38rem;
  border: 0;
  border-left: 4px solid var(--navy-700);
  border-radius: 5px;
  color: var(--ink);
  background: #e7f0f8;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-chip[data-color="auxiliary"] {
  border-left-color: #7552a7;
  background: #eee7f8;
}

.event-chip[data-color="department"] {
  border-left-color: var(--red-600);
  background: #f8e5e8;
}

.event-chip[data-color="community"] {
  border-left-color: #267c58;
  background: #e2f2e9;
}

.event-chip[data-color="national"] {
  border-left-color: #846000;
  background: #f8edce;
}

.calendar-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--navy-700);
}

.calendar-dot[data-color="auxiliary"] { background: #7552a7; }
.calendar-dot[data-color="department"] { background: var(--red-600); }
.calendar-dot[data-color="district"] { background: #3c6e9a; }
.calendar-dot[data-color="national"] { background: #846000; }


.calendar-agenda {
  padding: 1rem;
  border-top: 1px solid var(--line);
  background: #fff;
}

.calendar-agenda-list {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.calendar-agenda-item {
  display: grid;
  grid-template-columns: minmax(150px, 0.35fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.file-name-button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.35rem;
  border: 0;
  border-radius: 6px;
  color: var(--navy-800);
  background: transparent;
  text-align: left;
}

.file-name-button:hover {
  background: var(--navy-100);
}

.menu-builder {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 310px;
  min-height: 650px;
}

.menu-column {
  min-width: 0;
  padding: 1rem;
  border-right: 1px solid var(--line);
}

.menu-column:last-child {
  border-right: 0;
}

.menu-item-card {
  display: flex;
  width: 100%;
  color: var(--ink);
  font: inherit;
  text-align: left;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.45rem;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-left: 5px solid var(--navy-700);
  border-radius: 7px;
  background: #fff;
}

.menu-item-card[data-level="1"] { margin-left: 1.5rem; }
.menu-item-card[data-level="2"] { margin-left: 3rem; }
.menu-item-card.is-selected { background: #edf5fb; }

.placement-preview {
  display: grid;
  grid-template-columns: 70px 1fr 70px;
  grid-template-rows: 52px 160px 52px;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e8edf2;
}

.placement-zone {
  display: grid;
  place-items: center;
  border: 1px dashed #7e8d9a;
  border-radius: 5px;
  color: #53606c;
  background: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  text-align: center;
}

.placement-zone.top { grid-column: 1 / 4; }
.placement-zone.left { grid-column: 1; grid-row: 2; }
.placement-zone.content { grid-column: 2; grid-row: 2; background: #f8fafc; }
.placement-zone.right { grid-column: 3; grid-row: 2; }
.placement-zone.bottom { grid-column: 1 / 4; grid-row: 3; }
.placement-zone.is-active { border-style: solid; color: #fff; background: var(--navy-700); }

.chyron-preview {
  position: relative;
  overflow: hidden;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #fff;
  background: var(--navy-950);
}

.chyron-label {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  left: 0;
  display: grid;
  width: 122px;
  place-items: center;
  background: var(--red-600);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.chyron-track {
  display: flex;
  min-height: 72px;
  align-items: center;
  gap: 2.2rem;
  width: max-content;
  padding-left: 145px;
  padding-right: 4rem;
  animation: chyron-scroll 24s linear infinite;
  white-space: nowrap;
}

.chyron-preview:hover .chyron-track,
.chyron-preview:focus-within .chyron-track,
.chyron-preview.is-paused .chyron-track {
  animation-play-state: paused;
}

@keyframes chyron-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.chyron-controls {
  position: absolute;
  z-index: 3;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
}

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

.portal-card,
.template-card {
  padding: 1rem;
}

.portal-card ul,
.template-card ul {
  padding-left: 1.2rem;
}

.role-matrix-header {
  align-items: flex-start;
  gap: 1rem;
}

.role-matrix-controls {
  display: flex;
  flex: 0 0 auto;
  gap: 0.5rem;
  align-items: center;
}

.role-matrix-scroll {
  position: relative;
  scroll-behavior: auto;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
}

.role-matrix-scroll:focus-visible {
  outline: 3px solid var(--gold-500);
  outline-offset: -3px;
}

.role-matrix-scroll-button {
  min-width: 88px;
}

.role-matrix-scroll-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.permission-matrix {
  min-width: 1120px;
}

.permission-matrix th:first-child,
.permission-matrix td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 260px;
  max-width: 320px;
  background: var(--surface, #fff);
  box-shadow: 8px 0 12px -12px rgba(15, 31, 48, 0.55);
}

.permission-matrix thead th:first-child {
  z-index: 4;
}

.permission-matrix td:not(:first-child),
.permission-matrix th:not(:first-child) {
  min-width: 128px;
  text-align: center;
}

.permission-check {
  color: var(--success);
  font-weight: 900;
}

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

.site-preview-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid #aab7c3;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}


.site-preview-skip-link {
  position: absolute;
  z-index: 20;
  top: 0.5rem;
  left: 0.5rem;
  transform: translateY(-180%);
  padding: 0.65rem 0.9rem;
  border: 3px solid var(--gold-500);
  border-radius: 7px;
  color: #fff;
  background: var(--navy-950);
  font-weight: 800;
  text-decoration: none;
}

.site-preview-skip-link:focus {
  transform: translateY(0);
}

.site-preview-header {
  padding: 1.1rem 1.4rem;
  color: #fff;
  background: linear-gradient(135deg, var(--navy-950), var(--navy-700));
  border-bottom: 6px solid var(--red-600);
}

.site-preview-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.6rem 1rem;
  background: var(--navy-900);
}

.site-preview-nav > div {
  position: relative;
}

.site-preview-nav button,
.site-preview-nav a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: transparent;
  text-decoration: none;
  font-weight: 800;
}

.site-preview-nav button:hover,
.site-preview-nav a:hover {
  background: var(--navy-700);
}

.preview-dropdown {
  position: absolute;
  z-index: 5;
  top: 100%;
  left: 0;
  min-width: 220px;
  padding: 0.45rem;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.preview-dropdown a {
  display: flex;
  color: var(--ink);
}

.site-preview-content {
  min-height: 430px;
  padding: 2rem clamp(1rem, 5vw, 4rem) 5rem;
}

.site-preview-hero {
  padding: clamp(1.4rem, 4vw, 3rem);
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--navy-800), var(--navy-950));
}

.site-preview-bottom-nav {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.65rem;
  background: var(--navy-900);
}

.site-preview-bottom-nav a {
  color: #fff;
}

.preview-chyron-fixed {
  position: relative;
  overflow: hidden;
  min-height: 52px;
  color: #fff;
  background: var(--red-700);
}


.preview-chyron-pause {
  position: absolute;
  z-index: 4;
  top: 50%;
  right: 0.5rem;
  min-height: 36px;
  transform: translateY(-50%);
  border: 2px solid #fff;
  border-radius: 7px;
  color: #fff;
  background: var(--navy-950);
  font-weight: 800;
}

.preview-chyron-fixed.is-paused .chyron-track {
  animation-play-state: paused;
}

.preview-chyron-fixed .chyron-track {
  min-height: 52px;
  padding-right: 7rem;
  padding-left: 1rem;
}

.accessibility-results {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px solid transparent;
  border-radius: 8px;
}

.accessibility-results:empty {
  display: none;
}

.accessibility-results.has-errors {
  color: #70111f;
  border-color: #c75a69;
  background: #fff0f2;
}

.accessibility-results.is-clear {
  color: #0f5431;
  border-color: #4a9b71;
  background: #e8f6ee;
}

.accessibility-results p,
.accessibility-results ul {
  margin-bottom: 0;
}

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

.form-grid .full-width {
  grid-column: 1 / -1;
}

.fieldset {
  margin: 0;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.fieldset legend {
  padding: 0 0.35rem;
  color: var(--navy-800);
  font-weight: 900;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.modal {
  width: min(92vw, 780px);
  max-height: 90vh;
  padding: 0;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
}

.modal::backdrop {
  background: rgba(7, 25, 43, 0.7);
  backdrop-filter: blur(3px);
}

.modal-shell {
  display: grid;
  max-height: 90vh;
  grid-template-rows: auto minmax(0, 1fr) auto;
  margin: 0;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.2rem;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.modal-header h2 {
  margin: 0;
}

.modal-body {
  overflow-y: auto;
  padding: 1.2rem;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 0.9rem 1.2rem;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}

.context-menu {
  position: fixed;
  z-index: 500;
  min-width: 210px;
  overflow: hidden;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  box-shadow: var(--shadow);
}

.context-menu button {
  display: block;
  width: 100%;
  min-height: 38px;
  padding: 0.5rem 0.7rem;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.context-menu button:hover,
.context-menu button:focus-visible {
  background: var(--navy-100);
}

.flash-region {
  position: fixed;
  z-index: 200;
  top: calc(var(--topbar-height) + 1rem);
  right: 1rem;
  display: grid;
  width: min(360px, calc(100vw - 2rem));
  gap: 0.5rem;
}

.flash {
  padding: 0.8rem 1rem;
  border-left: 5px solid var(--navy-700);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  font-weight: 700;
}

.flash.is-error {
  border-left-color: var(--danger);
}

.loading-panel {
  display: flex;
  min-height: 260px;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  color: var(--muted);
}

.spinner {
  width: 26px;
  height: 26px;
  border: 3px solid var(--line);
  border-top-color: var(--navy-700);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.empty-state {
  padding: 2rem;
  color: var(--muted);
  text-align: center;
}

.mobile-only {
  display: none;
}

.sr-only {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  padding: 0 !important;
  white-space: nowrap !important;
}

.page-preview-modal {
  width: min(98vw, 1500px);
  height: min(96vh, 1000px);
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: #eef2f5;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.4);
}

.page-preview-modal::backdrop {
  background: rgba(4, 18, 30, 0.78);
  backdrop-filter: blur(3px);
}

.page-preview-dialog {
  display: grid;
  height: 100%;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.page-preview-toolbar,
.page-preview-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.page-preview-toolbar {
  justify-content: space-between;
}

.page-preview-toolbar h2,
.page-preview-toolbar p {
  margin: 0;
}

.page-preview-controls label {
  display: grid;
  gap: 0.2rem;
  min-width: 165px;
  font-size: 0.78rem;
  font-weight: 800;
}

.preview-device-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.preview-device-group [aria-pressed="true"] {
  color: #fff;
  background: var(--navy-800);
  border-color: var(--navy-800);
}

.page-preview-stage {
  display: grid;
  min-height: 0;
  overflow: auto;
  place-items: start center;
  padding: 1rem;
  background:
    linear-gradient(45deg, #dce3e9 25%, transparent 25%) 0 0 / 24px 24px,
    linear-gradient(-45deg, #dce3e9 25%, transparent 25%) 0 12px / 24px 24px,
    linear-gradient(45deg, transparent 75%, #dce3e9 75%) 12px -12px / 24px 24px,
    linear-gradient(-45deg, transparent 75%, #dce3e9 75%) -12px 0 / 24px 24px,
    #eef2f5;
}

.page-preview-frame-wrap {
  width: min(100%, 1366px);
  height: max(680px, calc(96vh - 190px));
  overflow: hidden;
  border: 1px solid #8796a5;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 50px rgba(10, 30, 48, 0.24);
  transition: width 160ms ease;
}

.page-preview-stage[data-device="tablet"] .page-preview-frame-wrap {
  width: min(100%, 768px);
}

.page-preview-stage[data-device="mobile"] .page-preview-frame-wrap {
  width: min(100%, 390px);
}

.page-preview-frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

@media (max-width: 700px) {
  .page-preview-modal {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }

  .page-preview-toolbar,
  .page-preview-controls {
    padding: 0.65rem;
  }

  .page-preview-controls {
    align-items: stretch;
  }

  .page-preview-controls > *,
  .page-preview-controls label {
    width: 100%;
  }

  .preview-device-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .page-preview-stage {
    padding: 0.5rem;
  }

  .page-preview-frame-wrap,
  .page-preview-stage[data-device="tablet"] .page-preview-frame-wrap,
  .page-preview-stage[data-device="mobile"] .page-preview-frame-wrap {
    width: 100%;
    height: calc(100vh - 310px);
    min-height: 360px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-preview-frame-wrap {
    transition: none;
  }
}

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


  .menu-builder {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .menu-builder .menu-column:last-child {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
  }

  .portal-grid,
  .template-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .mobile-only {
    display: inline-flex;
  }

  .topbar-brand > div,
  .user-button #user-name {
    display: none;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .main-content {
    max-width: 100vw;
    margin-left: 0;
  }

  .dashboard-grid,
  .split-layout,
  .calendar-shell,
  .file-layout {
    grid-template-columns: 1fr;
  }

  .split-sidebar,
  .calendar-sidebar,
  .preview-pane {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .preview-pane {
    border-left: 0;
  }

  .calendar-sidebar {
    max-height: 230px;
    overflow-y: auto;
  }

  .calendar-day {
    min-height: 100px;
  }

  .portal-grid,
  .template-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 0 0.55rem;
  }

  #global-create {
    min-width: 42px;
    overflow: hidden;
    padding: 0.62rem;
    white-space: nowrap;
  }

  .main-content {
    padding-right: 0.7rem;
    padding-left: 0.7rem;
  }

  .view-header {
    display: grid;
  }

  .card-grid,
  .form-grid,
  .check-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .full-width {
    grid-column: auto;
  }

  .month-grid {
    min-width: 720px;
  }

  .calendar-main {
    overflow-x: auto;
  }

  .calendar-agenda-item {
    grid-template-columns: 1fr;
  }

  .menu-builder {
    grid-template-columns: 1fr;
  }

  .menu-column {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .menu-builder .menu-column:last-child {
    grid-column: auto;
  }

  .modal {
    width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }

  .modal-shell {
    max-height: 100vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .chyron-track {
    width: auto;
    flex-wrap: wrap;
    white-space: normal;
    transform: none !important;
  }
}

@media print {
  .topbar,
  .sidebar,
  .header-actions,
  .toolbar,
  .flash-region,
  .chyron-controls {
    display: none !important;
  }

  .main-content {
    margin: 0;
    padding: 0;
  }

  .panel,
  .card,
  .stat-card {
    box-shadow: none;
  }
}

/* Drupal-inspired structure tools */
.structure-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-bottom: 1rem;
}

.taxonomy-layout,
.translation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  padding: 1rem;
}

.simple-term-list {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
  border-top: 1px solid #d9e2ec;
}

.simple-term-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .55rem 0;
  border-bottom: 1px solid #d9e2ec;
}

.workflow-path {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  margin: 1rem 0;
}

.views-layout {
  display: grid;
  grid-template-columns: minmax(210px, 290px) minmax(0, 1fr);
  min-height: 480px;
}

.views-layout > aside {
  border-right: 1px solid #d9e2ec;
  padding: .75rem;
  background: #f6f8fa;
}

.view-selector {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .2rem;
  border: 1px solid transparent;
  border-radius: .45rem;
  background: transparent;
  color: #102a43;
  padding: .7rem;
  margin-bottom: .35rem;
  text-align: left;
  cursor: pointer;
}

.view-selector:hover,
.view-selector:focus-visible,
.view-selector.is-active {
  background: #fff;
  border-color: #9fb3c8;
  outline: none;
}

.view-selector span {
  color: #52667a;
  font-size: .82rem;
}

.revision-list {
  display: grid;
  gap: .75rem;
}

.revision-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  border: 1px solid #d9e2ec;
  border-radius: .55rem;
  padding: .9rem;
}

.diff-block {
  margin-bottom: 1rem;
}

.diff-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

.diff-columns > div {
  min-width: 0;
  border: 1px solid #d9e2ec;
  border-radius: .45rem;
  padding: .7rem;
}

.diff-columns pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 300px;
  overflow: auto;
  background: #f6f8fa;
  padding: .65rem;
}

.preview-reusable-block {
  margin-top: 1.25rem;
  border-left: .35rem solid #c9202f;
  background: #eef3f7;
  padding: 1rem;
}

@media (max-width: 850px) {
  .views-layout,
  .diff-columns {
    grid-template-columns: 1fr;
  }

  .views-layout > aside {
    border-right: 0;
    border-bottom: 1px solid #d9e2ec;
  }

  .revision-card {
    flex-direction: column;
  }
}

/* Mobile-complete interface additions */
.mobile-record-list,
.mobile-scroll-cue,
.mobile-calendar-cue {
  display: none;
}

.record-card {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(7, 25, 43, 0.06);
}

.record-card-header {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.record-card-header > div {
  min-width: 0;
}

.record-card h3 {
  overflow-wrap: anywhere;
}

.record-details {
  display: grid;
  gap: 0.7rem;
  margin: 1rem 0;
}

.record-details > div {
  display: grid;
  grid-template-columns: minmax(92px, 0.35fr) minmax(0, 1fr);
  gap: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}

.record-details dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.record-details dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.record-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.capability-details {
  margin: 0.75rem 0 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.capability-details summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  padding: 0.65rem 0.8rem;
  cursor: pointer;
  font-weight: 800;
}

.capability-details ul {
  margin: 0;
  padding: 0 1.2rem 0.9rem 2rem;
}

.calendar-month-view {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

@media (max-width: 860px) {
  .button,
  .button-small,
  .icon-button,
  .tree-item,
  .calendar-toggle,
  .breadcrumbs button,
  .file-name-button,
  .context-menu button,
  .site-preview-nav button,
  .capability-details summary {
    min-height: 44px;
  }

  .icon-button {
    min-width: 44px;
    width: 44px;
  }

  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  select {
    min-height: 44px;
  }

  .event-chip {
    min-height: 44px;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
  }

  .modal-header,
  .modal-actions {
    position: sticky;
    z-index: 6;
  }

  .modal-header {
    top: 0;
  }

  .modal-actions {
    bottom: 0;
  }

  .modal-body {
    overscroll-behavior: contain;
  }
}

@media (max-width: 640px) {
  .desktop-data-table {
    display: none !important;
  }

  .mobile-record-list {
    display: grid;
    gap: 0.8rem;
    padding: 0.8rem;
  }

  .mobile-scroll-cue,
  .mobile-calendar-cue {
    display: block;
    margin: 0;
    padding: 0.7rem 0.85rem;
    color: var(--navy-800);
    border-bottom: 1px solid var(--line);
    background: #eef4f9;
    font-size: 0.86rem;
    font-weight: 800;
  }

  .calendar-main {
    overflow-x: hidden;
  }

  .calendar-month-view {
    overflow-x: auto;
  }

  .calendar-toolbar {
    position: sticky;
    z-index: 4;
    top: 0;
    background: #fff;
  }

  .calendar-toolbar > .toolbar,
  .calendar-view-switcher {
    width: 100%;
    justify-content: center;
  }

  .calendar-title {
    width: 100%;
    order: -1;
  }

  .calendar-view-switcher .button {
    flex: 1 1 0;
  }

  .calendar-agenda {
    padding: 0.75rem;
  }

  .calendar-agenda-item {
    gap: 0.65rem;
  }

  .calendar-agenda-item .button {
    width: 100%;
  }

  .view-header > .header-actions {
    width: 100%;
  }

  .view-header > .header-actions > .button,
  .view-header > .header-actions > .header-actions,
  .view-header > .header-actions > .header-actions > .button {
    width: 100%;
  }

  .view-header > .header-actions > .header-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .record-card-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .record-card-actions .button {
    width: 100%;
  }

  .record-details > div {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .panel-header {
    align-items: flex-start;
  }

  .panel-header .toolbar {
    width: 100%;
  }

  .panel-header .toolbar input,
  .panel-header .toolbar select {
    width: 100%;
  }

  .file-mobile-list + .preview-pane {
    border-top: 1px solid var(--line);
  }

  .modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding-bottom: max(0.9rem, env(safe-area-inset-bottom));
  }

  .modal-actions .button {
    width: 100%;
    min-height: 48px;
  }

  .main-content {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .flash-region {
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
  }
}

@media (max-width: 860px) {
  .site-preview-nav a,
  .site-preview-nav button {
    min-height: 44px;
  }
}

@media (max-width: 960px) and (max-height: 600px) {
  .button,
  .button-small,
  .icon-button,
  .tree-item,
  .calendar-toggle,
  .breadcrumbs button,
  .file-name-button,
  .context-menu button,
  .site-preview-nav button,
  .site-preview-nav a,
  .capability-details summary {
    min-height: 44px;
  }

  .icon-button {
    min-width: 44px;
    width: 44px;
  }

  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  select {
    min-height: 44px;
  }

  .event-chip {
    min-height: 44px;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
  }
}

@media (max-width: 640px) {
  .modal {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
  }

  .modal-shell {
    height: 100dvh;
    max-height: 100dvh;
  }
}

@media (max-width: 860px), (max-width: 960px) and (max-height: 600px) {
  .preview-chyron-pause {
    min-width: 44px;
    min-height: 44px;
  }
}

@media (max-width: 640px) {
  .modal {
    max-width: none;
  }
}

/* On-demand tutorials and AI assistant */
.topbar-help-button {
  min-height: 44px;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.08);
}

.tutorial-dialog {
  width: min(96vw, 1280px);
  height: min(92vh, 900px);
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.42);
}

.tutorial-dialog::backdrop {
  background: rgba(4, 18, 30, 0.78);
  backdrop-filter: blur(3px);
}

.tutorial-dialog-shell {
  display: grid;
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr);
}

.tutorial-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.tutorial-dialog-header h2,
.tutorial-dialog-header p {
  margin-bottom: 0.2rem;
}

.tutorial-dialog-layout {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
}

.tutorial-library {
  min-height: 0;
  overflow-y: auto;
  padding: 1rem;
  border-right: 1px solid var(--line);
  background: var(--surface-2);
}

.tutorial-search-label {
  display: grid;
  gap: 0.4rem;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
}

.tutorial-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 1rem;
}

.tutorial-list-item {
  display: grid;
  min-height: 52px;
  gap: 0.2rem;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.tutorial-list-item span {
  font-weight: 850;
}

.tutorial-list-item small {
  color: var(--muted);
}

.tutorial-list-item.is-active,
.tutorial-list-item:hover {
  border-color: var(--navy-700);
  background: var(--navy-100);
}

.tutorial-workspace {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: clamp(1rem, 3vw, 1.5rem);
}

.tutorial-detail {
  max-width: 900px;
}

.tutorial-steps {
  display: grid;
  gap: 1rem;
  padding-left: 1.6rem;
}

.tutorial-steps li {
  padding-left: 0.35rem;
}

.tutorial-steps p {
  margin: 0.3rem 0 0.55rem;
}

.tutorial-step-note,
.tutorial-privacy-note {
  color: var(--muted);
  font-size: 0.88rem;
}

.tutorial-tips {
  margin-top: 1rem;
  padding: 1rem;
  border-left: 5px solid var(--gold-500);
  background: #fbf7e9;
}

.ai-tutor-panel {
  max-width: 900px;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 2px solid var(--line);
}

.ai-tutor-answer {
  min-height: 80px;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.ai-tutor-answer:empty {
  display: none;
}

.ai-tutor-answer ol {
  display: grid;
  gap: 0.65rem;
  padding-left: 1.5rem;
}

.ai-answer-meta,
.related-tutorials {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.8rem;
}

.related-tutorials {
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

.tutorials-intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(240px, 0.7fr);
  gap: 1rem;
  align-items: start;
}

.tutorial-ai-status {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.tutorial-ai-status p {
  margin: 0.35rem 0 0;
}

.tutorial-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.tutorial-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(7, 25, 43, 0.07);
}

.tutorial-card h2 {
  font-size: 1.15rem;
}

.tutorial-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-top: auto;
  padding-top: 1rem;
}

@media (max-width: 1000px) {
  .tutorial-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .tutorial-dialog {
    width: 100vw;
    height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  .tutorial-dialog-header {
    position: sticky;
    z-index: 5;
    top: 0;
  }

  .tutorial-dialog-layout {
    display: block;
    overflow-y: auto;
  }

  .tutorial-library {
    max-height: 38vh;
    overflow-y: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .tutorial-workspace {
    overflow: visible;
  }

  .tutorials-intro-grid,
  .tutorial-card-grid {
    grid-template-columns: 1fr;
  }

  .tutorial-list-item,
  .tutorial-card .button,
  .ai-tutor-panel .button {
    min-height: 48px;
  }
}

@media (max-width: 640px) {
  .topbar-help-button {
    width: 44px;
    min-width: 44px;
    overflow: hidden;
    padding: 0;
    font-size: 0;
  }

  .topbar-help-button::before {
    content: '?';
    font-size: 1.15rem;
    font-weight: 900;
  }

  .tutorial-card-footer,
  .ai-answer-meta,
  .related-tutorials {
    align-items: stretch;
    flex-direction: column;
  }

  .tutorial-card-footer .button,
  .related-tutorials .button {
    width: 100%;
  }
}

.app-version { margin-top: 1rem; text-align: center; }
.sidebar-status-text { min-width: 0; line-height: 1.35; }

/* Inherited modern UX/UI baseline */
:root {
  --surface-canvas: #f5f7fa;
  --surface-raised: #ffffff;
  --surface-subtle: #f8fafc;
  --focus-ring: #2c7be5;
  --shadow-sm: 0 1px 2px rgba(7, 25, 43, 0.06), 0 2px 8px rgba(7, 25, 43, 0.04);
  --shadow-md: 0 10px 28px rgba(7, 25, 43, 0.12);
  --radius-lg: 14px;
  --content-max: 1720px;
}

body {
  background: var(--surface-canvas);
}

.topbar {
  border-bottom-width: 2px;
  box-shadow: 0 2px 12px rgba(7, 25, 43, 0.18);
}

.topbar-search-button {
  display: inline-flex;
  min-width: 210px;
  min-height: 42px;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.6rem 0.45rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 9px;
  color: #e7eff6;
  background: rgba(255, 255, 255, 0.08);
  text-align: left;
}

.topbar-search-button:hover {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.14);
}

.topbar-search-button .topbar-search-label {
  flex: 1;
}

kbd {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 0.45rem;
  border: 1px solid #c8d2dc;
  border-bottom-width: 2px;
  border-radius: 5px;
  color: #51606e;
  background: #fff;
  font: 700 0.72rem/1 ui-sans-serif, system-ui, sans-serif;
  white-space: nowrap;
}

.topbar-search-button kbd {
  border-color: rgba(255, 255, 255, 0.28);
  color: #dfeaf3;
  background: rgba(0, 0, 0, 0.18);
}

.sidebar {
  width: var(--sidebar-width);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, var(--navy-900), #0a1e32 72%);
}

.sidebar nav {
  gap: 0.15rem;
  padding: 0.8rem 0.65rem 1.5rem;
}

.nav-group {
  display: grid;
  gap: 0.2rem;
  padding: 0.55rem 0 0.3rem;
}

.nav-group + .nav-group {
  margin-top: 0.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.8rem;
}

.nav-group-label {
  margin: 0 0.65rem 0.25rem;
  color: #91a9bd;
  font-size: 0.69rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-item {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 9px;
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.nav-item:hover {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.08);
}

.nav-item.is-active {
  border-color: rgba(241, 212, 134, 0.22);
  background: #173f61;
  box-shadow: inset 3px 0 0 var(--gold-500);
}

.nav-item > span:first-child {
  width: 1.35rem;
  flex: 0 0 1.35rem;
  color: var(--gold-300);
  text-align: center;
}

.nav-item > span:last-child {
  width: auto;
  min-width: 0;
  flex: 1;
  text-align: left;
}

.sidebar-scrim {
  position: fixed;
  z-index: 35;
  inset: var(--topbar-height) 0 0;
  background: rgba(3, 13, 24, 0.5);
  backdrop-filter: blur(1px);
}

.main-content {
  width: calc(100% - var(--sidebar-width));
  max-width: none;
}

#view-container {
  width: min(100%, var(--content-max));
  margin-inline: auto;
}

.view-header {
  margin-bottom: 1.15rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--line);
}

.view-heading {
  min-width: 0;
}

.view-heading h1 {
  margin-bottom: 0.45rem;
  letter-spacing: -0.02em;
}

.cms-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.cms-breadcrumbs button {
  min-height: 32px;
  padding: 0.2rem 0.25rem;
  border: 0;
  border-radius: 5px;
  color: var(--navy-700);
  background: transparent;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.header-actions {
  justify-content: flex-end;
}

.button,
.icon-button {
  min-height: 44px;
  border-radius: 9px;
  transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 80ms ease;
}

.button:active:not(:disabled),
.icon-button:active:not(:disabled),
.quick-action:active:not(:disabled),
.global-search-result:active:not(:disabled) {
  transform: translateY(1px);
}

.button-primary {
  box-shadow: 0 1px 2px rgba(7, 25, 43, 0.12);
}

.button-secondary:hover {
  border-color: var(--navy-700);
  background: #f4f8fb;
}

.button-tertiary {
  color: var(--navy-700);
  border-color: transparent;
  background: transparent;
}

.button-tertiary:hover {
  background: var(--navy-100);
}

.button-danger:hover {
  background: #851724;
}

.button-gold:hover {
  background: #f7dda0;
}

.panel,
.card,
.stat-card,
.record-card {
  border-color: #dce3e9;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.panel-header {
  min-height: 60px;
  padding: 0.95rem 1.1rem;
  background: var(--surface-subtle);
}

.panel-body {
  padding: 1.1rem;
}

.quick-actions-panel {
  margin-bottom: 1rem;
  padding: 1.1rem;
  border: 1px solid #dce3e9;
  border-radius: var(--radius-lg);
  background: linear-gradient(125deg, #fff, #f7fafc);
  box-shadow: var(--shadow-sm);
}

.quick-actions-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.quick-actions-heading h2,
.quick-actions-heading p {
  margin-bottom: 0;
}

.quick-actions-heading > p {
  color: var(--muted);
  font-size: 0.88rem;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.7rem;
}

.quick-action {
  display: grid;
  min-height: 76px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.quick-action:hover,
.quick-action:focus-visible {
  border-color: #91adc4;
  background: #f8fbfd;
  box-shadow: 0 4px 14px rgba(7, 25, 43, 0.08);
}

.quick-action-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--navy-700);
  font-size: 1.15rem;
}

.quick-action strong,
.quick-action small {
  display: block;
}

.quick-action strong {
  margin-bottom: 0.18rem;
}

.quick-action small {
  color: var(--muted);
  line-height: 1.35;
}

.quick-action-arrow {
  color: var(--navy-700);
  font-size: 1.1rem;
  font-weight: 900;
}

.dashboard-stats .stat-card {
  position: relative;
  overflow: hidden;
  padding: 1.15rem;
}

.dashboard-stats .stat-card::after {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--gold-500);
  content: '';
}

.stat-card strong {
  font-size: clamp(1.6rem, 2.6vw, 2rem);
  letter-spacing: -0.035em;
}

.toolbar input[type="search"] {
  min-width: min(260px, 100%);
}

.data-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: #f1f5f8;
}

.data-table tbody tr:nth-child(even) {
  background: #fcfdfe;
}

.data-table tbody tr:hover {
  background: #f4f8fb;
}

.empty-state {
  margin: 0.75rem;
  padding: 2rem 1.25rem;
  border: 1px dashed #c8d3dd;
  border-radius: 10px;
  background: #fafcfd;
}

.danger-callout {
  padding: 1rem;
  border: 1px solid #e5adb5;
  border-left: 5px solid var(--danger);
  border-radius: 10px;
  background: #fff7f8;
}

.danger-callout p:last-child {
  margin-bottom: 0;
}

.flash {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.75rem 0.75rem 0.95rem;
  border: 1px solid #c7d7e3;
  border-left: 5px solid var(--success);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
}

.flash.is-error {
  border-color: #e4b5bd;
  border-left-color: var(--danger);
  background: #fff8f9;
}

.flash-close {
  display: inline-grid;
  width: 36px;
  min-width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  font-size: 1.2rem;
}

.flash-close:hover {
  background: var(--surface-3);
}

.global-search-dialog {
  width: min(94vw, 720px);
  max-height: min(80vh, 720px);
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: transparent;
  box-shadow: var(--shadow-md);
}

.global-search-dialog::backdrop {
  background: rgba(3, 13, 24, 0.58);
  backdrop-filter: blur(2px);
}

.global-search-shell {
  overflow: hidden;
  border: 1px solid #cbd6df;
  border-radius: 16px;
  background: #fff;
}

.global-search-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1rem 0.7rem;
}

.global-search-header h2 {
  margin-bottom: 0;
}

.global-search-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  margin: 0 1rem 0.75rem;
  padding: 0 0.7rem;
  border: 2px solid #8fa6b9;
  border-radius: 10px;
  background: #fff;
}

.global-search-field:focus-within {
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 3px rgba(44, 123, 229, 0.15);
}

.global-search-field input {
  min-height: 52px;
  padding-inline: 0;
  border: 0;
  outline: 0;
  box-shadow: none;
}

.global-search-results {
  display: grid;
  max-height: min(52vh, 470px);
  overflow-y: auto;
  padding: 0.25rem 0.55rem 0.65rem;
}

.global-search-result {
  display: grid;
  width: 100%;
  min-height: 60px;
  grid-template-columns: 94px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 0.75rem;
  border: 0;
  border-radius: 9px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.global-search-result:hover,
.global-search-result:focus-visible {
  background: var(--navy-100);
}

.search-result-type {
  color: var(--navy-700);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.search-result-copy {
  min-width: 0;
}

.search-result-copy strong,
.search-result-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-copy small {
  margin-top: 0.2rem;
  color: var(--muted);
}

.search-result-arrow {
  color: var(--navy-700);
  font-weight: 900;
}

.global-search-empty {
  padding: 2.25rem 1rem;
  color: var(--muted);
  text-align: center;
}

.global-search-empty p {
  margin: 0.35rem 0 0;
}

.global-search-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-subtle);
  font-size: 0.76rem;
}

.modal-shell,
.tutorial-dialog-shell,
.page-preview-dialog {
  box-shadow: var(--shadow-md);
}

@media (max-width: 1100px) {
  .topbar-search-button {
    min-width: 150px;
  }

  .topbar-search-button kbd {
    display: none;
  }
}

@media (max-width: 860px) {
  .sidebar {
    width: min(86vw, 320px);
    box-shadow: 14px 0 36px rgba(3, 13, 24, 0.32);
  }

  .main-content {
    width: 100%;
  }

  .nav-group-label {
    font-size: 0.72rem;
  }
}

@media (max-width: 700px) {
  .topbar-search-button {
    width: 44px;
    min-width: 44px;
    padding: 0;
    justify-content: center;
  }

  .topbar-search-label,
  .topbar-search-button kbd {
    display: none;
  }

  .quick-actions-heading {
    display: block;
  }

  .quick-actions-heading > p {
    margin-top: 0.35rem;
  }

  .quick-actions-grid {
    grid-template-columns: 1fr;
  }

  .global-search-dialog {
    width: 100vw;
    max-width: none;
    height: 100vh;
    max-height: none;
    border-radius: 0;
  }

  .global-search-shell {
    display: grid;
    height: 100%;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    border: 0;
    border-radius: 0;
  }

  .global-search-results {
    max-height: none;
  }

  .global-search-result {
    grid-template-columns: 74px minmax(0, 1fr) auto;
    min-height: 68px;
  }

  .global-search-footer {
    padding-bottom: max(0.65rem, env(safe-area-inset-bottom));
  }

  .view-header {
    gap: 0.85rem;
  }

  .header-actions {
    justify-content: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-item,
  .button,
  .icon-button {
    transition: none;
  }
}

/* Mobile target-size corrections retained in the Site Manager fork */
.topbar-search-button {
  min-height: 44px;
}

@media (max-width: 860px) {
  .cms-breadcrumbs button {
    min-height: 44px;
    padding-block: 0.5rem;
  }
}

@media (max-width: 960px) and (max-height: 600px) {
  .cms-breadcrumbs button {
    min-height: 44px;
    padding-block: 0.5rem;
  }
}

/* Utility class used by preview and search controls. */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  padding: 0 !important;
  white-space: nowrap !important;
}

#main-content:focus {
  outline: none;
}

.global-search-field input {
  min-width: 0;
}

/* VFW Site Manager v1.0.0 — streamlined interface */
:root {
  --sidebar-width: 212px;
  --topbar-height: 64px;
  --content-max: 1440px;
}

.sidebar nav {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 0.65rem;
}

.nav-spacer { flex: 1 1 auto; min-height: 1rem; }
.nav-item-secondary { border-top: 1px solid rgba(255,255,255,.1); margin-top: .35rem; }

.main-content {
  padding-top: calc(var(--topbar-height) + 1.35rem);
}

.view-header {
  align-items: end;
  margin-bottom: 1.35rem;
}

.view-heading > p:last-child {
  max-width: 72ch;
  margin-bottom: 0;
}

.simple-start,
.simple-status { margin-bottom: 1.5rem; }

.simple-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .8rem;
}

.simple-section-heading h2 { margin-bottom: 0; font-size: 1.35rem; }

.simple-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: .85rem;
}

.simple-hub-grid-primary { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.simple-hub-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto 28px;
  align-items: center;
  gap: .85rem;
  min-height: 106px;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: left;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.simple-hub-card:hover,
.simple-hub-card:focus-visible {
  border-color: #8ea7bb;
  box-shadow: 0 8px 22px rgba(7,25,43,.10);
  transform: translateY(-1px);
}

.simple-hub-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--navy-800);
  font-size: 1.3rem;
  font-weight: 900;
}

.simple-hub-copy { display: grid; gap: .28rem; min-width: 0; }
.simple-hub-copy strong { font-size: 1rem; }
.simple-hub-copy small { color: var(--muted); line-height: 1.4; }
.simple-hub-count { padding: .28rem .5rem; border-radius: 999px; color: var(--navy-800); background: var(--navy-100); font-size: .78rem; font-weight: 800; white-space: nowrap; }
.simple-hub-arrow { color: var(--navy-700); font-size: 1.25rem; font-weight: 900; }

.simple-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .7rem;
}

.simple-status-grid article {
  display: grid;
  gap: .15rem;
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.simple-status-grid strong { font-size: 1.55rem; color: var(--navy-800); }
.simple-status-grid span { color: var(--muted); font-size: .86rem; }

.simple-upcoming { max-width: 960px; }
.simple-event-list li { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.simple-event-list li:last-child { border-bottom: 0; }
.simple-event-list li > div { display: grid; gap: .2rem; }
.simple-event-list span { color: var(--muted); font-size: .86rem; }

.simple-tip {
  display: flex;
  align-items: center;
  gap: .75rem 1.1rem;
  margin-top: 1rem;
  padding: .85rem 1rem;
  border-left: 4px solid var(--gold-500);
  border-radius: 8px;
  background: #fffaf0;
}
.simple-tip span { color: var(--muted); }

/* Keep complex tools available, but visually quieter than the primary workflow. */
.structure-tabs,
.tab-list { border-radius: 10px; }

@media (max-width: 900px) {
  .simple-hub-grid-primary { grid-template-columns: 1fr; }
  .simple-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .simple-hub-grid { grid-template-columns: 1fr; }
  .simple-hub-card { grid-template-columns: 44px minmax(0, 1fr) 24px; min-height: 92px; padding: .85rem; }
  .simple-hub-icon { width: 44px; height: 44px; }
  .simple-hub-count { grid-column: 2; justify-self: start; }
  .simple-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .simple-event-list li { align-items: stretch; flex-direction: column; }
  .simple-event-list .button { width: 100%; }
  .simple-tip { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 860px) {
  .role-matrix-header {
    align-items: stretch;
  }

  .role-matrix-controls {
    width: 100%;
  }

  .role-matrix-scroll-button {
    flex: 1 1 0;
    min-height: 44px;
  }
}

@media (max-width: 640px) {
  .role-matrix-controls {
    display: none;
  }
}

.site-switcher-label {
  display: block;
}

.site-switcher {
  width: min(280px, 32vw);
  min-height: 30px;
  padding: 0.15rem 1.7rem 0.15rem 0;
  border: 0;
  color: var(--gold-300);
  background: transparent;
  font: inherit;
  font-size: 0.76rem;
  cursor: pointer;
}

.site-switcher option {
  color: var(--ink);
  background: #fff;
}

.site-switcher:focus-visible {
  outline: 3px solid var(--gold-300);
  outline-offset: 2px;
}

.site-record-list {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.record-card.is-current-site {
  border-color: var(--gold-500);
  box-shadow: inset 0 0 0 1px var(--gold-500);
}

@media (max-width: 640px) {
  .site-switcher {
    width: min(42vw, 190px);
  }
}


/* Home page highlights */

.vfw-slider{container-type:inline-size;width:100%;max-width:none;margin:0 auto 1.5rem;background:#102a43;color:#fff;overflow:hidden}
.vfw-slider *{box-sizing:border-box}.vfw-slider [hidden]{display:none!important}
.vfw-slider .vfw-slider-stage{width:100%;aspect-ratio:var(--slider-width,1440)/var(--slider-height,360)}
.vfw-slider .vfw-slide{height:100%;min-height:0}
.vfw-slider .vfw-slide-art,.vfw-slider .vfw-slide-art a{display:block;width:100%;height:100%}
.vfw-slider .vfw-slide-art img{display:block;width:100%;height:100%;object-fit:contain}
.vfw-slider .vfw-slider-controls{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:4px;padding:4px 8px;background:#081f33}
.vfw-slider button{min-width:44px;min-height:44px;border:1px solid #8496a8;border-radius:5px;background:#173b5f;color:#fff;cursor:pointer;font:700 18px Arial,sans-serif}
.vfw-slider .vfw-slider-dots{display:flex;flex-wrap:wrap;justify-content:center;gap:2px}.vfw-slider [data-slide-index]{border:0;background:transparent}.vfw-slider [data-slide-index] span{display:block;margin:auto;width:12px;height:12px;border:2px solid #fff;border-radius:50%}.vfw-slider [aria-current="true"] span{background:#eed483;border-color:#eed483}
.vfw-slider .vfw-slider-count{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.vfw-slider button:focus-visible,.vfw-slider a:focus-visible{outline:3px solid #eed483;outline-offset:3px}
@container(max-width:640px){.vfw-slider .vfw-slider-dots{order:3;flex-basis:100%}}
@media print{.vfw-slider .vfw-slider-controls{display:none}}

/* File Explorer transfers */
.file-drop-hint{display:grid;gap:.4rem;margin:.8rem;padding:1.2rem;border:2px dashed #60778c;border-radius:.6rem;background:#f4f7f9;color:#102a43;text-align:center}
.file-drop-hint p{margin:0}.file-transfer-status{margin:.5rem .8rem;min-height:1.4em;font-weight:600}
[data-file-drop-zone].is-file-drop-target{outline:3px solid #b58915;outline-offset:-3px;background:#fff8df}
[data-folder-id].is-file-drop-target,[data-open-folder].is-file-drop-target{outline:3px solid #b58915;background:#fff0bd;color:#102a43}
[data-select-file][draggable="true"]{cursor:grab}[data-select-file][draggable="true"]:active{cursor:grabbing}

/* Full File Explorer preview */
.modal.modal-file-preview{width:min(1600px,96vw);max-width:96vw;height:94dvh;max-height:94dvh}
.modal-file-preview .modal-shell{height:100%;max-height:none;display:flex;flex-direction:column}
.modal-file-preview .modal-body{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden;padding:1rem}
.file-preview-summary{display:flex;flex-wrap:wrap;gap:.4rem 1.2rem;margin-bottom:.7rem;font-size:.9rem;color:var(--muted)}
.file-preview-content{flex:1;min-height:0;overflow:auto;background:#f4f7f9;border:1px solid var(--line);border-radius:6px}
.file-preview-content iframe{display:block;width:100%;height:100%;min-height:250px;border:0;background:white}
.file-preview-content img{display:block;width:100%;height:100%;object-fit:contain}
.file-preview-content pre{margin:0;padding:1rem;white-space:pre-wrap;overflow-wrap:anywhere;font-size:1rem}
.modal-file-preview .modal-header,.modal-file-preview .modal-actions{flex:none}
@media(max-width:600px){.modal.modal-file-preview{width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;margin:0;border-radius:0}.modal-file-preview .modal-body{padding:.5rem}.file-preview-summary{font-size:.8rem}}

/* Slider File Explorer picker */
.slider-file-picker{width:min(1000px,96vw);max-width:96vw}
.slider-file-picker .modal-shell{max-height:90dvh}
.slider-image-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:.8rem;margin:1rem 0}
.slider-image-choice{display:flex;align-items:center;gap:.7rem;padding:.8rem;border:1px solid var(--line);border-radius:8px;background:#fff;cursor:pointer;min-width:0}
.slider-image-choice:has(input:checked){border-color:#b58915;background:#fff7d8}
.slider-image-choice img{width:90px;height:70px;object-fit:contain;background:#f4f7f9;flex-shrink:0}
.slider-image-choice span{min-width:0;overflow-wrap:anywhere}.slider-image-choice small{display:block;margin-top:.3rem;color:var(--muted)}
.slider-image-choice input{min-width:22px;min-height:22px}
.slider-file-picker [data-picker-status]{margin-right:auto;align-self:center}
[data-slider-file-picker]{margin-top:.5rem}
@media(max-width:600px){.slider-image-list{grid-template-columns:1fr}}

/* Start here card ordering */
.start-order-card{display:flex;flex-direction:column;gap:.35rem;min-width:0;cursor:grab;border-radius:12px}
.start-order-card>.simple-hub-card{flex:1;width:100%}
.start-order-controls{display:flex;gap:.35rem;align-items:center;justify-content:flex-end}
.start-order-controls>span{margin-right:auto;color:#526273;font-size:1.4rem}
.start-order-controls button{min-width:44px;min-height:44px}
.start-order-card.is-start-dragging{opacity:.55}
.start-order-card.is-start-drop-target{outline:3px solid #b58915;outline-offset:3px;background:#fff8df}

/* CMS HTML editing controls */
#modal .html-editor-tools{display:flex;gap:.45rem;flex-wrap:wrap;margin:.65rem 0}
#modal .html-editor-tools button{min-height:44px}
#modal .html-editor-tools [aria-pressed="true"]{background:var(--navy);color:#fff;border-color:var(--navy)}
#modal .jodit-container{max-width:100%;min-width:0;font-family:Arial,sans-serif}
#modal .jodit-toolbar-button{min-height:44px;min-width:44px}
#modal .jodit-source__mirror{font:15px/1.6 Consolas,monospace;tab-size:2}
#modal .jodit-popup,#modal .jodit-dialog{z-index:700}
#modal .html-editor-file-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:.65rem;margin:1rem 0;max-height:45vh;overflow:auto}
#modal .html-editor-file-choice{display:flex;align-items:center;gap:.7rem;border:1px solid var(--line);padding:.7rem;border-radius:6px;cursor:pointer}
#modal .html-editor-file-choice img{object-fit:contain;max-width:100px}
#modal .html-editor-file-choice small{display:block}
@media(max-width:600px){#modal .jodit-toolbar__box{overflow-x:auto}#modal .html-editor-tools{gap:.35rem}#modal .html-editor-tools button{flex:1 1 135px}}
#modal .html-editor-upload{display:inline-flex;gap:.5rem;align-items:center;margin-top:.75rem;flex-wrap:wrap}
#modal .html-editor-upload input{max-width:100%;font-size:14px}
@media(max-width:600px){#modal .jodit-container.jodit_split_mode .jodit-workplace{flex-direction:column}#modal .jodit-container.jodit_split_mode .jodit-wysiwyg_iframe,#modal .jodit-container.jodit_split_mode .jodit-source{width:100%;min-height:140px}}

/* v1.12.0 Personal Notepad — always available across CMS screens, hidden in previews. */
.cms-notepad {
  position: fixed;
  z-index: 45;
  top: var(--topbar-height);
  right: 0;
  bottom: 0;
  display: flex;
  width: var(--notepad-width, 354px);
  max-width: 100vw;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  border-left: 2px solid var(--gold-500);
  color: var(--ink);
  background: #fffefb;
  box-shadow: -8px 0 28px rgba(7, 25, 43, 0.15);
}
.notepad-launch {
  min-height: 44px;
  border: 1px solid rgba(255,255,255,.45);
  color: #fff;
  background: rgba(255,255,255,.09);
  white-space: nowrap;
}
.notepad-launch[aria-expanded="true"] { border-color: var(--gold-300); color: var(--gold-300); }
.notepad-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem .85rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.notepad-heading-row h2 { margin: 0; font-size: 1.35rem; }
.notepad-heading-row .eyebrow { margin-bottom: .2rem; }
.notepad-close { min-width: 44px; min-height: 44px; font-size: 1.7rem; }
.notepad-tools { display: grid; gap: .55rem; padding: 1rem 1rem .8rem; border-bottom: 1px solid var(--line); }
.notepad-tools > label,
.notepad-editor > label { font-size: .83rem; font-weight: 750; color: var(--navy-800); }
.notepad-tools select { min-width: 0; background: #fff; }
.notepad-tool-buttons { display: flex; gap: .5rem; }
.notepad-tool-buttons > button { flex: 1; min-height: 44px; }
.notepad-editor { display: flex; flex: 1; min-height: 0; flex-direction: column; gap: .5rem; padding: .8rem 1rem; }
.notepad-editor input { flex: none; }
.notepad-editor textarea {
  display: block;
  flex: 1;
  width: 100%;
  min-height: 130px;
  padding: .9rem;
  resize: none;
  border: 1px solid #aeb9c5;
  border-radius: 8px;
  background: repeating-linear-gradient(#fffefa, #fffefa 29px, #e3e9f0 30px);
  font: 1rem/30px ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  color: #152839;
  overflow-y: auto;
}
.notepad-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .4rem;
  padding: .7rem 1rem 1rem;
  border-top: 1px solid var(--line);
  color: #465766;
  background: #f8fafc;
  font-size: .77rem;
}
.notepad-footer #notepad-status { color: #17663b; font-weight: 650; }
.notepad-footer small { width: 100%; line-height: 1.4; }
@media (min-width: 1101px) {
  .app-shell.notepad-open .main-content {
    width: calc(100% - var(--sidebar-width) - var(--notepad-width, 354px));
    max-width: none;
  }
}
@media (max-width: 1100px) {
  .cms-notepad { z-index: 60; box-shadow: -12px 0 40px rgba(7,25,43,.3); }
}
@media (max-width: 640px) {
  .notepad-launch { min-width: 44px; padding: .5rem; font-size: 0; }
  .notepad-launch span { font-size: 1.2rem; }
  .cms-notepad {
    top: 0;
    bottom: 0;
    width: min(100vw, 390px);
    height: 100dvh;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
}
@media print {
  .cms-notepad, .notepad-launch { display: none !important; }
  .app-shell.notepad-open .main-content { width: 100%; }
}

/* v1.13.1 — Site Manager heading is the clickable, accessible role picker. */
.topbar-brand { min-width: 0; flex: 0 1 auto; }
.topbar-brand > div { min-width: 0; }
.topbar-brand-heading { display: flex; align-items: center; min-width: 0; }
.topbar-brand > div > .site-switcher-label {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-top: .12rem;
}
.topbar-brand > div > .site-switcher-label .site-switcher {
  width: clamp(135px, 18vw, 230px);
  max-width: 100%;
}
.role-switcher-label { display: flex; align-items: center; min-width: 0; }
.role-switcher {
  width: clamp(155px, 18vw, 220px);
  min-height: 33px;
  padding: .16rem 1.2rem .16rem 0;
  border: 1px solid transparent;
  border-bottom-color: rgba(241, 212, 134, .45);
  border-radius: 0;
  color: #fff;
  background-color: var(--navy-950);
  font-size: 1rem;
  font-weight: 800;
  text-overflow: ellipsis;
  cursor: pointer;
}
.role-switcher:hover { color: var(--gold-300); border-bottom-color: var(--gold-300); }
.role-switcher option { color: #fff; background: var(--navy-900); font-weight: 600; }
.role-switcher:disabled { opacity: .85; cursor: wait; }
@media (max-width: 1240px) {
  .role-switcher { width: clamp(145px, 17vw, 195px); }
  .topbar-actions { gap: .4rem; }
}
@media (max-width: 860px) {
  .topbar-brand > div { display: block; }
  .topbar-brand > div > .site-switcher-label { display: none; }
  .role-switcher { width: min(26vw, 175px); min-width: 110px; }
  .topbar-brand { gap: .35rem; }
}
@media (max-width: 550px) {
  .topbar-brand .brand-mark { display: none; }
  .role-switcher { width: min(24vw, 114px); min-width: 88px; padding-right: .4rem; font-size: .82rem; }
  .topbar-actions { gap: .2rem; }
  .topbar { gap: .3rem; }
}

/* v1.14.0 — browser identity, live website actions, slider diagnostics, image picker upload. */
.browser-indicator {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: .2rem .55rem;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 6px;
  color: var(--gold-300);
  background: rgba(255,255,255,.07);
  font-size: .76rem;
  font-weight: 700;
  white-space: nowrap;
}
.live-site-launch { min-height: 39px; padding: .42rem .6rem; white-space: nowrap; }
.slider-error-report {
  margin: .9rem 0;
  padding: .85rem 1rem;
  border: 2px solid #c7a354;
  border-radius: 8px;
  color: #28351c;
  background: #fff7d7;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.slider-error-report.has-errors { border-color: #a61b29; color: #7b1120; background: #ffedf0; }
.slider-picker-upload {
  display: grid;
  gap: .45rem;
  margin: 1rem 0;
  padding: 1rem;
  border: 2px dashed #587992;
  border-radius: 10px;
  background: #f4f8fb;
}
.slider-picker-upload [data-picker-upload-status] { overflow-wrap: anywhere; }
@media (max-width: 1200px) {
  .browser-indicator { font-size: .68rem; padding-inline: .3rem; }
  .live-site-launch { padding-inline: .3rem; font-size: .78rem; }
}
@media (max-width: 980px) {
  .browser-indicator { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .live-site-launch { font-size: 0; min-width: 44px; }
  .live-site-launch::before { content: '↗'; font-size: 1.2rem; }
}
@media (max-width: 700px) {
  .browser-indicator { position: absolute; top: calc(100% + 3px); right: .2rem; min-height: 20px; border: 0; border-radius: 0 0 4px 4px; color: #fff; background: var(--navy-700); font-size: .63rem; z-index: 2; }
}
@media print { .browser-indicator, .live-site-launch { display:none !important; } }

.site-demo-options { display:flex;flex-wrap:wrap;gap:.65rem;padding:1rem; }
.site-demo-options .button { min-height:44px; }
.site-demo-layout { display:grid;grid-template-columns:minmax(180px,250px) minmax(0,1fr);gap:1rem;min-height:330px; }
.site-demo-nav { display:flex;flex-direction:column;gap:.2rem;overflow-y:auto;max-height:65vh;border:1px solid var(--line);padding:.55rem;border-radius:8px;background:var(--surface-2); }
.site-demo-nav button { min-height:44px;padding:.55rem .7rem;border:0;border-radius:5px;background:transparent;color:var(--navy-900);font-weight:700;text-align:left; }
.site-demo-nav button:hover,.site-demo-nav button[aria-current="true"] { background:var(--navy-700);color:#fff; }
.site-demo-content { padding:1.25rem;border:1px solid var(--line);border-radius:8px;background:#fff; }
@media (max-width:640px) { .site-demo-layout { grid-template-columns:1fr; }.site-demo-nav { max-height:185px; }.site-demo-content { min-height:240px; } }

/* v1.16.1 — Live website card matches the spacing/alignment of other hub cards. */
.simple-hub-grid > .live-hub-card {
  grid-template-columns: 48px minmax(0, 1fr) 28px;
  width: 100%;
  min-width: 0;
  text-decoration: none;
}
.simple-hub-grid > .live-hub-card .simple-hub-copy {
  min-width: 0;
  overflow-wrap: anywhere;
}
.simple-hub-grid > .live-hub-card .simple-hub-arrow {
  justify-self: end;
}
@media (max-width: 640px) {
  .simple-hub-grid > .live-hub-card {
    grid-template-columns: 44px minmax(0, 1fr) 24px;
  }
}

/* v1.17.0: publishing/recovery controls and Identity and Access validation. */
.page-workflow-actions{display:flex;flex-wrap:wrap;align-items:center;gap:.45rem;max-width:100%;padding:.2rem 0}
.page-workflow-actions .button{min-height:44px;white-space:normal}
.identity-security-policy{margin-bottom:1rem;border-left:4px solid var(--gold-500)}
.identity-security-policy .panel-body{display:grid;gap:.65rem}
.identity-security-policy .panel-body>p{margin:.2rem 0;max-width:85ch}
.identity-security-policy .button{justify-self:start;min-height:44px}
.identity-feedback{padding:.85rem 1rem;border-radius:8px;background:#e8f5ee;color:#173f2d;border:1px solid #386a52;font-weight:700;overflow-wrap:anywhere}
.identity-feedback.is-error{background:#fff0f2;color:#821625;border:2px solid #a52b38}
.backup-list{display:grid;gap:.5rem;margin-top:1rem}
.backup-entry{display:flex;align-items:center;justify-content:space-between;gap:.75rem;border:1px solid var(--line);border-radius:8px;padding:.75rem 1rem;overflow-wrap:anywhere}
.backup-entry .button{min-height:44px;flex:none}
@media(max-width:700px){
  .page-workflow-actions{width:100%}
  .page-workflow-actions .button{flex:1 1 160px}
  .backup-entry{align-items:stretch;flex-direction:column}
  .backup-entry .button{width:100%}
}
@media(prefers-reduced-motion:reduce){.page-workflow-actions .button{transition:none}}

