:root {
  --bg: #000000;
  --surface: #050505;
  --panel: #080808;
  --line: #2a2a2a;
  --text: #f8fafc;
  --muted: #9fb0c9;
  --accent: #f59e0b;
  --header-bg: rgba(0, 0, 0, 0.96);
  --header-button-bg: #050505;
  --menu-bg: #050505;
  --field-bg: #050505;
  --panel-bg: rgba(5, 5, 5, 0.94);
  --card-bg: #050505;
  --card-bg-soft: rgba(8, 8, 8, 0.78);
  --hover-bg: rgba(255, 255, 255, 0.06);
  --button-secondary-bg: transparent;
  --button-secondary-text: var(--text);
  --button-secondary-border: var(--line);
  --button-secondary-hover: rgba(255, 255, 255, 0.08);
  --button-primary-bg: #d97706;
  --button-primary-border: #d97706;
  --button-primary-hover: #b45309;
  --button-primary-text: #ffffff;
  --danger-bg: rgba(127, 29, 29, 0.18);
  --danger-bg-hover: rgba(127, 29, 29, 0.32);
  --danger-border: #7f1d1d;
  --danger-text: #fecaca;
  --success-text: #86efac;
  --error-text: #fca5a5;
}

html[data-theme='light'] {
  --bg: #eef4fb;
  --surface: #ffffff;
  --panel: #f8fbff;
  --line: #cbd5e1;
  --text: #0f172a;
  --muted: #526277;
  --accent: #d97706;
  --header-bg: rgba(255, 255, 255, 0.92);
  --header-button-bg: #ffffff;
  --menu-bg: #ffffff;
  --field-bg: #ffffff;
  --panel-bg: rgba(255, 255, 255, 0.94);
  --card-bg: #ffffff;
  --card-bg-soft: rgba(248, 250, 252, 0.98);
  --hover-bg: rgba(15, 23, 42, 0.05);
  --button-secondary-bg: #ffffff;
  --button-secondary-text: #0f172a;
  --button-secondary-border: #bfcddd;
  --button-secondary-hover: #eef4fb;
  --button-primary-bg: #ea8600;
  --button-primary-border: #d97706;
  --button-primary-hover: #c96f00;
  --button-primary-text: #ffffff;
  --danger-bg: #fee2e2;
  --danger-bg-hover: #fecaca;
  --danger-border: #dc2626;
  --danger-text: #991b1b;
  --success-text: #166534;
  --error-text: #b91c1c;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  background: #000000;
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
}

html[data-theme='light'] body {
  background:
    radial-gradient(circle at top left, rgba(217, 119, 6, 0.10), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
}

a { color: #fbbf24; }
html[data-theme='light'] a { color: #b45309; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, 760px);
  min-height: 56px;
  margin: 0 auto;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
}
.site-brand {
  flex: 0 0 auto;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.05rem;
}
.site-page-title {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.95rem;
}
.site-header-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}
.menu-button {
  display: inline-grid;
  place-items: center;
  gap: 4px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: var(--header-button-bg);
  cursor: pointer;
}
.menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
}
.nav-menu {
  position: absolute;
  top: 52px;
  right: 16px;
  display: grid;
  min-width: 190px;
  border: 1px solid var(--line);
  background: var(--menu-bg);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
}
.nav-menu a,
.nav-menu button {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.nav-menu a:last-child,
.nav-menu button:last-child {
  border-bottom: 0;
}
.nav-menu a:hover,
.nav-menu button:hover {
  background: var(--hover-bg);
}

.site-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  min-width: 54px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--header-button-bg);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.site-theme-toggle:hover {
  background: var(--hover-bg);
}
.shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 24px 16px 48px;
}
.panel {
  border: 1px solid var(--line);
  background: var(--panel-bg);
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}
.stack { display: grid; gap: 14px; }
.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
}
.brand-link {
  color: var(--accent);
  text-decoration: none;
}
.brand-link:hover {
  text-decoration: underline;
}
h1 { margin: 0; font-size: 2rem; }
.muted { color: var(--muted); margin: 0; }
.field {
  width: 100%;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  background: var(--field-bg);
  color: var(--text);
  font: inherit;
  font-size: 0.86rem;
  line-height: 1.2;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  min-width: 72px;
  padding: 4px 10px;
  border: 1px solid var(--button-primary-border);
  border-radius: 999px;
  background: var(--button-primary-bg);
  color: var(--button-primary-text);
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.button:hover {
  background: var(--button-primary-hover);
  border-color: var(--button-primary-hover);
}
.button-secondary {
  border-color: var(--button-secondary-border);
  background: var(--button-secondary-bg);
  color: var(--button-secondary-text);
}

.button-secondary:hover {
  background: var(--button-secondary-hover);
  border-color: var(--button-secondary-border);
}
.callout {
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--card-bg);
}
.callout-title {
  margin: 0 0 6px;
  font-weight: 700;
}
.dashboard-actions {
  display: grid;
  gap: 12px;
}
.workflow-link {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--text);
  text-decoration: none;
}
.workflow-link:hover {
  border-color: #d97706;
  background: var(--hover-bg);
}
.workflow-link-title {
  font-weight: 700;
}
.workflow-link-copy {
  color: var(--muted);
}
.template-builder {
  gap: 18px;
}
.asset-source-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 360px);
  gap: 12px;
  align-items: end;
  border: 1px solid var(--line);
  background: var(--card-bg-soft);
  padding: 14px;
}

.asset-source-panel h2 {
  margin: 0 0 4px;
}

@media (max-width: 640px) {
  .asset-source-panel {
    grid-template-columns: 1fr;
  }
}
.template-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}
.template-list {
  display: grid;
  gap: 8px;
  min-height: 48px;
}
.template-sections {
  display: grid;
  gap: 16px;
}
.template-section {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--card-bg-soft);
}
.template-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}
.template-section-title {
  font-weight: 700;
}
.template-row {
  display: grid;
  grid-template-columns: 36px 28px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  background: var(--card-bg);
}
.template-row-disabled {
  opacity: 0.58;
}
.template-row-dragging {
  border-color: #d97706;
}
.drag-handle {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: grab;
  font: inherit;
}
.template-check {
  width: 20px;
  height: 20px;
  margin: 0;
}
.template-req-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: rgba(245, 158, 11, 0.08);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.template-req-check {
  width: 18px;
  height: 18px;
  margin: 0;
}
.template-item-field {
  min-width: 0;
}
.template-item-body {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.template-value-field {
  background: var(--field-bg);
  color: var(--muted);
}
.template-row-value {
  align-items: center;
}
.template-row-value .template-item-body {
  grid-template-columns: minmax(120px, 1fr) 90px 74px;
  align-items: center;
}
.template-row-value .template-item-field {
  padding-left: 0;
  padding-right: 0;
  border-color: transparent;
  background: transparent;
  font-weight: 700;
}
.template-row-value .template-value-field {
  color: var(--text);
}
.template-value-behavior {
  min-width: 0;
  width: 68px;
  padding-left: 7px;
  padding-right: 18px;
}
.template-source-link {
  display: grid;
  min-width: 0;
  width: 100%;
  grid-column: 2 / 4;
}
.template-source-field {
  min-width: 0;
  width: 100%;
  padding-left: 7px;
  padding-right: 18px;
}
.template-comment {
  min-height: 44px;
  resize: vertical;
}
@media (max-width: 560px) {
  .template-row-value .template-item-body {
    grid-template-columns: 1fr;
  }
}
.builder-controls {
  display: grid;
  gap: 16px;
}
.builder-control-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--card-bg-soft);
}
.builder-control-card h2 {
  margin: 0;
  font-size: 1.2rem;
}
.builder-control-card .button {
  width: 100%;
}
.section-order-actions {
  display: flex;
  gap: 6px;
}
.section-order-button {
  min-height: 30px;
  min-width: 72px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
}
.section-order-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
@media (max-width: 560px) {
  .template-section-head {
    grid-template-columns: 1fr;
  }
  .section-order-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}
.template-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.share-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--text);
}
.share-toggle input {
  width: 18px;
  height: 18px;
}
.save-status {
  min-height: 24px;
  margin: 0;
  color: var(--success-text);
}
.save-status-error {
  color: var(--error-text);
}
.button:disabled {
  opacity: 0.6;
  cursor: wait;
}
.remove-button,
.section-remove-button {
  border-color: var(--danger-border);
  color: var(--danger-text);
  font-weight: 700;
}
.remove-button {
  min-height: 30px;
  min-width: 72px;
  padding: 4px 10px;
  border: 1px solid var(--danger-border);
  border-radius: 999px;
  background: var(--danger-bg);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  white-space: nowrap;
  line-height: 1;
}
.remove-button:hover,
.section-remove-button:hover {
  background: var(--danger-bg-hover);
}
@media (max-width: 560px) {
  .template-row {
    grid-template-columns: 36px 32px minmax(0, 1fr);
  }
  .template-req-toggle,
  .remove-button {
    grid-column: 1 / -1;
  }
  .section-order-actions {
    grid-template-columns: 1fr 1fr 1fr;
  }
}
.scroll-top-button {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  min-height: 30px;
  min-width: 72px;
  padding: 4px 10px;
  border: 1px solid var(--button-primary-border);
  border-radius: 999px;
  background: var(--button-primary-bg);
  color: var(--button-primary-text);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
}
.scroll-top-button:hover {
  background: var(--button-primary-hover);
  border-color: var(--button-primary-hover);
}
.dashboard-section {
  margin-top: 10px;
}
.dashboard-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, 300px);
  gap: 12px;
  align-items: start;
  justify-content: start;
}

.dashboard-card-grid .template-card {
  grid-template-columns: 1fr;
  align-content: start;
  min-height: 148px;
}

.dashboard-card-grid .template-card-actions {
  justify-content: flex-start;
  margin-top: auto;
}

.dashboard-card-grid .template-card .button {
  width: auto;
}

.dashboard-card-grid-static .template-card {
  min-height: 132px;
}

.dash-control-card .field {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 0.86rem;
}

.dash-control-card .button {
  min-height: 30px;
  min-width: 72px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  line-height: 1;
}

.dashboard-asset-form-card {
  width: min(100%, 320px);
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--card-bg);
}

.dashboard-asset-form-adder {
  width: 100%;
  grid-template-columns: 1fr;
  gap: 8px;
}

.dashboard-asset-form-adder .button {
  width: auto;
}

.dashboard-card-grid .template-card .button {
  width: auto;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.section-title-row h2,
.template-card h3 {
  margin: 0;
}
.template-list-panel {
  display: grid;
  gap: 10px;
}
.template-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--card-bg);
}
.template-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
@media (max-width: 640px) {
  .section-title-row,
  .template-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .section-title-row {
    display: grid;
  }
  .template-card-actions {
    justify-content: stretch;
  }
  .template-card-actions .button {
    flex: 1;
  }

  .dashboard-card-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-card-grid .template-card .button {
    width: 100%;
  }
}
.button-danger {
  border-color: var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger-text);
  font-weight: 700;
}
.button-danger:hover {
  background: var(--danger-bg-hover);
}
.add-existing-template {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--card-bg-soft);
}
.add-existing-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}
.template-row-readonly {
  cursor: default;
  grid-template-columns: 32px minmax(0, 1fr);
}
.template-row-readonly .template-item-field:disabled {
  padding-left: 0;
  padding-right: 0;
  border-color: transparent;
  background: transparent;
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  font-weight: 700;
}
.template-row-readonly .template-value-field:disabled {
  color: var(--muted);
  -webkit-text-fill-color: var(--muted);
}
.template-row-readonly .field:disabled,
.template-comment:disabled,
.template-check:disabled {
  opacity: 1;
  cursor: default;
}
@media (max-width: 560px) {
  .add-existing-form {
    grid-template-columns: 1fr;
  }
}



.add-existing-template-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}
@media (max-width: 560px) {
  .add-existing-template-inline {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 420px) {
  .site-page-title {
    font-size: 0.85rem;
  }

  .site-header {
    gap: 8px;
    padding: 0 10px;
  }

  .site-header-actions {
    gap: 6px;
  }

  .site-theme-toggle {
    min-width: 52px;
    padding: 6px 8px;
    font-size: 0.75rem;
  }
}
.dashboard-title-row h2 {
  margin: 0;
}
.dashboard-template-actions {
  justify-content: flex-start;
}
.asset-template-fields {
  display: grid;
  gap: 8px;
}
.asset-template-field-row {
  grid-template-columns: minmax(0, 1fr) auto;
}
.dashboard-checklist-section {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.account-access-card {
  align-items: center;
}

.account-role-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 700;
}

.account-role-toggle input {
  width: 1.1rem;
  height: 1.1rem;
}

.tenant-user-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px auto;
  gap: 8px;
}

.tenant-user-actions {
  align-items: center;
}

.tenant-user-actions .field {
  width: auto;
  min-width: 150px;
}
.tenant-user-actions a.button {
  text-decoration: none;
}


.asset-entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.manager-asset-search-row {
  display: grid;
  grid-template-columns: minmax(220px, 420px) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 12px;
}

.asset-entry-field {
  min-width: 0;
}

.asset-panel-list {
  display: grid;
  gap: 10px;
}

.asset-panel {
  border: 1px solid var(--line);
  background: var(--card-bg-soft);
  padding: 12px;
}

.asset-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.asset-panel-values {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.asset-value-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--card-bg);
  padding: 7px 9px;
  min-width: 120px;
}

.asset-value-pill strong {
  color: var(--muted);
  font-size: 0.82rem;
}

.inline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.asset-value-pill-archived {
  border-style: dashed;
  opacity: 0.82;
}
.asset-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.asset-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.asset-edit-field {
  min-width: 0;
}

.asset-panel-inactive {
  opacity: 0.68;
}
.asset-panel-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.asset-active-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.86rem;
}

.asset-small-button {
  min-height: 30px;
  padding: 4px 9px;
  font-size: 0.82rem;
}

.builder-control-card .manager-asset-actions .button,
.manager-asset-actions .button {
  width: auto;
  flex: 0 0 auto;
}

@media (max-width: 640px) {
  .manager-asset-search-row {
    grid-template-columns: 1fr;
  }
}
.driver-app-body {
  background:
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.16), transparent 30%),
    linear-gradient(180deg, #07111f 0%, #0f172a 100%);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  width: min(100%, 620px);
  margin: 0 auto;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 17, 31, 0.96);
}

.app-header div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.app-brand-link {
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.app-brand-link:hover {
  color: var(--accent);
}

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

.app-shell {
  width: min(100%, 620px);
  margin: 0 auto;
  padding: 18px 12px 40px;
  display: grid;
  gap: 14px;
}

.app-card {
  border: 1px solid var(--line);
  background: rgba(17, 24, 39, 0.94);
  padding: 18px;
}

.app-field {
  min-height: 52px;
  font-size: 1.05rem;
}

.app-primary {
  width: 100%;
  min-height: 52px;
  font-weight: 800;
}

.app-result-list,
.app-checklist-sections {
  display: grid;
  gap: 10px;
}

.app-result-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  background: #0d1525;
}

.app-small-button {
  min-height: 38px;
  padding: 7px 10px;
}

.app-selected-asset h2,
.app-checklist-head h2,
.app-check-section h3 {
  margin: 0;
}

.app-check-section {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #0d1525;
}

.app-check-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 42px;
}

.app-check-choice-row {
  padding: 8px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.app-check-choice-row > span {
  font-weight: 700;
}

.app-required-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 6px;
  border: 1px solid rgba(245, 158, 11, 0.55);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.app-required-badge-inline {
  margin-left: 0;
  flex: 0 0 auto;
}

.app-required-missing {
  border-color: #f97316 !important;
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.42);
}

.app-check-choice-group {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}

.app-check-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.86);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.app-check-toggle.is-nil {
  color: var(--muted);
}

.app-check-toggle.is-ok {
  border-color: var(--accent);
  background: rgba(217, 119, 6, 0.2);
  color: var(--text);
}

.app-check-toggle.is-fail {
  border-color: #ef4444;
  background: rgba(127, 29, 29, 0.42);
  color: #fff;
}

.app-section-comment-wrap {
  margin-top: 4px;
}

.app-section-comment {
  min-height: 42px;
  resize: vertical;
}

@media (max-width: 380px) {
  .app-result-card,
  .app-check-row {
    grid-template-columns: 1fr;
  }

  .app-check-choice-group {
    min-width: 0;
    gap: 5px;
  }

  .app-check-toggle {
    min-width: 66px;
    min-height: 28px;
    padding: 3px 9px;
    font-size: 0.78rem;
  }
}

@media (max-width: 640px) {
  .tenant-user-form {
    grid-template-columns: 1fr;
  }

  .tenant-user-actions {
    justify-content: stretch;
  }

  .tenant-user-actions .field,
  .tenant-user-actions .button,
  .tenant-user-actions .account-role-toggle {
    width: 100%;
  }
}
.app-answer-field {
  gap: 6px;
}

.app-answer-field .app-field {
  min-height: 46px;
}

.app-field-locked {
  background: rgba(15, 23, 42, 0.62);
  color: var(--muted);
  cursor: not-allowed;
}

.app-submit-success {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #0d1525;
}

.app-submit-success h2 {
  margin: 0;
}

.admin-help-list {
  display: grid;
  gap: 10px;
}

.admin-help-item {
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.admin-help-question {
  width: 100%;
  padding: 14px 16px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.admin-help-question:hover,
.admin-help-question[aria-expanded="true"] {
  color: var(--accent);
}

.admin-help-answer {
  padding: 0 16px 16px;
  color: var(--muted);
}

.admin-help-answer p {
  margin: 0;
}
.library-list {
  display: grid;
  gap: 8px;
}

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

.library-row p {
  margin: 4px 0 0;
}

@media (max-width: 640px) {
  .library-row {
    align-items: stretch;
    flex-direction: column;
  }
}
/* Landing page */
.landing-body {
  background: #000000;
}

html[data-theme='light'] .landing-body {
  background:
    radial-gradient(circle at 12% 10%, rgba(217, 119, 6, 0.12), transparent 26%),
    radial-gradient(circle at 88% 8%, rgba(14, 165, 233, 0.12), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #eef4fb 62%, #e5edf7 100%);
}

.landing-header,
.landing-shell {
  width: min(100%, 1120px);
}

.landing-shell {
  margin: 0 auto;
  padding: 34px 16px 64px;
  display: grid;
  gap: 22px;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: 22px;
  align-items: stretch;
}

.landing-hero-copy,
.landing-logo-card,
.landing-card,
.landing-panel {
  border: 1px solid var(--line);
  background: var(--panel-bg);
  box-shadow: none;
}

.landing-hero-copy {
  padding: clamp(26px, 5vw, 54px);
  display: grid;
  align-content: center;
  gap: 18px;
  min-height: 430px;
}

.landing-hero h1 {
  max-width: 720px;
  font-size: clamp(2.35rem, 6vw, 5.25rem);
  line-height: 0.94;
  letter-spacing: -0.065em;
}

.landing-lede {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2.4vw, 1.32rem);
  line-height: 1.45;
}

.landing-actions {
  margin-top: 8px;
}

.landing-logo-card {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  min-height: 430px;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(217, 119, 6, 0.18), transparent 38%),
    var(--card-bg);
}

.landing-logo-card::before {
  content: '';
  position: absolute;
  inset: 18px;
  border: 1px dashed rgba(245, 158, 11, 0.44);
  pointer-events: none;
}

.landing-logo-card img {
  width: min(66%, 250px);
  height: auto;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.35));
}

.landing-logo-card span {
  position: absolute;
  left: 28px;
  bottom: 24px;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

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

.landing-card,
.landing-panel {
  padding: 22px;
}

.landing-card {
  display: grid;
  gap: 10px;
  min-height: 210px;
  align-content: start;
}

.landing-card-kicker {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.landing-card h2,
.landing-panel h2,
.landing-flow h2 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.08;
}

.landing-card p,
.landing-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.landing-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.landing-image-panel {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.landing-image-panel img {
  width: 86px;
  height: 86px;
}

.landing-flow {
  padding: 24px;
}

.landing-flow-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.landing-flow-steps div {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--card-bg);
}

.landing-flow-steps strong {
  color: var(--text);
}

.landing-flow-steps span {
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 820px) {
  .landing-hero,
  .landing-split,
  .landing-grid,
  .landing-flow-steps {
    grid-template-columns: 1fr;
  }

  .landing-hero-copy,
  .landing-logo-card {
    min-height: auto;
  }

  .landing-logo-card {
    min-height: 260px;
  }
}

@media (max-width: 520px) {
  .landing-shell {
    padding-top: 18px;
  }

  .landing-hero-copy,
  .landing-card,
  .landing-panel,
  .landing-flow {
    padding: 18px;
  }

  .landing-image-panel {
    grid-template-columns: 1fr;
  }
}

/* Landing page commercial refinements */
.landing-hero-commercial {
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
}

.landing-product-card {
  position: relative;
  overflow: hidden;
  min-height: 430px;
  display: grid;
  place-items: center;
  padding: 28px;
  border: 1px solid var(--line);
  background: var(--card-bg);
  box-shadow: none;
}

.landing-product-card::before,
.landing-product-card::after {
  content: '';
  position: absolute;
  border: 1px solid rgba(245, 158, 11, 0.26);
  border-radius: 999px;
}

.landing-product-card::before {
  width: 320px;
  height: 320px;
}

.landing-product-card::after {
  width: 460px;
  height: 460px;
  opacity: 0.55;
}

.landing-phone-mock {
  position: relative;
  z-index: 1;
  width: min(100%, 285px);
  min-height: 360px;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 26px 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.34);
}

.landing-phone-mock img {
  width: 72px;
  height: 72px;
  margin-bottom: 18px;
}

.landing-phone-mock strong {
  font-size: 1.45rem;
}

.landing-phone-mock span {
  display: inline-flex;
  width: fit-content;
  padding: 5px 10px;
  border: 1px solid rgba(34, 197, 94, 0.5);
  border-radius: 999px;
  color: var(--success-text);
  font-size: 0.82rem;
  font-weight: 800;
}

.landing-phone-mock small {
  color: var(--muted);
  line-height: 1.45;
}

.landing-product-card > p {
  position: absolute;
  left: 28px;
  bottom: 24px;
  z-index: 1;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.landing-proof-row div {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: var(--card-bg);
}

.landing-proof-row strong {
  font-size: 1.4rem;
  color: var(--text);
}

.landing-proof-row span {
  color: var(--muted);
  line-height: 1.35;
}

.landing-card-featured {
  background: var(--card-bg);
}

.landing-image-panel-large img {
  width: 112px;
  height: 112px;
}

.landing-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 26px;
}

.landing-cta h2 {
  margin: 0 0 8px;
}

@media (max-width: 820px) {
  .landing-hero-commercial,
  .landing-proof-row,
  .landing-cta {
    grid-template-columns: 1fr;
  }

  .landing-product-card {
    min-height: 360px;
  }
}

.landing-hero-image-card {
  padding: 16px;
  align-items: stretch;
  background: var(--card-bg);
}

.landing-hero-image-card::before,
.landing-hero-image-card::after {
  display: none;
}

.landing-hero-image {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 398px;
  object-fit: cover;
  object-position: center;
  border: 1px solid var(--line);
  box-shadow: none;
}

.landing-hero-image-card figcaption {
  position: absolute;
  left: 30px;
  bottom: 28px;
  z-index: 2;
  margin: 0;
  padding: 5px 9px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  background: rgba(8, 17, 31, 0.74);
  color: #fff7ed;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

@media (max-width: 820px) {
  .landing-hero-image {
    min-height: 300px;
    max-height: 560px;
  }
}


.landing-hero-copy,
.landing-logo-card,
.landing-card,
.landing-panel,
.landing-product-card,
.landing-proof-row div,
.landing-flow-steps div {
  border-color: transparent;
}

.landing-hero-image,
.landing-image-panel img,
.landing-logo-card img,
.landing-phone-mock img {
  border-radius: 18px;
}

.landing-hero-image-card {
  border-color: transparent;
}

.landing-hero-image {
  border-color: transparent;
}
.password-field-wrap {
  position: relative;
  display: block;
}

.password-field-wrap .field {
  min-width: 0;
  padding-right: 42px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: #f8fafc;
  color: #000000;
  cursor: pointer;
}

.password-toggle::before {
  content: '';
  width: 17px;
  height: 11px;
  border: 2px solid currentColor;
  border-radius: 50% / 62%;
}

.password-toggle::after {
  content: '';
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.password-toggle.is-visible::after {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  transform: rotate(-35deg);
  background: currentColor;
}

.password-toggle:hover {
  color: #000000;
  background: #ffffff;
}
html[data-theme='light'] .password-toggle {
  background: transparent;
  color: var(--muted);
}

html[data-theme='light'] .password-toggle:hover {
  color: var(--text);
}


.manager-access-inline {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.manager-access-inline h4 {
  margin: 0;
}


.alert-list {
  display: grid;
  gap: 0.85rem;
}

.alert-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
}

.alert-card-copy {
  min-width: 0;
}

.alert-card-copy h3,
.alert-card-copy p {
  margin: 0 0 0.35rem;
}

.alert-card-copy p {
  color: var(--muted);
}

@media (max-width: 640px) {
  .alert-card {
    grid-template-columns: 1fr;
  }

  .alert-card .button {
    width: 100%;
  }
}
.landing-record-image-card {
  margin: 0;
  display: grid;
  gap: 12px;
  align-content: start;
}

.landing-record-image-card img {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  object-position: center 42%;
  border-radius: 18px;
}

.landing-record-image-card figcaption {
  color: var(--muted);
  font-weight: 700;
}

.landing-live-card {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.landing-live-card > img {
  width: 78px;
  height: 78px;
  border-radius: 16px;
}

@media (max-width: 520px) {
  .landing-live-card {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 12px;
  }

  .landing-live-card > img {
    width: 54px;
    height: 54px;
    border-radius: 12px;
  }
}

.view-switch-pill,
.view-mode-note {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-left: 10px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.view-switch-pill {
  color: var(--button-primary-text);
  background: var(--button-primary-bg);
  border-color: var(--button-primary-border);
}

.view-switch-pill:hover {
  color: var(--button-primary-text);
  background: var(--button-primary-hover);
}

.view-mode-note {
  color: var(--muted);
  background: var(--card-bg-soft);
}

.template-library-section {
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--card-bg);
}

.template-library-section + .template-library-section {
  margin-top: 8px;
}

.template-library-section .section-title-row {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.template-library-section h2 {
  margin: 0 0 3px;
}

.template-library-grid {
  display: grid;
  gap: 0;
}

.template-library-row {
  display: grid;
  gap: 0.2rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(159, 176, 201, 0.2);
  color: var(--text);
  text-decoration: none;
}

.template-library-row:last-child {
  border-bottom: 0;
}

.template-library-row strong {
  color: var(--accent);
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.2;
}

.template-library-row span {
  max-width: 62ch;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.35;
}

.template-library-row:hover strong,
.template-library-row:focus-visible strong {
  color: var(--text);
}

.template-library-row:hover span,
.template-library-row:focus-visible span {
  color: var(--text);
}

.tenant-directory-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: 14px;
}

.tenant-directory-row > div:first-child {
  min-width: 0;
}

.tenant-directory-row .muted {
  overflow-wrap: anywhere;
}

.tenant-directory-row .template-card-actions {
  justify-content: flex-end;
  min-width: max-content;
}

.tenant-directory-row .button {
  white-space: nowrap;
}

@media (max-width: 640px) {
  .tenant-directory-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .tenant-directory-row .template-card-actions {
    justify-content: flex-start;
    min-width: 0;
  }
}

.super-admin-add-client-head {
  justify-content: space-between;
}

.super-admin-add-client-head h3 {
  margin: 0;
}

@media (max-width: 640px) {
  .super-admin-add-client-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

.dashboard-control-grid {
  display: block;
  columns: 300px;
  column-gap: 12px;
}

.dashboard-control-grid > .template-card {
  display: inline-grid;
  width: 300px;
  margin: 0 0 12px;
  break-inside: avoid;
}

@media (max-width: 640px) {
  .dashboard-control-grid {
    columns: auto;
  }

  .dashboard-control-grid > .template-card {
    width: 100%;
  }
}

.save-status-warning {
  color: var(--accent);
}


.template-library-action-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 1rem;
}

.template-library-copy {
  display: grid;
  gap: 0.2rem;
  color: inherit;
  text-decoration: none;
}

.template-library-actions {
  justify-content: flex-end;
  gap: 0.5rem;
}

@media (max-width: 640px) {
  .template-library-action-row {
    grid-template-columns: 1fr;
  }

  .template-library-actions {
    justify-content: flex-start;
  }
}
