/*
  Sekorix Theme
  Layered on top of Bootstrap 5.3.8. Bootstrap provides the finished component
  base; this file owns Sekorix tokens, clamp typography, product surfaces, and
  compatibility styling for the existing static HTML/JS app.
*/

:root {
  color-scheme: light;
  --skx-font-sans: var(--bs-font-sans-serif);
  --skx-font-display: var(--bs-font-sans-serif);
  --skx-font-mono: var(--bs-font-monospace);

  --skx-type-page-title: clamp(1.75rem, 1.35rem + 1vw, 2rem);
  --skx-type-section-title: clamp(1.25rem, 1.05rem + 0.5vw, 1.5rem);
  --skx-type-panel-title: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --skx-type-body: clamp(0.875rem, 0.82rem + 0.2vw, 1rem);
  --skx-type-dense: clamp(0.8125rem, 0.78rem + 0.15vw, 0.875rem);
  --skx-type-meta: clamp(0.75rem, 0.72rem + 0.12vw, 0.8125rem);
  --skx-type-metric: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  --skx-type-display: clamp(2rem, 1.5rem + 2.5vw, 3.5rem);

  --skx-space-1: 4px;
  --skx-space-2: 8px;
  --skx-space-3: 12px;
  --skx-space-4: 16px;
  --skx-space-5: 20px;
  --skx-space-6: 24px;
  --skx-space-8: 32px;
  --skx-space-10: 40px;
  --skx-space-12: 48px;

  --skx-radius-micro: 4px;
  --skx-radius-control: 8px;
  --skx-radius-panel: 12px;
  --skx-radius-circle: 999px;

  --skx-bg: #f4f7fb;
  --skx-app-bg: #f6f8fb;
  --skx-bg-strong: #f8fbff;
  --skx-shell-bg: #ffffff;
  --skx-panel-bg: #ffffff;
  --skx-panel-muted: #f6f9fd;
  --skx-border-soft: rgba(96, 122, 150, 0.18);
  --skx-border-strong: rgba(96, 122, 150, 0.28);
  --skx-text: #162b3f;
  --skx-text-strong: #102033;
  --skx-text-muted: #61758a;
  --skx-primary: #1f8a5b;
  --skx-primary-hover: #176d49;
  --skx-navy: #01025f;
  --skx-blue: #2563eb;
  --skx-teal: #0f9f8f;
  --skx-amber: #b7791f;
  --skx-red: #c2414b;
  --skx-violet: #6d5bd0;
  --skx-success: #1f8a5b;
  --skx-warning: #b7791f;
  --skx-danger: #c2414b;
  --skx-info: #2563eb;
  --skx-shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04);
  --skx-shadow-float: 0 18px 44px rgba(15, 23, 42, 0.10);

  --bs-font-sans-serif: "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, -apple-system, sans-serif;
  --bs-font-monospace: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --bs-body-font-family: var(--skx-font-sans);
  --bs-body-font-size: var(--skx-type-body);
  --bs-body-line-height: 1.5;
  --bs-body-color: var(--skx-text);
  --bs-body-bg: var(--skx-app-bg);
  --bs-heading-color: var(--skx-text-strong);
  --bs-primary: var(--skx-primary);
  --bs-primary-rgb: 31, 138, 91;
  --bs-secondary-color: var(--skx-text-muted);
  --bs-border-color: var(--skx-border-soft);
  --bs-border-radius: var(--skx-radius-control);
  --bs-border-radius-sm: var(--skx-radius-micro);
  --bs-border-radius-lg: var(--skx-radius-panel);
  --bs-link-color: var(--skx-blue);
  --bs-link-hover-color: var(--skx-primary);
  --bs-focus-ring-color: color-mix(in srgb, var(--skx-primary) 28%, transparent);
}

body.cs-theme-dark,
body[data-theme="dark"] {
  color-scheme: dark;
  --skx-bg: #081728;
  --skx-app-bg: #08111f;
  --skx-bg-strong: #0a1624;
  --skx-shell-bg: #0b1626;
  --skx-panel-bg: #101c2e;
  --skx-panel-muted: #0d192a;
  --skx-border-soft: #1c2b40;
  --skx-border-strong: #26364d;
  --skx-text: #e1e8f2;
  --skx-text-strong: #f5f7fb;
  --skx-text-muted: #8fa1ba;
  --skx-primary: #21a46d;
  --skx-primary-hover: #2bbf80;
  --skx-navy: #dbeafe;
  --skx-blue: #60a5fa;
  --skx-teal: #2dd4bf;
  --skx-amber: #f59e0b;
  --skx-red: #f87171;
  --skx-violet: #a78bfa;
  --skx-success: #22c55e;
  --skx-shadow-card: none;
  --skx-shadow-float: 0 18px 44px rgba(0, 0, 0, 0.34);

  --bs-body-color: var(--skx-text);
  --bs-body-bg: var(--skx-app-bg);
  --bs-heading-color: var(--skx-text-strong);
  --bs-primary: var(--skx-primary);
  --bs-primary-rgb: 33, 164, 109;
  --bs-secondary-color: var(--skx-text-muted);
  --bs-border-color: var(--skx-border-soft);
  --bs-link-color: var(--skx-blue);
  --bs-link-hover-color: var(--skx-primary-hover);
}

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

html {
  min-height: 100%;
  background: var(--skx-app-bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--skx-font-sans);
  font-size: var(--skx-type-body);
  line-height: 1.5;
  letter-spacing: 0;
  color: var(--skx-text);
  background: var(--skx-app-bg);
}

body.modal-open {
  overflow: hidden;
}

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

button,
summary,
[role="button"] {
  cursor: pointer;
}

button:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.56;
}

:where(a, button, input, textarea, select, summary, [role="button"], [tabindex]):focus-visible {
  outline: 2px solid color-mix(in srgb, var(--skx-primary) 70%, transparent);
  outline-offset: 2px;
}

a {
  color: var(--skx-blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

img,
svg {
  max-width: 100%;
}

.hidden,
.is-hidden,
[hidden] {
  display: none;
}

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

.muted,
.muted-small,
.sub,
.support-subtle-copy,
.quick-prompt-result-muted {
  color: var(--skx-text-muted);
}

.muted-small,
small {
  font-size: var(--skx-type-meta);
}

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

h1 {
  font-family: var(--skx-font-display);
  font-size: var(--skx-type-page-title);
  line-height: 1.18;
  color: var(--skx-text-strong);
}

h2 {
  font-size: var(--skx-type-section-title);
  line-height: 1.25;
  color: var(--skx-text-strong);
}

h3,
h4 {
  font-size: var(--skx-type-panel-title);
  line-height: 1.3;
  color: var(--skx-text-strong);
}

.workspace-wrap {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: var(--skx-space-6);
  width: min(100%, 1680px);
  min-height: 100vh;
  margin: 0 auto;
  padding: var(--skx-space-6);
}

.workspace-sidebar,
.stitch-sidebar,
.support-sidebar {
  position: sticky;
  top: var(--skx-space-6);
  align-self: start;
  max-height: calc(100vh - var(--skx-space-12));
  overflow: auto;
}

.workspace-main,
.support-main {
  min-width: 0;
}

.offer-card,
.card,
.panel,
.section-panel,
.support-panel,
.quick-geocheck-panel,
.quick-prompt-dialog-card,
.modal,
.settings-account-card,
.settings-setup-rail,
.stitch-dashboard-table-card,
.stitch-kpi-card,
.stitch-health-card,
.stats-hero-card,
.stats-coverage-card,
.run-text-extraction-card,
.run-sources-card,
.run-debug-screenshot-card {
  border: 1px solid var(--skx-border-soft);
  border-radius: var(--skx-radius-panel);
  background: var(--skx-panel-bg);
  box-shadow: var(--skx-shadow-card);
}

.auth-page,
.hub-page,
.support-space-page,
.sekorix-workspace,
.provider-bridge-page {
  background:
    radial-gradient(circle at 16% 0%, color-mix(in srgb, var(--skx-primary) 12%, transparent), transparent 32rem),
    linear-gradient(180deg, var(--skx-bg-strong), var(--skx-app-bg));
}

.page-shell,
.provider-bridge-main {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: var(--skx-space-6);
}

.login-stack,
.secondary-stack {
  display: grid;
  gap: var(--skx-space-4);
  width: min(100%, 460px);
}

.auth-page .card {
  display: grid;
  gap: var(--skx-space-4);
  width: min(100%, 520px);
  margin: var(--skx-space-8) auto;
  padding: var(--skx-space-6);
}

.auth-login .card {
  margin: 0;
}

.brand-row,
.support-brand,
.sekorix-card-brand {
  display: flex;
  align-items: center;
  gap: var(--skx-space-3);
}

.brand-logo {
  display: block;
  width: auto;
  height: 44px;
}

.brand-context,
.register-copy,
.hint {
  color: var(--skx-text-muted);
  font-size: var(--skx-type-meta);
}

.intro {
  margin-bottom: var(--skx-space-5);
}

.field-group,
.field-shell {
  display: grid;
  gap: var(--skx-space-2);
}

.field-shell {
  position: relative;
}

.field-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  display: inline-flex;
  width: 20px;
  height: 20px;
  color: var(--skx-text-muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.field-icon svg,
.button svg,
.btn svg {
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.field-icon svg circle,
.button-spark path {
  fill: currentColor;
  stroke: none;
}

.field-icon + input {
  padding-left: 42px;
}

.button,
.button-primary,
.button-secondary {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--skx-space-2);
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--skx-border-soft);
  border-radius: var(--skx-radius-control);
  background: var(--skx-panel-bg);
  color: var(--skx-text);
  font-family: var(--skx-font-sans);
  font-size: var(--skx-type-dense);
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

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

.button-secondary {
  background: var(--skx-panel-muted);
}

.status,
.msg,
.hint,
.linkline,
.register-row,
.footer-links {
  font-size: var(--skx-type-dense);
}

.status,
.msg {
  min-height: 24px;
  color: var(--skx-text-muted);
}

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: var(--skx-space-4);
}

.panel-head,
.register-row,
.footer-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--skx-space-3);
}

.auth-page form {
  display: grid;
  gap: var(--skx-space-3);
}

.auth-page .panel-title {
  color: var(--skx-text-strong);
  font-size: var(--skx-type-panel-title);
  font-weight: 700;
}

.auth-page .sub,
.auth-page .intro-note {
  color: var(--skx-text-muted);
  font-size: var(--skx-type-dense);
  line-height: 1.45;
}

.panel-link,
.register-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--skx-blue);
  font-size: var(--skx-type-dense);
  font-weight: 700;
}

.sekorix-logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.sekorix-logo-badge img {
  display: block;
  width: auto;
  height: 44px;
}

.provider-bridge-link {
  min-width: 160px;
  min-height: 44px;
}

.offer-card,
.card,
.section-panel,
.support-panel,
.quick-geocheck-panel {
  padding: var(--skx-space-6);
}

.section-panel:not(.active) {
  display: none;
}

.stitch-topbar-card {
  grid-column: 1 / -1;
  padding: var(--skx-space-4) var(--skx-space-5);
}

.stitch-topbar,
.customer-head,
.support-topbar,
.support-topbar-actions,
.customer-head-right,
.stitch-topbar-right,
.actions,
.support-reply-actions,
.support-quick-actions,
.stitch-toolbar-actions,
.stitch-dashboard-hero-actions {
  display: flex;
  align-items: center;
  gap: var(--skx-space-3);
}

.stitch-topbar,
.customer-head,
.support-topbar {
  justify-content: space-between;
}

.stitch-dashboard-hero {
  flex-wrap: wrap;
}

.stitch-dashboard-hero-copy {
  flex: 1 1 320px;
}

.stitch-dashboard-hero-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stitch-view-switch,
.checks-view-switch {
  display: inline-flex;
  align-items: center;
  gap: var(--skx-space-2);
  white-space: nowrap;
}

.sekorix-logo-plain,
.stitch-topbar-logo-image {
  display: block;
  width: auto;
  height: 40px;
}

.sekorix-logo-plain.is-large {
  height: 48px;
}

.btn,
.button,
.btn-primary,
.btn-ghost,
.compact-btn,
.stitch-new-prompt-btn,
.stitch-hero-primary-btn,
.stitch-toolbar-btn,
.stitch-view-btn,
.stitch-page-btn,
.support-outline-btn,
.support-filled-btn,
.quick-prompt-dialog-close,
.quick-prompt-remove,
.settings-provider-primary-action,
.settings-provider-inline-copy {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--skx-space-2);
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid var(--skx-border-soft);
  border-radius: var(--skx-radius-control);
  background: var(--skx-panel-bg);
  color: var(--skx-text);
  font-family: var(--skx-font-sans);
  font-size: var(--skx-type-dense);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
}

.btn.primary,
.button-primary,
.btn-primary,
.btn.btn-primary,
.stitch-new-prompt-btn,
.stitch-hero-primary-btn,
.support-filled-btn,
.settings-provider-primary-action {
  border-color: var(--skx-primary);
  background: var(--skx-primary);
  color: #ffffff;
}

.btn:hover,
.button:hover,
.btn-primary:hover,
.btn-secondary:hover,
.btn-outline-secondary:hover,
.btn-ghost:hover,
.compact-btn:hover,
.stitch-toolbar-btn:hover,
.support-outline-btn:hover {
  border-color: var(--skx-border-strong);
  background: color-mix(in srgb, var(--skx-primary) 8%, var(--skx-panel-bg));
  color: var(--skx-text-strong);
}

.btn.primary:hover,
.button-primary:hover,
.btn-primary:hover,
.btn.btn-primary:hover,
.stitch-new-prompt-btn:hover,
.stitch-hero-primary-btn:hover,
.support-filled-btn:hover,
.settings-provider-primary-action:hover {
  border-color: var(--skx-primary-hover);
  background: var(--skx-primary-hover);
  color: #ffffff;
}

.btn.danger,
.btn-outline-danger,
.is-danger {
  border-color: color-mix(in srgb, var(--skx-red) 38%, transparent);
  color: var(--skx-red);
}

.btn-secondary,
.btn-ghost,
.button-secondary,
.stitch-toolbar-btn,
.support-outline-btn {
  background: var(--skx-panel-muted);
}

.btn-sm {
  min-height: 34px;
  padding: 7px 10px;
  font-size: var(--skx-type-meta);
}

.stitch-icon-btn,
.icon-only,
.theme-toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--skx-border-soft);
  border-radius: var(--skx-radius-control);
  background: var(--skx-panel-bg);
  color: var(--skx-text);
}

.material-symbols-outlined {
  font-size: clamp(1.125rem, 1rem + 0.4vw, 1.375rem);
  line-height: 1;
}

.theme-switch-track {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--skx-space-1);
}

.lang-switcher-host,
.auth-lang-row,
.workspace-language-switcher,
.lang-switcher {
  display: flex;
  align-items: center;
}

.auth-lang-row {
  justify-content: flex-end;
  margin-bottom: var(--skx-space-3);
}

.lang-switcher {
  display: inline-flex;
  gap: var(--skx-space-1);
  padding: var(--skx-space-1);
  border: 1px solid var(--skx-border-soft);
  border-radius: var(--skx-radius-control);
  background: var(--skx-panel-muted);
}

.lang-switcher-btn {
  appearance: none;
  min-width: 42px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: var(--skx-radius-control);
  background: transparent;
  color: var(--skx-text);
  font-size: var(--skx-type-dense);
  font-weight: 600;
  line-height: 1;
}

.lang-switcher-btn.is-active {
  border-color: var(--skx-primary);
  background: var(--skx-primary);
  color: #ffffff;
}

input,
select,
textarea,
.form-control,
.form-select,
.support-select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--skx-border-soft);
  border-radius: var(--skx-radius-control);
  background: var(--skx-panel-bg);
  color: var(--skx-text);
  font-size: var(--skx-type-body);
  line-height: 1.4;
}

input,
select,
.form-control,
.form-select {
  padding: 0 12px;
}

textarea,
textarea.form-control {
  min-height: 112px;
  padding: 10px 12px;
  resize: vertical;
}

label,
.form-label,
.field,
.support-field {
  display: grid;
  gap: var(--skx-space-2);
  font-size: var(--skx-type-dense);
  font-weight: 600;
  color: var(--skx-text-strong);
}

.form-text,
.invalid-feedback,
.valid-feedback {
  font-size: var(--skx-type-meta);
}

.form-control:focus,
.form-select:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: color-mix(in srgb, var(--skx-primary) 68%, var(--skx-border-soft));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--skx-primary) 16%, transparent);
}

.form-grid,
.quick-geocheck-form,
.support-control-grid,
.settings-account-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: var(--skx-space-4);
}

.field-wide {
  grid-column: 1 / -1;
}

.side-tabs,
.stitch-side-tabs,
.support-thread-list {
  display: grid;
  gap: var(--skx-space-2);
}

.side-tab {
  width: 100%;
  justify-content: flex-start;
}

.side-tab.is-active,
.stitch-view-btn.is-active,
.stitch-page-btn.is-current {
  border-color: var(--skx-primary);
  background: color-mix(in srgb, var(--skx-primary) 12%, var(--skx-panel-bg));
  color: var(--skx-primary);
}

.stitch-nav-divider,
.support-kicker,
.quick-prompt-dialog-kicker,
.quick-prompt-intent {
  font-size: var(--skx-type-meta);
  font-weight: 700;
  color: var(--skx-text-muted);
  letter-spacing: 0;
}

.stitch-plan-card,
.support-user-pill,
.support-flash,
.support-placeholder-row,
.support-empty-state,
.quick-empty,
.msg,
.chip,
.status-chip,
.stitch-status-inline,
.quick-prompt-state,
.quick-run-detail-status,
.quick-prompt-result-status,
.competitor-trend-badge {
  border: 1px solid var(--skx-border-soft);
  border-radius: var(--skx-radius-control);
  background: var(--skx-panel-muted);
  color: var(--skx-text);
}

.stitch-plan-card {
  display: grid;
  gap: var(--skx-space-3);
  padding: var(--skx-space-3);
}

.stitch-plan-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--skx-space-2);
}

.stitch-plan-head > span:not(.material-symbols-outlined) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stitch-plan-icon {
  color: var(--skx-primary);
}

.stitch-plan-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--skx-success) 34%, transparent);
  border-radius: var(--skx-radius-circle);
  background: color-mix(in srgb, var(--skx-success) 10%, var(--skx-panel-bg));
  color: var(--skx-success);
  font-size: var(--skx-type-meta);
  font-weight: 700;
}

.stitch-plan-track {
  height: 8px;
  overflow: hidden;
  border-radius: var(--skx-radius-circle);
  background: color-mix(in srgb, var(--skx-border-soft) 70%, transparent);
}

.stitch-plan-fill {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--skx-primary), var(--skx-teal));
}

.stitch-plan-card p {
  margin: 0;
  color: var(--skx-text-muted);
  font-size: var(--skx-type-meta);
}

.chip,
.status-chip,
.stitch-status-inline,
.quick-prompt-state,
.quick-run-detail-status,
.quick-prompt-result-status,
.support-user-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--skx-space-1);
  min-height: 28px;
  padding: 4px 8px;
  border-radius: var(--skx-radius-circle);
  font-size: var(--skx-type-meta);
  font-weight: 700;
  white-space: nowrap;
}

.is-done,
.is-success,
.ok,
.status-erfolgreich {
  border-color: color-mix(in srgb, var(--skx-success) 38%, transparent);
  color: var(--skx-success);
}

.is-running,
.is-info,
.status-running {
  border-color: color-mix(in srgb, var(--skx-blue) 38%, transparent);
  color: var(--skx-blue);
}

.is-pending,
.is-needs-review,
.is-review,
.warn {
  border-color: color-mix(in srgb, var(--skx-amber) 42%, transparent);
  color: var(--skx-amber);
}

.is-error,
.error,
.status-fehler {
  border-color: color-mix(in srgb, var(--skx-red) 42%, transparent);
  color: var(--skx-red);
}

.stitch-dashboard-shell,
.god-app,
.god-main,
.god-console,
.god-content,
.god-dashboard-view,
.stats-dashboard,
.support-layout {
  display: grid;
  gap: var(--skx-space-5);
}

.stitch-dashboard-layout,
.support-layout {
  grid-template-columns: minmax(0, 1fr);
}

.stitch-dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  align-items: start;
  gap: var(--skx-space-5);
}

.stitch-dashboard-primary,
.stitch-insight-rail,
.stitch-dashboard-table-card {
  min-width: 0;
}

.stitch-dashboard-hero,
.god-topbar,
.god-topbar-left,
.god-topbar-right,
.god-page-head,
.god-gate-head,
.stitch-dashboard-toolbar,
.quick-geocheck-toolbar,
.support-panel-head,
.support-detail-head,
.run-text-extraction-head,
.run-sources-head,
.run-debug-screenshot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--skx-space-4);
}

.god-app {
  width: min(100%, 1680px);
  margin: 0 auto;
  padding: var(--skx-space-6);
}

.god-topbar {
  margin-bottom: var(--skx-space-6);
}

.god-brand img {
  display: block;
  width: auto;
  height: 40px;
}

.god-title-chip,
.god-admin-trigger,
.god-secure-hint {
  display: inline-flex;
  align-items: center;
  gap: var(--skx-space-2);
  font-size: var(--skx-type-dense);
}

.god-icon svg,
.god-admin-avatar svg,
.god-admin-trigger > svg,
.god-eye svg,
.god-secure-hint svg,
.god-hero-icon svg,
.god-section-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.god-gate-icon svg,
.god-hero-icon svg {
  width: 28px;
  height: 28px;
}

.god-admin-trigger {
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--skx-border-soft);
  border-radius: var(--skx-radius-control);
  background: var(--skx-panel-bg);
  color: var(--skx-text);
  font-weight: 600;
}

.god-admin-menu button {
  display: flex;
  align-items: center;
  gap: var(--skx-space-2);
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--skx-radius-control);
  background: transparent;
  color: var(--skx-text);
  font-size: var(--skx-type-dense);
  text-align: left;
}

.god-password-wrap {
  position: relative;
}

.god-password-wrap input {
  padding-right: 42px;
}

.god-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--skx-text-muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.god-secure-hint svg {
  flex: 0 0 20px;
}

.god-admin-menu,
.settings-action-menu-popover {
  position: absolute;
  z-index: 20;
  min-width: 200px;
  padding: var(--skx-space-2);
  border: 1px solid var(--skx-border-soft);
  border-radius: var(--skx-radius-panel);
  background: var(--skx-panel-bg);
  box-shadow: var(--skx-shadow-float);
}

.god-mode-gate {
  max-width: 620px;
  margin: var(--skx-space-8) auto;
}

.god-mode-locked .requires-god-mode {
  display: none;
}

body:not(.god-mode-locked) .god-mode-gate {
  display: none;
}

.god-mode-locked .god-mode-gate {
  margin-top: min(18vh, 140px);
}

.stitch-dashboard-title {
  margin-bottom: var(--skx-space-2);
}

.stitch-dashboard-subtitle,
.support-header-meta,
.quick-status-line {
  max-width: 74ch;
  color: var(--skx-text-muted);
}

.stitch-kpi-grid,
.stats-hero-grid,
.stats-breakdown-grid,
.quick-model-grid,
.quick-results-grid,
.support-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: var(--skx-space-4);
}

.stitch-kpi-card,
.stitch-health-card,
.stats-hero-card,
.stats-coverage-card {
  padding: var(--skx-space-4);
}

.stitch-kpi-card,
.stitch-health-card {
  display: grid;
  gap: var(--skx-space-3);
}

.stitch-health-card {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.stitch-health-ring,
.stitch-health-donut {
  display: inline-grid;
  place-items: center;
  width: clamp(58px, 6vw, 76px);
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--skx-primary) 26%, var(--skx-border-soft));
  border-radius: var(--skx-radius-circle);
  background: conic-gradient(var(--skx-primary) var(--skx-health-progress, 0%), color-mix(in srgb, var(--skx-primary) 10%, var(--skx-panel-muted)) 0);
  color: var(--skx-primary);
  font-weight: 800;
}

.stitch-health-card p,
.stitch-kpi-copy p,
.stitch-kpi-copy span,
.stitch-health-delta {
  margin: 0;
  color: var(--skx-text-muted);
  font-size: var(--skx-type-meta);
}

.stitch-kpi-card h3,
.stitch-health-card h3,
.stats-kpi-ring-value,
.stats-metric-value {
  margin: 0;
  font-family: var(--skx-font-display);
  font-size: var(--skx-type-metric);
  line-height: 1;
}

.stitch-dashboard-toolbar {
  flex-wrap: wrap;
  margin-bottom: var(--skx-space-4);
}

.stitch-dashboard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--skx-space-3);
  padding-top: var(--skx-space-4);
}

.stitch-dashboard-footer > p {
  margin: 0;
  color: var(--skx-text-muted);
  font-size: var(--skx-type-dense);
}

.stitch-dashboard-footer-controls,
.stitch-pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--skx-space-2);
}

.stitch-page-size {
  display: inline-flex;
  align-items: center;
  grid-template-columns: none;
  gap: var(--skx-space-2);
  margin: 0;
}

.stitch-page-size select {
  width: auto;
  min-width: 76px;
}

.stitch-page-btn {
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
}

.stitch-page-ellipsis {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--skx-text-muted);
}

.stitch-search-shell {
  display: flex;
  align-items: center;
  gap: var(--skx-space-2);
  min-width: min(340px, 100%);
  flex: 1 1 280px;
}

.stitch-search-shell input {
  flex: 1;
}

.table-wrap,
.stitch-dashboard-table-wrap,
.settings-data-table-wrap,
.quick-rich-table-wrap {
  max-width: 100%;
  overflow: auto;
}

.stitch-dashboard-table-wrap {
  max-height: min(72vh, 760px);
}

.stitch-insight-rail {
  display: grid;
  gap: var(--skx-space-4);
}

.stitch-insight-toggle-row {
  display: flex;
  justify-content: flex-end;
}

.stitch-insight-body,
.stitch-next-checks-list {
  display: grid;
  gap: var(--skx-space-4);
}

.stitch-insight-card {
  display: grid;
  gap: var(--skx-space-3);
  padding: var(--skx-space-4);
  border: 1px solid var(--skx-border-soft);
  border-radius: var(--skx-radius-panel);
  background: var(--skx-panel-bg);
  box-shadow: var(--skx-shadow-card);
}

.stitch-insight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--skx-space-2);
}

.stitch-insight-head h2,
.stitch-insight-card p {
  margin: 0;
}

.stitch-health-donut {
  width: clamp(84px, 9vw, 112px);
  margin: 0 auto;
}

.stitch-health-legend {
  display: grid;
  gap: var(--skx-space-2);
  color: var(--skx-text-muted);
  font-size: var(--skx-type-meta);
}

.stitch-health-legend span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--skx-space-2);
}

.stitch-health-legend i {
  width: 8px;
  height: 8px;
  border-radius: var(--skx-radius-circle);
  background: currentColor;
}

table,
.table,
.grid,
.settings-data-table,
.quick-rich-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--skx-type-dense);
}

th,
.table th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--skx-border-soft);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--skx-panel-bg);
  color: var(--skx-text-muted);
  font-size: var(--skx-type-meta);
  font-weight: 700;
}

.table {
  --bs-table-color: var(--skx-text);
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--skx-border-soft);
  --bs-table-hover-bg: var(--skx-panel-muted);
  margin-bottom: 0;
}

.stitch-dashboard-status-cell,
.stitch-dashboard-model-cell {
  white-space: nowrap;
}

.stitch-placement-value.is-empty {
  color: var(--skx-text-muted);
}

.stitch-status-inline.is-placement {
  border-color: color-mix(in srgb, var(--skx-blue) 36%, transparent);
  color: var(--skx-blue);
}

.badge,
.alert,
.dropdown-menu,
.dropdown-item,
.nav,
.nav-link,
.pagination,
.page-link {
  font-size: var(--skx-type-dense);
}

.badge {
  border-radius: var(--skx-radius-circle);
  font-weight: 700;
}

.alert {
  border-color: var(--skx-border-soft);
  border-radius: var(--skx-radius-panel);
  background: var(--skx-panel-muted);
  color: var(--skx-text);
}

.alert-success {
  border-color: color-mix(in srgb, var(--skx-success) 38%, transparent);
  color: var(--skx-success);
}

.alert-warning {
  border-color: color-mix(in srgb, var(--skx-amber) 42%, transparent);
  color: var(--skx-amber);
}

.alert-danger {
  border-color: color-mix(in srgb, var(--skx-red) 42%, transparent);
  color: var(--skx-red);
}

.dropdown-menu {
  border-color: var(--skx-border-soft);
  border-radius: var(--skx-radius-panel);
  background: var(--skx-panel-bg);
  box-shadow: var(--skx-shadow-float);
}

.dropdown-item {
  color: var(--skx-text);
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--skx-panel-muted);
  color: var(--skx-text-strong);
}

.nav-pills .nav-link {
  border-radius: var(--skx-radius-control);
  color: var(--skx-text);
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
  background: var(--skx-primary);
  color: #ffffff;
}

.prompt-bulk-tray.is-loading {
  pointer-events: none;
  opacity: 0.72;
}

.stitch-insight-toggle,
.insight-toggle,
[data-insight-toggle] {
  display: inline-grid;
  place-items: center;
  width: clamp(28px, 2vw, 32px);
  height: clamp(28px, 2vw, 32px);
  flex: 0 0 clamp(28px, 2vw, 32px);
  border: 1px solid var(--skx-border-soft);
  border-radius: var(--skx-radius-control);
  background: var(--skx-panel-bg);
  color: var(--skx-text);
  white-space: nowrap;
}

.run-text-extraction-card,
.run-sources-card,
.run-debug-screenshot-card {
  display: grid;
  gap: var(--skx-space-3);
  padding: var(--skx-space-4);
}

.run-text-extraction-card::before {
  content: none;
}

.run-text-extraction-body,
.run-source-list,
.run-debug-screenshot-body {
  display: grid;
  gap: var(--skx-space-2);
}

.run-source-link,
.run-debug-artifact-link,
.rich-text a.rich-source-link {
  color: var(--skx-blue);
  overflow-wrap: anywhere;
}

.run-source-url {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.run-review-prompt-title .run-review-prompt-open,
.run-text-extraction-card.is-prompt.is-clickable {
  cursor: pointer;
}

.quick-geocheck-screen,
.quick-geocheck-prompts,
.quick-prompt-result-workspace,
.quick-prompt-result-detail,
.quick-run-detail-grid,
.quick-prompt-dialog-body,
.support-message-list,
.support-reply-box {
  display: grid;
  gap: var(--skx-space-4);
}

.quick-prompt-item,
.quick-run-detail-block,
.prompt-history-card,
.competitor-change-card,
.prompt-model-row {
  display: grid;
  gap: var(--skx-space-2);
  padding: var(--skx-space-3);
  border: 1px solid var(--skx-border-soft);
  border-radius: var(--skx-radius-panel);
  background: var(--skx-panel-bg);
}

.quick-prompt-dialog {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: var(--skx-space-6);
  background: rgba(8, 17, 31, 0.52);
}

.quick-prompt-dialog-card {
  width: min(980px, 100%);
  max-height: min(86vh, 920px);
  overflow: auto;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1055;
  display: none;
  width: 100%;
  height: 100%;
  padding: var(--skx-space-6);
  overflow: auto;
  background: color-mix(in srgb, #07111f 58%, transparent);
}

.modal.open {
  display: grid;
  place-items: center;
}

.modal-dialog,
.modal-card,
.modal-content,
.stitch-team-modal-card,
.competitor-profile-drawer-panel {
  border: 1px solid var(--skx-border-soft);
  border-radius: var(--skx-radius-panel);
  background: var(--skx-panel-bg);
  color: var(--skx-text);
  box-shadow: var(--skx-shadow-float);
}

.modal-card {
  width: min(100%, 760px);
  max-height: min(88vh, 980px);
  overflow: auto;
}

.modal-card-compact {
  width: min(100%, 640px);
}

.modal-card-run-review {
  width: min(100%, 1180px);
}

.modal-head,
.modal-header,
.modal-footer,
.modal-actions,
.stitch-team-modal-head,
.stitch-team-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--skx-space-3);
  padding: var(--skx-space-4);
  border-color: var(--skx-border-soft);
}

.modal-body,
.modal-card > :not(.modal-head):not(.modal-footer):not(.modal-actions),
.stitch-team-modal-body {
  padding: var(--skx-space-4);
}

.modal-title {
  font-size: var(--skx-type-section-title);
}

.stitch-team-modal {
  position: fixed;
  inset: 0;
  z-index: 1060;
  display: grid;
  place-items: center;
  padding: var(--skx-space-6);
}

.stitch-team-modal.hidden {
  display: none;
}

.stitch-team-modal-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, #07111f 58%, transparent);
}

.stitch-team-modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 620px);
}

.schedule-dialog {
  margin-top: var(--skx-space-4);
  padding: var(--skx-space-4);
  border: 1px solid var(--skx-border-soft);
  border-radius: var(--skx-radius-panel);
  background: var(--skx-panel-muted);
}

.competitor-profile-drawer {
  position: fixed;
  inset: 0;
  z-index: 1065;
  display: none;
  justify-content: flex-end;
  background: color-mix(in srgb, #07111f 46%, transparent);
}

.competitor-profile-drawer.open {
  display: flex;
}

.competitor-profile-drawer-panel {
  width: min(520px, 100%);
  min-height: 100vh;
  overflow: auto;
  border-radius: var(--skx-radius-panel) 0 0 var(--skx-radius-panel);
}

.competitor-drawer-head,
.competitor-drawer-body,
.competitor-drawer-footer,
.competitor-drawer-section {
  display: grid;
  gap: var(--skx-space-3);
  padding: var(--skx-space-4);
}

.competitor-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--skx-border-soft);
}

.competitor-drawer-close-btn,
.stitch-team-modal-close {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--skx-border-soft);
  border-radius: var(--skx-radius-control);
  background: var(--skx-panel-muted);
  color: var(--skx-text);
}

.quick-prompt-dialog-head,
.quick-prompt-dialog-foot {
  display: flex;
  justify-content: space-between;
  gap: var(--skx-space-3);
  padding: var(--skx-space-4);
  border-bottom: 1px solid var(--skx-border-soft);
}

.quick-prompt-dialog-foot {
  border-top: 1px solid var(--skx-border-soft);
  border-bottom: 0;
}

.support-shell {
  width: min(100%, 1540px);
  margin: 0 auto;
  padding: var(--skx-space-6);
}

.support-layout {
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
}

.support-panel + .support-panel,
.support-main > .support-panel + .support-panel {
  margin-top: var(--skx-space-4);
}

.support-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--skx-radius-circle);
  background: var(--skx-panel-muted);
}

.dom-inspector-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  pointer-events: none;
}

.dom-inspector-panel {
  position: fixed;
  right: var(--skx-space-4);
  bottom: var(--skx-space-4);
  z-index: 1201;
  pointer-events: auto;
  display: grid;
  gap: var(--skx-space-3);
  width: min(420px, calc(100vw - 32px));
  padding: var(--skx-space-4);
  border: 1px solid var(--skx-border-strong);
  border-radius: var(--skx-radius-panel);
  background: var(--skx-panel-bg);
  box-shadow: var(--skx-shadow-float);
}

.dom-inspector-actions,
.dom-inspector-voice-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--skx-space-2);
}

.dom-inspector-comment {
  min-height: 120px;
}

@media (max-width: 1180px) {
  .stitch-dashboard-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .workspace-wrap,
  .support-layout {
    grid-template-columns: 1fr;
  }

  .workspace-sidebar,
  .stitch-sidebar,
  .support-sidebar {
    position: static;
    max-height: none;
  }
}

@media (max-width: 680px) {
  .workspace-wrap,
  .support-shell {
    padding: var(--skx-space-3);
  }

  .offer-card,
  .card,
  .section-panel,
  .support-panel,
  .quick-geocheck-panel {
    padding: var(--skx-space-4);
  }

  .stitch-topbar,
  .customer-head,
  .support-topbar,
  .support-topbar-actions,
  .stitch-dashboard-hero,
  .stitch-dashboard-footer,
  .stitch-dashboard-footer-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .stitch-toolbar-actions,
  .stitch-dashboard-hero-actions {
    flex-wrap: wrap;
  }

  .stitch-page-size,
  .stitch-page-size select {
    width: 100%;
  }

  .quick-prompt-dialog {
    padding: var(--skx-space-2);
  }

  .modal,
  .stitch-team-modal {
    padding: var(--skx-space-2);
  }

  .modal-card,
  .stitch-team-modal-card {
    width: 100%;
    max-height: calc(100vh - 16px);
  }

  .competitor-profile-drawer-panel {
    width: 100%;
    border-radius: 0;
  }
}

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