:root {
  --paper: #f5f3ee;
  --surface: #fffdf8;
  --ink: #171714;
  --muted: #6f6d65;
  --line: #dedbd2;
  --samokat: #ecff2c;
  --blue: #2357d9;
  --green: #16714a;
  --amber: #9a5a00;
  --red: #a52a2a;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.page-header {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 800; letter-spacing: -.03em; text-decoration: none; }
.brand span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--ink); color: white; }
.back-link { color: var(--muted); font-size: 14px; font-weight: 650; text-decoration: none; }
.back-link:hover { color: var(--ink); }

.connections-page { width: min(880px, calc(100% - 40px)); margin: 48px auto 96px; }
.title-block { max-width: 680px; }
.title-block h1 { max-width: 620px; margin: 8px 0 18px; font-size: clamp(40px, 7vw, 68px); line-height: .96; letter-spacing: -.065em; }
.title-block > p:last-child { margin: 0; color: var(--muted); font-size: 18px; line-height: 1.55; }
.eyebrow { margin: 0; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }

.session-gate {
  margin-top: 40px;
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 20px 60px rgb(39 35 21 / 7%);
}
.session-gate h2 { margin: 12px 0 8px; font-size: 25px; letter-spacing: -.03em; }
.session-gate p { max-width: 580px; margin: 0; color: var(--muted); line-height: 1.5; }

.prototype-badge, .scope-note {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 9px;
  border: 1px solid #c9c6bc;
  border-radius: 999px;
  color: #5b584f;
  background: #f2efe7;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

#connection-hub { margin-top: 50px; }
.hub-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.hub-heading h2 { margin: 6px 0 0; font-size: 30px; letter-spacing: -.04em; }
.connection-list { display: grid; gap: 14px; }

.connection-card { padding: 24px; border: 1px solid var(--line); border-radius: 24px; background: white; box-shadow: 0 12px 38px rgb(39 35 21 / 5%); }
.connection-card:focus-visible { outline: 3px solid #94b2ff; outline-offset: 4px; }
.card-header, .provider-identity, .card-actions, .status-pill, .capability-line { display: flex; align-items: center; }
.card-header { justify-content: space-between; gap: 18px; }
.provider-identity { gap: 14px; min-width: 0; }
.provider-identity h3 { margin: 0; font-size: 22px; letter-spacing: -.035em; }
.account-label { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.provider-mark { flex: 0 0 auto; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; font-size: 20px; font-weight: 900; }
.provider-mark--samokat { background: var(--samokat); }
.provider-mark--lavka { color: #2f5db3; background: #e8efff; }
.provider-mark--perekrestok { color: #17683f; background: #dff1df; }
.provider-mark--kuper { color: #69531a; background: #fff1a8; }
.provider-mark--unknown { border: 1px dashed #b9b6ac; background: #f2f0e9; color: #76736b; }

.status-pill { flex: 0 0 auto; gap: 7px; padding: 7px 10px; border: 1px solid currentColor; border-radius: 999px; font-size: 12px; font-weight: 750; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-pill--neutral { color: #5e5d57; background: #f4f3ef; }
.status-pill--progress { color: var(--blue); background: #edf3ff; }
.status-pill--success { color: var(--green); background: #edf9f2; }
.status-pill--warning { color: var(--amber); background: #fff7e9; }
.status-pill--muted { color: #77756e; background: #eeede9; }

.card-description { max-width: 650px; margin: 20px 0 14px; color: var(--muted); line-height: 1.5; }
.authority-warning, .basket-login-warning { max-width: 760px; margin: 0 0 14px; padding: 13px 14px; border: 1px solid #e1b56a; border-radius: 12px; background: #fff7e8; color: #68430b; font-size: 13px; line-height: 1.5; }
.capability-line { gap: 10px; font-size: 14px; }
.capability-label { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.state-message { margin: 16px 0 0; padding: 12px 14px; border-radius: 12px; background: #fff5df; color: #6d4405; line-height: 1.45; }

.capability-panel { margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #faf9f5; }
.capability-heading { margin: 0 0 11px; font-size: 13px; letter-spacing: .01em; }
.capability-list { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; list-style: none; }
.capability-item { min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 13px; line-height: 1.4; }
.capability-state { flex: 0 0 auto; color: var(--muted); font-size: 11px; font-weight: 750; }
.capability-item--enabled .capability-state { color: var(--green); }
.capability-item--disabled { color: #77756e; }
.session-storage-note { margin: 12px 0 0; padding-top: 11px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

.permission-details { margin-top: 20px; border-top: 1px solid var(--line); }
.permission-details summary, .status-glossary summary { padding: 17px 0; cursor: pointer; color: #4e4c46; font-size: 14px; font-weight: 750; }
.permission-details summary:focus-visible, .status-glossary summary:focus-visible { outline: 3px solid #94b2ff; outline-offset: 4px; border-radius: 4px; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding: 2px 0 16px; }
.permission-grid > div { display: grid; gap: 6px; }
.permission-grid span, .real-auth-note { color: var(--muted); font-size: 13px; line-height: 1.5; }
.permission-label { font-size: 13px; }
.real-auth-note { margin: 0 0 18px; padding: 12px; border-left: 3px solid #bbb7aa; background: #f6f4ed; }

.card-actions { flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.button {
  min-height: 42px;
  padding: 10px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 750;
  text-decoration: none;
  transition: transform 140ms var(--ease-out), background-color 160ms ease, border-color 160ms ease;
}
.button:active { transform: scale(.97); }
.button:focus-visible, .choice:focus-visible, .otp-step input:focus-visible { outline: 3px solid #94b2ff; outline-offset: 3px; }
.button:disabled { cursor: progress; opacity: .55; }
.button--primary { background: var(--ink); color: white; }
.button--primary:hover { background: #34342f; }
.button--secondary { border-color: var(--line); background: white; color: var(--ink); }
.button--secondary:hover, .button--quiet:hover { background: #f2f0ea; }
.button--quiet { border-color: transparent; background: #f6f4ef; color: #4f4d47; }
.button--danger { border-color: #e1b2ad; background: #fff3f1; color: var(--red); }
.unavailable-note { color: var(--muted); font-size: 13px; }

.status-glossary { margin-top: 18px; padding: 0 22px; border: 1px solid var(--line); border-radius: 18px; background: rgb(255 255 255 / 55%); }
.status-glossary dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 28px; margin: 0; padding: 0 0 20px; }
.status-glossary dl div { display: grid; gap: 4px; }
.status-glossary dt { font-size: 13px; font-weight: 800; }
.status-glossary dd { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.page-status { min-height: 24px; margin: 20px 4px 0; color: var(--green); font-size: 14px; }
.page-status--error { color: var(--red); }

dialog { width: min(560px, calc(100% - 28px)); max-height: calc(100dvh - 28px); padding: 0; overflow: auto; border: 0; border-radius: 24px; background: white; color: var(--ink); box-shadow: 0 30px 100px rgb(0 0 0 / 28%); }
dialog::backdrop { background: rgb(20 20 18 / 52%); backdrop-filter: blur(5px); }
.dialog-card { padding: 24px; }
.dialog-heading h2 { margin: 12px 0 8px; font-size: 27px; letter-spacing: -.04em; }
.dialog-heading p { margin: 0; color: var(--muted); line-height: 1.5; }
.live-authorization { margin: 22px 0 16px; padding: 18px; border: 1px solid rgb(39 99 62 / 20%); border-radius: 16px; background: #f0f4e5; }
.live-authorization strong, .live-authorization p { display: block; }
.live-authorization p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.live-spinner { width: 10px; height: 10px; display: inline-block; margin: 0 8px 1px 0; border-radius: 50%; background: var(--green); animation: pulse 1s infinite alternate; }
.phone-otp-panel { margin: 20px 0 16px; padding: 18px; border: 1px solid rgb(39 99 62 / 22%); border-radius: 16px; background: #f5f8ef; }
.phone-otp-panel h3 { margin: 0 0 7px; font-size: 18px; letter-spacing: -.02em; }
.phone-otp-safety, .field-help, .otp-meta, .provider-action-step p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.otp-step { margin: 18px 0 0; }
.otp-step label { font-size: 13px; font-weight: 800; }
.otp-step input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #bab7ad; border-radius: 11px; background: white; color: var(--ink); font: inherit; font-size: 16px; }
.otp-step input:invalid:not(:placeholder-shown) { border-color: #c66f65; }
.otp-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.phone-otp-panel .button { min-height: 44px; }
.otp-actions .button:disabled { cursor: not-allowed; }
.provider-action-step { margin: 18px 0 0; padding: 14px; display: grid; gap: 10px; border: 1px solid #d8bf7e; border-radius: 12px; background: #fff8e8; }
.provider-action-step strong { color: #6d4405; }
.provider-action-step .button { justify-self: start; }
.account-choice-fieldset { margin: 2px 0; gap: 8px; }
.account-choice-fieldset legend { margin-bottom: 4px; color: #6d4405; }
.account-choice-list { display: grid; gap: 8px; }
.account-choice { min-width: 0; padding: 11px 12px; display: flex; align-items: flex-start; gap: 9px; border: 1px solid #d8bf7e; border-radius: 11px; background: white; color: var(--ink); font-size: 14px; line-height: 1.4; cursor: pointer; }
.account-choice:has(input:checked) { border-color: #8d691d; background: #fff3cf; }
.account-choice input { flex: 0 0 auto; margin: 3px 0 0; accent-color: var(--green); }
.account-choice span { min-width: 0; overflow-wrap: anywhere; }
.otp-error { margin: 14px 0 0; padding: 11px 12px; border-radius: 11px; background: #fff0ee; color: var(--red); font-size: 13px; line-height: 1.45; }
fieldset { display: grid; gap: 8px; margin: 22px 0 16px; padding: 0; border: 0; }
legend { margin-bottom: 10px; font-size: 13px; font-weight: 800; }
.choice { width: 100%; padding: 13px 14px; display: grid; gap: 3px; border: 1px solid var(--line); border-radius: 14px; background: white; color: var(--ink); text-align: left; cursor: pointer; transition: transform 140ms var(--ease-out), border-color 160ms ease, background-color 160ms ease; }
.choice:hover { border-color: #a6a39a; background: #f8f7f3; }
.choice:active { transform: scale(.98); }
.choice span { color: var(--muted); font-size: 13px; }
.candidate-scope { margin: 20px 0; padding: 14px; display: grid; gap: 5px; border-radius: 14px; background: #f2f6ff; }
.candidate-scope span { color: #4c5b7b; font-size: 13px; }
.retention-consent { margin: 18px 0 8px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fbfaf6; font-size: 13px; line-height: 1.5; }
.consent-note { margin: 0 0 18px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.warning { padding: 12px; border-radius: 12px; background: #fff5df; color: #6d4405; font-size: 13px; line-height: 1.45; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }

.basket-panel { margin-top: 20px; padding: 18px; border: 1px solid #cfd8c9; border-radius: 18px; background: #f8fbf5; }
.basket-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.basket-heading h4 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.basket-freshness { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.basket-freshness--fresh { color: var(--green); background: #e5f5ea; }
.basket-freshness--stale { color: var(--amber); background: #fff0d3; }
.basket-meta, .basket-footnote { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.basket-empty { margin: 16px 0 0; padding: 14px; border-radius: 12px; background: white; color: #4d4c46; font-size: 13px; line-height: 1.5; }
.basket-lines { margin: 16px 0 0; padding: 0; display: grid; gap: 8px; list-style: none; }
.basket-line { padding: 13px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; border-radius: 12px; background: white; }
.basket-line-copy, .basket-line-price { display: grid; gap: 4px; }
.basket-line-merchant { width: fit-content; padding: 3px 7px; border-radius: 999px; background: #edf2e9; color: #47603d; font-size: 11px; font-weight: 800; line-height: 1.3; }
.basket-line-title { font-size: 14px; line-height: 1.35; }
.basket-line-details, .basket-line-price span, .basket-availability { color: var(--muted); font-size: 12px; line-height: 1.4; }
.basket-availability--available { color: var(--green); }
.basket-availability--unavailable { color: var(--red); }
.basket-line-price { justify-items: end; text-align: right; white-space: nowrap; }
.basket-line-price strong { font-size: 14px; }
.basket-line-price span { text-decoration: line-through; }
.basket-warning { margin: 12px 0 0; padding: 12px; border-radius: 12px; background: #fff5df; color: #6d4405; font-size: 12px; line-height: 1.5; }
.basket-import-button { width: 100%; margin-top: 14px; }
.import-preview { margin-top: 12px; padding: 18px; border: 1px solid #b9cda9; border-radius: 18px; background: #f1f7eb; }
.import-preview h4 { margin: 0; }
.workspace-import-preview h3 { margin: 0 0 12px; font-size: 17px; }
.workspace-import-preview .workspace-copy { margin: 6px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.workspace-import-preview .workspace-warning { color: #785421; font-size: 12px; line-height: 1.5; }
.workspace-import-row { display: flex; flex-direction: column; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; overflow-wrap: anywhere; }
.workspace-import-preview .workspace-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.import-effect { margin: 14px 0 0; display: grid; gap: 8px; }
.import-effect > div { display: grid; grid-template-columns: minmax(88px, auto) minmax(0, 1fr); gap: 12px; }
.import-effect dt { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.import-effect dd { margin: 0; font-size: 12px; line-height: 1.45; }
.import-preview-lines { margin: 12px 0 0; padding-left: 20px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.import-safety { margin: 14px 0 0; padding: 12px; border-radius: 12px; background: white; color: #42523c; font-size: 12px; line-height: 1.5; }

@media (max-width: 680px) {
  .page-header, .connections-page { width: min(100% - 28px, 880px); }
  .connections-page { margin-top: 28px; }
  .title-block h1 { font-size: clamp(38px, 13vw, 54px); }
  .title-block > p:last-child { font-size: 16px; }
  .session-gate { align-items: stretch; flex-direction: column; padding: 20px; }
  .hub-heading { align-items: flex-start; flex-direction: column; }
  .connection-card { padding: 18px; border-radius: 20px; }
  .card-header { align-items: flex-start; flex-direction: column; }
  .status-pill { margin-left: 60px; }
  .permission-grid, .status-glossary dl, .capability-list { grid-template-columns: 1fr; }
  .card-actions .button { width: 100%; }
  .basket-heading { align-items: flex-start; flex-direction: column; }
  .basket-line { grid-template-columns: 1fr; }
  .basket-line-price { justify-items: start; text-align: left; }
  .import-effect > div { grid-template-columns: 1fr; gap: 3px; }
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions .button { width: 100%; }
  .otp-actions { flex-direction: column; }
  .otp-actions .button, .otp-step > .button, .provider-action-step .button { 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; }
}

/* A quiet overview; details stay available without competing with the next step. */
.title-block h1 { font-size: clamp(32px, 5vw, 48px); line-height: 1.12; letter-spacing: -.035em; margin-bottom: 14px; }
.connections-page { max-width: 880px; }
#connection-hub { margin-top: 32px; }
.hub-heading h2 { font-size: 24px; }
.hub-heading .eyebrow { display: none; }
.connection-card { box-shadow: none; padding: 24px; border-radius: 20px; }
.provider-identity > div { min-width: 0; }
.provider-identity h3, .account-label, .account-choice { overflow-wrap: anywhere; }
.account-label { font-size: 16px; line-height: 1.5; }
.status-pill { font-size: 14px; }
.connection-settings { border-top: 1px solid var(--line); margin-top: 18px; }
.connection-settings > summary, .phone-privacy > summary { cursor: pointer; min-height: 48px; display: list-item; align-content: center; padding: 12px 4px; font-size: 16px; color: #494b44; }
.connection-settings .card-actions { margin-bottom: 8px; }
.button { min-height: 48px; font-size: 16px; line-height: 1.4; white-space: normal; text-align: center; }
.button:focus-visible, summary:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid #2458c7; outline-offset: 4px; }
.dialog-card { padding: 28px; }
dialog { max-height: calc(100dvh - 32px); overflow-y: auto; }
.dialog-heading h2 { font-size: 28px; line-height: 1.2; }
.dialog-heading p, .retention-consent, .consent-note, .field-help, .otp-meta, .provider-action-step p, .candidate-scope, .phone-otp-safety { font-size: 16px; line-height: 1.5; }
.phone-otp-panel h3 { font-size: 20px; }
.otp-step input { min-height: 52px; font-size: 20px; }
.account-choice { min-height: 56px; font-size: 16px; }
.account-choice:has(input:checked) { border-color: #2458c7; background: #edf3ff; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 680px) {
  .title-block h1 { font-size: 34px; }
  .connection-card { padding: 18px; }
  .card-header { gap: 10px; }
  .status-pill { margin-left: 60px; }
  .scope-note { font-size: 12px; }
  .dialog-card { padding: 20px; }
  dialog { width: calc(100% - 20px); max-width: none; margin: auto; }
  .dialog-heading h2 { font-size: 25px; }
}
.hub-heading { margin-bottom: 14px; }
.scope-note { text-transform: none; font-size: 14px; letter-spacing: 0; font-weight: 500; }
.status-pill--muted { color: #595a52; }
.connection-settings p, .connection-settings .permission-grid, .connection-settings .capability-list { font-size: 14px; line-height: 1.5; }
@media (min-width: 900px) {
  .connection-list { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .card-header { align-items: flex-start; flex-direction: column; gap: 10px; }
  .status-pill { margin-left: 60px; max-width: calc(100% - 60px); }
}
.dialog-progress:empty, .dialog-error:empty { display: none; }
.dialog-progress, .dialog-error { font-size: 16px; line-height: 1.5; }
.dialog-error { color: var(--red); }

/* Connecting is a focused page, with one task visible at a time. */
.is-connecting { background: white; }
.is-connecting .connections-page { width: min(420px, calc(100% - 40px)); margin: 28px auto 72px; }
.connection-flow { position: relative; padding-top: 68px; }
.flow-back { position: absolute; top: 0; left: -8px; display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 8px; border: 0; border-radius: 10px; background: transparent; color: #575950; font-size: 16px; cursor: pointer; }
.flow-back:focus-visible { outline: 3px solid #2458c7; outline-offset: 2px; }
.flow-back:disabled { opacity: .5; cursor: progress; }
.flow-service { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; font-size: 17px; font-weight: 650; }
.flow-service .provider-mark { width: 36px; height: 36px; border-radius: 11px; font-size: 18px; }
.flow-form .dialog-heading h1 { margin: 0 0 12px; font-size: 32px; line-height: 1.14; letter-spacing: -.035em; }
.flow-form .dialog-heading p { color: #61645d; font-size: 16px; line-height: 1.5; }
.flow-form p:empty { display: none; }
.flow-form .phone-otp-panel { margin: 24px 0 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
.flow-form .otp-step { margin: 0; gap: 14px; }
.flow-form .otp-step input { min-height: 60px; padding: 14px 16px; border: 1px solid #9d9f98; border-radius: 14px; font-size: 22px; line-height: 1.3; }
.flow-form #authorization-code { letter-spacing: .25em; text-align: center; font-variant-numeric: tabular-nums; }
.flow-form #authorization-code::placeholder { letter-spacing: 0; }
.flow-form input::placeholder { color: #73766f; opacity: 1; }
.flow-form .otp-actions, .flow-form .dialog-actions { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 0; }
.flow-form .button { width: 100%; min-height: 52px; border-radius: 14px; font-weight: 650; }
.flow-form .button--quiet { background: transparent; color: #575950; }
.flow-form .button--quiet:disabled { opacity: 1; color: #6c7067; cursor: default; }
.flow-form .field-help, .flow-form .otp-meta { font-size: 14px; line-height: 1.5; color: #60645b; }
.flow-form .otp-meta { text-align: center; font-variant-numeric: tabular-nums; }
.flow-notice { margin: 0; color: #705317; font-size: 14px; line-height: 1.45; }
.flow-terms { margin-top: 20px; color: #62655e; font-size: 14px; line-height: 1.5; }
.flow-terms > p { margin: 0 0 8px; }
.flow-form .phone-privacy > summary { min-height: 44px; padding: 10px 0; color: #55594f; font-size: 14px; font-weight: 500; }
.flow-form .phone-privacy p { margin: 0 0 12px; color: #62655e; font-size: 14px; line-height: 1.5; }
.flow-form .provider-action-step { margin: 0; padding: 0; border: 0; background: transparent; gap: 16px; }
.flow-form .provider-action-step .button { justify-self: stretch; }
.flow-form .account-choice-fieldset { margin: 0; }
.flow-form .account-choice-list { gap: 12px; }
.flow-form .account-choice { align-items: center; gap: 12px; min-height: 72px; padding: 16px; border-color: #d0d3ca; border-radius: 14px; }
.flow-form .account-choice input { width: 20px; height: 20px; margin: 0; }
.flow-form .account-choice strong { color: var(--ink); }
.flow-form .account-choice:has(input:checked) { border-color: #2458c7; background: #f3f6ff; }
.flow-form .account-choice:has(input:focus-visible) { outline: 3px solid #2458c7; outline-offset: 3px; }
.flow-form .account-choice-line { display: block; }
.flow-form .account-choice-line + .account-choice-line { margin-top: 3px; color: #65695f; font-size: 14px; }
.flow-form .account-choice-name { display: block; font-size: 14px; color: #65695f; margin-top: 4px; }
.flow-form .account-choice-plus { display: inline-block; margin-top: 7px; padding: 2px 7px; border-radius: 6px; background: #f0ebfb; color: #7050a4; font-size: 12px; line-height: 1.5; }
.flow-form .account-choice-plus--absent { background: #f3f4f0; color: #65695f; }
.candidate-account { display: flex; align-items: center; gap: 14px; margin: 24px 0; padding: 18px; border: 1px solid #e1e4dc; border-radius: 16px; }
.candidate-avatar { flex: 0 0 40px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #eaf5ed; color: #16714a; font-size: 20px; }
.candidate-account > div { min-width: 0; display: grid; gap: 4px; }
.candidate-account strong { overflow-wrap: anywhere; font-size: 18px; }
.candidate-account #candidate-provider-name { font-size: 14px; color: #65695f; }
.flow-form .candidate-scope { display: block; margin: 0 0 22px; padding: 0; background: transparent; }
.flow-form .candidate-scope span { color: #4e5349; font-size: 16px; line-height: 1.5; }
.flow-form .retention-consent { margin: 22px 0 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: #62655e; font-size: 14px; line-height: 1.5; }
.flow-form .dialog-progress { color: #62655e; text-align: center; }

@media (max-width: 680px) {
  .is-connecting .connections-page { width: min(420px, calc(100% - 40px)); margin-top: 16px; }
  .connection-flow { padding-top: 62px; }
  .flow-service { margin-bottom: 24px; }
  .flow-form .dialog-heading h1 { font-size: 29px; }
}

@media (hover: hover) and (pointer: fine) {
  .flow-back:hover { background: #f3f4f0; }
  .flow-form .button--quiet:hover { background: #f3f4f0; }
}

/* Service settings read as a compact list; search is a single page-level action. */
.connection-list { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.connection-card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; padding: 20px; border-radius: 18px; }
.connection-card .card-header { display: block; grid-column: 1; grid-row: 1; min-width: 0; }
.connection-card .provider-identity { gap: 12px; }
.connection-card .provider-mark { width: 40px; height: 40px; border-radius: 12px; font-size: 18px; }
.connection-card .provider-identity h3 { font-size: 20px; line-height: 1.25; }
.connection-card .account-label { font-size: 14px; line-height: 1.45; margin-top: 4px; }
.connection-card .status-pill { width: fit-content; max-width: none; margin: 5px 0 0 52px; padding: 0; border: 0; border-radius: 0; background: transparent; font-size: 14px; line-height: 1.45; font-weight: 500; }
.connection-card > .card-actions { grid-column: 2; grid-row: 1; align-self: center; margin: 0; }
.connection-card > .card-actions .button { width: auto; min-height: 44px; padding: 9px 13px; font-size: 15px; }
.connection-card > .card-actions:has(.unavailable-note) { grid-column: 1 / -1; grid-row: auto; margin: 8px 0 0 52px; }
.connection-card .unavailable-note { font-size: 14px; }
.connection-card > .state-message, .connection-card > .connection-settings, .connection-card > .basket-panel, .connection-card > .import-preview { grid-column: 1 / -1; }
.connection-card .connection-settings { margin-top: 12px; }
.connection-card .connection-settings > summary { width: fit-content; min-height: 44px; padding: 9px 12px; border: 1px solid #d6d9d0; border-radius: 11px; font-size: 15px; list-style: none; }
.connection-settings > summary::-webkit-details-marker { display: none; }
.connection-settings > summary::after { content: "⌄"; margin-left: 7px; }
.connection-settings[open] > summary::after { content: "⌃"; }
.connection-card:has(> .connection-settings):not(:has(> .card-actions)) .card-header { grid-column: 1 / -1; padding-right: 126px; }
.connection-card:not(:has(> .card-actions)) > .connection-settings { margin-top: 0; border-top: 0; }
.connection-card:not(:has(> .card-actions)) > .connection-settings > summary { position: absolute; top: 24px; right: 20px; }
.connection-card:not(:has(> .card-actions)) > .connection-settings[open] { margin-top: 14px; border-top: 1px solid var(--line); }
.connection-settings .permission-details { margin-top: 12px; }
.connection-settings .permission-details > summary { min-height: 44px; font-weight: 500; }
.connection-settings .permission-grid { grid-template-columns: 1fr; gap: 14px; }
.back-link { min-height: 44px; display: inline-flex; align-items: center; font-size: 16px; }
@media (max-width: 680px) {
  .connection-card { padding: 16px; column-gap: 10px; }
  .connection-card .provider-identity { gap: 10px; }
  .connection-card .provider-mark { width: 36px; height: 36px; }
  .connection-card .provider-identity h3 { font-size: 18px; }
  .connection-card .status-pill { margin-left: 46px; }
  .connection-card > .card-actions:has(.unavailable-note) { margin-left: 46px; }
  .connection-card:has(> .connection-settings):not(:has(> .card-actions)) .card-header { padding-right: 114px; }
  .connection-card:not(:has(> .card-actions)) > .connection-settings > summary { top: 18px; right: 16px; padding-inline: 10px; }
}
@media (max-width: 380px) {
  .connection-card { grid-template-columns: minmax(0, 1fr); }
  .connection-card > .card-actions { grid-column: 1; grid-row: auto; margin: 12px 0 0 46px; }
  .connection-card:has(> .connection-settings):not(:has(> .card-actions)) .card-header { padding-right: 0; }
  .connection-card:not(:has(> .card-actions)) > .connection-settings { margin-top: 12px; }
  .connection-card:not(:has(> .card-actions)) > .connection-settings > summary { position: static; margin-left: 46px; }
}
