/* SignalFlow dashboard. Vanilla CSS adaptations of OpenSourceUI's Frost Mesh,
   System Alert, Resource Links Panel, and Depth Outline Button.
   Sources and MIT notice: /third-party/opensourceui.txt */
:root {
  color-scheme: light;
  --bg: #eef3f5;
  --paper: #fff;
  --ink: #112630;
  --ink-soft: #3d535d;
  --muted: #657880;
  --blue: #32b7e5;
  --blue-deep: #087fa8;
  --blue-dark: #075f7d;
  --line: rgba(17, 38, 48, .11);
  --line-strong: rgba(17, 38, 48, .18);
  --success: #177552;
  --warning: #80530a;
  --danger: #b43845;
  --sans: "Geist", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.22, .72, .18, 1);
  --control-shadow: 0 1px 2px rgba(17, 38, 48, .04), 0 3px 8px rgba(17, 38, 48, .04), inset 0 1px 1px rgba(255, 255, 255, .8);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; scroll-padding-top: 92px; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-width: 320px; color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.flow-dashboard { position: relative; isolation: isolate; display: flex; flex-direction: column; min-height: 100dvh; background: linear-gradient(135deg, #fafcfd 0%, #f2f8fa 50%, #eaf4f6 100%); }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
a, button, input { -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; }
::selection { background: var(--blue-deep); color: #fff; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--blue-deep); outline-offset: 4px; }
.shell { width: min(1240px, calc(100% - 48px)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 20; top: 12px; left: 12px; padding: 12px 18px; border-radius: 12px; background: var(--ink); color: #fff; transform: translateY(-160%); }
.skip-link:focus { transform: none; }

.site-header { position: relative; z-index: 2; border-bottom: 1px solid rgba(17, 38, 48, .06); background: rgba(255, 255, 255, .64); }
.header-inner { display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 16px; font-weight: 800; letter-spacing: -.04em; text-decoration: none; }
.brand em { color: var(--blue-deep); font-style: normal; }
.brand-glyph { display: inline-flex; width: 30px; height: 30px; align-items: end; gap: 2px; padding: 6px; border-radius: 9px; background: var(--ink); box-shadow: 0 6px 16px rgba(17, 38, 48, .16); }
.brand-glyph i { flex: 1; border-radius: 2px 2px 1px 1px; background: var(--blue); }
.brand-glyph i:nth-child(1) { height: 26%; }
.brand-glyph i:nth-child(2) { height: 58%; }
.brand-glyph i:nth-child(3) { height: 42%; }
.brand-glyph i:nth-child(4) { height: 82%; }

/* Outlined controls retain OpenSourceUI's raised edge and 1px press feedback. */
.return-link, .management-action, .button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 10px; padding: 0 18px; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; color: var(--ink); box-shadow: var(--control-shadow); font-family: var(--sans); font-size: 13px; font-weight: 650; line-height: 1.35; text-decoration: none; cursor: pointer; transition: background-color .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease); }
.return-link { min-height: 38px; padding-inline: 20px; }
.button::after, .management-action::after { content: "↗"; flex-shrink: 0; font-size: 16px; font-weight: 500; }
.return-link:hover, .management-action:hover, .button:hover { border-color: rgba(8, 127, 168, .32); background: #f8fcfd; box-shadow: 0 2px 4px rgba(17, 38, 48, .04), 0 5px 14px rgba(17, 38, 48, .07), inset 0 1px 1px rgba(255, 255, 255, .8); }
.return-link:active, .management-action:active, .button:active { transform: translateY(1px); box-shadow: inset 0 2px 4px rgba(17, 38, 48, .07); }
/* Match the cyan primary actions on the homepage and membership selection. */
.button-primary { border-color: var(--blue); background: var(--blue); color: #062936; font-weight: 700; box-shadow: 0 4px 12px rgba(50, 183, 229, .16); }
.button-primary:hover { border-color: #58c7eb; background: #58c7eb; box-shadow: 0 5px 14px rgba(50, 183, 229, .2); }
.button-primary:active { box-shadow: 0 1px 3px rgba(50, 183, 229, .16); }
.button[disabled], [aria-disabled="true"] { opacity: .5; cursor: wait; transform: none; box-shadow: none; }
.status-cancel::after { content: "×"; }

main { flex: 1; padding-block: clamp(38px, 5.5vw, 68px) 72px; }
#dashboard-content { padding-block: clamp(28px, 4vw, 44px) 48px; }
.dashboard-shell { max-width: 1024px; }
.account-overview { display: grid; gap: 20px; }
.profile-panel { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 32px; padding-block: 4px 8px; }
.profile-identity { display: flex; min-width: 0; align-items: center; gap: 14px; }
.profile-copy { min-width: 0; }
.profile-name { max-width: 660px; font-size: clamp(26px, 3vw, 32px); font-weight: 650; line-height: 1.15; letter-spacing: -.045em; overflow-wrap: anywhere; text-wrap: balance; }
.profile-email, .profile-handle { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.profile-name.profile-name--email { font-size: clamp(20px, 2.4vw, 28px); letter-spacing: -.025em; text-wrap: initial; }
.profile-avatar-wrap { position: relative; flex: 0 0 44px; width: 44px; height: 44px; }
.profile-avatar, .profile-avatar-fallback { display: grid; width: 100%; height: 100%; place-items: center; border: 2px solid #fff; border-radius: 12px; background: var(--ink); color: #fff; object-fit: cover; box-shadow: 0 0 0 1px var(--line), 0 2px 6px rgba(17, 38, 48, .06); }
.profile-avatar-fallback { font-size: 19px; font-weight: 600; }
.membership-summary { flex-shrink: 0; padding: 12px 18px; border: 1px solid rgba(255, 255, 255, .9); border-radius: 12px; background: rgba(255, 255, 255, .72); box-shadow: none; }
.summary-grid { display: flex; gap: 28px; }
.summary-item { min-width: 96px; }
.summary-item + .summary-item { padding-left: 24px; border-left: 1px solid var(--line); }
.summary-label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.4; }
.summary-value-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.summary-renewal { color: var(--muted); font-size: 11px; line-height: 1.5; white-space: nowrap; }
.summary-grid:has(.summary-renewal:not([hidden])) .summary-item:first-child { flex: 1 0 auto; }
.summary-grid:has(.membership-cta:not([hidden])) .summary-item:first-child { flex: 1 0 auto; }
.summary-value { display: inline-block; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.4; letter-spacing: -.02em; }
#account-access { display: inline-flex; align-items: center; gap: 7px; padding: 3px 9px; border: 1px solid rgba(23, 117, 82, .1); border-radius: 7px; background: #e8f5ef; color: var(--success); font-size: 12px; font-weight: 600; letter-spacing: 0; }
#account-access[data-tone="danger"] { border-color: rgba(101, 120, 128, .12); background: #edf1f3; color: #5c6e77; }
.membership-cta { color: var(--blue-deep); font-size: 11px; line-height: 1.4; text-decoration: none; }
.membership-cta:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Compact system alert; required actions deliberately have no dismiss control. */
.status-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255, 255, 255, .88); box-shadow: 0 4px 16px -8px rgba(17, 38, 48, .09); }
.status-message { min-width: 0; flex: 1; }
.status-card h2 { margin-top: 0; max-width: 610px; color: var(--ink); font-size: 19px; font-weight: 650; letter-spacing: -.035em; line-height: 1.35; text-wrap: pretty; }
.status-copy { max-width: none; margin-top: 7px; color: var(--ink-soft); font-size: 13px; line-height: 1.6; text-wrap: pretty; }
.status-actions { display: flex; flex-shrink: 0; flex-wrap: wrap; gap: 9px; }
.status-actions:has(> [hidden]):not(:has(> :not([hidden]))) { display: none; }
.status-card[data-tone="warning"] { border-color: #e8dcc2; background: linear-gradient(110deg, #fffdf7, rgba(255, 255, 255, .94) 75%); }
.status-card[data-tone="danger"] { border-color: #ebcdd2; background: #fff9fa; }

/* Resource row hierarchy: leading icon, flexible content, trailing action. */
.management-panel { margin-top: 2px; min-width: 0; }
.account-access-group { min-width: 0; }
.account-access-group:not(:has(#account-management:not([hidden]))) { display: none; }
.linked-accounts.management-list { margin-top: 0; }
#account-management:not([hidden]):has(+ .linked-accounts:not([hidden])) > .management-list { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
#account-management:not([hidden]) + .linked-accounts:not([hidden]) { border-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }
#account-management[hidden] + .linked-accounts { width: 100%; margin-top: 0; }
#account-management[hidden] + .linked-accounts summary.management-row { min-height: 48px; padding: 10px 16px; gap: 10px; align-items: center; }
.linked-accounts summary { cursor: pointer; list-style: none; }
.linked-accounts summary.management-row { grid-template-columns: 24px minmax(0, 1fr) auto; }
.linked-accounts summary::-webkit-details-marker { display: none; }
.linked-accounts summary::after { content: ''; width: 8px; height: 8px; margin-right: 3px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.linked-accounts[open] summary::after { transform: rotate(225deg); }
.linked-accounts summary:hover { background: #f4f9fa; }
.linked-accounts summary:focus-visible { outline: 2px solid var(--blue-deep); outline-offset: -4px; border-radius: 10px; }
.management-head { margin-bottom: 10px; }
.management-head h2 { color: #61737b; font-size: 12px; font-weight: 500; line-height: 1.5; letter-spacing: .025em; }
.script-library-heading h1 { margin-top: 12px; font-size: clamp(32px, 4vw, 44px); font-weight: 750; line-height: 1.12; letter-spacing: -.055em; }
.script-library-heading > p { margin-top: 14px; max-width: 60ch; color: var(--muted); font-size: 14px; line-height: 1.65; }
.script-library-heading .script-library-eyebrow { margin-top: 0; color: var(--blue-deep); font-size: 12px; font-weight: 600; }
.script-library .script-grid { margin-top: 28px; }
.script-preview-status { margin-top: 20px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.script-preview-status:empty { display: none; }
.script-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.script-card { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 16px; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255, 255, 255, .95); box-shadow: 0 2px 5px rgba(17, 38, 48, .025); }
.script-card-heading { display: flex; align-items: center; gap: 14px; }
.script-card-heading .management-icon { flex-shrink: 0; }
.script-card h2 { font-size: 16px; font-weight: 650; line-height: 1.4; letter-spacing: -.02em; }
.script-card > p { color: var(--muted); font-size: 13px; line-height: 1.6; text-wrap: pretty; }
.script-card > .management-action { margin-top: auto; min-height: 44px; }
.management-list { margin: 0; padding: 0; list-style: none; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .9); box-shadow: none; }
.management-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 72px; padding: 14px 18px; }
.management-row:not([hidden]) ~ .management-row:not([hidden]) { border-top: 1px solid var(--line); }
.management-icon { display: grid; width: 24px; height: 24px; place-items: center; border: 0; background: none; color: #58727f; }
.management-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.65; }
.management-icon .icon-discord { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.management-copy { min-width: 0; }
.management-copy > strong { display: block; font-size: 13px; font-weight: 600; line-height: 1.4; }
.management-copy p { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.5; text-wrap: pretty; }
#member-resource-upload { display: inline-block; }
.management-row--required { background: linear-gradient(110deg, #fffaf0, #fff 85%); }
.management-row-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 10px; margin-bottom: 5px; }
.management-row-heading > strong { font-size: 13px; font-weight: 600; line-height: 1.4; }
.discord-connection-feedback { margin: 8px 0 0; color: var(--danger); font-size: 12px; font-weight: 550; line-height: 1.5; overflow-wrap: anywhere; }
.management-row--required > .management-action { min-height: 42px; }
.management-copy .billing-detail { display: block; margin-top: 5px; color: var(--ink-soft); font-size: 12px; font-weight: 550; line-height: 1.5; overflow-wrap: anywhere; }
.account-value-detail { display: block; margin-top: 3px; }
.management-action { min-height: 38px; padding-inline: 15px; font-size: 12px; }
.management-row > .management-action { min-height: 32px; padding-inline: 12px; gap: 8px; font-size: 11px; font-weight: 550; box-shadow: none; }
.management-row > .management-action::after { font-size: 14px; }

.account-recovery { width: min(100%, 480px); justify-self: center; padding: 38px; border: 1px solid var(--line); border-radius: 26px; background: #fff; box-shadow: 0 16px 48px -28px rgba(17, 38, 48, .2); }
.recovery-brand { display: flex; justify-content: center; margin-bottom: 22px; }
.recovery-brand .brand-glyph { width: 52px; height: 52px; padding: 11px; gap: 3px; border-radius: 16px; }
.account-recovery h1 { margin-top: 0; text-align: center; font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -.045em; }
.recovery-intro { margin-top: 10px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.6; }
.recovery-notice { margin-top: 20px; padding: 12px 14px; border: 1px solid #e7ca8b; border-radius: 10px; background: #fff5dc; color: var(--warning); font-size: 12px; line-height: 1.6; }
.recovery-methods { display: grid; gap: 24px; margin-top: 28px; }
.recovery-methods .button { width: 100%; min-height: 48px; border-radius: 12px; }
.recovery-methods .button::after { content: none; }
#recovery-discord { border-color: #5865f2; background: #5865f2; color: #fff; box-shadow: none; }
#recovery-discord:hover { border-color: #4752c4; background: #4752c4; }
#recovery-discord .icon-discord { flex: 0 0 22px; width: 22px; height: 22px; fill: currentColor; stroke: none; }
.recovery-methods > :not(:first-child)::before { content: "or"; display: block; margin-bottom: 24px; color: var(--muted); font-size: 11px; line-height: 16px; text-align: center; background: linear-gradient(to right, var(--line) calc(50% - 22px), transparent calc(50% - 22px), transparent calc(50% + 22px), var(--line) calc(50% + 22px)) center / 100% 1px no-repeat; }
.account-recovery.is-signup .recovery-methods > :not(:first-child)::before,
.account-recovery.is-verifying .recovery-methods > :not(:first-child)::before { display: none; }
.recovery-discord-option p { margin-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.6; }
#recovery-form { display: grid; gap: 10px; margin-top: 0; }
#recovery-form label { color: var(--ink-soft); font-size: 12px; font-weight: 600; }
#recovery-email { width: 100%; min-width: 0; min-height: 48px; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; color: var(--ink); font-size: 16px; }
#recovery-email::placeholder { color: #7a8b93; }
#recovery-submit { margin-top: 8px; min-height: 48px; }
.recovery-status { color: var(--muted); font-size: 12px; line-height: 1.6; }
.recovery-status:empty { display: none; }
.recovery-status[data-tone="danger"], .dashboard-plan-status[data-tone="danger"] { color: var(--danger); }
.recovery-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; }
.recovery-signup, .recovery-help { margin: 0; font-size: 12px; line-height: 1.6; }
.recovery-help { margin-left: auto; }
.recovery-footer a { display: inline-flex; align-items: center; min-height: 28px; color: var(--blue-deep); font-weight: 500; text-decoration: none; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.recovery-help a { color: var(--muted); }
.recovery-footer a:hover, .recovery-footer a:focus-visible { color: var(--blue-deep); text-decoration: underline; }

.dashboard-plans { display: grid; min-width: 0; gap: 28px; }
.membership-discovery, .membership-purchase { min-width: 0; }
.membership-return-card { display: grid; grid-template-columns: minmax(0, 1fr) 148px; align-items: center; gap: 24px; padding: 20px 24px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.membership-return-copy { min-width: 0; }
.membership-offer-title { max-width: 340px; font-size: 30px; line-height: 1.12; font-weight: 650; letter-spacing: -.045em; text-wrap: balance; }
.membership-offer-intro { max-width: 370px; margin-top: 12px; color: var(--ink-soft); font-size: 13px; line-height: 1.65; text-wrap: pretty; }
.membership-sample { display: grid; justify-items: center; gap: 10px; min-width: 0; margin: 0; }
.membership-preview { display: block; width: 128px; max-width: 100%; height: auto; border-radius: 10px; box-shadow: 0 8px 22px -12px rgba(17, 38, 48, .25); }
.account-dashboard .membership-sample .management-action { min-height: var(--dashboard-button-height, 32px); padding-inline: 8px; border-radius: 8px; font-size: 11px; font-weight: 550; white-space: nowrap; box-shadow: none; }
.membership-offer { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.membership-cadence { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
.membership-cadence legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.membership-choice { display: flex; align-items: flex-start; gap: 10px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; transition: background-color .18s var(--ease), border-color .18s var(--ease); }
.membership-choice:hover { background: #f8fcfd; border-color: var(--line-strong); }
.membership-choice:has(input:checked) { border-color: var(--blue-deep); background: #f1fafe; }
.membership-choice:has(input:disabled) { cursor: default; opacity: .6; }
.membership-choice input { flex: 0 0 15px; width: 15px; height: 15px; margin: 4px 0 0; accent-color: var(--blue-deep); cursor: inherit; }
.membership-choice-content { flex: 1; min-width: 0; }
.membership-choice-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 8px; }
.membership-choice-heading > strong { font-size: 13px; font-weight: 550; }
.membership-choice-price { font-size: 21px; font-weight: 650; line-height: 1.2; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.membership-choice-price > span { margin-left: 2px; color: var(--muted); font-size: 11px; font-weight: 400; letter-spacing: 0; }
.membership-choice-detail { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.membership-offer .membership-continue { width: 100%; min-height: var(--dashboard-field-height, 40px); margin-top: 12px; }
.membership-checkout-note { margin-top: 12px; color: var(--ink-soft); font-size: 11px; line-height: 1.5; }
.membership-checkout-note a { color: var(--blue-deep); text-underline-offset: 2px; }
.membership-help { margin-top: 12px; color: var(--muted); font-size: 11px; line-height: 1.5; text-align: center; }
.membership-help a { color: var(--blue-deep); text-underline-offset: 3px; }
.dashboard-plan-status { margin-top: 14px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.dashboard-plan-status:empty { display: none; }
.sandbox-banner { display: flex; gap: 20px; align-items: center; margin-bottom: 24px; padding: 16px 20px; border: 1px solid #e7ca8b; border-radius: 14px; background: #fff5dc; color: var(--warning); font-size: 12px; line-height: 1.6; }
.sandbox-banner strong { flex-shrink: 0; }

footer { border-top: 1px solid rgba(17, 38, 48, .08); }
.dashboard-footer { display: flex; min-height: 76px; align-items: center; justify-content: flex-end; gap: 20px; color: var(--muted); font-size: 11px; }
.dashboard-footer nav { display: flex; flex-wrap: wrap; gap: 22px; }
.dashboard-footer a { text-decoration: none; }
.dashboard-footer a:hover { color: var(--blue-deep); }

@media (max-width: 820px) {
  .profile-panel { align-items: flex-start; flex-direction: column; gap: 18px; }
  .membership-summary { width: 100%; padding: 12px 16px; }
  .summary-grid { gap: 24px; }
  .summary-item { flex: 1; }
  .status-card { align-items: flex-start; }
  .status-actions { flex-direction: column; }
  .status-actions .button { width: 100%; }
  .management-row { gap: 12px; padding: 14px 16px; }
}

@media (max-width: 620px) {
  .shell { width: calc(100% - 32px); }
  .header-inner { min-height: 68px; }
  .return-link { min-height: 36px; padding-inline: 17px; font-size: 12px; }
  main { padding-top: 30px; padding-bottom: 48px; }
  .account-overview { gap: 18px; }
  .profile-panel { gap: 16px; padding-block: 0; }
  .profile-name { font-size: 26px; }
  .profile-identity { gap: 12px; }
  .profile-avatar-wrap { flex-basis: 40px; width: 40px; height: 40px; }
  .profile-avatar, .profile-avatar-fallback { border-radius: 11px; }
  .profile-email, .profile-handle { margin-top: 5px; font-size: 12px; }
  .membership-summary { padding: 12px 14px; border-radius: 10px; }
  .summary-label { margin-bottom: 6px; font-size: 11px; }
  .summary-item + .summary-item { padding-left: 20px; }
  .status-card { flex-direction: column; gap: 18px; padding: 20px; border-radius: 16px; }
  .status-card h2 { font-size: 19px; }
  .status-actions { width: 100%; }
  .status-actions .button { min-height: 42px; }
  .management-head { margin-bottom: 8px; }
  .script-grid { grid-template-columns: 1fr; gap: 14px; }
  .script-card { padding: 20px 18px; border-radius: 16px; }
  .management-list { border-radius: 10px; }
  .management-row { grid-template-columns: 24px minmax(0, 1fr); align-items: start; gap: 8px 10px; min-height: 0; padding: 12px 14px; }
  .management-row > .management-action { grid-column: 2; justify-self: start; min-height: 40px; padding-inline: 12px; font-size: 11px; }
  .management-row--required > .management-action { grid-column: 1 / -1; justify-self: stretch; min-height: 42px; font-size: 12px; }
  .management-row-heading > strong { font-size: 13px; }
  .management-copy > strong { font-size: 13px; }
  .management-copy p, .management-copy .billing-detail { font-size: 12px; }
  .membership-return-card { grid-template-columns: minmax(0, 1fr) 112px; gap: 16px; padding: 18px; }
  .membership-offer-title { max-width: none; font-size: 24px; }
  .membership-offer-intro { font-size: 12px; }
  .account-recovery { padding: 26px 22px; border-radius: 18px; }
  .account-recovery h1 { font-size: 30px; }
  .sandbox-banner { flex-direction: column; align-items: flex-start; gap: 6px; }
  .dashboard-footer { min-height: 92px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 14px; }
  .dashboard-footer nav { gap: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .return-link:active, .management-action:active, .button:active { transform: none; }
}
.signin-social { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 12px; }
.signin-social:empty { display: none; }
.signin-provider { width: 100%; min-height: 48px; border-radius: 12px; }
.signin-provider--google { background: #fff; color: #1f1f1f; border: 1px solid #747775; box-shadow: none; }
.signin-provider--apple { background: #000; color: #fff; border: 1px solid #000; box-shadow: none; }
.signin-provider--apple:hover { background: #222; color: #fff; }
.signin-social #recovery-discord { width: 100%; min-height: 48px; margin: 0; }
.signin-social #recovery-discord-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.signin-social svg, .signin-social img { width: 24px; height: 24px; flex: none; }
#signin-feedback { max-width: 480px; margin: 0 auto 20px; text-align: center; }

/* Keep the required activation step above resources and account settings. */
.discord-activation:has(#discord-connection[hidden]) { display: none; }
@media (max-width: 600px) {
  .account-overview, .profile-panel, .membership-summary { min-width: 0; }
  .summary-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; }
  .summary-item { min-width: 0; }
  .summary-value-row { flex-wrap: wrap; }
  .summary-renewal { white-space: normal; }
  .summary-item + .summary-item { padding-left: 14px; border-left: 1px solid var(--line); }
}

.recovery-confirmation { min-height: 100svh; display: grid; place-items: center; padding: 32px 20px; }
.recovery-confirmation-content { margin-top: 28px; }
.recovery-confirmation-content p { color: var(--muted); font-size: 13px; line-height: 1.6; text-align: center; margin-bottom: 24px; }
.recovery-confirmation-content .button { width: 100%; min-height: 48px; border-radius: 12px; }
.recovery-confirmation-content > a { display: block; text-align: center; }
@media (max-width: 600px) { .recovery-confirmation { padding: 24px 16px; } }

/* Status resolution takes precedence over independently loaded sign-in controls. */
#account-overview:is([data-state="loading"], [data-state="error"], [data-state="pending"]) .account-access-group { display: none; }

/* Account dashboard: membership overview, resources, then account controls. */
:is(.account-dashboard, .owner-dashboard) { --dashboard-button-height: 32px; --dashboard-compact-button-height: 28px; --dashboard-field-height: 40px; }
.account-dashboard { --account-rail-width: 352px; background: #f4f8fa; }
.account-dashboard > .site-header .shell,
.account-dashboard > footer .shell,
.account-dashboard .dashboard-shell { max-width: 1120px; }
.account-dashboard #dashboard-content { padding-block: 32px 48px; }
.account-dashboard .account-overview { gap: 24px; align-items: start; }
.account-dashboard .profile-panel { padding-block: 0 24px; border-bottom: 1px solid var(--line); }
.profile-eyebrow { margin-bottom: 7px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.account-dashboard .profile-avatar-wrap { flex-basis: 52px; width: 52px; height: 52px; }
.account-dashboard .profile-avatar,
.account-dashboard .profile-avatar-fallback { border-radius: 16px; }
.account-dashboard .membership-summary { padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.account-dashboard .summary-label { margin-bottom: 8px; font-size: 12px; }
.account-dashboard .summary-renewal { font-size: 12px; }
.account-dashboard .management-panel { margin-top: 0; }
.account-dashboard :is(.button, .management-action) { min-height: var(--dashboard-button-height); gap: 6px; padding-inline: 10px; border-radius: 8px; font-size: 11px; font-weight: 600; box-shadow: none; }
.account-dashboard .membership-continue { min-height: var(--dashboard-field-height); font-size: 12px; }
.account-dashboard .button-primary { border-color: var(--blue-deep); background: var(--blue-deep); color: #fff; box-shadow: none; }
.account-dashboard .button-primary:hover { border-color: var(--blue-dark); background: var(--blue-dark); color: #fff; }
.account-dashboard .account-recovery { width: min(100%, 440px); padding: 24px; border-radius: 16px; box-shadow: none; }
.account-dashboard .recovery-brand { margin-bottom: 16px; }
.account-dashboard .recovery-brand .brand-glyph { width: 40px; height: 40px; padding: 8px; border-radius: 12px; }
.account-dashboard .account-recovery h1 { font-size: 24px; }
.account-dashboard .recovery-notice { margin-top: 16px; }
.account-dashboard .recovery-methods { gap: 16px; margin-top: 20px; }
.account-dashboard .recovery-methods > :not(:first-child)::before { margin-bottom: 16px; }
.account-dashboard .recovery-methods .button { min-height: var(--dashboard-field-height); border-radius: 8px; font-size: 12px; }
.account-dashboard .signin-social { gap: 8px; }
.account-dashboard .signin-social #recovery-discord { min-height: var(--dashboard-field-height); }
.account-dashboard .signin-social :is(svg, img) { width: 20px; height: 20px; }
.account-dashboard #recovery-discord .icon-discord { flex-basis: 20px; width: 20px; height: 20px; }
.account-dashboard #recovery-form { gap: 8px; }
.account-dashboard #recovery-email { min-height: var(--dashboard-field-height); padding: 8px 12px; border-radius: 8px; }
.account-dashboard #recovery-submit { min-height: var(--dashboard-field-height); margin-top: 4px; }
/* One compact alert treatment for account, checkout, and access notices. */
:is(.account-dashboard, .owner-dashboard) .dashboard-alert {
  --alert-border: #bddfeb;
  --alert-bg: #edf7fb;
  --alert-ink: #087fa8;
  --alert-copy: #476674;
  width: 100%; min-width: 0; padding: 8px 12px;
  border: 1px solid var(--alert-border); border-radius: 10px;
  background: var(--alert-bg); color: var(--alert-copy);
  box-shadow: none; font-size: 12px; line-height: 1.5;
}
:is(.account-dashboard, .owner-dashboard) .dashboard-alert[data-tone="warning"] { --alert-border: #e5d9b9; --alert-bg: #fffbef; --alert-ink: #805f19; --alert-copy: #74623b; }
:is(.account-dashboard, .owner-dashboard) .dashboard-alert[data-tone="danger"] { --alert-border: #ead0d6; --alert-bg: #fff7f8; --alert-ink: #a03646; --alert-copy: #7e4b54; }
:is(.account-dashboard, .owner-dashboard) .dashboard-alert[data-tone="success"] { --alert-border: #cce4db; --alert-bg: #f1faf6; --alert-ink: #267257; --alert-copy: #4b7162; }
.account-dashboard .status-card { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 48px; }
.account-dashboard .dashboard-alert-icon { display: grid; width: 20px; height: 20px; place-items: center; color: var(--alert-ink); }
.account-dashboard .dashboard-alert-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.account-dashboard .status-message,
.account-dashboard .discord-activation .management-copy { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 12px; }
.account-dashboard .status-card h2 { max-width: none; font-size: 13px; font-weight: 600; line-height: 1.4; letter-spacing: 0; }
.account-dashboard .status-copy { margin: 0; color: var(--alert-copy); font-size: 12px; line-height: 1.5; }
.account-dashboard .status-feedback { flex-basis: 100%; margin: 0; font-size: 12px; line-height: 1.5; }
.account-dashboard .status-actions { grid-column: 3; width: auto; flex-direction: row; flex-wrap: wrap; gap: 6px; }
.account-dashboard .dashboard-alert :is(.button, .management-action) { width: auto; min-height: var(--dashboard-compact-button-height); padding: 0 8px; border-radius: 7px; font-size: 11px; font-weight: 600; box-shadow: none; }
.account-dashboard .account-overview:has(:is(#discord-connection, #flow-status, #signin-feedback):not([hidden])) { row-gap: 20px; }
.account-dashboard #signin-feedback { max-width: none; margin: 0; text-align: left; }
.account-dashboard .sandbox-banner { gap: 4px 12px; flex-wrap: wrap; margin-bottom: 20px; }
.account-dashboard .discord-activation .management-list { border: 0; border-radius: 0; background: transparent; overflow: visible; }
.account-dashboard .discord-activation .management-row { grid-template-columns: 20px minmax(0, 1fr) auto; min-height: 30px; padding: 0; gap: 12px; background: transparent; }
.account-dashboard .discord-activation .management-icon { width: 20px; height: 20px; color: var(--alert-ink); }
.account-dashboard .discord-activation .management-row-heading { margin-bottom: 0; }
.account-dashboard .discord-activation .management-row-heading > strong { color: var(--ink); font-size: 13px; }
.account-dashboard .discord-activation .management-copy p { margin: 0; color: var(--alert-copy); }
.account-dashboard .discord-activation .discord-connection-feedback { flex-basis: 100%; color: var(--danger); }
.account-dashboard .discord-activation .icon-error { display: none; }
.account-dashboard .discord-activation[data-tone="danger"] .icon-discord { display: none; }
.account-dashboard .discord-activation[data-tone="danger"] .icon-error { display: block; }
.account-dashboard .discord-activation[data-tone="danger"] .management-copy { display: block; }
.account-dashboard .discord-activation[data-tone="danger"] .management-row-heading > strong { color: var(--alert-ink); }
.account-dashboard .discord-activation[data-tone="danger"] .discord-connection-feedback { margin-top: 3px; color: var(--alert-copy); font-weight: 400; }
#member-guides .management-row,
.account-access-group #account-management .management-row {
  min-height: 56px;
  padding: 8px 16px;
  gap: 10px;
}
#member-guides .management-head,
.account-access-group .management-head,
.dashboard-plans .management-head { margin-bottom: 8px; }
#member-guides .management-list,
.account-access-group .management-list { border-radius: 16px; background: #fff; }
#member-guides .management-copy > strong,
.account-access-group .management-copy > strong { font-size: 13px; }
#member-guides .management-copy p,
.account-access-group .management-copy p { margin-top: 3px; font-size: 12px; line-height: 1.5; }
#member-guides .management-row > .management-action,
.account-access-group .management-row > .management-action { min-height: var(--dashboard-button-height); padding-inline: 10px; border-radius: 8px; font-size: 11px; }
.account-dashboard :is(.management-action, .button)::after { content: none; }
.account-access-group .billing-detail { color: var(--warning); }
.account-access-group .management-copy .billing-feedback { margin-top: 6px; color: var(--danger); }
.account-dashboard .dashboard-footer { min-height: 80px; }
@media (min-width: 1000px) {
  .account-dashboard .account-overview:has(#account-profile:not([hidden])) { grid-template-columns: minmax(0, 1fr) var(--account-rail-width); }
  .account-dashboard .membership-summary { width: var(--account-rail-width); }
  .account-dashboard .summary-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; }
  .account-dashboard .summary-item { min-width: 0; }
  .account-dashboard .summary-item + .summary-item { padding-left: 20px; }
  .account-dashboard .account-overview > * { grid-column: 1; }
  .account-dashboard .account-overview > :is(.profile-panel, .discord-activation, .status-card, .account-recovery, #signin-feedback) { grid-column: 1 / -1; }
  .account-dashboard .account-overview:has(#account-profile:not([hidden])) > .account-access-group { grid-column: 2; }
  .account-dashboard .account-overview > .dashboard-plans { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) var(--account-rail-width); gap: 24px; }
}
@media (max-width: 640px) {
  :is(.account-dashboard, .owner-dashboard) { --dashboard-button-height: 36px; --dashboard-compact-button-height: 32px; --dashboard-field-height: 44px; }
  .account-dashboard #dashboard-content { padding-block: 28px 40px; }
  .account-dashboard .account-overview { gap: 22px; }
  .account-dashboard .account-recovery { padding: 20px; }
  .account-dashboard .profile-panel { gap: 22px; padding-bottom: 24px; }
  .account-dashboard .profile-avatar-wrap { flex-basis: 44px; width: 44px; height: 44px; }
  .account-dashboard .profile-avatar,
  .account-dashboard .profile-avatar-fallback { border-radius: 12px; }
  .account-dashboard .membership-summary { padding: 14px 16px; }
  .account-dashboard .account-overview:has(:is(#discord-connection, #flow-status, #signin-feedback):not([hidden])) { row-gap: 18px; }
  .account-dashboard .status-card,
  .account-dashboard .discord-activation .management-row { grid-template-columns: 20px minmax(0, 1fr); align-items: start; gap: 8px; }
  .account-dashboard .status-actions { grid-column: 2; }
  .account-dashboard .discord-activation .management-action { grid-column: 2; justify-self: start; }
  #member-guides .management-row,
  .account-access-group #account-management .management-row {
    grid-template-columns: 20px minmax(0, 1fr) auto;
    align-items: center;
    min-height: 48px;
    padding: 10px 12px;
    gap: 8px;
  }
  #member-guides .management-row > .management-action,
  .account-access-group #account-management .management-row > .management-action {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    min-height: var(--dashboard-button-height);
    padding-inline: 10px;
    gap: 6px;
  }
  .account-dashboard .dashboard-footer { min-height: 92px; }
}

.recovery-status[data-tone="verification"] { color: var(--danger); border: 0; background: none; padding: 0; box-shadow: none; }

.profile-settings { width: min(400px, calc(100% - 32px)); max-height: calc(100dvh - 48px); margin: auto; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; color: var(--ink); box-shadow: 0 24px 80px #132d3b30; }
.profile-settings::backdrop { background: #10283366; }
.profile-settings-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.profile-settings h2 { font-size: 18px; font-weight: 650; line-height: 1.3; letter-spacing: -.03em; }
.profile-settings h3 { color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.5; }
.profile-settings-header form { flex-shrink: 0; margin: -6px -6px -6px 0; }
.profile-settings-close { display: grid; width: 36px; height: 36px; place-items: center; padding: 8px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.profile-settings-close:hover { color: var(--ink); }
.profile-settings-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; }
#profile-settings-status { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.profile-settings #signin-options { margin-top: 4px; }
.profile-settings #signin-options .management-row { grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 44px; margin: 0; padding: 6px 0; }
.profile-settings #signin-options .management-row + .management-row { border-top: 1px solid var(--line); }
.profile-settings .signin-account-icon { width: 18px; height: 18px; justify-self: center; object-fit: contain; }
.profile-settings .signin-account-icon--apple { filter: invert(1); }
.profile-settings #signin-options strong { font-size: 13px; font-weight: 550; }
.profile-settings #signin-options .management-row > span { color: var(--success); font-size: 12px; }
.profile-settings #signin-options .management-action { grid-column: 3; justify-self: end; min-height: var(--dashboard-compact-button-height); padding-inline: 8px; border-radius: 7px; font-size: 11px; }
.profile-settings #signin-options .management-action::after { content: none; }
.profile-settings :focus-visible { outline: 2px solid var(--blue-deep); outline-offset: 3px; }
@media (max-width: 480px) {
  .profile-settings { padding: 16px; }
  .profile-settings-header form { margin: -10px -10px -10px 0; }
  .profile-settings-close { width: 44px; height: 44px; }
}
