/* advisor UX round (Nov 2026). Loaded last: a calm shell, the Overblik page,
   and clearer states. Uses the product's existing tokens (style.css,
   product.css): one navy, one orange primary action, Manrope. */
:root {
  --ux-bg: #f5f7fa;
  --ux-surface: #fff;
  --ux-navy: #1c2f43;
  --ux-navy-2: #23394f;
  --ux-ink: #17222c;
  --ux-muted: #5f6d79;
  --ux-line: #e0e6ec;
  --ux-soft: #f0f4f8;
  --ux-attention: #8a5a12;
  --ux-attention-soft: #fdf6ea;
  --ux-attention-line: #ecd9b4;
  --ux-ok: #1f5a45;
  --ux-ok-soft: #edf5f0;
  --ux-radius: 14px;
  --ux-radius-sm: 10px;
  --ux-shadow: 0 1px 2px rgb(23 34 44 / 4%), 0 6px 20px rgb(23 34 44 / 5%);
  --ux-focus: 0 0 0 3px rgb(52 76 102 / 30%);
}

/* --- Content area: the brand's slow ambient background (brand-motion.css)
   stays behind opaque cards; what must be read never sits on the ribbon.
   The profile menu has the switch to stop it. --- */
body {
  background: var(--ux-bg);
}
/* Page titles in sentence case (the sign-in panel keeps its brand display). */
main#leadstudio-app h1 {
  text-transform: none !important;
  letter-spacing: -0.03em;
  font-weight: 750;
}

/* --- Sidebar: one solid navy surface, navigation in two quiet groups --- */
.history-sidebar {
  background: var(--ux-navy) !important;
}
.sidebar-nav {
  display: grid;
  gap: 2px;
}
.sidebar-nav .nav-item.history-new-button {
  margin: 0;
}
.sidebar-nav-secondary {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgb(255 255 255 / 10%);
}
.sidebar-nav-secondary .nav-item.history-new-button {
  min-height: 40px;
  font-weight: 550;
  color: #aebfd0;
}
.sidebar-nav .nav-item.history-new-button[aria-current="page"] {
  box-shadow: inset 3px 0 0 var(--k-orange, #ec9638);
}
.sidebar-nav .nav-item.history-new-button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 1px;
}
#history-label {
  margin-top: 20px;
}
.history-item-meta .history-job-status.is-partial,
.history-item-meta .history-job-status.is-failed {
  color: #f1c98a !important;
}

/* --- Overblik --- */
.overview-screen {
  max-width: 1180px;
  padding: clamp(28px, 4vw, 56px) 0 48px;
}
.overview-head h1 {
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.1;
  max-width: 20ch;
  margin: 0 0 14px;
  color: var(--ux-ink);
}
.overview-lead {
  max-width: 62ch;
  margin: 0 0 24px;
  color: var(--ux-muted);
  font-size: var(--text-md);
}
.overview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
}
.overview-help {
  margin: 0;
  color: var(--ux-muted);
  font-size: var(--text-sm);
}
.overview-status:empty {
  display: none;
}
.overview-status {
  margin: 18px 0 0;
  color: var(--ux-muted);
}
.overview-continue {
  margin-top: 32px;
  padding: 20px 24px;
  background: var(--ux-surface);
  border: 1px solid var(--ux-attention-line);
  border-left: 4px solid var(--k-orange, #ec9638);
  border-radius: var(--ux-radius);
}
.overview-continue h2 {
  margin: 0 0 10px;
  font-size: var(--text-lg);
}
.overview-continue-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.overview-continue-item {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: space-between;
}
.overview-continue-item > span {
  flex: 1 1 320px;
  min-width: 0;
}
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 20px;
  margin-top: 32px;
  align-items: start;
}
.overview-panel {
  background: var(--ux-surface);
  border: 1px solid var(--ux-line);
  border-radius: var(--ux-radius);
  box-shadow: var(--ux-shadow);
  padding: 22px 24px;
  min-width: 0;
}
.overview-panel-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.overview-panel-head h2 {
  margin: 0;
  font-size: var(--text-xl);
}
.overview-block + .overview-block {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--ux-line);
}
.overview-block h3,
.overview-panel h3 {
  margin: 0 0 6px;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0;
  color: var(--ux-ink);
}
.overview-who {
  margin: 0;
  font-size: var(--text-md);
  color: var(--ux-ink);
}
.overview-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: var(--ux-ink);
}
.overview-note {
  display: block;
  color: var(--ux-muted);
  font-size: var(--text-xs);
  line-height: 1.45;
  margin-top: 2px;
}
.overview-empty {
  margin: 0 0 8px;
  color: var(--ux-muted);
}
.overview-offer > summary {
  cursor: pointer;
  list-style: none;
}
.overview-offer > summary::-webkit-details-marker {
  display: none;
}
.overview-offer-text {
  display: block;
  color: var(--ux-ink);
}
.overview-more {
  display: inline-block;
  margin-top: 6px;
  color: var(--brand-primary);
  font-weight: 650;
}
.overview-offer[open] .overview-offer-text,
.overview-offer[open] .overview-more {
  display: none;
}
.overview-offer-full {
  margin: 0;
  white-space: pre-line;
}
.overview-panel .overview-help {
  margin-bottom: 10px;
  font-size: var(--text-xs);
}
.overview-panel h3:not(:first-child) {
  margin-top: 14px;
}
.overview-first-use {
  margin-top: 32px;
  background: var(--ux-surface);
  border: 1px solid var(--ux-line);
  border-radius: var(--ux-radius);
  padding: 22px 24px;
  max-width: 760px;
}
.overview-first-use h2 {
  margin: 0 0 10px;
  font-size: var(--text-lg);
}
.overview-steps {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
}

@media (max-width: 900px) {
  .overview-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 520px) {
  .overview-panel,
  .overview-continue,
  .overview-first-use {
    padding: 18px 16px;
  }
  .overview-actions .button {
    width: 100%;
  }
}

/* --- Search page: compact target group --- */
.discovery-target-alternatives {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--ux-ink);
}
.discovery-target-offer-label {
  font-weight: 650;
  color: var(--ux-ink);
}
.discovery-target-offer-details > summary {
  cursor: pointer;
  list-style: none;
  margin-top: 8px;
  color: var(--ux-muted);
}
.discovery-target-offer-details > summary::-webkit-details-marker {
  display: none;
}
.discovery-target-offer-details[open] > summary {
  display: none;
}
.discovery-target-offer.is-missing {
  color: var(--ux-attention);
}

/* --- Results: where the search is, in a place the eye lands --- */
.pick-progress {
  margin: 4px 0 18px;
  padding: 14px 18px;
  border-radius: var(--ux-radius-sm);
  border: 1px solid var(--ux-line);
  background: var(--ux-soft);
  color: var(--ux-ink);
}
.pick-progress p {
  margin: 6px 0 0;
}
.pick-progress-head {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
}
.pick-progress-count {
  color: var(--ux-muted);
  font-size: var(--text-sm);
}
.pick-progress progress {
  display: block;
  width: 100%;
  height: 6px;
  margin-top: 10px;
  border: 0;
  border-radius: 99px;
  background: #dfe6ee;
  overflow: hidden;
  appearance: none;
}
.pick-progress progress::-webkit-progress-bar {
  background: #dfe6ee;
}
.pick-progress progress::-webkit-progress-value {
  background: var(--brand-primary);
  border-radius: 99px;
}
.pick-progress progress::-moz-progress-bar {
  background: var(--brand-primary);
}
.pick-progress-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #c3d0dc;
  border-top-color: var(--brand-primary);
  animation: ux-spin 0.9s linear infinite;
}
@keyframes ux-spin {
  to {
    transform: rotate(360deg);
  }
}
.pick-progress.is-partial {
  background: var(--ux-attention-soft);
  border-color: var(--ux-attention-line);
}
.pick-progress.is-done {
  background: var(--ux-ok-soft);
  border-color: #cfe0d6;
}
.pick-progress-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}
.pick-progress-actions span {
  color: var(--ux-muted);
  font-size: var(--text-xs);
}
.pick-help {
  margin: -6px 0 18px;
  color: var(--ux-muted);
}
.pick-help > summary {
  cursor: pointer;
  color: var(--brand-primary);
  font-weight: 650;
  width: fit-content;
}
.pick-help p {
  margin: 8px 0 0;
  max-width: 78ch;
  color: var(--ux-ink);
}
.pick-why {
  display: block;
  margin-top: 6px;
  font-size: var(--text-xs);
  line-height: 1.45;
  color: var(--ux-muted);
}
.pick-why.is-pending {
  color: var(--ux-attention);
}
.pick-retry {
  margin: 0;
  padding: 0 0 4px 46px;
}
@media (prefers-reduced-motion: reduce) {
  .pick-progress-spinner {
    animation: none;
  }
}
/* The card's reason for its result sits on its own row. */
.pick-main {
  grid-template-areas:
    "check name score"
    ". label label"
    ". reason reason"
    ". why why";
}
.pick-why {
  grid-area: why;
}
.pick-retry {
  padding: 0 18px 4px 52px;
}
@media (max-width: 520px) {
  .pick-retry {
    padding-left: 46px;
  }
}

/* --- Analysis: SWOT honesty --- */
.swot-point-kind {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 8px;
  border-radius: 99px;
  background: var(--ux-attention-soft);
  color: var(--ux-attention);
  font-size: var(--text-xs);
  font-weight: 600;
}
.swot-empty-state {
  color: var(--ux-muted);
  font-style: normal;
}
.swot-approval-summary {
  margin: 18px 0 12px;
  padding: 14px 18px;
  border: 1px solid var(--ux-line);
  border-radius: var(--ux-radius-sm);
  background: var(--ux-soft);
}
.swot-approval-summary h4 {
  margin: 0 0 6px;
  font-size: var(--text-sm);
}
.swot-approval-summary ul {
  margin: 0 0 6px;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

/* A busy button keeps its width (LoadingUI.busy locks it); its label never
   wraps or pushes the layout. */
.button.is-loading {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* A card being saved stays focusable (aria-disabled, not disabled). */
.pick-main[aria-disabled="true"] {
  cursor: progress;
}

/* --- Recommendations: what is found vs. what is still a hypothesis --- */
.pitch-card-hypothesis {
  margin-top: 12px;
  padding: 10px 14px;
  border-left: 3px solid var(--ux-attention-line);
  background: var(--ux-attention-soft);
  border-radius: 0 var(--ux-radius-sm) var(--ux-radius-sm) 0;
}
.pitch-card-hypothesis .pitch-card-field {
  margin-top: 6px;
}
.pitch-card-hypothesis .pitch-card-field p {
  margin: 0;
}
.pitch-evidence-list .swot-point-sources {
  margin: 2px 0 6px;
  font-size: var(--text-xs);
}

/* --- Contrast (axe, WCAG 2.1 AA, advisor UX round) --- */
:root {
  --muted: #5a6773; /* was #6a7887: 4.16:1 on the tinted panels */
}
/* The open analysis keeps its light highlight on hover and focus (the dark
   hover wash turned its dark text 1.39:1). */
.history-item[aria-current="true"]:hover,
.history-item[aria-current="true"]:focus-visible {
  background: var(--brand-primary-soft) !important;
}
#history-label,
.history-group-toggle {
  color: #a9bacb !important;
}
.history-item-meta {
  color: #a9bacb !important;
}
.history-item[aria-current="true"] .history-item-meta {
  color: var(--ink) !important;
}
.advanced-details > summary,
.single-analysis-details > summary {
  color: var(--ux-muted);
}
.technical-details {
  opacity: 1; /* 0.9 took its muted text below 4.5:1 */
}
/* "Ikke søgt" stays distinct by its dashed outline, not by unreadable text. */
.source-unused,
.source-badge-not-searched,
.source-badge-not-searched span.source-badge-logo {
  color: #66706b;
}
span.source-badge-logo[data-initials]::before {
  content: attr(data-initials);
}
.history-item[aria-current="true"] .history-job-status.is-partial,
.history-item[aria-current="true"] .history-job-status.is-failed {
  color: var(--ux-attention) !important;
}
