/* Shared product layer. Keep analytics/chart values and print reports untouched. */
:root {
  --type-caption: .8125rem;
  --type-secondary: .9375rem;
  --type-body: 1rem;
  --type-control: 1rem;
  --type-heading-small: 1.125rem;
  --type-heading-medium: 1.375rem;
  --radius: 16px;
  --shadow: 0 3px 18px rgba(22, 33, 59, .035);
  --border: var(--line);
}
html { scroll-padding-top: 24px; }
body { font-size: 1rem; line-height: 1.55; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 10000; padding: 12px 20px; background: var(--surface); color: var(--ink); border: 2px solid var(--accent); border-radius: 10px; }
.skip-link:focus { top: 12px; }
.app-shell { grid-template-columns: 254px minmax(0, 1fr); }
.main { min-width: 0; padding: 24px clamp(20px, 3vw, 48px) 40px; }
.sidebar { padding: 26px 16px 18px; background: #141c36; }
.brand { padding: 0 2px 26px; font-size: 1rem; }
.brand-mark { flex-shrink: 0; }
.nav { gap: 3px; }
.nav-section-label { color: #909eb9; padding: 16px 12px 8px; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.nav-section-label:first-child { padding-top: 0; }
.nav a { padding: 10px 12px; font-size: .9375rem; color: #bec8dc; border: 1px solid transparent; }
.nav a.active { color: #fff; background: #25314d; border-color: #39445e; box-shadow: inset 3px 0 var(--accent); }
.nav a:hover { background: #202c47; }
.sidebar-credit { padding-top: 18px; }
.app-topbar { gap: 12px; margin-bottom: 32px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.app-topbar .agency-switcher { flex: 1 1 310px; padding: 10px 14px; border: 1px solid var(--line); background: var(--surface); }
.agency-switcher form { width: 100%; }
.agency-switcher select { flex: 1; min-width: 0; width: auto; }
.agency-switcher form > a { font-size: .875rem; text-underline-offset: 3px; }
.user-menu summary { min-height: 48px; }
.page-header { align-items: flex-start; flex-wrap: wrap; gap: 20px; margin-bottom: 24px; }
.page-header > div:first-child { flex: 1 1 320px; }
.page-header h1 { font-size: clamp(1.75rem, 2.5vw, 2.5rem); line-height: 1.15; letter-spacing: -.04em; margin: 4px 0 12px; }
.page-header p:not(.eyebrow) { max-width: 65ch; font-size: 1rem; line-height: 1.6; }
.eyebrow { font-size: .75rem; letter-spacing: .12em; font-weight: 750; }
.header-actions { gap: 10px; align-items: center; max-width: 100%; }
.button { min-height: 46px; padding: 11px 18px; font-size: .9375rem; line-height: 1.4; border-radius: 10px; font-weight: 650; transition: background .16s, border-color .16s, box-shadow .16s; }
.button-primary { box-shadow: 0 3px 9px rgba(255, 92, 53, .13); }
.button-secondary { background: var(--surface); border-color: var(--line); }
.button:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea { font: inherit; border-radius: 10px; border-color: var(--line); }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select:not([multiple]) { min-height: 46px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
.stack-form { gap: 20px; }
.stack-form > label { font-size: .9375rem; line-height: 1.5; }
.consent-field { align-items: flex-start; line-height: 1.55; font-size: .875rem; }
.consent-field input { flex-shrink: 0; margin-top: 4px; }
.errorlist { color: var(--red); padding-left: 18px; font-size: .875rem; }
.panel-header h2, .section-heading h2 { line-height: 1.3; }
.panel-header p { max-width: 75ch; }
.panel-header { gap: 18px; flex-wrap: wrap; }
.panel { min-width: 0; }
.badge { font-size: .8125rem; padding: 4px 10px; border-radius: 7px; white-space: normal; }
.inline-alert, .message { line-height: 1.6; border-radius: 12px; }
th { font-size: .8125rem; letter-spacing: .02em; }
td { font-size: .9375rem; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: var(--surface-soft); }
.integration-catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.integration-tile { padding: 26px; gap: 20px; min-height: 0; }
.integration-tile .check-list { margin: 0; }
.integration-tile h2 { font-size: 1.375rem; }
.integration-tile .button { margin-top: auto; }
.connection-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding: 22px 26px; margin-bottom: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); list-style: none; }
.connection-steps li { display: flex; gap: 12px; align-items: flex-start; }
.connection-steps b { flex: 0 0 30px; display: grid; place-items: center; height: 30px; border-radius: 9px; color: var(--navy); background: var(--surface-soft); font-size: .875rem; }
.connection-steps strong { display: block; font-size: .9375rem; }
.connection-steps small { display: block; margin-top: 3px; color: var(--muted); font-size: .875rem; }
.credentials-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.credential-card { padding: 24px; border-top: 3px solid var(--line); }
.credential-card.is-configured { border-top-color: var(--green); }
.credential-card-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 20px; }
.credential-card-head h2 { font-size: 1.25rem; margin: 0; }
.credential-card-head small { color: var(--muted); font-size: .8125rem; }
.credential-status { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 12px 0 18px; border-top: 1px solid var(--line); font-size: .8125rem; }
.credential-card .button { width: 100%; }
.credential-guide { margin-top: 24px; padding: 22px 26px; }
.credential-guide summary { font-size: 1rem; font-weight: 700; cursor: pointer; }
.credential-guide p { max-width: 100ch; color: var(--muted); }
/* Caption and help are one grid item, never separate rows in the field. */
.field-caption { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-width: 0; text-align: left; }
.field-caption > span:first-child { min-width: 0; color: var(--ink); font-size: .9375rem; line-height: 1.45; }
.field-caption > .field-tooltip { flex: 0 0 24px; width: 24px; height: 24px; min-height: 24px; margin: 0 0 0 auto; padding: 0; align-self: center; }
.field-tooltip:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.field-tooltip .field-tooltip-bubble { position: fixed; z-index: 200; top: 0; left: 0; right: auto; bottom: auto; width: min(320px, calc(100vw - 24px)); max-height: min(360px, 70vh); padding: 14px 16px; font-size: .875rem; line-height: 1.6; transform: none; }
.field-tooltip .field-tooltip-bubble::after { display: none; }
.field-tooltip:hover .field-tooltip-bubble, .field-tooltip:focus-visible .field-tooltip-bubble, .field-tooltip[aria-expanded="true"] .field-tooltip-bubble { transform: none; }
.credentials-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); align-items: stretch; }
.credential-card { display: flex; flex-direction: column; padding: 26px; }
.credential-card-head { align-items: flex-start; flex-wrap: nowrap; min-height: 64px; }
.credential-card-head > div { min-width: 0; }
.credential-card-head .service-logo { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 12px; font-size: 22px; }
.credential-card-head small { overflow-wrap: anywhere; }
.credential-status { min-height: 58px; align-items: center; }
.credential-card .stack-form { display: flex; flex-direction: column; flex: 1; gap: 20px; min-width: 0; }
.credential-card .stack-form > label:not(.consent-field) { display: grid; gap: 10px; min-width: 0; }
.credential-card .stack-form input:not([type="checkbox"]):not([type="hidden"]) { width: 100%; min-width: 0; margin: 0; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9375rem; }
.credential-card .stack-form > .button { margin-top: auto; }
.credential-card .consent-field { font-weight: 400; }
.account-name-editor { margin: 16px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.account-name-editor summary { cursor: pointer; font-size: .9375rem; font-weight: 650; }
.account-name-editor form { margin-top: 16px; }
.account-name-editor small { color: var(--muted); font-size: .875rem; }
.seo-heading-actions { flex: 0 1 auto; }
.seo-control-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 22px; margin-bottom: 16px; }
.seo-control-bar .period-filter { margin: 0; }
.seo-refresh-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.seo-source-details { padding: 16px 22px; margin-bottom: 18px; }
.seo-source-details > summary { cursor: pointer; font-size: .9375rem; font-weight: 650; }
.seo-source-details p { color: var(--muted); font-size: .9375rem; }
.seo-source-details .panel { padding: 14px 0 0; border: 0; border-radius: 0; box-shadow: none; }
.seo-plan-panel { padding: clamp(20px, 3vw, 32px); margin-top: 28px; border-top: 3px solid var(--accent); scroll-margin-top: 24px; }
.seo-plan-panel > .panel-header { margin-bottom: 24px; }
.plan-context { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 0; }
.plan-context span { padding: 5px 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-size: .8125rem; }
.seo-plan-form { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 20px; padding: 24px; border: 1px solid var(--line); background: var(--surface-soft); }
.seo-plan-form > label { display: grid; align-content: start; gap: 8px; font-weight: 650; min-width: 0; }
.seo-plan-form > label:first-of-type { grid-column: auto; }
.seo-plan-form .consent-field { grid-column: 1 / -1; display: flex; font-weight: 400; }
.seo-plan-form input[type="number"] { width: 100%; }
.seo-plan-form > .button { grid-column: 1 / -1; justify-self: start; }
.seo-plan-form small { font-weight: 400; }
.seo-plan-list { gap: 20px; margin-top: 24px; }
.seo-plan-list article { padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.seo-plan-list article > span { font-size: .8125rem; }
.seo-plan-list h3 { font-size: 1.25rem; line-height: 1.35; margin: 0; letter-spacing: -.02em; }
.seo-plan-list p { font-size: .9375rem; margin: 0; line-height: 1.6; }
.seo-plan-list small { padding: 12px 14px; background: var(--surface-soft); border-left: 2px solid var(--accent); border-radius: 0 8px 8px 0; font-size: .875rem; }
.seo-plan-list details { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.seo-plan-list summary { cursor: pointer; font-size: .9375rem; font-weight: 650; }
.seo-plan-list ol { padding-left: 22px; font-size: .9375rem; }
.seo-plan-list li + li { margin-top: 8px; }
.mobile-nav-toggle, .mobile-nav-dismiss, .nav-backdrop { display: none; }
html[data-theme="dark"] .sidebar { background: #101628; }
html[data-theme="dark"] .credential-card.is-configured { border-top-color: #51ba91; }
@media (min-width: 1650px) { .integration-catalog { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1250px) { .credentials-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .connection-steps { gap: 16px; } }
@media (max-width: 1000px) { .app-shell { grid-template-columns: 220px minmax(0, 1fr); } .brand { font-size: .875rem; gap: 7px; } .connection-steps { grid-template-columns: 1fr; gap: 16px; } .credentials-grid { grid-template-columns: 1fr; } .seo-plan-form { grid-template-columns: 1fr; } .seo-plan-list { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .app-shell { display: block; }
  .main { padding: 18px 18px 32px; }
  .app-topbar { gap: 10px; margin-bottom: 24px; }
  .navigation-ready .mobile-nav-toggle { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
  .app-topbar .agency-switcher { order: 3; flex-basis: 100%; }
  .navigation-ready .sidebar { display: flex; position: fixed; z-index: 90; top: 0; bottom: 0; left: 0; width: min(300px, 85vw); height: 100dvh; padding: 24px 18px; visibility: hidden; transform: translateX(-100%); transition: transform .18s, visibility .18s; }
  .navigation-ready .mobile-nav-dismiss { display: grid; place-items: center; position: absolute; right: 12px; bottom: 12px; width: 44px; height: 44px; border: 1px solid #53617d; border-radius: 12px; color: #fff; background: #25314d; font-size: 24px; cursor: pointer; }
  .navigation-ready .sidebar .nav { padding-bottom: 58px; }
  .sidebar .brand { display: flex; }
  .sidebar .nav { display: grid; grid-auto-flow: row; grid-template-columns: 1fr; overflow-y: auto; overflow-x: hidden; }
  .sidebar .nav a { white-space: normal; }
  .navigation-open { overflow: hidden; }
  .navigation-ready.navigation-open .sidebar { visibility: visible; transform: none; }
  .nav-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 89; border: 0; background: rgba(7, 13, 29, .55); cursor: pointer; }
  .integration-catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-header > div:first-child { flex: 0 1 auto; width: 100%; }
}
@media (max-width: 580px) {
  .integration-catalog, .credentials-grid { grid-template-columns: 1fr; }
  .seo-heading-actions, .seo-heading-actions .button { width: 100%; }
  .seo-control-bar { padding: 16px; }
  .seo-refresh-actions, .seo-refresh-actions form, .seo-refresh-actions .button { width: 100%; }
  .seo-plan-form { padding: 16px; }
  .seo-plan-form > .button { width: 100%; }
  .credential-card, .integration-tile { padding: 22px; }
  .agency-switcher form > a { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
