:root {
  --bg: #e9eef2;
  --bg-soft: #dfe8ee;
  --brand: #bcd9e3;
  --brand-strong: #6bb8d2;
  --surface: #ffffff;
  --ink: #16354b;
  --ink-soft: #466378;
  --line: #d8e2e8;
  --shadow: 0 18px 40px rgba(61, 89, 109, 0.12);
  --radius: 26px;
  --content-width: 1120px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#app {
  flex: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.page-width {
  width: min(calc(100% - 32px), var(--content-width));
  margin: 0 auto;
}

.site-header {
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.top-strip {
  height: 30px;
  background: var(--brand);
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  min-height: 82px;
}

.brand-block {
  display: flex;
  align-items: stretch;
}

.brand-mark {
  width: 164px;
  min-height: 82px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-right: 1px solid var(--line);
}

.brand-mark img {
  max-width: 100%;
  max-height: 54px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 0 18px;
}

.brand-text span {
  font-size: 14px;
  color: var(--ink-soft);
}

.brand-text strong {
  font-size: 26px;
}

.header-nav {
  display: flex;
  gap: 20px;
  font-size: 15px;
  font-weight: 700;
}

.header-nav a {
  padding: 10px 0;
}

main {
  padding-bottom: 48px;
}

.hero-strip {
  background: linear-gradient(180deg, var(--brand) 0%, #cfe1e8 100%);
  padding: 38px 0 46px;
}

.hero-block {
  min-height: 220px;
  display: flex;
  align-items: end;
}

.hero-copy {
  max-width: 760px;
}

.hero-kicker,
.stat-label,
.theme-name,
.scenario-type,
.section-tag {
  display: inline-block;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 14px;
  color: #5d7890;
  font-weight: 700;
}

.hero-copy h2,
.section-head h3,
.toolbox-head h4,
.admin-head h2,
.editor-section h3 {
  margin: 0;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.05;
}

.hero-copy p,
.section-head p,
.theme-card p,
.scenario-card p,
.stat-card p,
.advanced-intro,
.editor-section label span,
.login-card p {
  color: var(--ink-soft);
}

.ai-disclaimer {
  background: #7f1d1d;
  color: #fef2f2;
  padding: 14px 0;
}

.ai-disclaimer p {
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
  color: #fef2f2;
}

.ai-disclaimer strong {
  font-weight: 700;
}

.overview-section,
.content-section,
.admin-page {
  margin-top: -18px;
}

.theme-grid,
.scenario-grid,
.advanced-columns,
.library-grid,
.two-col,
.admin-layout {
  display: grid;
  gap: 20px;
}

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

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

.surface-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.theme-card,
.scenario-card,
.toolbox-section,
.admin-head,
.admin-nav,
.editor-section {
  padding: 26px;
}

.theme-card {
  border-radius: 12px;
  border-top: 4px solid var(--brand-strong);
  transition: box-shadow 0.15s, transform 0.15s;
}

.theme-card:hover {
  box-shadow: 0 12px 32px rgba(61, 89, 109, 0.14);
  transform: translateY(-2px);
}

.theme-scenario-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0 16px;
}

.scenario-card {
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(61, 89, 109, 0.08);
}

.toolbox-section {
  border-radius: 10px;
}

.advanced-section {
  border-top: 8px solid #7fc7db;
  background: linear-gradient(180deg, #ffffff 0%, #f6fafb 100%);
  padding-top: 30px;
}

.section-head {
  margin: 34px 0 18px;
}

.section-head h3 {
  font-size: 40px;
  margin-bottom: 10px;
}

.theme-card h4,
.scenario-card h4,
.toolbox-head h4 {
  margin: 8px 0 6px;
  font-size: 30px;
  line-height: 1.15;
}

.link-button,
.primary-button,
.ghost-button,
.mini-action {
  border: 0;
  cursor: pointer;
}

.link-button,
.ghost-button,
.primary-button,
.mini-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 700;
}

.link-button,
.ghost-button {
  background: #eef5f8;
  color: var(--ink);
}

.primary-button {
  background: #37afcf;
  color: #fff;
}

.toolbox-section {
  margin-top: 20px;
}

.toolbox-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.model-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.model-link {
  padding: 8px 14px 8px 8px;
  border-radius: 999px;
  background: #eef5f8;
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.model-link-logo {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d9e5ea;
}

.model-link-logo img {
  width: 18px;
  height: 18px;
}

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

.form-row label,
.editor-section label,
.login-fields {
  display: grid;
  gap: 8px;
}

.helper-copy {
  margin: 18px 0 10px;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 14px 16px;
  color: var(--ink);
}

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

.compact-area {
  min-height: 100px;
}

.prompt-box {
  min-height: 280px;
  line-height: 1.6;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}

.status-copy {
  color: #4d7085;
  font-weight: 700;
}

.advanced-section h5 {
  margin: 0 0 14px;
  font-size: 22px;
}

.advanced-flow,
.advanced-main,
.advanced-side,
.advanced-guidance-grid {
  display: grid;
  gap: 18px;
}

.advanced-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.advanced-tab,
.prompt-chip {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  padding: 10px 0;
  font-weight: 700;
  cursor: pointer;
  position: relative;
}

.advanced-tab {
  margin-right: 26px;
}

.advanced-tab.is-active,
.prompt-chip.is-active {
  color: var(--ink);
}

.advanced-tab.is-active::after,
.prompt-chip.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -11px;
  height: 3px;
  background: #37afcf;
}

.advanced-panel {
  padding: 8px 0 0;
}

.advanced-panel-section {
  display: grid;
  gap: 20px;
}

.advanced-custom-block {
  display: grid;
  gap: 12px;
}

.advanced-prompt-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.advanced-prompt-box {
  min-height: 260px;
  background: #fff;
}

.prompt-explanation {
  margin: -2px 0 0;
  color: var(--ink-soft);
  max-width: 820px;
  line-height: 1.6;
}

.advanced-guidance-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.inline-label {
  display: inline-block;
  margin-bottom: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
  color: #5d7890;
  font-weight: 700;
}

.ordered-list,
.check-list {
  margin: 0;
  padding-left: 22px;
  line-height: 1.65;
}

.advanced-tool-list,
.stack-list {
  display: grid;
  gap: 16px;
}

.advanced-tool,
.library-card,
.library-editor {
  border: 1px solid var(--line);
  border-radius: 6px 24px 6px 6px;
  background: #f7fafb;
  padding: 18px;
}

.advanced-tool p,
.library-card textarea {
  margin: 8px 0 0;
}

.advanced-tool a {
  display: inline-block;
  margin-top: 10px;
  font-weight: 700;
}

.advanced-tool-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
}

.advanced-tool-row {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  gap: 28px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.advanced-tool-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.advanced-tool-name {
  display: flex;
  align-items: center;
  gap: 12px;
}

.advanced-tool-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.advanced-tool-logo img {
  width: 20px;
  height: 20px;
}

.advanced-tool-meta p {
  margin: 10px 0 0;
  color: var(--ink-soft);
}

.advanced-tool-steps {
  padding-left: 8px;
}

.advanced-tool-links a:last-child {
  color: #2f6983;
}

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

.advanced-block {
  margin-top: 28px;
}

.advanced-block-wide {
  margin-top: 0;
  background: #fff;
  border: 1px solid var(--line);
  padding: 22px;
  border-radius: 8px;
}

.library-grid {
  grid-template-columns: 1fr;
  gap: 16px;
}

.library-card textarea {
  min-height: 220px;
  margin-top: 12px;
  border-radius: 6px;
  background: #fff;
}

.library-card-large {
  background: linear-gradient(180deg, #fcfeff 0%, #f2f8fb 100%);
  border-left: 6px solid #7fc7db;
}

.library-card-large strong {
  font-size: 20px;
}

.library-label,
.advanced-note {
  display: block;
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 14px;
}

.advanced-note {
  margin: 0 0 10px;
}

.advanced-tool-strong {
  background: #fff;
  border-radius: 8px;
}

.breadcrumb {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 24px 0 22px;
  font-size: 14px;
  color: #5d7890;
}

.breadcrumb button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
}

.admin-page {
  padding-top: 32px;
}

.admin-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

.admin-head h2 {
  font-size: 36px;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 10px;
}

.logged-in-as {
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  font-size: 14px;
  color: var(--ink-soft);
}

.admin-layout {
  grid-template-columns: 280px minmax(0, 1fr);
  margin-top: 22px;
}

.admin-nav {
  align-self: start;
  position: sticky;
  top: 26px;
}

.nav-block + .nav-block {
  margin-top: 26px;
}

.nav-head,
.section-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.nav-head h3,
.section-line h3 {
  margin: 0;
  font-size: 22px;
}

.nav-item {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  padding: 12px 14px;
  border-radius: 16px;
  cursor: pointer;
}

.nav-item.is-active {
  background: #eef5f8;
  border-color: #d6e6ec;
}

.admin-content {
  display: grid;
  gap: 20px;
}

.admin-explainer {
  margin-top: 22px;
}

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

.editor-section h3 {
  font-size: 28px;
  margin-bottom: 18px;
}

.editor-subsection {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.editor-subsection h4 {
  margin: 0;
  font-size: 22px;
}

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

.mini-action {
  background: #eef5f8;
  color: var(--ink);
  padding: 9px 12px;
}

.login-shell {
  min-height: calc(100vh - 112px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.login-card {
  width: min(100%, 420px);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18);
  padding: 22px;
  text-align: center;
}

.login-logo {
  width: 200px;
  max-width: 100%;
  margin-bottom: 0;
}

.login-logo-wrap {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.login-card h2 {
  margin: 0 0 12px;
  font-size: 28px;
}

.login-actions {
  display: grid;
  gap: 10px;
  margin: 20px 0;
}

.login-social-button {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  color: #555;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 700;
}

.login-social-button img {
  width: 25px;
  height: 25px;
}

.login-fields input {
  border-radius: 4px;
}

.login-primary-button,
.login-text-button {
  width: 100%;
  padding: 12px;
  border-radius: 4px;
  cursor: pointer;
}

.login-primary-button {
  border: 0;
  background: #233f91;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}

.login-text-button {
  border: 0;
  background: transparent;
  color: #233f91;
  font-size: 13px;
}

/* ── Focus area badges ─────────────────────────────────────────── */
.focus-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
}

.focus-badge--kommunikation  { background: #dbeafe; color: #1e40af; }
.focus-badge--indhold         { background: #fce7f3; color: #9d174d; }
.focus-badge--analyse         { background: #ede9fe; color: #5b21b6; }
.focus-badge--strategi        { background: #fef3c7; color: #92400e; }

.theme-section-head {
  display: flex;
  align-items: flex-start;
  gap: 32px;
}

.theme-head-text {
  flex: 1 1 0;
  min-width: 0;
}

.theme-filter {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  padding-top: 6px;
}

.theme-filter .focus-badge {
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s, box-shadow 0.15s;
}

.theme-filter .focus-badge:hover {
  opacity: 1;
}

.theme-filter .focus-badge.is-active-filter {
  opacity: 1;
  box-shadow: 0 0 0 2px currentColor;
}

.scenario-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.scenario-toggle {
  display: flex;
  gap: 0;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg);
  flex-shrink: 0;
}

.scenario-toggle button {
  background: transparent;
  border: 0;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border-radius: 0;
}

.scenario-toggle button.is-active {
  background: var(--brand-strong);
  color: #fff;
}

.problem-statement {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.55;
  font-style: italic;
  margin: 0 0 12px;
}

/* ── Scenario scroll-spy stepper ───────────────────────────────── */
.scenario-stepper {
  position: fixed;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: none;
  flex-direction: column;
  gap: 28px;
}

.scenario-stepper.is-visible {
  display: flex;
}

.scenario-stepper::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 4px;
  width: 2px;
  background: var(--line);
  border-radius: 1px;
  pointer-events: none;
}

.stepper-step {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  position: relative;
}

.stepper-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--brand-strong);
  background: var(--bg);
  flex-shrink: 0;
  transition: background 0.2s, transform 0.2s;
  position: relative;
  z-index: 1;
}

.stepper-step.is-active .stepper-dot {
  background: var(--brand-strong);
  transform: scale(1.3);
}

.stepper-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.stepper-step.is-active .stepper-label {
  color: var(--ink);
}

@media (max-width: 1279px) {
  .scenario-stepper.is-visible {
    display: none !important;
  }
}

@media (max-width: 980px) {
.theme-grid,
.scenario-grid,
.library-grid,
  .form-row,
  .two-col,
  .advanced-flow,
  .advanced-guidance-grid,
  .admin-layout,
  .explainer-grid,
  .variant-grid {
    grid-template-columns: 1fr;
  }

  .admin-nav {
    position: static;
  }

  .header-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .header-nav {
    padding: 14px 0 18px;
  }
}

@media (max-width: 640px) {
  .brand-block {
    flex-direction: column;
  }

  .brand-mark {
    width: 100%;
  }

  .toolbox-head,
  .admin-head {
    flex-direction: column;
    align-items: stretch;
  }

  .advanced-tool-row {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .advanced-tab {
    margin-right: 16px;
  }

  .section-head h3,
  .theme-card h4,
  .scenario-card h4,
  .toolbox-head h4 {
    font-size: 28px;
  }
}

/* ── Search ──────────────────────────────────────────────────────── */
.search-wrap {
  margin-top: 28px;
}

.search-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 760px;
}

.search-icon {
  position: absolute;
  left: 18px;
  color: #5d7890;
  display: flex;
  pointer-events: none;
  z-index: 1;
}

.search-input {
  width: 100%;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  padding: 15px 52px 15px 50px;
  font-size: 16px;
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  min-height: unset;
  resize: none;
}

.search-input:focus {
  outline: none;
  border-color: var(--brand-strong);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(107, 184, 210, 0.22);
}

.search-input::placeholder {
  color: #7a96a8;
}

.search-clear {
  position: absolute;
  right: 14px;
  background: #c8d8e0;
  border: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}

.search-clear:hover {
  background: var(--brand-strong);
  color: #fff;
}

.search-results-head h3 em {
  font-style: normal;
  color: var(--ink-soft);
  font-weight: 400;
}

.search-result-theme {
  font-size: 11px;
  color: var(--ink-soft);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.search-no-results {
  padding: 48px 0 24px;
  color: var(--ink-soft);
  font-size: 16px;
}

.search-no-results strong {
  color: var(--ink);
}

/* ── Suggestion widget ──────────────────────────────────────────── */
.suggestion-widget {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 0 4px;
}

.suggestion-toggle {
  background: transparent;
  border: 0;
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
  padding: 6px 0;
  opacity: 0.7;
  transition: opacity 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.suggestion-toggle::before {
  content: "✦";
  font-size: 10px;
  opacity: 0.5;
}

.suggestion-toggle:hover {
  opacity: 1;
  color: var(--ink);
}

.suggestion-widget--open {
  flex-direction: column;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  gap: 12px;
}

.suggestion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.suggestion-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.suggestion-close {
  background: transparent;
  border: 0;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  line-height: 1;
  border-radius: 4px;
}

.suggestion-close:hover {
  background: var(--bg-soft);
  color: var(--ink);
}

.suggestion-textarea {
  min-height: 90px;
  resize: vertical;
  border-radius: 10px;
  font-size: 14px;
  border-color: var(--line);
}

.suggestion-actions {
  display: flex;
  justify-content: flex-end;
}

.suggestion-submit {
  padding: 10px 22px;
  font-size: 14px;
}

.suggestion-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.suggestion-error {
  font-size: 13px;
  color: #b91c1c;
  margin: 0;
}

.suggestion-widget--sent {
  justify-content: flex-end;
  gap: 8px;
  font-size: 13px;
  color: #15803d;
  font-weight: 600;
}

.suggestion-sent-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #dcfce7;
  font-size: 11px;
}

/* ── AI knowledge floating button ──────────────────────────────── */
.ai-panel-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 100;
  background: var(--brand-strong);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 11px 20px 11px 14px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(22, 53, 75, 0.22);
  transition: box-shadow 0.15s, transform 0.15s;
}

.ai-panel-btn:hover {
  box-shadow: 0 8px 28px rgba(22, 53, 75, 0.3);
  transform: translateY(-2px);
}

.ai-panel-btn-icon {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

/* ── AI knowledge slide-out panel ──────────────────────────────── */
.ai-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(22, 53, 75, 0.45);
  z-index: 200;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.ai-panel-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.ai-panel-dialog {
  width: min(100%, 720px);
  background: var(--surface);
  overflow-y: auto;
  transform: translateX(32px);
  transition: transform 0.25s ease-out;
  display: flex;
  flex-direction: column;
}

.ai-panel-overlay.is-open .ai-panel-dialog {
  transform: translateX(0);
}

.ai-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.ai-panel-header h2 {
  margin: 0;
  font-size: 26px;
}

.ai-panel-close {
  border: 0;
  background: #eef5f8;
  color: var(--ink);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.ai-panel-close:hover {
  background: var(--line);
}

.ai-panel-body {
  padding: 24px 28px 40px;
  display: grid;
  gap: 16px;
}

.ai-panel-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.ai-panel-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
}

.ai-panel-card h3 {
  margin: 0 0 12px;
  font-size: 15px;
  letter-spacing: 0.03em;
}

.ai-panel-card ul,
.ai-panel-card ol {
  margin: 0;
  padding-left: 20px;
  line-height: 1.65;
  font-size: 14px;
  color: var(--ink-soft);
}

.ai-panel-card p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.6;
}

.ai-panel-card--can {
  border-top: 3px solid #22c55e;
  background: #f0fdf4;
}

.ai-panel-card--can h3 {
  color: #15803d;
}

.ai-panel-card--cannot {
  border-top: 3px solid #ef4444;
  background: #fff7f7;
}

.ai-panel-card--cannot h3 {
  color: #b91c1c;
}

.ai-panel-card--gdpr {
  border-top: 3px solid #f59e0b;
  background: #fffbeb;
}

.ai-panel-card--gdpr h3 {
  color: #92400e;
}

.ai-panel-card--output {
  border-top: 3px solid #8b5cf6;
  background: #faf5ff;
}

.ai-panel-card--output h3 {
  color: #5b21b6;
}

.ai-panel-card--rim {
  border-top: 3px solid var(--brand-strong);
  background: #f0f9fd;
}

.ai-panel-card--rim h3 {
  color: #1a6a86;
}

.ai-panel-rim-intro {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.55;
}

.ai-panel-rim {
  display: grid;
  gap: 14px;
}

.ai-panel-rim-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.ai-panel-rim-letter {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-strong);
  color: #fff;
  font-weight: 900;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-panel-rim-item strong {
  display: block;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 3px;
}

.ai-panel-rim-item p {
  margin: 0;
  font-size: 13px !important;
  line-height: 1.5 !important;
}

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

  .ai-panel-btn-text {
    display: none;
  }

  .ai-panel-btn {
    padding: 12px;
  }
}

/* ── Site footer ────────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12px;
  padding: 14px 0;
}

.site-footer-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.site-footer a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.15s;
}

.site-footer a:hover {
  color: var(--ink);
}

.site-footer-sep {
  color: var(--line);
}

.site-footer-admin-link {
  opacity: 0.55;
}

/* ── Cookie consent banner ──────────────────────────────────────── */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 150;
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 24px rgba(22, 53, 75, 0.1);
  padding: 16px 0;
  transition: transform 0.35s ease;
}

.cookie-banner.is-hidden {
  transform: translateY(110%);
}

.cookie-banner-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.cookie-banner-text {
  flex: 1;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.55;
  min-width: 200px;
}

.cookie-banner-text strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  margin-bottom: 3px;
}

.cookie-accept-btn {
  flex-shrink: 0;
  padding: 10px 22px;
}

/* ── ai-panel cookie card ───────────────────────────────────────── */
.ai-panel-card--cookie {
  border-top: 3px solid #94a3b8;
  background: #f8fafc;
}

.ai-panel-card--cookie h3 {
  color: #475569;
}

/* ── Admin shell – full-screen layout ───────────────────────────── */
.admin-shell-body {
  margin: 0;
  padding: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.admin-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  color: var(--ink-soft);
}

/* Admin shell container */
.admin-shell {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Admin top bar ───────────────────────────────────────────────── */
.admin-top-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  height: 58px;
  background: var(--ink);
  color: #fff;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.admin-logo-img {
  height: 34px;
  width: 34px;
  border-radius: 8px;
  object-fit: cover;
}

.admin-brand-name {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}

.admin-brand-sub {
  font-size: 10px;
  opacity: 0.55;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.admin-status-bar {
  flex: 1;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 12px;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.admin-user-block {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.admin-user-email {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Admin body grid ────────────────────────────────────────────── */
.admin-body-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ── Admin sidebar ──────────────────────────────────────────────── */
.admin-sidebar {
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--line);
  flex-shrink: 0;
}

.admin-tree {
  padding: 8px 0 24px;
}

.admin-tree-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--ink);
  transition: background 0.1s;
}

.admin-tree-item:hover {
  background: var(--bg-soft);
}

.admin-tree-item.is-active {
  background: #dff0f7;
  color: #1a6a86;
  font-weight: 700;
}

.admin-tree-root {
  font-weight: 600;
  font-size: 14px;
  padding: 11px 16px;
  gap: 10px;
}

.admin-tree-icon {
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  font-size: 15px;
  opacity: 0.7;
}

.admin-tree-expand {
  font-size: 15px;
  font-weight: 700;
  transition: transform 0.18s;
  display: inline-block;
  width: 14px;
  flex-shrink: 0;
  color: var(--ink-soft);
}

.admin-tree-expand.is-expanded {
  transform: rotate(90deg);
}

.admin-tree-theme {
  padding-left: 14px;
  font-size: 13px;
  font-weight: 600;
}

.admin-tree-children {
  padding-left: 0;
}

.admin-tree-scenario {
  padding-left: 36px;
  font-size: 12px;
  color: var(--ink-soft);
  padding-top: 6px;
  padding-bottom: 6px;
}

.admin-tree-scenario.is-active {
  color: #1a6a86;
  font-weight: 700;
}

.admin-tree-add {
  padding-left: 36px;
  font-size: 12px;
  color: #2f8fb0;
  padding-top: 5px;
  padding-bottom: 5px;
  font-weight: 600;
}

.admin-tree-divider {
  height: 1px;
  background: var(--line);
  margin: 10px 0;
}

.admin-tree-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 4px 16px 6px;
}

/* ── Admin main content area ────────────────────────────────────── */
.admin-main {
  overflow-y: auto;
  padding: 30px 36px 48px;
  background: var(--bg);
}

.editor-page {
  max-width: 860px;
}

.editor-page-header {
  margin-bottom: 26px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.editor-page-header h2 {
  font-size: 26px;
  margin: 0 0 5px;
}

.editor-page-header p {
  color: var(--ink-soft);
  margin: 0;
  font-size: 14px;
}

.editor-form {
  display: grid;
  gap: 20px;
}

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

.field-label > span {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.field-hint {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.5;
}

.field-hint code {
  background: #eef5f8;
  padding: 1px 5px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 11px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field-area--compact {
  min-height: 80px;
}

.field-area--tall {
  min-height: 220px;
}

/* Scenario tabs */
.editor-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin-top: 14px;
}

.editor-tab {
  background: transparent;
  border: 0;
  padding: 10px 20px 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  color: var(--ink-soft);
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.editor-tab:hover {
  color: var(--ink);
}

.editor-tab.is-active {
  color: var(--ink);
  border-bottom-color: #37afcf;
}

/* Subsections within editor */
.editor-subsection {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  display: grid;
  gap: 16px;
}

.editor-subsection h3 {
  font-size: 17px;
  margin: 0;
  color: var(--ink);
}

.subsection-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.editor-stack {
  display: grid;
  gap: 14px;
}

.editor-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: #fff;
  display: grid;
  gap: 14px;
}

.editor-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.editor-card--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.editor-page-action {
  margin-top: 24px;
}

/* Access role badges */
.access-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 8px;
}

.access-badge--admin {
  background: #dbeafe;
  color: #1e40af;
}

.access-badge--superadmin {
  background: #ede9fe;
  color: #5b21b6;
}

/* ── Admin buttons ──────────────────────────────────────────────── */
.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.admin-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.admin-btn--primary {
  background: #37afcf;
  color: #fff;
}

.admin-btn--primary:hover:not(:disabled) {
  background: #2f9ab8;
}

/* Ghost in top bar context (dark background) */
.admin-btn--ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.admin-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Ghost in light context (editor area) */
.editor-form .admin-btn--ghost,
.editor-page-action .admin-btn--ghost,
.editor-page-action .admin-btn--secondary,
.subsection-head .admin-btn--ghost,
.editor-card .admin-btn--ghost,
.editor-stack .admin-btn--ghost {
  background: #eef5f8;
  color: var(--ink);
}

.editor-form .admin-btn--ghost:hover,
.editor-page-action .admin-btn--ghost:hover,
.subsection-head .admin-btn--ghost:hover,
.editor-card .admin-btn--ghost:hover,
.editor-stack .admin-btn--ghost:hover {
  background: #ddeaf0;
}

/* Ghost dark context (preview bar) */
.admin-btn--ghost-dark {
  background: rgba(22, 53, 75, 0.1);
  color: var(--ink);
}

.admin-btn--ghost-dark:hover {
  background: rgba(22, 53, 75, 0.16);
}

.admin-btn--secondary {
  background: #eef5f8;
  color: var(--ink);
}

.admin-btn--secondary:hover {
  background: #ddeaf0;
}

.admin-btn--small {
  padding: 5px 12px;
  font-size: 12px;
}

.admin-btn--danger {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.admin-btn--danger:hover {
  background: #fecaca;
}

.admin-btn--warn {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.admin-btn--warn:hover {
  background: #ffedd5;
}

/* ── Admin login page ───────────────────────────────────────────── */
.admin-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 32px 16px;
}

.admin-login-card {
  width: min(100%, 400px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(22, 53, 75, 0.14);
  padding: 32px 28px;
  text-align: center;
}

.admin-login-logo-wrap {
  display: inline-flex;
  background: var(--bg-soft);
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 20px;
}

.admin-login-logo {
  height: 48px;
}

.admin-login-card h1 {
  margin: 0 0 4px;
  font-size: 22px;
}

.admin-login-sub {
  color: var(--ink-soft);
  margin: 0 0 20px;
  font-size: 14px;
}

.admin-login-status {
  background: #f0f9fd;
  border: 1px solid #bcd9e3;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 16px;
}

.admin-login-social {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.admin-social-btn {
  width: 100%;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s;
}

.admin-social-btn:hover {
  background: var(--bg-soft);
}

.admin-social-btn img {
  width: 22px;
  height: 22px;
}

.admin-login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 12px;
  margin: 4px 0 16px;
}

.admin-login-divider::before,
.admin-login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.admin-login-fields {
  display: grid;
  gap: 10px;
  text-align: left;
}

.admin-login-fields input {
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 12px 14px;
  font-size: 14px;
}

.admin-primary-btn {
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 8px;
  background: #37afcf;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.admin-primary-btn:hover {
  background: #2f9ab8;
}

.admin-text-btn {
  background: transparent;
  border: 0;
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
  text-align: center;
}

.admin-text-btn:hover {
  color: var(--ink);
}

/* ── Preview modal ──────────────────────────────────────────────── */
.preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(22, 53, 75, 0.6);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.preview-container {
  width: 95%;
  height: 94vh;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.35);
}

.preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  flex-shrink: 0;
}

.preview-frame {
  flex: 1;
  width: 100%;
  border: 0;
}

@media (max-width: 800px) {
  .admin-body-grid {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    display: none;
  }

  .admin-main {
    padding: 20px 16px 40px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .admin-status-bar {
    display: none;
  }

  .admin-user-email {
    display: none;
  }
}

/* Forslag read-only field display */
.forslag-val {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  color: #1e293b;
  line-height: 1.6;
  min-height: 34px;
}

.forslag-pre {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 12px;
  font-size: 12px;
  color: #334155;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-y: auto;
  max-height: 260px;
  margin: 0;
  font-family: inherit;
}
}
