/* Welcome flow: a quiet editorial panel and a stable, independent form column. */
body.first-run-active { height: auto; overflow: auto; }
.first-run { display: grid; place-items: center; height: auto; min-height: 100svh; padding: 32px; overflow: visible; }
.first-run-shell { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); width: min(1120px, 100%); min-height: 700px; height: auto; border-radius: 20px; }
.first-run-story { padding: 32px 36px 36px; gap: 0; }
.first-run-brand { min-height: 48px; }
.first-run-promise { margin: 36px 0 28px; }
.first-run-story h1 { font-size: clamp(38px, 3.5vw, 48px); margin: 16px 0 22px; line-height: 1.08; }
.first-run-story .first-run-kicker { font-size: 10px; }
.first-run-story .first-run-promise p { margin: 0; font-size: 14px; line-height: 1.75; max-width: 38ch; }


.first-run-card { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; align-items: stretch; justify-items: center; gap: 36px; padding: 32px 44px 36px; height: auto; overflow: visible; }
.first-run-card-header { min-height: 48px; grid-row: 1; display: flex; align-items: center; justify-content: flex-end; gap: 20px; width: min(440px, 100%); }
.first-run-language { margin: 0; flex: none; }
.first-run-language .theme-switch { padding: 4px; background: var(--canvas); border-color: var(--line); }
.first-run-language .theme-switch button { min-height: 36px; padding: 7px 12px; font-size: 12px; }
.first-run-step { grid-row: 2; grid-column: 1; align-self: start; width: min(440px, 100%); min-width: 0; }
.first-run-step-copy h2 { font-size: 36px; line-height: 1.15; text-wrap: balance; }
.first-run-step-copy > p { font-size: 14px; line-height: 1.65; margin-top: 12px; }
.first-run-form, .first-run-divider + .first-run-form { margin-top: 24px; gap: 14px; }
#firstRunAccountForm { grid-template-columns: 1fr; }
.first-run-form label { min-width: 0; }
.first-run-form > label { margin: 0; }
.first-run-form label > span { font-size: 13px; margin-bottom: 6px; }
.first-run-form label > span > [data-i18n] { margin: 0; }
.first-run-form input { min-height: 52px; font-size: 15px; padding: 13px 15px; }
.first-run-primary, .first-run-form-actions > button { min-height: 52px; font-size: 14px; }
.first-run-form .first-run-primary { margin-top: 4px; }
.first-run-terms { margin-top: 18px; font-size: 11px; line-height: 1.7; text-wrap: pretty; }
.first-run-field-error { font-size: 12px; line-height: 1.5; }


.first-run-ready-list strong { font-size: 13px; }
.first-run-ready-list small { font-size: 12px; line-height: 1.5; }
.first-run-secondary-action { font-size: 13px; }
@media (max-width: 900px) {
  .first-run { padding: 24px; }
  .first-run-shell { display: block; max-width: 560px; min-height: 0; border: 0; background: transparent; box-shadow: none; overflow: visible; }
  .first-run-story { display: none; }
  .first-run-card { padding: 0; background: transparent; gap: 36px; }
  .first-run-card-header { justify-content: space-between; gap: 12px; width: 100%; }
  .first-run-mobile-brand { display: flex; width: auto; margin: 0; padding: 0; gap: 8px; }
  .first-run-mobile-brand img { width: 30px; height: 30px; }
  .first-run-mobile-brand strong { font-size: 25px; }
  .first-run-step { width: 100%; margin: 0; padding: 32px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: 0 12px 36px color-mix(in srgb, var(--ink) 4%, transparent); }
  .first-run-step-copy h2 { font-size: 34px; }


  .first-run-form input { font-size: 16px; }
}
@media (max-width: 480px) {
  .first-run { padding: max(20px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); place-items: start center; }
  .first-run-card { gap: 28px; }
  .first-run-card-header { flex-wrap: wrap; row-gap: 16px; }
  .first-run-language { margin-left: auto; }
  .first-run-language .theme-switch button { padding-inline: 9px; }
  .first-run-step { padding: 26px 22px; }
  .first-run-step-copy h2 { font-size: 32px; }

}


/* The welcome identity is always neutral, independent of the saved workspace palette. */
.first-run {
  --canvas: #fafafa;
  --paper: #ffffff;
  --surface-soft: #eeeeee;
  --hover: #e5e5e5;
  --ink: #333333;
  --muted: #626262;
  --line: #d8d8d8;
  --accent: #525252;
  --accent-hover: #333333;
  --accent-soft: #eeeeee;
  --hero-paper: #e7e7e7;
  --hero-ink: #333333;
  --chart-bar: #8a8a8a;
  --navy: #525252;
  --navy-soft: #333333;

  --blue: var(--accent); --blue-dark: var(--accent-hover); --blue-strong: var(--accent); --blue-soft: var(--accent-soft); --focus: var(--accent);
  --studio-hero: var(--navy); --studio-hero-end: var(--navy);
  color: var(--ink);
}
:root[data-theme="dark"] .first-run {
  --canvas: #1b1b1b;
  --paper: #252525;
  --surface-soft: #303030;
  --hover: #3b3b3b;
  --ink: #f3f3f3;
  --muted: #bcbcbc;
  --line: #494949;
  --accent: #d2d2d2;
  --accent-hover: #f5f5f5;
  --accent-soft: #3a3a3a;
  --hero-paper: #363636;
  --hero-ink: #f3f3f3;
  --chart-bar: #858585;
  --navy: #525252;
  --navy-soft: #333333;
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) .first-run {
  --canvas: #1b1b1b;
  --paper: #252525;
  --surface-soft: #303030;
  --hover: #3b3b3b;
  --ink: #f3f3f3;
  --muted: #bcbcbc;
  --line: #494949;
  --accent: #d2d2d2;
  --accent-hover: #f5f5f5;
  --accent-soft: #3a3a3a;
  --hero-paper: #363636;
  --hero-ink: #f3f3f3;
  --chart-bar: #858585;
  --navy: #525252;
  --navy-soft: #333333;
}
}

.first-run .brand-period { color: inherit; }

.first-run-form input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }


.first-run-next-hint { margin: 9px 0 0; text-align: center; color: var(--muted); font-size: 12px; line-height: 1.5; }


#firstRunAccountSubmit { background: #333; color: #fff; border-color: #333; }
#firstRunAccountSubmit:hover { background: #171717; border-color: #171717; transform: none; }


/* Eerste factuur: de gebruiker kiest één partij; Summa leert de velden eromheen. */
.identity-dialog { width: min(620px, calc(100vw - 32px)); padding: 28px; }
.identity-dialog-head { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 14px; align-items: center; }
.identity-dialog-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.identity-dialog-icon .summa-icon { width: 21px; height: 21px; }
.identity-dialog-kicker { display: block; margin-bottom: 3px; color: var(--accent); font-size: 10px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.identity-dialog h2 { margin: 0; font-family: "Newsreader", Georgia, serif; font-size: 27px; font-weight: 500; letter-spacing: -.025em; }
.identity-dialog .identity-dialog-lead { margin-top: 18px; max-width: 58ch; font-size: 14px; }
.identity-local-note { display: flex; align-items: center; gap: 9px; margin-top: 14px; padding: 10px 12px; border-radius: 9px; background: var(--surface-soft); color: var(--muted); font-size: 12px; }
.identity-local-note .summa-icon { width: 16px; height: 16px; flex: none; }
.identity-candidates { display: grid; gap: 10px; margin: 20px 0 0; padding: 0; border: 0; }
.identity-candidate { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 22px; gap: 14px; align-items: center; min-height: 74px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.identity-candidate:hover { border-color: var(--muted); background: var(--hover); }
.identity-candidate input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.identity-candidate:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.identity-candidate:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.identity-candidate-copy { min-width: 0; }
.identity-candidate-copy strong, .identity-candidate-copy small, .identity-candidate-copy em { display: block; }
.identity-candidate-copy strong { color: var(--ink); font-size: 15px; line-height: 1.35; }
.identity-candidate-copy small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.identity-candidate-copy em { margin-top: 7px; overflow-wrap: anywhere; color: var(--muted); font-size: 11px; font-style: normal; letter-spacing: .01em; }
.identity-candidate-check { width: 20px; height: 20px; color: var(--accent); visibility: hidden; }
.identity-candidate:has(input:checked) .identity-candidate-check { visibility: visible; }
.identity-dialog-error { margin-top: 12px !important; padding: 10px 12px; border-radius: 8px; background: var(--danger-soft); color: var(--danger) !important; }
.identity-dialog-actions { gap: 10px; }
.identity-dialog-actions #identitySkip { margin-right: auto; }
@media (max-width: 720px) {
  .identity-dialog { padding: 22px 16px calc(18px + env(safe-area-inset-bottom)); }
  .identity-dialog-actions { flex-direction: column-reverse; }
  .identity-dialog-actions button { width: 100%; }
}

/* Quiet entry: one decision at a time, with setup and recovery on separate screens. */
.first-run-shell { width: min(1040px, 100%); min-height: 640px; }
.first-run-story { padding: 36px; }
.first-run-promise { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 32px; margin: 0; padding-block: 32px; }
.first-run-story h1 { font-size: clamp(38px, 3.6vw, 48px); margin: 0; line-height: 1.12; }
.first-run-card { grid-template-rows: auto 1fr auto; gap: 32px; padding: 36px 48px 28px; }
.first-run-step { align-self: center; width: min(380px, 100%); padding-block: 12px; }
.first-run-card-header, .first-run-footer { width: min(380px, 100%); }
.first-run-language .theme-switch { border: 0; background: transparent; padding: 0; gap: 4px; }
.first-run-language .theme-switch button { background: transparent; border-radius: 4px; min-height: 32px; padding: 6px 8px; color: var(--muted); }
.first-run-language .theme-switch button[aria-pressed="true"] { background: transparent; color: var(--ink); text-decoration: underline; text-underline-offset: 5px; box-shadow: none; }


.first-run-route { margin: 28px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.first-run-route button, .first-run-footer button { border: 0; min-height: 32px; padding: 4px 0; background: transparent; box-shadow: none; color: var(--ink); font: inherit; cursor: pointer; }
.first-run-route button { font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.first-run-footer { grid-row: 3; display: flex; align-items: center; justify-content: center; gap: 20px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.first-run-footer a, .first-run-footer button { color: inherit; text-decoration: none; }
.first-run-footer a:hover, .first-run-footer button:hover { text-decoration: underline; text-underline-offset: 4px; }
.first-run [data-first-run-step="account"] .first-run-route { margin-top: 14px; }
.first-run [data-first-run-step="help"] #firstRunRestore { margin-top: 28px; border: 1px solid var(--line); border-radius: 8px; min-height: 48px; }
@media (max-width: 900px) {
  .first-run-shell { min-height: 0; max-width: 480px; }
  .first-run-card { padding: 0; gap: 32px; }
  .first-run-card-header, .first-run-footer, .first-run-step { width: 100%; }
  .first-run-step { padding: 32px 24px; }
  .first-run-footer { gap: 18px; }
}
@media (max-width: 480px) {
  .first-run-login { padding-block: 40px; }
  .first-run-step-copy h2 { font-size: 30px; }
}

/* Three concise reasons to choose Summa, grouped with the brand promise. */
.first-run-highlights { display: grid; gap: 22px; width: 100%; margin: 0; padding: 0; list-style: none; }
.first-run-highlights li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 14px; align-items: start; }
.first-run-highlights .summa-icon { width: 20px; height: 20px; margin-top: 1px; color: var(--hero-ink); opacity: .8; }
.first-run-highlights strong { display: block; font-size: 14px; line-height: 1.5; font-weight: 600; color: var(--hero-ink); }
.first-run-highlights small { display: block; margin-top: 3px; font-size: 12px; line-height: 1.6; color: var(--muted); }

/* Restored vertical welcome with matching desktop columns. */
.first-run-step h2[tabindex="-1"]:focus { outline: none; }
@media (min-width: 901px) {
  .first-run-shell { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .first-run-story, .first-run-card {
    display: grid; grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 48px auto 1fr; gap: 48px;
    justify-items: center; padding: 36px 44px 28px;
  }
  .first-run-brand { grid-row: 1; width: min(380px, 100%); }
  .first-run-promise { grid-row: 2; width: min(380px, 100%); padding: 0; gap: 32px; }
  .first-run-step { grid-row: 2; align-self: start; padding: 0; }
  .first-run-footer { align-self: end; }
  .first-run-story h1, .first-run-login h2 { font-size: 40px; line-height: 1.15; letter-spacing: -.05em; }
  .first-run-story h1, .first-run-login h2 { min-height: 92px; }


  .first-run-footer { justify-content: flex-start; }

}

/* Compact completion screen: one aligned column that stays inside the desktop viewport. */
.first-run-language { position: relative; }
.first-run-language::after {
  position: absolute; right: 13px; top: 50%; width: 7px; height: 7px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  content: ""; pointer-events: none; transform: translateY(-70%) rotate(45deg);
}
#firstRunLanguageSwitch {
  appearance: none; min-width: 132px; min-height: 38px; padding: 8px 34px 8px 12px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--paper);
  color: var(--ink); font: inherit; font-size: 12px; cursor: pointer;
}
#firstRunLanguageSwitch:hover { border-color: var(--muted); }
#firstRunLanguageSwitch:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.first-run-finish { text-align: left; }
.first-run-finish-status { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.first-run-finish-status .first-run-kicker { margin: 0; color: var(--muted); }
.first-run-finish-icon {
  width: 28px; height: 28px; margin: 0; border-radius: 50%;
  background: var(--surface-soft); color: var(--accent); box-shadow: none;
}
.first-run-finish-icon svg { width: 15px; height: 15px; }
.first-run-finish .first-run-step-copy h2 { font-size: 31px; line-height: 1.1; }
.first-run-finish .first-run-step-copy > p { max-width: 42ch; margin-top: 10px; line-height: 1.55; }
.first-run-finish .first-run-ready-list {
  gap: 0; margin: 20px 0 18px; overflow: hidden;
  border: 1px solid var(--line); border-radius: 12px; background: var(--paper);
}
.first-run-finish .first-run-ready-list > div {
  min-height: 58px; padding: 10px 12px; border: 0; border-radius: 0; background: transparent;
}
.first-run-finish .first-run-ready-list > div + div { border-top: 1px solid var(--line); }
.first-run-finish .first-run-ready-list svg {
  width: 32px; height: 32px; padding: 7px; border-radius: 9px;
  background: var(--surface-soft); color: var(--accent);
}
.first-run-finish .first-run-ready-list strong { font-size: 12px; }
.first-run-finish .first-run-ready-list small { color: var(--muted); font-size: 10.5px; line-height: 1.4; }
.first-run-finish .first-run-primary { min-height: 48px; border-color: #333; border-radius: 9px; background: #333; box-shadow: none; }
.first-run-finish .first-run-primary:hover { border-color: #171717; background: #171717; }
.first-run-finish .first-run-secondary-action { display: block; min-height: 34px; margin: 6px auto 0; color: var(--muted); }


@media (max-width: 900px) {
  .first-run-finish { text-align: left; }
  .first-run-finish .first-run-step-copy h2 { font-size: 29px; }
}

/* Local setup is the primary route on every screen size. */
.first-run-login .first-run-route button {
  display: flex; align-items: center; justify-content: center; width: 100%;
  min-height: 52px; padding: 12px 16px; border: 1px solid var(--ink);
  border-radius: 10px; background: var(--ink); color: var(--paper);
  font-size: 16px; text-decoration: none;
}
.first-run-login .first-run-route button:hover { background: var(--muted); transform: none; }
.first-run-login .first-run-workspace-link {
  display: block; width: 100%; min-height: 44px; margin-top: 8px;
  border: 0; background: transparent; color: var(--ink); box-shadow: none;
  font-size: 14px; text-decoration: underline; text-underline-offset: 4px;
}
.first-run-local-description { margin-top: 20px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.first-run-footer { font-size: 13px; }
.first-run-footer a, .first-run-footer button { display: inline-flex; align-items: center; min-height: 44px; }
.first-run-terms, .first-run-next-hint, .first-run-highlights small { font-size: 13px; }
.first-run-finish .first-run-ready-list strong { font-size: 14px; }
.first-run-finish .first-run-ready-list small { font-size: 13px; line-height: 1.55; }

.identity-candidate-copy em { font-size: 13px; line-height: 1.5; color: var(--ink); }
