/*
 * Connect CMS Admin — v18.24
 * Flat editorial workspace for high-end property administration.
 * Presentation only: field names, IDs, requests and guest-facing code remain unchanged.
 */

@font-face {
  font-family: "Connect CMS UI";
  src: url("assets/fonts/connect-cms-ui-variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root,
html[data-theme="dark"] {
  --font-ui: "Connect CMS UI", Montserrat, "Avenir Next", Avenir, "Segoe UI", sans-serif;
  color-scheme: dark;
  --header-h: 72px;
  --sidebar-w: 272px;
  --page-max: 1320px;
  --label-w: 310px;
  --action-w: 72px;

  --bg: #101114;
  --bg-subtle: #14161a;
  --header-bg: rgba(16, 17, 20, .92);
  --nav-bg: #0c0d0f;
  --surface: #191b20;
  --surface-raised: #1e2026;
  --surface-soft: #17191d;
  --control: #20232a;
  --control-hover: #262a32;
  --row-bg: transparent;
  --card: var(--surface);
  --panel: var(--surface);

  --fg: #f5f5f4;
  --text: #f5f5f4;
  --secondary: #a7a9b0;
  --tertiary: #72757e;
  --muted: #a7a9b0;
  --nav-btn-fg: #dbdce0;
  --nav-btn-fg-sub: #a3a5ad;
  --nav-title: #777a84;

  --line: rgba(255,255,255,.075);
  --line-strong: rgba(255,255,255,.14);
  --border: var(--line);
  --border-strong: var(--line-strong);
  --input-bg: #1b1e24;
  --input-fg: #f5f5f4;
  --input-border: rgba(255,255,255,.13);
  --nav-hover: rgba(255,255,255,.05);
  --nav-active: rgba(88,166,255,.13);

  --accent: #5aa4f4;
  --accent-strong: #2489f4;
  --accent-soft: rgba(90,164,244,.13);
  --blue: #5aa4f4;
  --green: #36c98f;
  --red: #ff6259;
  --amber: #f0b34b;

  --btn-primary-bg: #252830;
  --btn-primary-border: rgba(255,255,255,.11);
  --btn-primary-fg: #f2f3f5;
  --btn-accent-bg: #2489f4;
  --btn-accent-border: #2489f4;
  --btn-accent-fg: #fff;
  --focus-ring: 0 0 0 3px rgba(90,164,244,.22);
  --soft-shadow: 0 18px 50px rgba(0,0,0,.24);
  --checker-a: #30333a;
  --checker-b: #202228;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f5f7;
  --bg-subtle: #eef0f3;
  --header-bg: rgba(255,255,255,.92);
  --nav-bg: #f8f8fa;
  --surface: #fff;
  --surface-raised: #fff;
  --surface-soft: #f7f8fa;
  --control: #fff;
  --control-hover: #f7f8fa;
  --row-bg: transparent;
  --card: #fff;
  --panel: #fff;

  --fg: #202124;
  --text: #202124;
  --secondary: #64676f;
  --tertiary: #93969e;
  --muted: #64676f;
  --nav-btn-fg: #34363b;
  --nav-btn-fg-sub: #62656c;
  --nav-title: #92959d;

  --line: rgba(29,34,43,.095);
  --line-strong: rgba(29,34,43,.17);
  --border: var(--line);
  --border-strong: var(--line-strong);
  --input-bg: #fff;
  --input-fg: #202124;
  --input-border: rgba(29,34,43,.16);
  --nav-hover: rgba(29,34,43,.045);
  --nav-active: rgba(28,126,214,.11);

  --accent: #1d7ed6;
  --accent-strong: #116fc3;
  --accent-soft: rgba(29,126,214,.1);
  --blue: #1d7ed6;
  --green: #16885f;
  --red: #d9463e;
  --amber: #a66e11;

  --btn-primary-bg: #f0f2f5;
  --btn-primary-border: rgba(29,34,43,.1);
  --btn-primary-fg: #202124;
  --btn-accent-bg: #1d7ed6;
  --btn-accent-border: #1d7ed6;
  --btn-accent-fg: #fff;
  --focus-ring: 0 0 0 3px rgba(29,126,214,.17);
  --soft-shadow: 0 18px 45px rgba(40,45,55,.12);
  --checker-a: #d8dbe0;
  --checker-b: #fff;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  min-width: 320px;
  background: var(--bg);
  scrollbar-color: var(--tertiary) transparent;
}

body.admin-shell,
body.admin-login {
  color: var(--fg);
  font-family: var(--font-ui);
  letter-spacing: -.012em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.admin-shell {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
}

::selection { background: rgba(90,164,244,.28); }

* { scrollbar-width: thin; scrollbar-color: var(--tertiary) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 99px;
  background: var(--tertiary);
  background-clip: padding-box;
}

/* Application header */
body.admin-shell > header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-h);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 16px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
}

.brand {
  width: calc(var(--sidebar-w) - 18px);
  min-width: calc(var(--sidebar-w) - 18px);
  display: flex;
  align-items: center;
  gap: 11px;
}

.brandmark {
  width: 38px;
  min-width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface-raised);
  color: var(--secondary);
  box-shadow: inset 0 1px rgba(255,255,255,.05);
}

.brandmark svg {
  width: 17px;
  height: 17px;
  display: block;
  stroke: currentColor;
}

.brandtext .title {
  color: var(--fg);
  font-size: 14px;
  line-height: 1.2;
  font-weight: 720;
  letter-spacing: -.015em;
}

.brandtext .subline {
  margin-top: 4px;
  color: var(--tertiary);
  font-size: 11px;
  line-height: 1.2;
  text-transform: capitalize;
}

.brandtext .subline strong { color: var(--secondary); font-weight: 580; }
.header-spacer { flex: 1 1 auto; }

.header-controls {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.hdr-form,
.theme-picker {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.theme-options {
  height: 36px;
  padding: 3px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.theme-option {
  width: 30px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--tertiary);
  cursor: pointer;
  transition: color .15s, background .15s;
}

.theme-option:hover { color: var(--fg); background: var(--nav-hover); }
.theme-option.active { color: var(--fg); background: var(--btn-primary-bg); }
.theme-option:focus-visible { outline: 0; box-shadow: var(--focus-ring); }
.theme-option svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-option svg circle { fill: currentColor; stroke: none; }

.hdr-label {
  color: var(--tertiary);
  font-size: 10px;
  line-height: 1;
  font-weight: 750;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.hdr-select,
body.admin-shell header select {
  min-height: 36px !important;
  width: auto !important;
  max-width: 220px;
  padding: 0 30px 0 10px !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  background-color: var(--surface) !important;
  color: var(--fg) !important;
  font-size: 12px !important;
  font-weight: 560;
  box-shadow: none !important;
}

.logout-btn {
  min-height: 36px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 620;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
}

.logout-btn:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--fg);
}

.logout-btn .ico,
.logout-btn svg { width: 15px; height: 15px; }

/* Sidebar */
.layout {
  min-height: calc(100vh - var(--header-h));
  display: grid !important;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  align-items: stretch;
}

body.admin-shell nav.sidenav {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  width: auto !important;
  min-width: 0 !important;
  padding: 18px 13px 28px;
  overflow-y: auto;
  background: var(--nav-bg) !important;
  border-right: 1px solid var(--line);
}

.nav-top { display: flex; flex-direction: column; gap: 7px; }
.nav-solo {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}
.nav-acc { margin: 0; border: 0; background: transparent !important; }
html[data-theme="dark"] body.admin-shell .nav-acc { background: transparent !important; }
.nav-acc > summary { list-style: none; }
.nav-acc > summary::-webkit-details-marker { display: none; }

.nav-sum,
.nav-btn {
  position: relative;
  width: 100%;
  min-height: 39px;
  margin: 0;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--nav-btn-fg);
  font: inherit;
  font-size: 12.5px;
  line-height: 1.2;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: color .15s, background .15s;
}

.nav-sum:hover,
.nav-btn:hover { background: var(--nav-hover); color: var(--fg); }
.nav-btn.active { background: var(--nav-active); color: var(--accent); }
.nav-solo-btn { color: var(--nav-btn-fg); }
.nav-solo .nav-solo-btn {
  min-height: 39px;
  padding: 0 10px;
  border-radius: 7px;
}
.nav-solo .nav-solo-btn.active {
  background: transparent !important;
  color: var(--fg);
}
.nav-sum-spacer {
  width: 6px;
  min-width: 6px;
  height: 6px;
  margin: 0 3.5px;
  border-radius: 50%;
  background: transparent;
}
.nav-solo .nav-solo-btn.active .nav-sum-spacer { background: var(--secondary); }

.nav-sum .ico,
.nav-btn .ico {
  width: 17px;
  min-width: 17px;
  height: 17px;
  display: inline-flex;
  color: var(--tertiary);
}

.nav-btn.active .ico { color: var(--accent); }
.nav-sum .ico svg,
.nav-btn .ico svg { width: 100%; height: 100%; }
.nav-sum-title { min-width: 0; flex: 1; }
.nav-sum-chev {
  width: 13px !important;
  min-width: 13px !important;
  transition: transform .16s ease;
}
.nav-acc[open] > .nav-sum .nav-sum-chev { transform: rotate(90deg); }
.nav-items { padding: 2px 0 8px 19px; display: grid; gap: 1px; }
.nav-items .nav-btn {
  min-height: 35px;
  padding-left: 11px;
  color: var(--nav-btn-fg-sub);
  font-size: 12px;
  font-weight: 520;
}
.nav-items .nav-btn .ico { width: 15px; min-width: 15px; height: 15px; opacity: .8; }

/* Flat content canvas */
.content {
  min-width: 0;
  width: 100%;
  padding: 0 42px 72px !important;
  overflow: visible !important;
  background: var(--bg);
}

.panel {
  display: none;
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0;
}

.panel.active { display: block; animation: panel-in .2s ease both; }
@keyframes panel-in { from { opacity: 0; transform: translateY(4px); } }

.panel > .card {
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.panel > .card > h2,
.panel > .card > .panel-head {
  min-height: 126px;
  margin: 0 !important;
  padding: 43px 0 30px !important;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  border-bottom: 1px solid var(--line-strong);
  background: transparent !important;
}

.panel > .card > .panel-head h2 { margin: 0 !important; }

.panel h2 {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  color: var(--fg);
  font-size: clamp(27px, 2.25vw, 36px) !important;
  line-height: 1.08 !important;
  font-weight: 680 !important;
  letter-spacing: -.035em !important;
}

.panel h2::before {
  content: attr(data-eyebrow);
  display: none;
}

.panel h2::after {
  content: attr(data-description);
  max-width: 760px;
  margin-top: 12px;
  color: var(--secondary);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 430;
  letter-spacing: -.006em;
}

.panel > .card > .body {
  padding: 0 !important;
  border: 0;
  background: transparent;
}

.panel form { margin: 0; }

/* Section headings and navigation */
.subpane-heading,
.section-heading { display: none !important; }

.subpane-heading > div,
.section-heading > div { max-width: 720px; }

.section-kicker,
.section-heading > div > span {
  display: block;
  margin-bottom: 7px;
  color: var(--tertiary);
  font-size: 9px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.subpane-heading h3,
.section-heading h3 {
  margin: 0;
  color: var(--fg);
  font-size: 19px;
  line-height: 1.25;
  font-weight: 660;
  letter-spacing: -.025em;
}

.subpane-heading p,
.section-heading p {
  margin: 6px 0 0;
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.5;
}

.settings-section + .settings-section { margin-top: 32px; }

.subtabs {
  position: sticky;
  top: var(--header-h);
  z-index: 20;
  min-height: 54px;
  margin: 0 !important;
  padding: 0;
  display: flex;
  align-items: stretch;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 91%, transparent);
  backdrop-filter: blur(15px);
}

.subtab {
  position: relative;
  min-height: 54px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--tertiary);
  font-size: 12px;
  font-weight: 640;
  cursor: pointer;
}

.subtab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: transparent;
}

.subtab:hover { color: var(--secondary); }
.subtab.active { color: var(--fg); }
.subtab.active::after { background: var(--accent); }
.subpanel { display: none; }
.subpanel.active { display: block; }

/* Setting rows */
.rows {
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0 !important;
  background: transparent !important;
  overflow: visible !important;
}

.editor-toolbar + .rows { border-top: 0; }

.rowline {
  width: 100%;
  min-height: 98px;
  margin: 0 !important;
  padding: 22px 0 !important;
  display: grid !important;
  grid-template-columns: minmax(210px, var(--label-w)) minmax(0, 1fr) minmax(0, var(--action-w));
  align-items: start !important;
  gap: 30px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transition: background .15s;
}

.rows > .rowline:last-child,
form > .rowline:last-of-type { border-bottom-color: transparent !important; }

.rowline:focus-within {
  background: linear-gradient(90deg, transparent, var(--accent-soft) 32%, transparent) !important;
}

.rowline > .left,
.rowline > .right,
.rowline > .actions {
  width: auto !important;
  min-width: 0 !important;
  flex: none !important;
}

.rowline > .left > label:first-child,
.rowline > .left > div > label:first-child {
  display: block;
  margin: 1px 0 0;
  color: var(--fg);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 640;
}

.rowline > .left > input,
.rowline > .left > select { margin-top: 10px; }

.hint,
.muted {
  color: var(--secondary) !important;
  font-size: 11.5px !important;
  line-height: 1.5 !important;
}

.rowline .left .hint { max-width: 285px; margin-top: 6px; }
.rowline .right { align-self: center; }
.rowline .actions {
  align-self: center;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.inline,
.inline-3,
.tv-grid,
.form-wrap {
  display: flex !important;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px !important;
}

.inline > *,
.inline-3 > *,
.tv-grid > * { min-width: 140px; flex: 1 1 160px; }
.inline-3 > * { flex-basis: 190px; }
.tv-grid > * { flex-basis: 180px; }
.tv-grid .col3 { flex-grow: 2; }

.field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

label,
.mini-label {
  color: var(--secondary);
  font-size: 11px;
  line-height: 1.3;
  font-weight: 620;
}

.mini-label {
  color: var(--tertiary) !important;
  font-size: 9.5px !important;
  font-weight: 760 !important;
  letter-spacing: .045em;
  text-transform: uppercase;
}

input,
select,
textarea {
  font: inherit;
}

body.admin-shell input[type="text"],
body.admin-shell input[type="url"],
body.admin-shell input[type="email"],
body.admin-shell input[type="password"],
body.admin-shell input[type="number"],
body.admin-shell input[type="search"],
body.admin-shell input[type="file"],
body.admin-shell select,
body.admin-shell textarea {
  width: 100%;
  max-width: none;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--input-border) !important;
  border-radius: 8px !important;
  outline: 0;
  background: var(--input-bg) !important;
  color: var(--input-fg) !important;
  font-size: 12px;
  line-height: 1.35;
  box-shadow: none !important;
  transition: border-color .15s, background .15s, box-shadow .15s;
}

body.admin-shell textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

body.admin-shell input:hover,
body.admin-shell select:hover,
body.admin-shell textarea:hover { border-color: var(--line-strong) !important; }

body.admin-shell input:focus,
body.admin-shell select:focus,
body.admin-shell textarea:focus {
  border-color: var(--accent) !important;
  box-shadow: var(--focus-ring) !important;
}

body.admin-shell input:disabled,
body.admin-shell select:disabled,
body.admin-shell textarea:disabled { opacity: .52; cursor: not-allowed; }

body.admin-shell input[type="color"] {
  width: 44px !important;
  min-width: 44px;
  height: 40px;
  padding: 4px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background: var(--input-bg);
}

body.admin-shell input[type="checkbox"] { accent-color: var(--accent-strong); }

.toggle {
  min-height: 40px;
  padding: 8px 11px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--secondary);
  font-size: 11.5px;
  font-weight: 560;
}

.toggle input[type="checkbox"] { width: 15px; height: 15px; margin: 0; }

.btn,
button.btn,
a.btn {
  min-height: 38px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--btn-primary-border) !important;
  border-radius: 8px !important;
  outline: 0;
  background: var(--btn-primary-bg) !important;
  color: var(--btn-primary-fg) !important;
  font-family: inherit;
  font-size: 11.5px;
  line-height: 1;
  font-weight: 670;
  letter-spacing: -.005em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none !important;
  transition: transform .12s, background .15s, border-color .15s, opacity .15s;
}

.btn:hover { border-color: var(--line-strong) !important; filter: brightness(1.045); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { box-shadow: var(--focus-ring) !important; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn.green,
.btn.add-row {
  border-color: var(--btn-accent-border) !important;
  background: var(--btn-accent-bg) !important;
  color: var(--btn-accent-fg) !important;
}

.btn.red {
  border-color: color-mix(in srgb, var(--red) 62%, transparent) !important;
  background: color-mix(in srgb, var(--red) 15%, var(--surface)) !important;
  color: var(--red) !important;
}

.btn.small { min-height: 32px; padding: 0 10px; font-size: 10.5px; }
.btn svg { width: 14px; height: 14px; }

.icon-btn {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--tertiary);
  font-size: 13px;
  cursor: pointer;
}

.icon-btn:hover { background: var(--surface-raised); color: var(--fg); border-color: var(--line-strong); }

/* Editor command bars */
.editor-toolbar,
.form-footer,
.list-heading,
.permission-heading {
  min-height: 74px;
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border-bottom: 1px solid var(--line);
}

.editor-toolbar > div,
.form-footer > div,
.list-heading,
.permission-heading { min-width: 0; }

.editor-toolbar strong,
.form-footer strong,
.list-heading strong,
.permission-heading strong,
.save-context strong {
  display: block;
  color: var(--fg);
  font-size: 12.5px;
  line-height: 1.35;
  font-weight: 650;
}

.editor-toolbar span,
.form-footer span,
.list-heading span,
.permission-heading span,
.save-context span {
  display: none;
  margin-top: 4px;
  color: var(--secondary);
  font-size: 11.5px;
  line-height: 1.4;
}

.form-footer {
  min-height: 82px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 0;
}

.form-footer.compact { width: 100%; }
.row:has(> .form-footer) { margin: 0 !important; padding: 0 !important; }
.form-footer .btn { min-width: 150px; }

.sticky-save {
  position: static !important;
  bottom: auto !important;
  z-index: auto !important;
  min-height: 82px;
  margin: 0 !important;
  padding: 16px 0 !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border-top: 1px solid var(--line-strong);
  background: transparent !important;
}

.context-note {
  margin-top: 18px;
  padding: 12px 14px;
  border-left: 2px solid var(--accent);
  background: var(--accent-soft);
  color: var(--secondary);
  font-size: 11.5px;
  line-height: 1.5;
}

/* Settings use clear on/off switches; list-selection checkboxes remain compact. */
.toggle,
label.check {
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--secondary);
}

.toggle input[type="checkbox"],
label.check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 38px !important;
  min-width: 38px;
  height: 22px !important;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background:
    radial-gradient(circle at 10px 50%, #d8d9dc 0 6px, transparent 6.5px),
    #30333a;
  cursor: pointer;
  transition: background .18s, border-color .18s, box-shadow .18s;
}

.toggle input[type="checkbox"]:checked,
label.check input[type="checkbox"]:checked {
  border-color: var(--accent-strong);
  background:
    radial-gradient(circle at 27px 50%, #fff 0 6px, transparent 6.5px),
    var(--accent-strong);
}

.toggle input[type="checkbox"]:focus-visible,
label.check input[type="checkbox"]:focus-visible {
  outline: 0;
  box-shadow: var(--focus-ring);
}

html[data-theme="light"] .toggle input[type="checkbox"],
html[data-theme="light"] label.check input[type="checkbox"] {
  background:
    radial-gradient(circle at 10px 50%, #fff 0 6px, transparent 6.5px),
    #c9ccd2;
}

html[data-theme="light"] .toggle input[type="checkbox"]:checked,
html[data-theme="light"] label.check input[type="checkbox"]:checked {
  background:
    radial-gradient(circle at 27px 50%, #fff 0 6px, transparent 6.5px),
    var(--accent-strong);
}

/* Disclosure sections remain part of the flat canvas */
details:not(.nav-acc) {
  margin: 0;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

details:not(.nav-acc) > summary {
  min-height: 58px;
  padding: 0 !important;
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
  color: var(--fg);
  font-size: 12.5px;
  font-weight: 640;
  cursor: pointer;
}

details:not(.nav-acc) > summary::-webkit-details-marker { display: none; }
details:not(.nav-acc) > summary::after {
  content: "+";
  margin-left: auto;
  color: var(--tertiary);
  font-size: 18px;
  font-weight: 350;
}
details:not(.nav-acc)[open] > summary::after { content: "−"; }
details:not(.nav-acc) > .hint { margin: -8px 0 13px !important; max-width: 720px; }

/* Upload library */
.upload-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 32px !important;
}

.upload-tile,
.upload-card {
  min-height: 172px;
  margin: 0 !important;
  padding: 26px 0 !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.upload-meta strong {
  display: block;
  color: var(--fg);
  font-size: 14px;
  font-weight: 650;
}

.upload-meta span {
  display: block;
  max-width: 430px;
  margin-top: 5px;
  color: var(--secondary);
  font-size: 11.5px;
  line-height: 1.5;
}

.upload-tile .upload-row,
.upload-card .upload-row { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; }
.upload-tile input[type="file"],
.upload-card input[type="file"] { flex: 1 1 220px; }

/* Dashboard */
.dash-grid {
  padding: 30px 0;
  display: grid !important;
  grid-template-columns: minmax(0, 1.8fr) minmax(260px, .75fr);
  gap: 0 34px !important;
}

.dash-grid > .card {
  margin: 0 !important;
  padding: 0 0 28px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.dash-preview { grid-row: span 2; padding-right: 34px !important; border-right: 1px solid var(--line) !important; }
.dash-links { margin-bottom: 26px !important; }
.card-head { padding: 0 0 17px; }
.card-head h3 { margin: 0; font-size: 14px; font-weight: 650; }
.card-head .small { margin-top: 5px; }
.card-foot { padding-top: 16px; display: flex; gap: 9px; }

.preview-shell {
  width: 100%;
  min-width: 0;
  padding: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-soft);
}

.preview-frame-wrap {
  flex: 0 0 auto;
  max-width: 100%;
  overflow: hidden;
  background: #050506;
  border-radius: 8px;
}
.preview-stage {
  position: absolute !important;
  top: 12px;
  left: 12px;
  width: 960px;
  height: 540px;
  transform-origin: top left;
}
.preview-stage iframe { width: 960px; height: 540px; display: block; border: 0; background: #000; }

.dash-quicklinks { display: grid; grid-template-columns: 1fr; gap: 7px; }
.dash-quicklinks .btn { width: 100%; justify-content: flex-start; }
.dash-statline {
  padding: 14px 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-top: 1px solid var(--line);
}
.dash-statline .k { color: var(--secondary); font-size: 11.5px; }
.dash-statline .v { color: var(--fg); font-size: 26px; font-weight: 650; letter-spacing: -.04em; }

/* Preview page and media */
.image-dir-preview {
  width: 108px;
  height: 61px;
  margin-top: 12px;
  display: block;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background:
    linear-gradient(45deg, var(--checker-a) 25%, transparent 25%) 0 0/12px 12px,
    linear-gradient(45deg, transparent 75%, var(--checker-a) 75%) 0 0/12px 12px,
    var(--checker-b);
}
.image-dir-grid-note { margin-top: 5px; color: var(--tertiary); font-size: 10px; }
#image-dir-image-rows .img-file { display: none !important; }

/* Access management */
.access-create-form {
  padding-top: 24px !important;
  padding-bottom: 24px !important;
}
.access-create-form.form-wrap {
  display: grid !important;
  grid-template-columns: repeat(12, 1fr);
  align-items: end !important;
}
.access-create-form > * { grid-column: span 3; }
.access-create-form > .left:first-of-type { grid-column: span 3; align-self: start; }
.user-create-form > * { grid-column: span 3; }
.user-create-form .field { grid-column: span 3; }
.user-create-form > [style*="flex-basis"] { display: none; }
.permission-heading {
  width: 100%;
  grid-column: 1 / -1 !important;
  justify-content: flex-start;
}
.list-heading { margin-top: 22px; }
.access-list .rowitem {
  padding: 18px 0 !important;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
  background: transparent !important;
}
.access-list details { width: 100%; }
.access-list details form { padding-bottom: 18px; }

code {
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--surface-raised);
  color: var(--secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9em;
}

/* Internal notifications */
.toast-host {
  position: fixed;
  top: calc(var(--header-h) + 16px);
  right: 18px;
  z-index: 1000;
  width: min(380px, calc(100vw - 32px));
  display: grid;
  gap: 10px;
  pointer-events: none;
  bottom: auto !important;
  align-content: start;
  grid-auto-rows: max-content;
}

.toast {
  --state: var(--accent);
  position: relative;
  min-height: 58px;
  padding: 10px 38px 10px 11px;
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-raised) 94%, transparent);
  color: var(--fg);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(20px);
  pointer-events: auto;
  animation: toast-in .25s cubic-bezier(.2,.8,.2,1) both;
}

.toast-success { --state: var(--green); }
.toast-error { --state: var(--red); }
.toast-warning { --state: var(--amber); }
.toast-info { --state: var(--accent); }

.toast-symbol {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--state) 15%, transparent);
  color: var(--state);
  font-size: 11px;
  font-weight: 800;
}

.toast-copy strong { display: block; font-size: 11.5px; line-height: 1.25; font-weight: 700; }
.toast-copy span { display: block; margin-top: 2px; color: var(--secondary); font-size: 10.5px; line-height: 1.35; white-space: pre-line; }
.toast-close {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 25px;
  height: 25px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--tertiary);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.toast-close:hover { background: var(--nav-hover); color: var(--fg); }
.toast-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--state);
  transform-origin: left;
  animation: toast-progress var(--toast-duration, 4400ms) linear both;
}
.toast.is-leaving { animation: toast-out .2s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(.985); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(12px); } }
@keyframes toast-progress { to { transform: scaleX(0); } }

/* Internal confirmation dialog */
.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1100;
  padding: 24px;
  display: grid;
  place-items: center;
  background: rgba(4,5,7,.56);
  opacity: 0;
  backdrop-filter: blur(7px);
  transition: opacity .16s ease;
}
.dialog-backdrop[hidden] { display: none; }
.dialog-backdrop.is-visible { opacity: 1; }
.dialog {
  width: min(430px, 100%);
  padding: 24px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-raised);
  box-shadow: 0 28px 90px rgba(0,0,0,.42);
  transform: translateY(7px) scale(.985);
  transition: transform .16s ease;
}
.dialog-backdrop.is-visible .dialog { transform: none; }
.dialog-symbol {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--red) 14%, transparent);
  color: var(--red);
  font-weight: 800;
}
.dialog-copy h3 { margin: 2px 0 0; font-size: 15px; font-weight: 680; }
.dialog-copy p { margin: 7px 0 0; color: var(--secondary); font-size: 12px; line-height: 1.55; }
.dialog-actions {
  grid-column: 1 / -1;
  margin-top: 22px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Login */
body.admin-login {
  min-height: 100vh;
  margin: 0;
  padding: 28px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(125deg, transparent 46%, rgba(90,164,244,.055)),
    var(--bg) !important;
}

body.admin-login .wrap { width: min(100%, 430px); max-width: 430px; }
body.admin-login .card {
  border: 1px solid var(--line-strong) !important;
  border-radius: 14px !important;
  background: var(--surface) !important;
  box-shadow: 0 26px 80px rgba(0,0,0,.28) !important;
}
body.admin-login .head { padding: 28px 28px 18px !important; border-bottom: 1px solid var(--line); }
body.admin-login .logo {
  width: 38px;
  height: 38px;
  padding: 5px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}
body.admin-login .title { color: var(--fg); font-size: 19px; font-weight: 680; letter-spacing: -.025em; }
body.admin-login .sub { margin-top: 5px; color: var(--secondary); font-size: 11.5px; }
body.admin-login form.body { padding: 18px 28px 24px !important; }
body.admin-login .row { margin: 0 0 17px !important; gap: 7px !important; }
body.admin-login label { color: var(--secondary); font-size: 11px; font-weight: 620; }
body.admin-login input {
  width: 100% !important;
  min-height: 43px !important;
  padding: 10px 12px !important;
  border: 1px solid var(--input-border) !important;
  border-radius: 8px !important;
  outline: 0;
  background: var(--input-bg) !important;
  color: var(--input-fg) !important;
  box-shadow: none !important;
}
body.admin-login input:focus { border-color: var(--accent) !important; box-shadow: var(--focus-ring) !important; }
body.admin-login .btn {
  width: 100%;
  min-height: 43px;
  border-color: var(--btn-accent-border) !important;
  background: var(--btn-accent-bg) !important;
  color: #fff !important;
}
body.admin-login .foot { padding: 0 28px 23px !important; }
body.admin-login .error {
  margin-bottom: 17px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--red) 35%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--red) 10%, transparent);
  color: var(--red);
  font-size: 11.5px;
  line-height: 1.45;
}

/* Medium layouts */
@media (max-width: 1180px) {
  :root { --sidebar-w: 238px; --label-w: 250px; }
  .content { padding-left: 28px !important; padding-right: 28px !important; }
  .brand { width: calc(var(--sidebar-w) - 14px); min-width: calc(var(--sidebar-w) - 14px); }
  .hdr-label { display: none; }
  .hdr-select { max-width: 170px; }
  .rowline { gap: 22px !important; }
}

@media (max-width: 960px) {
  :root { --header-h: auto; }
  body.admin-shell > header {
    position: relative;
    min-height: 68px;
    flex-wrap: wrap;
  }
  .brand { width: auto; min-width: 210px; }
  .header-controls { flex: 1 1 100%; justify-content: flex-start; overflow-x: auto; padding-bottom: 2px; }
  .layout { display: block !important; min-height: 0; }
  .sidenav {
    position: sticky;
    top: 0;
    z-index: 90;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: 56px;
    padding: 8px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .nav-top { width: max-content; flex-direction: row; align-items: flex-start; }
  .nav-solo { padding: 0; margin: 0; border: 0; }
  .nav-acc { position: relative; }
  .nav-sum,
  .nav-solo-btn { width: auto; min-width: max-content; padding-right: 10px; }
  .nav-items {
    min-width: 205px;
    padding: 6px;
    display: none;
    position: fixed;
    z-index: 200;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: var(--surface-raised);
    box-shadow: var(--soft-shadow);
  }
  .nav-acc[open] .nav-items { display: grid; }
  .content { padding: 0 24px 60px !important; }
  .subtabs { top: 0; }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-preview { grid-row: auto; padding-right: 0 !important; margin-bottom: 28px !important; border-right: 0 !important; }
  .upload-grid { grid-template-columns: 1fr; }
  .access-create-form.form-wrap { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 740px) {
  :root { --label-w: auto; --action-w: auto; }
  body.admin-shell > header { padding: 10px 13px; }
  .brandtext .subline { display: none; }
  .header-spacer { display: none; }
  .header-controls { gap: 6px; }
  .hdr-select { max-width: 140px; }
  .logout-btn span:last-child { display: none; }
  .content { padding: 0 17px 48px !important; }
  .panel > .card > h2,
  .panel > .card > .panel-head { min-height: 140px; padding-top: 34px !important; }
  .panel h2 { font-size: 29px !important; }
  .rowline {
    min-height: 0;
    padding: 21px 0 !important;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px 12px !important;
  }
  .rowline > .left { grid-column: 1 / -1; }
  .rowline > .right { grid-column: 1; }
  .rowline > .actions { grid-column: 2; align-self: end; }
  .rowline .left .hint { max-width: 100%; }
  .inline,
  .inline-3,
  .tv-grid { width: 100%; }
  .editor-toolbar,
  .form-footer,
  .sticky-save,
  .list-heading,
  .permission-heading { align-items: flex-start; flex-direction: column; }
  .editor-toolbar .btn,
  .form-footer .btn,
  .sticky-save .btn { width: 100%; }
  .subpane-heading,
  .section-heading { min-height: 96px; }
  .access-create-form.form-wrap { display: flex !important; flex-direction: column; align-items: stretch !important; }
  .access-create-form > * { width: 100% !important; }
  .toast-host { top: 12px; right: 12px; width: calc(100vw - 24px); }
}

@media (max-width: 500px) {
  .theme-picker { display: none; }
  .hdr-select { max-width: 125px; }
  .content { padding-left: 14px !important; padding-right: 14px !important; }
  .panel h2::after { font-size: 12.5px; }
  .subtabs { gap: 18px; overflow-x: auto; }
  .inline > *,
  .inline-3 > *,
  .tv-grid > * { flex-basis: 100%; }
  .card-foot { flex-direction: column; }
  .card-foot .btn { width: 100%; }
  .dialog { padding: 20px; }
}

/* v18.5 — compact hospitality workspace */
.content {
  padding-bottom: 28px !important;
}

.panel > .card > .body {
  padding-top: 20px !important;
}

/* Page identity lives in the navigation; panels open directly into their tools. */
.panel > .card > h2,
.panel > .card > .panel-head {
  display: none !important;
}

.rowline {
  min-height: 74px;
  padding: 15px 0 !important;
  grid-template-columns: minmax(170px, 230px) minmax(0, 1fr) 52px;
  gap: 18px !important;
}

.rows > .rowline {
  grid-template-columns: minmax(150px, 205px) minmax(0, 1fr) 52px;
}

.rowline .left .hint {
  max-width: 240px;
  margin-top: 4px;
}

.editor-toolbar,
.list-heading,
.permission-heading {
  min-height: 58px;
  padding: 10px 0;
}

.form-footer,
.sticky-save {
  min-height: 62px;
  padding: 11px 0 !important;
}

details:not(.nav-acc) > summary {
  min-height: 48px;
}

body.admin-shell textarea {
  min-height: 96px;
}

/* Controls take the space their value actually needs. */
.rowline > .right .field:has(> input[type="number"]) {
  min-width: 125px;
  max-width: 170px;
  flex: 0 1 155px;
}

.rowline > .right .field:has(> input[type="color"]) {
  min-width: 76px;
  max-width: 92px;
  flex: 0 0 84px;
}

.rowline > .right .field:has(> select) {
  min-width: 180px;
  max-width: 300px;
  flex: 0 1 260px;
}

.rowline > .right > input[type="number"],
.rowline > .right > select {
  width: min(100%, 300px);
}

.rowline > .right > input[type="color"] {
  width: 44px;
}

.rowline > .right .toggle {
  min-width: 0;
  flex: 0 1 auto;
}

.rowline .right.inline,
.rowline .right.inline-3,
.rowline .right.tv-grid {
  align-items: flex-end;
  justify-content: flex-start;
}

/* Configuration pages use a shared two-column settings workspace. */
#form-config .subpane:not([hidden]),
#form-info-style .settings-section,
#form-services-style .settings-section,
#form-tv-viewer,
#form-tv-epg,
#form-flights {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 34px;
  align-items: start;
}

#form-config .subpane > .rowline,
#form-config .subpane > details > .rowline,
#form-info-style .settings-section > .rowline,
#form-services-style .settings-section > .rowline,
#form-tv-viewer > .rowline,
#form-tv-epg > .rowline,
#form-flights > .rowline {
  min-height: 0;
  padding: 15px 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  align-items: start !important;
  align-content: start;
  gap: 9px !important;
}

#form-config .subpane > .rowline > .right,
#form-config .subpane > details > .rowline > .right,
#form-info-style .settings-section > .rowline > .right,
#form-services-style .settings-section > .rowline > .right,
#form-tv-viewer > .rowline > .right,
#form-tv-epg > .rowline > .right,
#form-flights > .rowline > .right {
  grid-column: 1;
  width: 100% !important;
  justify-self: stretch;
  align-self: start;
}

#form-config .subpane > .rowline > .actions:empty,
#form-config .subpane > details > .rowline > .actions:empty,
#form-info-style .settings-section > .rowline > .actions:empty,
#form-services-style .settings-section > .rowline > .actions:empty,
#form-tv-viewer > .rowline > .actions:empty,
#form-tv-epg > .rowline > .actions:empty,
#form-flights > .rowline > .actions:empty {
  display: none !important;
}

#form-config .subpane > .rowline .left .hint,
#form-config .subpane > details > .rowline .left .hint,
#form-info-style .settings-section > .rowline .left .hint,
#form-services-style .settings-section > .rowline .left .hint,
#form-tv-viewer > .rowline .left .hint,
#form-tv-epg > .rowline .left .hint,
#form-flights > .rowline .left .hint {
  max-width: 560px;
}

#form-config .subpane > details,
#form-config .subpane > .hint,
#form-tv-viewer > .hint,
#form-tv-viewer > .row,
#form-tv-epg > .form-footer,
#form-flights > .form-footer {
  grid-column: 1 / -1;
}

#form-config .subpane > details {
  grid-column: auto;
}

#form-config .subpane > .rowline > .right:is(.inline, .inline-3, .inline-4),
#form-config .subpane > details > .rowline > .right:is(.inline, .inline-3, .inline-4),
#form-info-style .settings-section > .rowline > .right:is(.inline, .inline-3, .inline-4),
#form-services-style .settings-section > .rowline > .right:is(.inline, .inline-3, .inline-4),
#form-tv-viewer > .rowline > .right:is(.inline, .inline-3, .inline-4),
#form-tv-epg > .rowline > .right:is(.inline, .inline-3, .inline-4),
#form-flights > .rowline > .right:is(.inline, .inline-3, .inline-4) {
  display: flex !important;
  flex-wrap: wrap;
  align-items: flex-end !important;
  gap: 10px 12px !important;
}

#form-tv-viewer > .hint {
  display: none;
}

#form-info-style .settings-section + .settings-section,
#form-services-style .settings-section + .settings-section {
  margin-top: 12px;
}

#form-info-style > .form-footer,
#form-services-style > .form-footer {
  margin-top: 6px;
}

/* Repeating content editors keep stable proportions instead of full-width inputs. */
#info-pages-rows > .rowline {
  grid-template-columns: minmax(270px, 340px) minmax(360px, 1fr) 52px;
}

#info-pages-rows > .rowline > .left .hint {
  max-width: 330px;
}

#info-pages-rows textarea {
  min-height: 156px;
}

#menu-rows > .rowline,
#wp-rows > .rowline,
#rooms-rows > .rowline {
  grid-template-columns: minmax(180px, 260px) minmax(300px, 680px) 52px;
}

#tv-rows > .rowline,
#apps-rows > .rowline,
#services-rows > .rowline,
#image-dir-image-rows > .rowline {
  grid-template-columns: minmax(150px, 190px) minmax(0, 1fr) 52px;
}

/* v18.16 asset management workspace. */
#panel-uploads .body {
  display: block;
}

.asset-workspace { min-width: 0; padding: 20px 0 32px; }

.asset-upload-form {
  padding: 19px 20px 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.asset-upload-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.asset-upload-heading > div { min-width: 0; }
.asset-upload-heading strong,
.asset-library-toolbar strong {
  display: block;
  color: var(--fg);
  font-size: 14px;
  font-weight: 680;
}

.asset-upload-heading span:not(.asset-upload-icon),
.asset-library-toolbar > div:first-child span {
  display: block;
  margin-top: 3px;
  color: var(--secondary);
  font-size: 11.5px;
}

.asset-upload-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--secondary);
}
.asset-upload-icon svg { width: 17px; height: 17px; }

.asset-upload-fields {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(180px, 230px) minmax(280px, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.asset-upload-fields .field { margin: 0; }
.asset-upload-fields select,
.asset-upload-fields input[type="file"] { width: 100% !important; min-width: 0; }
.asset-upload-fields .btn { min-height: 40px; white-space: nowrap; }

.asset-upload-foot {
  min-height: 20px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--tertiary);
  font-size: 10.5px;
}
.asset-upload-foot span:first-child { color: var(--secondary); }

.asset-library-toolbar {
  min-height: 66px;
  margin-top: 20px;
  padding: 18px 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.asset-library-filters { display: flex; align-items: center; gap: 8px; }
.asset-library-filters input { width: 210px !important; }
.asset-library-filters select { width: 190px !important; }

.asset-grid {
  padding-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 12px;
}

.asset-card {
  min-width: 0;
  min-height: 158px;
  padding: 12px;
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.asset-card[hidden] { display: none !important; }
.asset-preview {
  width: 108px;
  min-height: 108px;
  display: grid;
  place-items: center;
  align-self: stretch;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background:
    linear-gradient(45deg, var(--surface) 25%, transparent 25%),
    linear-gradient(-45deg, var(--surface) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--surface) 75%),
    linear-gradient(-45deg, transparent 75%, var(--surface) 75%),
    var(--bg);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.asset-preview img { width: 100%; height: 100%; display: block; object-fit: contain; }
.asset-font-preview { font-size: 34px; font-weight: 650; letter-spacing: -.06em; color: var(--secondary); }

.asset-card-body { min-width: 0; display: flex; flex-direction: column; }
.asset-card-topline { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.asset-card-topline > span:first-child {
  min-width: 0;
  color: var(--tertiary);
  font-size: 9.5px;
  font-weight: 720;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.asset-state {
  padding: 4px 6px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--secondary);
  font-size: 9px;
  font-weight: 680;
  white-space: nowrap;
}
.asset-state.is-used { background: var(--accent-soft); color: var(--accent); }
.asset-state.is-system { color: var(--tertiary); }

.asset-filename {
  max-width: 100%;
  margin-top: 9px;
  overflow: hidden;
  color: var(--fg);
  font-size: 12px;
  font-weight: 620;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-file-meta { margin-top: 5px; display: flex; align-items: center; gap: 10px; color: var(--tertiary); font-size: 10px; }
.asset-file-meta span + span::before { content: "·"; margin-right: 10px; }
.asset-usage { margin-top: auto; padding-top: 10px; color: var(--secondary); font-size: 10.5px; }

.asset-actions {
  margin-top: auto;
  padding-top: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 38px;
  align-items: center;
  gap: 6px;
}
.asset-actions input { width: 100% !important; min-width: 0; height: 34px !important; font-size: 11px !important; }
.asset-actions .btn { min-width: 0; height: 34px; padding: 0 9px; gap: 5px; }
.asset-actions .btn svg { width: 13px; height: 13px; }
.asset-actions .asset-delete { width: 38px; padding: 0; }

.asset-empty {
  grid-column: 1 / -1;
  min-height: 120px;
  display: grid;
  place-items: center;
  color: var(--secondary);
  font-size: 12px;
  text-align: center;
}
.asset-empty[hidden] { display: none !important; }

@media (max-width: 1120px) {
  .asset-upload-fields { grid-template-columns: minmax(170px, 220px) minmax(0, 1fr); }
  .asset-upload-fields .btn { grid-column: 2; justify-self: end; }
  .asset-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Overview density and number alignment. */
.dash-grid {
  padding: 20px 0 0;
}

.dash-grid > .card {
  padding-bottom: 20px !important;
}

.dash-preview {
  padding-right: 30px !important;
}

.dash-links {
  margin-bottom: 20px !important;
}

.card-head {
  min-height: 34px;
  padding: 0 0 10px;
  display: flex;
  align-items: center;
}

.dash-stats-one {
  padding: 0 !important;
}

.dash-statline {
  min-height: 62px;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border: 0 !important;
  border-top: 1px solid var(--line) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.dash-statline .k {
  display: block;
  min-width: 0;
  line-height: 1.25;
}

.dash-statline .v {
  min-width: 46px;
  margin: 0;
  text-align: right;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* Administration creation forms share the same efficient field rhythm. */
.access-create-form {
  min-height: 0;
  padding-top: 17px !important;
  padding-bottom: 17px !important;
}

.access-list .rowitem {
  padding: 13px 0 !important;
}

@media (max-width: 960px) {
  .panel > .card > .body {
    padding-top: 16px !important;
  }

  #form-config .subpane:not([hidden]),
  #form-info-style .settings-section,
  #form-services-style .settings-section,
  #form-tv-viewer,
  #form-tv-epg,
  #form-flights {
    grid-template-columns: minmax(0, 1fr);
  }

  #form-config .subpane > details,
  #form-config .subpane > .hint,
  #form-tv-viewer > .hint,
  #form-tv-viewer > .row,
  #form-tv-epg > .form-footer,
  #form-flights > .form-footer {
    grid-column: 1;
  }

  #form-config .subpane > details {
    grid-column: 1;
  }

  .asset-library-toolbar { align-items: flex-start; flex-direction: column; }
  .asset-library-filters { width: 100%; }
  .asset-library-filters input { flex: 1 1 auto; width: auto !important; }

  #info-pages-rows > .rowline {
    grid-template-columns: minmax(230px, 300px) minmax(0, 1fr) 52px;
  }
}

@media (max-width: 740px) {
  .panel > .card > .body {
    padding-top: 14px !important;
  }

  .rowline,
  .rows > .rowline,
  #info-pages-rows > .rowline,
  #menu-rows > .rowline,
  #wp-rows > .rowline,
  #rooms-rows > .rowline,
  #tv-rows > .rowline,
  #apps-rows > .rowline,
  #services-rows > .rowline,
  #image-dir-image-rows > .rowline {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .rowline {
    padding: 16px 0 !important;
  }

  .asset-upload-form { padding: 16px; }
  .asset-upload-fields { grid-template-columns: minmax(0, 1fr); }
  .asset-upload-fields .btn { grid-column: 1; justify-self: stretch; }
  .asset-upload-foot { align-items: flex-start; flex-direction: column; gap: 4px; }
  .asset-library-filters { align-items: stretch; flex-direction: column; }
  .asset-library-filters input,
  .asset-library-filters select { width: 100% !important; }
  .asset-card { grid-template-columns: 88px minmax(0, 1fr); }
  .asset-preview { width: 88px; min-height: 88px; }
  .asset-actions { grid-template-columns: minmax(0, 1fr) 38px; }
  .asset-actions .asset-rename { grid-column: 1; }
  .asset-actions .asset-delete { grid-column: 2; grid-row: 1 / span 2; height: 100%; }
}

/* v18.6 — tighter workspaces and simplified actions */
.form-footer > div,
.sticky-save > .save-context {
  display: none !important;
}

.form-footer,
.sticky-save {
  justify-content: flex-end !important;
}

.form-footer .btn,
.sticky-save .btn {
  min-width: 96px;
}

/* Secondary views use one quiet segmented control. */
.subtabs {
  position: sticky;
  width: max-content;
  min-height: 42px;
  margin: 0 0 14px !important;
  padding: 4px;
  align-items: center;
  gap: 3px;
  border: 1px solid var(--line) !important;
  border-radius: 10px;
  background: var(--surface-soft);
  backdrop-filter: none;
}

.subtab {
  min-height: 32px;
  padding: 0 14px;
  border-radius: 7px;
  color: var(--secondary);
}

.subtab:hover {
  background: var(--nav-hover);
  color: var(--fg);
}

.subtab.active {
  background: var(--surface-raised);
  color: var(--fg);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.subtab::after {
  display: none;
}

/* Home settings remain in two balanced columns without grid-row dead space. */
#form-config .subpane[data-sub="home"]:not([hidden]) {
  grid-template-rows: repeat(5, auto);
}

#form-config .subpane[data-sub="home"] > .rowline:has([name="homeMenu.autoHide.enabled"]) {
  grid-column: 1;
  grid-row: 1;
}

#form-config .subpane[data-sub="home"] > .rowline:has([name="homeMenu.position"]) {
  grid-column: 1;
  grid-row: 2;
}

#form-config .subpane[data-sub="home"] > .rowline:has([name="homeMenu.wrapNavigation"]) {
  grid-column: 1;
  grid-row: 3;
}

#form-config .subpane[data-sub="home"] > .rowline:has([name="roomDisplay.enabled"]) {
  grid-column: 1;
  grid-row: 4;
}

#form-config .subpane[data-sub="home"] > .rowline:has([name="roomDisplay.autoHide.enabled"]) {
  grid-column: 1;
  grid-row: 5;
}

#form-config .subpane[data-sub="home"] > .rowline:has([name="roomDisplay.margins.top"]) {
  grid-column: 2;
  grid-row: 5;
}

#form-config .subpane[data-sub="home"] > details {
  grid-column: 2;
  grid-row: 1 / span 6;
  align-self: start;
}

#form-config .subpane[data-sub="home"] > details > .hint {
  display: none !important;
}

#form-config .subpane[data-sub="home"] > .rowline .left .hint {
  display: none !important;
}

#form-config .subpane[data-sub="home"] > .rowline > .right .field:has(> input[type="number"]) {
  min-width: 100px;
  max-width: 120px;
  flex: 0 1 120px;
}

#form-config .subpane[data-sub="home"] > .rowline > .right .field:has(> select) {
  min-width: 180px;
  max-width: 230px;
  flex: 0 1 230px;
}

#form-config .subpane[data-sub="home"] > .rowline > .right .field:has(> .toggle) {
  min-width: 130px;
  max-width: 170px;
  flex: 0 1 150px;
}

#form-config .subpane[data-sub="home"] > .rowline:has([name="homeMenu.wrapNavigation"]) > .right .field:has(> .toggle) {
  max-width: 300px;
  flex-basis: 300px;
}

/* The device count mirrors the quick-link control language. */
.dash-statline {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--btn-primary-border) !important;
  border-radius: 8px !important;
  background: var(--btn-primary-bg) !important;
}

.dash-statline .v {
  font-size: 18px;
  font-weight: 700;
}

/* Team creation is an explicit action rather than an always-open form. */
body.modal-open {
  overflow: hidden;
}

.editor-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1150;
  padding: 24px;
  display: grid;
  place-items: center;
  background: rgba(4, 5, 7, .64);
  opacity: 0;
  backdrop-filter: blur(8px);
  transition: opacity .16s ease;
}

.editor-modal-backdrop[hidden] {
  display: none !important;
}

.editor-modal-backdrop.is-visible {
  opacity: 1;
}

.editor-modal {
  width: min(960px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface-raised);
  box-shadow: 0 30px 100px rgba(0, 0, 0, .48);
  transform: translateY(8px) scale(.988);
  transition: transform .16s ease;
}

.editor-modal-backdrop.is-visible .editor-modal {
  transform: none;
}

.editor-modal-head {
  min-height: 60px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.editor-modal-head h3 {
  margin: 0;
  color: var(--fg);
  font-size: 16px;
  font-weight: 680;
  letter-spacing: -.02em;
}

.editor-modal-close {
  font-size: 20px;
}

.editor-modal .user-create-form {
  width: 100%;
  min-height: 0;
  margin: 0 !important;
  padding: 20px !important;
  overflow: auto;
  border: 0 !important;
  background: transparent !important;
}

.editor-modal-actions {
  grid-column: 1 / -1 !important;
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
}

.user-list-heading {
  min-height: 58px;
  margin-top: 0;
}

@media (max-width: 960px) {
  #form-config .subpane[data-sub="home"]:not([hidden]) {
    grid-template-rows: none;
  }

  #form-config .subpane[data-sub="home"] > .rowline:has([name^="homeMenu."]) {
    grid-column: 1;
    grid-row: auto;
    order: 1;
  }

  #form-config .subpane[data-sub="home"] > .rowline:has([name^="roomDisplay."]) {
    grid-column: 1;
    grid-row: auto;
    order: 2;
  }

  #form-config .subpane[data-sub="home"] > details {
    grid-column: 1;
    grid-row: auto;
    order: 3;
  }
}

@media (max-width: 740px) {
  .subtabs {
    position: static;
    max-width: 100%;
  }

  .editor-modal-backdrop {
    padding: 12px;
  }

  .editor-modal {
    max-height: calc(100vh - 24px);
  }

  .editor-modal-head {
    padding: 0 14px;
  }

  .editor-modal .user-create-form {
    padding: 14px !important;
  }

  .editor-modal-actions {
    width: 100%;
  }

  .editor-modal-actions .btn {
    flex: 1 1 0;
  }
}

/* v18.7 — fixed application shell and consistent overview controls */
html,
body.admin-shell {
  height: 100%;
  overflow: hidden;
}

body.admin-shell {
  display: grid;
  grid-template-rows: var(--header-h) minmax(0, 1fr);
}

body.admin-shell > header {
  position: relative;
  top: auto;
  height: var(--header-h);
  min-height: var(--header-h);
}

body.admin-shell > .layout {
  height: auto;
  min-height: 0;
  overflow: hidden;
}

body.admin-shell nav.sidenav {
  position: relative;
  top: auto;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

body.admin-shell .content {
  height: 100%;
  min-height: 0;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

body.admin-shell .content .subtabs {
  top: 0;
}

body.modal-open .content {
  overflow-y: hidden !important;
}

.dash-links,
.dash-stats,
.dash-quicklinks,
.dash-stats-one,
.dash-statline {
  width: 100% !important;
  max-width: none !important;
}

.dash-statline {
  box-sizing: border-box;
}

.dash-stats-one {
  padding-right: var(--admin-body-pad, 18px) !important;
  padding-left: var(--admin-body-pad, 18px) !important;
}

@media (max-width: 960px) {
  body.admin-shell {
    grid-template-rows: auto minmax(0, 1fr);
  }

  body.admin-shell > header {
    position: relative;
    height: auto;
    min-height: 68px;
  }

  body.admin-shell > .layout {
    min-height: 0;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  body.admin-shell nav.sidenav {
    position: relative;
    top: auto;
    height: auto !important;
    min-height: 0 !important;
    max-height: 56px;
  }

  body.admin-shell .content {
    height: 100%;
    min-height: 0;
    overflow-y: auto !important;
  }
}

/* v18.8 — official product identity, flat settings and adaptive page density */
.brand {
  align-items: flex-start;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}

.brand-lockup {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand-logo {
  width: 116px;
  max-width: 100%;
  height: auto;
  display: block;
}

.brand-product,
.login-product {
  padding-left: 9px;
  border-left: 1px solid rgba(255,255,255,.22);
  color: #fff;
  font-size: 10px;
  line-height: 18px;
  font-weight: 760;
  letter-spacing: .11em;
}

.brand-userline {
  color: var(--tertiary);
  font-size: 9.5px;
  line-height: 1.2;
  letter-spacing: .015em;
}

.brand-userline strong {
  color: var(--secondary);
  font-weight: 620;
}

html[data-theme="light"] .brand-lockup {
  margin-left: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.brand-logo-light {
  display: none;
}

html[data-theme="light"] .brand-logo-dark {
  display: none;
}

html[data-theme="light"] .brand-logo-light {
  display: block;
}

html[data-theme="light"] .brand-product {
  border-left-color: var(--line-strong);
  color: var(--fg);
}

body.admin-login .head {
  display: block !important;
}

body.admin-login .login-branding {
  width: 100%;
}

body.admin-login .login-lockup {
  display: flex;
  align-items: center;
  gap: 11px;
}

body.admin-login .login-logo {
  width: 168px;
  max-width: calc(100% - 52px);
  height: auto;
  display: block;
}

body.admin-login .sub {
  margin: 10px 0 0;
  font-family: "Avenir Next", Avenir, "Century Gothic", Futura, "Trebuchet MS", sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .025em;
}

.brand-product,
.login-product {
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: .13em;
}

/* Snapshot rows retain the exact quick-link width and use compact text values. */
.dash-stats-one {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding-top: 18px !important;
  padding-bottom: var(--admin-body-pad, 18px) !important;
}

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

.dash-quicklinks .btn {
  min-width: 0;
  padding-right: 10px;
  padding-left: 10px;
  font-size: 10.5px;
  white-space: nowrap;
}

.dash-statline {
  min-width: 0;
  min-height: 46px;
  padding: 0 10px;
  border: 1px solid var(--line) !important;
  border-radius: 10px !important;
  background: var(--surface-soft) !important;
}

html[data-theme="dark"] .dash-quicklinks .btn,
html[data-theme="dark"] .dash-preview .card-foot .btn,
html[data-theme="dark"] .dash-statline {
  border-color: var(--line) !important;
  background: var(--surface-soft) !important;
}

html[data-theme="light"] .dash-statline {
  border-color: var(--btn-primary-border) !important;
  background: var(--btn-primary-bg) !important;
}

.dash-grid > .dash-preview {
  border-bottom: 0 !important;
}

/* v18.21 — keep the Overview television frame stable from first paint.
   The outer frame now takes its final width from CSS, while JavaScript scales
   only the fixed 960x540 guest canvas inside it. Loading the iframe can no
   longer change the size of the television border. */
.dash-preview-wrap {
  box-sizing: content-box !important;
  width: calc(100% - 24px) !important;
  height: auto !important;
  aspect-ratio: 16 / 9;
  padding: 0 !important;
  border: 12px solid #050506 !important;
  border-radius: 10px !important;
  background: #000 !important;
}

.dash-preview-stage {
  top: 0 !important;
  left: 0 !important;
}

.dash-statline.is-wide {
  grid-column: 1 / -1;
}

.dash-location-link {
  text-decoration: none;
}

.dash-location-link[href]:hover {
  text-decoration: underline;
}

/* v18.16 — one typeface and a restrained four-level weight hierarchy. */
body.admin-shell,
body.admin-login,
body.admin-shell button,
body.admin-shell input,
body.admin-shell select,
body.admin-shell textarea,
body.admin-login button,
body.admin-login input,
body.admin-login select,
body.admin-login textarea {
  font-family: var(--font-ui) !important;
}

body.admin-shell,
body.admin-login,
body.admin-shell .hint,
body.admin-shell .small,
body.admin-shell .brand-userline,
body.admin-shell .dash-statline .k {
  font-weight: 400;
}

body.admin-shell input,
body.admin-shell select,
body.admin-shell textarea,
body.admin-shell .nav-items .nav-btn,
body.admin-login input {
  font-weight: 500 !important;
}

body.admin-shell .nav-sum,
body.admin-shell .nav-solo-btn,
body.admin-shell .btn,
body.admin-shell label,
body.admin-shell .mini-label,
body.admin-shell .toggle span,
body.admin-shell .dash-statline.is-text .v,
body.admin-login label,
body.admin-login .btn,
body.admin-login .sub {
  font-family: var(--font-ui) !important;
  font-weight: 600 !important;
}

body.admin-shell h1,
body.admin-shell h2,
body.admin-shell h3,
body.admin-shell h4,
body.admin-shell .card-head h3,
body.admin-shell .dash-statline:not(.is-text) .v,
body.admin-shell strong,
body.admin-login h1,
body.admin-login h2,
body.admin-login h3,
.brand-product,
.login-product {
  font-weight: 700 !important;
}

.dash-statline.is-text {
  grid-column: 1 / -1;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 10px;
}

.dash-statline.is-text .v {
  min-width: 0;
  max-width: none;
  overflow: hidden;
  color: var(--secondary);
  font-size: 10.5px;
  line-height: 1.25;
  font-weight: 620;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Overview actions and snapshot labels use one compact typographic scale. */
.dash-quicklinks .btn,
.dash-preview .card-foot .btn,
.dash-statline .k {
  font-size: 10.5px !important;
  font-weight: 600 !important;
}

/* Snapshot labels and text values match the dashboard action foreground. */
.dash-statline .k,
.dash-statline.is-text .v {
  color: var(--btn-primary-fg) !important;
}

/* Property creation keeps the new copy source readable without stretching fields. */
.property-create-form {
  display: grid !important;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, .85fr) minmax(170px, .85fr) minmax(190px, 1fr) minmax(140px, auto);
  align-items: end;
  gap: 12px !important;
}

.property-create-form > .left,
.property-create-form > .right {
  width: auto !important;
  min-width: 0;
}

.property-create-form .btn {
  width: 100%;
}

@media (max-width: 1200px) {
  .property-create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 740px) {
  .property-create-form {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* The compact interface is supported by separate documentation, so row labels
   stay concise and the controls use the available viewport more efficiently. */
#form-config .subpane > .rowline .left .hint {
  display: none !important;
}

#form-config .field:has(> label.mini-label + span.mini-label),
#form-config .field > input + span.mini-label,
#form-config .field > .toggle + span.mini-label {
  display: none !important;
}

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

/* Home settings stay balanced now that there are no disclosure containers. */
#form-config .subpane[data-sub="home"] > .rowline:has([name="branding.logoPosition"]) {
  grid-column: 2;
  grid-row: 1;
}

#form-config .subpane[data-sub="home"] > .rowline:has([name="branding.namePosition"]) {
  grid-column: 2;
  grid-row: 2;
}

#form-config .subpane[data-sub="home"] > .rowline:has([name="branding.logoMargins.top"]) {
  grid-column: 2;
  grid-row: 3;
}

#form-config .subpane[data-sub="home"] > .rowline:has([name="branding.nameMargins.top"]) {
  grid-column: 2;
  grid-row: 4;
}

/* Pages that fit are explicitly non-scrolling; overflow remains automatic elsewhere. */
body.admin-shell .content.is-contained {
  overflow-y: hidden !important;
  scrollbar-gutter: auto;
}

/* User editing uses the same focused modal pattern as user creation. */
.user-rowitem {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-row-primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.user-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-row-actions form {
  margin: 0;
}

.editor-modal .user-edit-form {
  width: 100%;
  min-height: 0;
  margin: 0 !important;
  padding: 20px !important;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 16px;
  border: 0 !important;
  background: transparent !important;
}

.user-edit-form .user-sites-field {
  grid-column: span 2;
}

.user-edit-form .editor-modal-actions {
  grid-column: 1 / -1 !important;
}

@media (min-width: 961px) {
  .panel > .card > .body {
    padding-top: 12px !important;
  }

  #form-config .subpane > .rowline,
  #form-info-style .settings-section > .rowline,
  #form-services-style .settings-section > .rowline,
  #form-tv-viewer > .rowline,
  #form-tv-epg > .rowline,
  #form-flights > .rowline {
    padding-top: 13px !important;
    padding-bottom: 13px !important;
  }

  .form-footer,
  .sticky-save {
    min-height: 56px;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
  }
}

@media (max-width: 960px) {
  #form-config .subpane[data-sub="home"] > .rowline:has([name^="branding."]) {
    grid-column: 1;
    grid-row: auto;
    order: 3;
  }

  .editor-modal .user-edit-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 740px) {
  .brand {
    min-width: 200px;
  }

  .brand-logo {
    width: 108px;
  }

  .brand-userline {
    display: none;
  }

  .user-row-primary {
    align-items: flex-start;
    flex-direction: column;
  }

  .editor-modal .user-edit-form {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px !important;
  }

  .user-edit-form .user-sites-field {
    grid-column: 1;
  }

  .dash-stats-one,
  .dash-quicklinks {
    grid-template-columns: minmax(0, 1fr);
  }

  .dash-statline.is-text {
    grid-column: 1;
  }
}

/* v18.17 — keep guest programme-guide choices in a predictable two-column set. */
#form-tv-viewer .guide-display-controls {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end !important;
  gap: 12px 18px !important;
}

#form-tv-viewer .guide-display-controls > .toggle {
  min-height: 28px;
}

#form-tv-viewer .guide-display-controls > .field {
  width: 100%;
  min-width: 0;
  max-width: none;
  flex: none;
}

#form-tv-viewer .guide-display-controls > .field input {
  width: 100%;
}

@media (max-width: 540px) {
  #form-tv-viewer .guide-display-controls {
    grid-template-columns: minmax(0, 1fr);
  }
}

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