/* ==========================================================================
   P3 Account — Midnight Editorial, Configure/Inspect surface.

   Near-black paper, warm-white ink, restrained P3 cyan, twelve-column ledger,
   one-pixel rules. The account page is a place to configure and inspect, not
   a marketing landing page: the title stays a heading, sections are separated
   by rules instead of repeated glowing cards, and every control keeps a real
   44px floor. Tokens and rules are documented in DESIGN.md and
   docs/p3-midnight-editorial-guideline.md.
   ========================================================================== */

:root {
    --p3-bg:        #050505;
    --p3-bg-soft:   #0b0b0b;
    --p3-bg-lift:   #101010;
    --p3-paper:     #ffffff;

    --p3-ink:       #f4f2ec;
    --p3-dim:       #b9b6ad;
    --p3-muted:     #8a877f;

    --p3-rule:        rgba(244, 242, 236, 0.14);
    --p3-rule-strong: rgba(244, 242, 236, 0.30);

    --p3-cyan:      #67e8f9;
    --p3-cyan-deep: #22d3ee;
    --p3-cyan-pale: #d9f7fb;
    --p3-cyan-soft: rgba(103, 232, 249, 0.08);
    --p3-cyan-line: rgba(103, 232, 249, 0.40);

    --p3-green:  #4ade80;
    --p3-gold:   #fbbf24;
    --p3-red:    #f87171;
    --p3-orange: #fb923c;
    --p3-blue:   #60a5fa;
    --p3-pink:   #f472b6;

    --p3-warm:      rgba(255, 104, 42, 0.14);
    --p3-warm-core: rgba(255, 72, 38, 0.18);
    --p3-cool:      rgba(45, 91, 255, 0.16);

    --p3-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --p3-display: 'Sora', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --p3-mono: 'JetBrains Mono', 'SF Mono', ui-monospace, 'Cascadia Mono', Menlo, monospace;

    --p3-gutter: clamp(18px, 4vw, 48px);
    --p3-radius: 4px;
    --p3-tap: 44px;
    --p3-maxw: 1120px;
    color-scheme: dark;
}

* { box-sizing: border-box; }

html {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: var(--p3-bg);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    overflow-x: hidden;
    background:
        radial-gradient(900px 520px at 92% -12%, var(--p3-warm), transparent 62%),
        radial-gradient(760px 560px at -12% 36%, var(--p3-cool), transparent 66%),
        var(--p3-bg);
    color: var(--p3-ink);
    font-family: var(--p3-font);
    font-size: 14px;
    line-height: 1.6;
    position: relative;
    font-synthesis-weight: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* A 96px drafting grid at near-invisible weight: paper texture, never a
   surface that covers controls. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(244, 242, 236, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(244, 242, 236, 0.018) 1px, transparent 1px);
    background-size: 96px 96px;
}

[hidden] { display: none !important; }

a {
    color: var(--p3-cyan);
    text-decoration: none;
    text-underline-offset: 3px;
}
a:hover { text-decoration: underline; }

::selection { background: var(--p3-cyan); color: var(--p3-bg); }

:focus-visible {
    outline: 2px solid var(--p3-cyan);
    outline-offset: 3px;
}

img, svg { max-width: 100%; }

/* ── Shell and masthead ───────────────────────────────────────────────── */

.p3ac-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: var(--p3-maxw);
    margin: 0 auto;
    padding: 0 var(--p3-gutter) 84px;
}

.p3ac-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 76px;
    padding: 12px 0;
    border-bottom: 1px solid var(--p3-rule);
    background: rgba(5, 5, 5, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.p3ac-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--p3-ink);
}
.p3ac-brand span {
    font-family: var(--p3-display);
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--p3-ink);
}
.p3ac-brand small {
    font-family: var(--p3-mono);
    font-size: 8.5px;
    font-weight: 500;
    letter-spacing: 0.26em;
    line-height: 1;
    text-transform: uppercase;
    color: var(--p3-cyan);
}

.p3ac-topbar__actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ── Twelve-column ledger ─────────────────────────────────────────────── */

main {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: clamp(24px, 3.2vw, 40px);
    row-gap: 0;
    align-items: start;
}

main > * { min-width: 0; }
main > section,
main > .p3ac-card { grid-column: 1 / span 8; }

.p3ac-title {
    grid-column: 1 / span 8;
    margin: 58px 0 16px;
    font-family: var(--p3-display);
    font-size: clamp(34px, 4.8vw, 58px);
    font-weight: 700;
    line-height: 0.98;
    letter-spacing: -0.045em;
    color: var(--p3-ink);
    text-wrap: balance;
}

.p3ac-subtitle {
    grid-column: 1 / span 6;
    margin: 0 0 34px;
    max-width: 56ch;
    color: var(--p3-dim);
    font-size: 15px;
    line-height: 1.7;
}

.p3ac-profile { grid-column: 1 / -1; }
main > [data-account-loading],
main > [data-account-notice] { grid-column: 1 / -1; }
main > [data-panel="auth"] { grid-column: 1 / span 7; }
main > [data-panel="free-tools"] { grid-column: 9 / span 4; }
main > [data-panel="status"] { grid-column: 1 / span 8; }
main > [data-panel="manage"] { grid-column: 1 / span 9; }
main > [data-panel="pro-notice"] { grid-column: 1 / span 8; }
main > [data-panel="gift"] { grid-column: 1 / span 7; }
main > [data-panel="delete"] { grid-column: 1 / span 8; }
main > [data-panel="pro-guide"] { grid-column: 1 / -1; }
main > [data-billing] { grid-column: 1 / -1; }

/* ── Section furniture ────────────────────────────────────────────────── */

.p3ac-card {
    margin: 0;
    padding: 30px 0 36px;
    border: 0;
    border-top: 1px solid var(--p3-rule);
    border-radius: 0;
}

.p3ac-card h2 {
    margin: 0 0 8px;
    font-family: var(--p3-display);
    font-size: clamp(21px, 2.2vw, 26px);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.035em;
    color: var(--p3-ink);
    text-wrap: balance;
}

.p3ac-hint {
    margin: 0 0 20px;
    max-width: 64ch;
    color: var(--p3-dim);
    font-size: 13.5px;
    line-height: 1.65;
}

.p3ac-muted { color: var(--p3-muted); }
.p3ac-mono {
    font-family: var(--p3-mono);
    font-size: 11.5px;
    letter-spacing: 0.02em;
}

/* The editorial index label used by generated billing notes. */
.p3ac-note {
    margin: 12px 0 0;
    font-family: var(--p3-mono);
    font-size: 10px;
    line-height: 1.6;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--p3-muted);
}

/* ── Forms ────────────────────────────────────────────────────────────── */

.p3ac-field {
    margin-bottom: 16px;
    max-width: 460px;
    min-width: 0;
}

.p3ac-field label {
    display: block;
    margin-bottom: 8px;
    color: var(--p3-muted);
    font-family: var(--p3-mono);
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.14em;
    line-height: 1.4;
    text-transform: uppercase;
}

.p3ac-input {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    font: inherit;
    font-size: 14px;
    line-height: 1.5;
    color: var(--p3-ink);
    background: #080808;
    border: 1px solid var(--p3-rule-strong);
    border-radius: var(--p3-radius);
    transition: border-color 0.18s ease, background-color 0.18s ease;
}

.p3ac-input::placeholder { color: var(--p3-muted); opacity: 1; }
.p3ac-input:hover { border-color: rgba(244, 242, 236, 0.44); }
.p3ac-input:focus {
    outline: 2px solid var(--p3-cyan);
    outline-offset: 2px;
    border-color: var(--p3-cyan);
    background-color: #0b0b0b;
}
.p3ac-input:focus:not(:focus-visible) { outline: none; }
.p3ac-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.p3ac-input--code {
    font-family: var(--p3-mono);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.28em;
    text-align: center;
}

.p3ac-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
    flex-wrap: wrap;
}
.p3ac-row > .p3ac-input {
    flex: 1 1 220px;
    width: auto;
    min-width: 0;
}
.p3ac-row > label {
    align-self: center;
    font-family: var(--p3-mono);
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--p3-muted);
    white-space: nowrap;
}

/* ── Buttons ──────────────────────────────────────────────────────────── */

.p3ac-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--p3-tap);
    padding: 0 18px;
    font-family: var(--p3-mono);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.09em;
    line-height: 1.2;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--p3-bg);
    background: var(--p3-ink);
    border: 1px solid var(--p3-ink);
    border-radius: var(--p3-radius);
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.p3ac-btn:hover {
    background: var(--p3-cyan);
    border-color: var(--p3-cyan);
    color: var(--p3-bg);
    text-decoration: none;
}
.p3ac-btn:active { transform: translateY(1px); }
.p3ac-btn:focus-visible {
    outline: 2px solid var(--p3-cyan);
    outline-offset: 3px;
}
.p3ac-btn:disabled,
.p3ac-btn[disabled] {
    opacity: 0.42;
    cursor: not-allowed;
    transform: none;
}

.p3ac-btn--ghost {
    color: var(--p3-ink);
    background: transparent;
    border-color: var(--p3-rule-strong);
}
.p3ac-btn--ghost:hover {
    color: var(--p3-cyan);
    background: transparent;
    border-color: var(--p3-cyan);
}

.p3ac-btn--danger {
    color: var(--p3-red);
    background: transparent;
    border-color: rgba(248, 113, 113, 0.55);
}
.p3ac-btn--danger:hover {
    color: var(--p3-bg);
    background: var(--p3-red);
    border-color: var(--p3-red);
}

.p3ac-btn--block { width: 100%; }
form .p3ac-btn--block { max-width: 460px; }

/* ── Tabs ─────────────────────────────────────────────────────────────── */

.p3ac-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 0 0 24px;
    border-bottom: 1px solid var(--p3-rule-strong);
}

.p3ac-tab {
    min-height: var(--p3-tap);
    padding: 0 14px;
    margin-bottom: -1px;
    font-family: var(--p3-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--p3-muted);
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.18s ease, border-color 0.18s ease;
}
.p3ac-tab:hover { color: var(--p3-ink); }
.p3ac-tab:focus-visible {
    outline: 2px solid var(--p3-cyan);
    outline-offset: -2px;
}
.p3ac-tab[aria-selected="true"] {
    color: var(--p3-cyan);
    border-bottom-color: var(--p3-cyan);
}

/* ── Profile ledger line ──────────────────────────────────────────────── */

.p3ac-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 0;
    margin: 0 0 8px;
    background: transparent;
    border: 0;
    border-top: 1px solid var(--p3-rule-strong);
    border-bottom: 1px solid var(--p3-rule);
    border-radius: 0;
}

.p3ac-profile__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border: 1px solid var(--p3-rule-strong);
    border-radius: 2px;
    background: transparent;
    color: var(--p3-cyan);
    font-family: var(--p3-mono);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.p3ac-profile__main { min-width: 0; }

.p3ac-profile__email {
    margin: 0 0 4px;
    color: var(--p3-ink);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.p3ac-profile__status {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 7px;
    row-gap: 2px;
    color: var(--p3-dim);
    font-family: var(--p3-mono);
    font-size: 10px;
    letter-spacing: 0.06em;
    line-height: 1.6;
    text-transform: uppercase;
}
.p3ac-profile__tier { color: var(--p3-dim); font-weight: 700; }
.p3ac-profile[data-tier="pro"] .p3ac-profile__tier { color: var(--p3-cyan); }
.p3ac-profile[data-tier="expired"] .p3ac-profile__tier { color: var(--p3-gold); }
.p3ac-profile[data-tier="unknown"] .p3ac-profile__tier { color: var(--p3-muted); }
.p3ac-profile__source { color: var(--p3-ink); font-weight: 600; }
.p3ac-profile__until { color: var(--p3-dim); }
.p3ac-profile__sep {
    width: 1px;
    height: 10px;
    align-self: center;
    background: var(--p3-rule-strong);
    color: transparent;
    overflow: hidden;
}

/* ── Status ledger ────────────────────────────────────────────────────── */

.p3ac-status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 0 26px;
    border-top: 1px solid var(--p3-rule);
}

.p3ac-kv {
    min-width: 0;
    padding: 14px 20px 16px 0;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--p3-rule);
    border-radius: 0;
}
.p3ac-kv:nth-child(odd) { border-right: 1px solid var(--p3-rule); }
.p3ac-kv:nth-child(even) { padding-left: 20px; }

.p3ac-kv dt {
    margin: 0 0 6px;
    color: var(--p3-muted);
    font-family: var(--p3-mono);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.14em;
    line-height: 1.4;
    text-transform: uppercase;
}
.p3ac-kv dd {
    margin: 0;
    color: var(--p3-ink);
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.p3ac-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
    padding: 3px 8px;
    border: 1px solid var(--p3-rule-strong);
    border-radius: 2px;
    background: transparent;
    color: var(--p3-dim);
    font-family: var(--p3-mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1.2;
    text-transform: uppercase;
}
.p3ac-chip--pro {
    color: var(--p3-cyan);
    border-color: var(--p3-cyan-line);
    background: var(--p3-cyan-soft);
}
.p3ac-chip--free { color: var(--p3-dim); }
.p3ac-chip[data-tier="expired"] {
    color: var(--p3-gold);
    border-color: rgba(251, 191, 36, 0.4);
}
.p3ac-chip[data-tier="unknown"] { color: var(--p3-muted); }

/* Sources: a real ruled table, not a card grid. */
.p3ac-sources {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 12.5px;
}
.p3ac-sources th,
.p3ac-sources td {
    padding: 12px 14px 12px 0;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--p3-rule);
    overflow-wrap: anywhere;
}
.p3ac-sources th {
    color: var(--p3-muted);
    font-family: var(--p3-mono);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.p3ac-sources th:nth-child(1) { width: 38%; }
.p3ac-sources th:nth-child(2) { width: 30%; }
.p3ac-sources th:nth-child(3) { width: 32%; }
.p3ac-sources tbody tr:hover { background: rgba(244, 242, 236, 0.022); }
.p3ac-sources td { color: var(--p3-dim); }

/* ── Free tools ───────────────────────────────────────────────────────── */

.p3ac-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--p3-rule);
}

.p3ac-tools li { min-width: 0; }

.p3ac-tools a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: var(--p3-tap);
    padding: 12px 12px 12px 0;
    color: var(--p3-ink);
    border-bottom: 1px solid var(--p3-rule);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none;
    transition: color 0.18s ease, background-color 0.18s ease;
}
.p3ac-tools li:nth-child(odd) a { border-right: 1px solid var(--p3-rule); }
.p3ac-tools li:nth-child(even) a { padding-left: 14px; }
.p3ac-tools a:hover {
    color: var(--p3-cyan);
    background: rgba(244, 242, 236, 0.025);
    text-decoration: none;
}
.p3ac-tools a::after {
    content: '↗';
    color: var(--p3-muted);
    font-family: var(--p3-mono);
    font-size: 11px;
}

/* ── Billing and plans ────────────────────────────────────────────────── */

.p3ac-billing {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: clamp(28px, 3.4vw, 52px);
    align-items: start;
}
.p3ac-billing > .p3ac-card { margin-bottom: 0; }
.p3ac-billing > [data-panel="plans"] { grid-column: 1 / span 8; }
.p3ac-billing > [data-panel="pro-benefits"] { grid-column: 9 / span 4; }
.p3ac-billing--solo > [data-panel="plans"] { grid-column: 1 / -1; }
.p3ac-billing--solo > [data-panel="pro-benefits"] { grid-column: 1 / span 8; }

.p3ac-pricing__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.p3ac-pricing__head h2 { margin: 0; }

.p3ac-currency {
    display: inline-flex;
    align-items: stretch;
    padding: 0;
    border: 1px solid var(--p3-rule);
    border-radius: 2px;
    background: transparent;
}
.p3ac-currency__opt {
    min-height: var(--p3-tap);
    min-width: var(--p3-tap);
    padding: 0 12px;
    font-family: var(--p3-mono);
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--p3-muted);
    background: transparent;
    border: 0;
    border-right: 1px solid var(--p3-rule);
    cursor: pointer;
    transition: color 0.18s ease, background-color 0.18s ease;
}
.p3ac-currency__opt:last-child { border-right: 0; }
.p3ac-currency__opt:hover { color: var(--p3-ink); }
.p3ac-currency__opt:focus-visible {
    outline: 2px solid var(--p3-cyan);
    outline-offset: -2px;
}
.p3ac-currency__opt[aria-pressed="true"] {
    color: var(--p3-bg);
    background: var(--p3-ink);
}

.p3ac-paymethod {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.p3ac-paymethod__label {
    color: var(--p3-muted);
    font-family: var(--p3-mono);
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.p3ac-paymethod__opts {
    display: inline-flex;
    align-items: stretch;
    padding: 0;
    border: 1px solid var(--p3-rule);
    border-radius: 2px;
    background: transparent;
}
.p3ac-paymethod__opt {
    min-height: var(--p3-tap);
    min-width: var(--p3-tap);
    padding: 0 12px;
    font-family: var(--p3-mono);
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--p3-muted);
    background: transparent;
    border: 0;
    border-right: 1px solid var(--p3-rule);
    cursor: pointer;
    transition: color 0.18s ease, background-color 0.18s ease;
}
.p3ac-paymethod__opt:last-child { border-right: 0; }
.p3ac-paymethod__opt:hover { color: var(--p3-ink); }
.p3ac-paymethod__opt:focus-visible {
    outline: 2px solid var(--p3-cyan);
    outline-offset: -2px;
}
.p3ac-paymethod__opt[aria-pressed="true"] {
    color: var(--p3-bg);
    background: var(--p3-ink);
}

/* Three durations, one aligned ledger row. */
.p3ac-durations {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin-top: 16px;
    border-top: 1px solid var(--p3-rule-strong);
    border-bottom: 1px solid var(--p3-rule);
}

.p3ac-plan.p3ac-duration {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    padding: 18px 16px 18px 0;
    background: transparent;
    border: 0;
    border-right: 1px solid var(--p3-rule);
    border-radius: 0;
}
.p3ac-plan.p3ac-duration + .p3ac-duration { padding-left: 16px; }
.p3ac-plan.p3ac-duration:last-child {
    padding-right: 0;
    border-right: 0;
}

.p3ac-duration__name {
    margin: 0;
    color: var(--p3-muted);
    font-family: var(--p3-mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.14em;
    line-height: 1.4;
    text-transform: uppercase;
}

.p3ac-plan__price { color: var(--p3-ink); }
.p3ac-duration .p3ac-plan__price {
    margin: 12px 0 0;
    font-family: var(--p3-display);
    font-size: clamp(26px, 2.5vw, 34px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.045em;
}
.p3ac-duration__cadence {
    margin: 4px 0 0;
    color: var(--p3-muted);
    font-family: var(--p3-mono);
    font-size: 9.5px;
    line-height: 1.45;
}
.p3ac-duration .p3ac-duration__price--was {
    margin: 12px 0 0;
    color: var(--p3-muted);
    font-family: var(--p3-mono);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}
.p3ac-duration .p3ac-duration__price--promo {
    margin: 0;
    color: var(--p3-cyan);
}
.p3ac-duration__promo {
    margin: 5px 0 0;
    color: var(--p3-gold);
    font-size: 10.5px;
    line-height: 1.45;
}
.p3ac-duration__billing {
    margin: 4px 0 0;
    color: var(--p3-muted);
    font-size: 10.5px;
    line-height: 1.45;
}
.p3ac-duration__equiv {
    margin: 7px 0 0;
    color: var(--p3-dim);
    font-family: var(--p3-mono);
    font-size: 10.5px;
    line-height: 1.45;
}
.p3ac-duration__save {
    margin: 5px 0 0;
    color: var(--p3-green);
    font-family: var(--p3-mono);
    font-size: 10px;
    line-height: 1.45;
}

.p3ac-duration .p3ac-btn {
    width: 100%;
    margin-top: auto;
    background: transparent;
    color: var(--p3-ink);
    border-color: var(--p3-rule-strong);
}
.p3ac-duration .p3ac-btn:hover {
    background: var(--p3-ink);
    color: var(--p3-bg);
    border-color: var(--p3-ink);
}
.p3ac-duration > :nth-last-child(2) { margin-bottom: 14px; }

.p3ac-duration--unavailable {
    border-right-style: dashed;
}
.p3ac-duration--unavailable .p3ac-plan__price { color: var(--p3-muted); }
.p3ac-duration__unavailable {
    margin: 8px 0 0;
    color: var(--p3-muted);
    font-size: 10.5px;
    line-height: 1.45;
}
.p3ac-duration__unavailable + .p3ac-btn { margin-top: 12px; }

.p3ac-plan__fine {
    margin: 14px 0 0;
    max-width: 82ch;
    color: var(--p3-muted);
    font-size: 10.5px;
    line-height: 1.75;
}
.p3ac-plan__fine a {
    color: var(--p3-dim);
    border-bottom: 1px solid var(--p3-rule);
}
.p3ac-plan__fine a:hover {
    color: var(--p3-cyan);
    border-bottom-color: var(--p3-cyan);
}

/* RUB stays a second-level choice behind one quiet disclosure. */
.p3ac-rub { margin-top: 6px; }
.p3ac-rub__toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: var(--p3-tap);
    padding: 0 2px;
    font-family: var(--p3-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--p3-muted);
    background: none;
    border: 0;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 4px;
}
.p3ac-rub__toggle::after { content: '▾'; font-size: 9px; text-decoration: none; }
.p3ac-rub__toggle[aria-expanded="true"]::after { content: '▴'; }
.p3ac-rub__toggle:hover { color: var(--p3-ink); }
.p3ac-rub__toggle:focus-visible { outline: 2px solid var(--p3-cyan); outline-offset: 2px; }
.p3ac-rub__panel { margin-top: 2px; }
.p3ac-rub__note {
    margin: 0 0 8px;
    max-width: 64ch;
    color: var(--p3-muted);
    font-size: 10.5px;
    line-height: 1.6;
}

/* Promo disclosure: a quiet ruled panel, never a promise of validity. */
.p3ac-promo { margin-top: 2px; }
.p3ac-promo__toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: var(--p3-tap);
    padding: 0 2px;
    font-family: var(--p3-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--p3-muted);
    background: none;
    border: 0;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 4px;
}
.p3ac-promo__toggle::after { content: '▾'; font-size: 9px; text-decoration: none; }
.p3ac-promo__toggle[aria-expanded="true"]::after { content: '▴'; }
.p3ac-promo__toggle:hover { color: var(--p3-ink); }
.p3ac-promo__toggle:focus-visible { outline: 2px solid var(--p3-cyan); outline-offset: 2px; }
.p3ac-promo__panel {
    max-width: 520px;
    margin: 4px 0 6px;
    padding: 16px;
    background: #080808;
    border: 1px solid var(--p3-rule);
    border-radius: 2px;
}
.p3ac-promo__row {
    display: flex;
    gap: 8px;
    align-items: stretch;
    flex-wrap: wrap;
}
.p3ac-promo__row > .p3ac-input {
    flex: 1 1 190px;
    min-width: 0;
    width: auto;
}
.p3ac-promo__apply {
    flex: 0 0 auto;
    padding: 0 14px;
}
.p3ac-promo__label {
    display: block;
    margin-bottom: 7px;
    color: var(--p3-dim);
    font-family: var(--p3-mono);
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.p3ac-promo__hint {
    margin: 7px 0 0;
    color: var(--p3-muted);
    font-size: 10.5px;
    line-height: 1.55;
}
.p3ac-promo__hint[data-promo-status] { color: var(--p3-dim); }
.p3ac-promo__hint[data-promo-status]:empty { display: none; }
.p3ac-promo .p3ac-error { margin-top: 6px; font-size: 11px; }
.p3ac-error[data-promo-error] { min-height: 0; }
.p3ac-error[data-checkout-status] {
    margin-top: 12px;
    font-size: 12px;
    line-height: 1.6;
}

/* ── What Pro includes ────────────────────────────────────────────────── */

.p3ac-benefits__list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--p3-rule-strong);
}
.p3ac-benefits__item {
    padding: 14px 0;
    border-bottom: 1px solid var(--p3-rule);
}
.p3ac-benefits__name {
    margin: 0 0 4px;
    color: var(--p3-ink);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}
.p3ac-benefits__desc {
    margin: 0;
    color: var(--p3-dim);
    font-size: 12px;
    line-height: 1.6;
}
.p3ac-benefits__ind {
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 6px;
}
.p3ac-benefits__ind li {
    color: var(--p3-muted);
    font-size: 11.5px;
    line-height: 1.55;
}
.p3ac-benefits__ind b { color: var(--p3-dim); font-weight: 600; }
.p3ac-benefits__free {
    margin: 14px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--p3-rule);
    color: var(--p3-muted);
    font-size: 10.5px;
    line-height: 1.6;
}
.p3ac-benefits__more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: var(--p3-tap);
    margin-top: 2px;
    color: var(--p3-cyan);
    font-family: var(--p3-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
}
.p3ac-benefits__more span { color: var(--p3-muted); }
.p3ac-benefits__more:hover { color: var(--p3-cyan-pale); }
.p3ac-benefits__more:focus-visible {
    outline: 2px solid var(--p3-cyan);
    outline-offset: 4px;
}

/* ── Manage subscription ──────────────────────────────────────────────── */

.p3ac-manage__head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.p3ac-manage__head h2 { margin: 0; }
.p3ac-manage__head .p3ac-muted {
    margin-left: auto;
    font-family: var(--p3-mono);
    font-size: 9.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.p3ac-manage__list {
    display: grid;
    gap: 0;
    margin-top: 14px;
    border-top: 1px solid var(--p3-rule);
}

.p3ac-sub {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 16px 0;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--p3-rule);
    border-radius: 0;
}
.p3ac-sub[data-cancel-status="unknown"] {
    border-bottom-color: rgba(251, 191, 36, 0.45);
    background: rgba(251, 191, 36, 0.025);
}
.p3ac-sub__main { min-width: 0; flex: 1 1 260px; }
.p3ac-sub__title {
    margin: 0 0 4px;
    color: var(--p3-ink);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.4;
}
.p3ac-sub__amount {
    margin-left: 7px;
    color: var(--p3-muted);
    font-family: var(--p3-mono);
    font-size: 10.5px;
    font-weight: 500;
}
.p3ac-sub__meta {
    margin: 0;
    color: var(--p3-dim);
    font-size: 12px;
    line-height: 1.55;
}
.p3ac-sub__warn,
.p3ac-sub__refund {
    margin: 7px 0 0;
    color: var(--p3-gold);
    font-size: 11.5px;
    line-height: 1.55;
}
.p3ac-sub__refund[data-refund-reviewed],
.p3ac-sub__refund[data-refund-rejected] { color: var(--p3-dim); }
.p3ac-sub__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.p3ac-sub__btn {
    min-height: var(--p3-tap);
    padding: 8px 14px;
    font-size: 10px;
    white-space: normal;
}
.p3ac-sub__confirm {
    flex: 1 1 100%;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--p3-rule);
    color: var(--p3-dim);
    font-size: 12px;
    line-height: 1.55;
}
.p3ac-sub__confirm p { margin: 0 0 7px; }
.p3ac-sub__confirm b { color: var(--p3-ink); }
.p3ac-sub__label {
    display: block;
    margin: 2px 0 6px;
    color: var(--p3-dim);
    font-family: var(--p3-mono);
    font-size: 9.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.p3ac-sub__reason {
    min-height: 96px;
    resize: vertical;
}

/* ── Notices, errors, progress ────────────────────────────────────────── */

.p3ac-notice {
    margin: 0 0 18px;
    padding: 12px 14px;
    color: var(--p3-dim);
    background: rgba(244, 242, 236, 0.02);
    border: 1px solid var(--p3-rule);
    border-radius: 2px;
    font-size: 12.5px;
    line-height: 1.6;
}
.p3ac-notice--info {
    color: var(--p3-ink);
    border-color: var(--p3-cyan-line);
    background: var(--p3-cyan-soft);
}
.p3ac-notice--warn {
    color: var(--p3-gold);
    border-color: rgba(251, 191, 36, 0.36);
    background: rgba(251, 191, 36, 0.05);
}
.p3ac-notice--error {
    color: var(--p3-red);
    border-color: rgba(248, 113, 113, 0.38);
    background: rgba(248, 113, 113, 0.05);
}
.p3ac-notice--ok {
    color: var(--p3-green);
    border-color: rgba(74, 222, 128, 0.34);
    background: rgba(74, 222, 128, 0.05);
}

.p3ac-card[data-account-error],
.p3ac-card[data-account-disabled] { border-top-color: var(--p3-rule-strong); }
.p3ac-card[data-account-error] h2 { color: var(--p3-ink); }
[data-status-error] { margin-top: 16px; }
[data-status-error] .p3ac-btn { margin-top: 10px; }

.p3ac-error {
    min-height: 18px;
    margin-top: 8px;
    color: var(--p3-red);
    font-size: 12px;
    line-height: 1.5;
}

.p3ac-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 9px;
    border: 2px solid var(--p3-rule-strong);
    border-top-color: var(--p3-cyan);
    border-radius: 50%;
    animation: p3ac-spin 0.8s linear infinite;
    vertical-align: -2px;
}
@keyframes p3ac-spin { to { transform: rotate(360deg); } }

/* ── Sign-in methods ──────────────────────────────────────────────────── */

.p3ac-methods { margin: 0 0 20px; }
.p3ac-methods__label {
    margin: 0 0 9px;
    color: var(--p3-muted);
    font-family: var(--p3-mono);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.p3ac-methods__row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.p3ac-method {
    width: 100%;
    min-height: var(--p3-tap);
    justify-content: flex-start;
    padding-left: 16px;
    text-align: left;
    color: var(--p3-ink);
    background: transparent;
    border-color: var(--p3-rule-strong);
}
.p3ac-method:hover {
    color: var(--p3-cyan);
    background: transparent;
    border-color: var(--p3-cyan);
}
.p3ac-provider-setup {
    display: flex;
    align-items: center;
    min-height: var(--p3-tap);
    margin: 0;
    padding: 9px 13px;
    color: var(--p3-muted);
    background: transparent;
    border: 1px dashed var(--p3-rule);
    border-radius: var(--p3-radius);
    font-size: 11.5px;
    line-height: 1.45;
}
.p3ac-methods__sep {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 14px 0 6px;
    color: var(--p3-muted);
    font-family: var(--p3-mono);
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.p3ac-methods__sep::before,
.p3ac-methods__sep::after {
    content: '';
    flex: 1 1 auto;
    height: 1px;
    background: var(--p3-rule);
}

/* ── Gift and danger zones ────────────────────────────────────────────── */

.p3ac-card--danger-zone { border-top-color: rgba(248, 113, 113, 0.4); }
.p3ac-danger-zone { padding-bottom: 40px; }
.p3ac-danger-zone h2 { color: var(--p3-ink); }
.p3ac-danger-zone .p3ac-hint { max-width: 70ch; }

/* ── P3 PRO guide (Learn surface inside Account) ──────────────────────── */

.p3ac-pro {
    padding: 46px 0 30px;
    border-top: 1px solid var(--p3-rule-strong);
    scroll-margin-top: 96px;
}
.p3ac-pro__head { padding-bottom: 0; }

.p3ac-pro__eyebrow {
    margin: 0 0 10px;
    color: var(--p3-cyan);
    font-family: var(--p3-mono);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.2em;
    line-height: 1.4;
    text-transform: uppercase;
}

.p3ac-pro__head .p3ac-pro__title {
    margin: 0 0 12px;
    font-family: var(--p3-display);
    font-size: clamp(28px, 3.4vw, 40px);
    font-weight: 700;
    line-height: 1.04;
    letter-spacing: -0.045em;
    color: var(--p3-ink);
    text-wrap: balance;
}

.p3ac-pro__lede {
    margin: 0;
    max-width: 64ch;
    color: var(--p3-dim);
    font-size: 14px;
    line-height: 1.65;
}

.p3ac-pro__nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 22px;
    margin-top: 26px;
    padding: 10px 0;
    border-top: 1px solid var(--p3-rule);
    border-bottom: 1px solid var(--p3-rule);
}
.p3ac-pro__navlabel {
    color: var(--p3-muted);
    font-family: var(--p3-mono);
    font-size: 8.5px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.p3ac-pro__nav a {
    display: inline-flex;
    align-items: center;
    min-height: var(--p3-tap);
    color: var(--p3-dim);
    font-family: var(--p3-mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-decoration: none;
    border-bottom: 1px solid transparent;
}
.p3ac-pro__nav a:hover {
    color: var(--p3-cyan);
    border-bottom-color: var(--p3-cyan-line);
    text-decoration: none;
}
.p3ac-pro__nav a:focus-visible {
    outline: 2px solid var(--p3-cyan);
    outline-offset: 3px;
}

.p3ac-pro__chapters {
    margin: 0;
    padding: 0;
    list-style: none;
    border-bottom: 1px solid var(--p3-rule-strong);
}

.p3ac-pro__chapter {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding: 32px 0;
    border-top: 1px solid var(--p3-rule);
    scroll-margin-top: 96px;
}
.p3ac-pro__chapter:focus-visible {
    outline: 2px solid var(--p3-cyan);
    outline-offset: 4px;
}

.p3ac-pro__copy { min-width: 0; max-width: 66ch; }

.p3ac-pro__kicker {
    margin: 0 0 7px;
    color: var(--p3-muted);
    font-family: var(--p3-mono);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.p3ac-pro__chapter h3 {
    margin: 0 0 8px;
    color: var(--p3-ink);
    font-family: var(--p3-display);
    font-size: clamp(19px, 2vw, 23px);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.p3ac-pro__lead {
    margin: 0 0 14px;
    max-width: 52ch;
    color: var(--p3-dim);
    font-size: 13px;
    line-height: 1.65;
}

.p3ac-pro__points {
    margin: 0;
    padding: 0;
    list-style: none;
}
.p3ac-pro__points li {
    position: relative;
    padding-left: 17px;
    color: var(--p3-dim);
    font-size: 12.5px;
    line-height: 1.65;
}
.p3ac-pro__points li + li { margin-top: 10px; }
.p3ac-pro__points li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.68em;
    width: 5px;
    height: 5px;
    border: 1px solid var(--p3-cyan-line);
    border-radius: 0;
}
.p3ac-pro__points b { color: var(--p3-ink); font-weight: 600; }

.p3ac-pro__fig {
    margin: 0;
    min-width: 0;
    align-self: start;
}
.p3ac-pro__frame {
    padding: 8px;
    overflow: hidden;
    background-color: #080808;
    background-image: radial-gradient(rgba(244, 242, 236, 0.10) 1px, transparent 1px);
    background-size: 16px 16px;
    border: 1px solid var(--p3-rule);
    border-radius: 2px;
}
.p3ac-pro__fig figcaption {
    margin: 10px 0 0;
    max-width: 52ch;
    color: var(--p3-muted);
    font-family: var(--p3-mono);
    font-size: 9px;
    line-height: 1.7;
    letter-spacing: 0.03em;
}

.p3ac-pro__foot {
    padding-top: 20px;
    border-top: 1px solid var(--p3-rule);
}
.p3ac-pro__free {
    margin: 0 0 8px;
    color: var(--p3-dim);
    font-size: 12px;
    line-height: 1.6;
}
.p3ac-pro__free b { color: var(--p3-cyan); font-weight: 600; }
.p3ac-pro__disclaimer {
    margin: 0;
    max-width: 66ch;
    color: var(--p3-muted);
    font-size: 10.5px;
    line-height: 1.6;
}

/* Inline schematics: quiet decoration, meaning lives in the figcaption. */
.p3ac-ill { display: block; width: 100%; height: auto; overflow: visible; }
.p3ac-ill__panel { fill: rgba(8, 8, 8, 0.9); stroke: var(--p3-rule); stroke-width: 1; }
.p3ac-ill__screen { fill: #030303; stroke: var(--p3-rule); stroke-width: 1; }
.p3ac-ill__notch { fill: var(--p3-rule-strong); }
.p3ac-ill__grid line,
.p3ac-ill__grid path { fill: none; stroke: rgba(244, 242, 236, 0.12); stroke-width: 1; }
.p3ac-ill__label {
    fill: var(--p3-dim);
    font-family: var(--p3-mono);
    font-size: 8.5px;
    letter-spacing: 0.03em;
}
.p3ac-ill__key { fill: var(--p3-cyan); }
.p3ac-ill__rowtext text {
    fill: var(--p3-dim);
    font-family: var(--p3-mono);
    font-size: 8.5px;
}
.p3ac-ill__wick { stroke: var(--p3-muted); stroke-width: 1; }
.p3ac-ill__up { fill: rgba(74, 222, 128, 0.72); }
.p3ac-ill__down { fill: rgba(248, 113, 113, 0.68); }
.p3ac-ill__bar { fill: rgba(103, 232, 249, 0.26); }
.p3ac-ill__meter { fill: rgba(103, 232, 249, 0.5); }
.p3ac-ill__row { fill: rgba(103, 232, 249, 0.055); }
.p3ac-ill__chip { fill: rgba(103, 232, 249, 0.05); stroke: rgba(103, 232, 249, 0.22); }
.p3ac-ill__wall { fill: rgba(103, 232, 249, 0.3); stroke: var(--p3-cyan); stroke-width: 0.8; }
.p3ac-ill__ask { fill: rgba(248, 113, 113, 0.3); }
.p3ac-ill__bid { fill: rgba(74, 222, 128, 0.26); }
.p3ac-ill__accent {
    fill: none;
    stroke: var(--p3-cyan);
    stroke-width: 1.3;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.p3ac-ill__dim { fill: none; stroke: var(--p3-muted); stroke-width: 1; }
.p3ac-ill__dash { stroke-dasharray: 4 4; }
.p3ac-ill__base { stroke: rgba(244, 242, 236, 0.28); stroke-width: 1; }
.p3ac-ill__stop { stroke: var(--p3-red); stroke-width: 1.1; stroke-dasharray: 3 3; }
.p3ac-ill__entry { stroke: var(--p3-pink); stroke-width: 1.1; stroke-dasharray: 3 3; }
.p3ac-ill__exit { fill: var(--p3-dim); }
.p3ac-ill__mark { fill: var(--p3-cyan); }
.p3ac-ill__mark--soft { opacity: 0.55; }
.p3ac-ill__up-mark { fill: var(--p3-green); }
.p3ac-ill__dot { fill: var(--p3-dim); }

/* Reveal-once motion. The hidden state exists only after the script adds the
   class, so no-JS and failed-JS readers always see the guide. */
.p3ac-pro--motion .p3ac-pro__chapter {
    opacity: 0;
    transform: translateY(16px);
}
.p3ac-pro__chapter.is-in {
    opacity: 1;
    transform: none;
    transition:
        opacity 0.5s ease,
        transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.p3ac-pro--motion .p3ac-draw {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
}
.p3ac-pro__chapter.is-in .p3ac-draw {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1.1s cubic-bezier(0.4, 0, 0.2, 1) 0.18s;
}
.p3ac-pro--motion .p3ac-pop {
    opacity: 0.35;
    transform: scaleY(0.4);
    transform-box: fill-box;
    transform-origin: 50% 100%;
}
.p3ac-pro__chapter.is-in .p3ac-pop {
    opacity: 1;
    transform: scaleY(1);
    transition:
        transform 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) calc(0.1s + var(--i, 0) * 26ms),
        opacity 0.35s ease calc(0.1s + var(--i, 0) * 26ms);
}
.p3ac-pro--motion .p3ac-fade { opacity: 0; }
.p3ac-pro__chapter.is-in .p3ac-fade {
    opacity: 1;
    transition: opacity 0.5s ease calc(0.55s + var(--i, 0) * 55ms);
}

/* ── Footer ───────────────────────────────────────────────────────────── */

.p3ac-footer {
    display: flex;
    gap: 10px 20px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid var(--p3-rule-strong);
    color: var(--p3-muted);
    font-family: var(--p3-mono);
    font-size: 9px;
    letter-spacing: 0.08em;
    line-height: 1.6;
    text-transform: uppercase;
}
.p3ac-footer a { color: var(--p3-dim); }
.p3ac-footer a:hover { color: var(--p3-cyan); }
.p3ac-footer > span:last-child { margin-left: auto; color: var(--p3-muted); }

/* Guide chapters alternate only when there is room for two readable columns. */
@media (min-width: 900px) {
    .p3ac-pro__chapter {
        grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
        gap: clamp(32px, 4.5vw, 64px);
        align-items: start;
    }
    .p3ac-pro__chapter:nth-child(even) .p3ac-pro__fig { order: -1; }
}

/* Below this width the plans ledger and its benefits column would both become
   too narrow to read; stack them while the main grid is still open. */
@media (max-width: 1100px) {
    .p3ac-billing { display: block; }
    .p3ac-billing > [data-panel="plans"],
    .p3ac-billing > [data-panel="pro-benefits"],
    .p3ac-billing--solo > [data-panel="plans"],
    .p3ac-billing--solo > [data-panel="pro-benefits"] { grid-column: auto; }
}

/* ── Tablet ───────────────────────────────────────────────────────────── */

@media (min-width: 641px) and (max-width: 1024px) {
    .p3ac-shell {
        max-width: 820px;
        padding: 0 26px 72px;
    }
    main { display: block; }
    .p3ac-title {
        margin-top: 44px;
        font-size: clamp(38px, 6vw, 50px);
    }
    .p3ac-subtitle { max-width: 60ch; margin-bottom: 28px; }
    .p3ac-billing { display: block; }
    .p3ac-billing > [data-panel="plans"],
    .p3ac-billing > [data-panel="pro-benefits"],
    .p3ac-billing--solo > [data-panel="plans"],
    .p3ac-billing--solo > [data-panel="pro-benefits"] { grid-column: auto; }
    .p3ac-card { padding: 28px 0 32px; }
}

/* ── Phone ────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .p3ac-shell { padding: 0 16px 60px; }
    .p3ac-topbar {
        min-height: 62px;
        gap: 10px;
        padding: 9px 0;
    }
    .p3ac-brand span { font-size: 16px; }
    .p3ac-topbar__actions { gap: 6px; }
    .p3ac-topbar__actions .p3ac-btn {
        padding: 0 12px;
        font-size: 9.5px;
    }

    main { display: block; }
    .p3ac-title {
        margin: 38px 0 14px;
        font-size: clamp(32px, 9.4vw, 42px);
    }
    .p3ac-subtitle {
        margin-bottom: 24px;
        font-size: 13.5px;
        line-height: 1.65;
    }

    .p3ac-card { padding: 24px 0 28px; }
    .p3ac-card h2 { font-size: 21px; }

    .p3ac-profile {
        gap: 12px;
        padding: 14px 0;
        align-items: flex-start;
    }
    .p3ac-profile__avatar {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }
    .p3ac-profile__email { font-size: 14px; }

    .p3ac-tabs { margin-bottom: 20px; }
    .p3ac-tab {
        flex: 1 1 auto;
        padding: 0 10px;
        font-size: 9px;
        letter-spacing: 0.05em;
    }

    .p3ac-field { margin-bottom: 15px; }
    .p3ac-row { flex-direction: column; align-items: stretch; }
    .p3ac-row > .p3ac-input { width: 100%; }
    .p3ac-row > .p3ac-btn,
    .p3ac-row > .p3ac-promo__apply { width: 100%; }
    .p3ac-row > label { align-self: flex-start; }

    .p3ac-status-grid { grid-template-columns: minmax(0, 1fr); }
    .p3ac-kv,
    .p3ac-kv:nth-child(odd),
    .p3ac-kv:nth-child(even) {
        padding: 12px 0 14px;
        border-right: 0;
    }
    .p3ac-kv:last-child { border-bottom: 0; }

    .p3ac-sources th:nth-child(2),
    .p3ac-sources td:nth-child(2) { display: none; }
    .p3ac-sources th:nth-child(1) { width: 46%; }
    .p3ac-sources th:nth-child(3) { width: 54%; }

    .p3ac-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .p3ac-billing { display: block; }
    .p3ac-pricing__head { align-items: flex-start; }
    .p3ac-currency__opt,
    .p3ac-paymethod__opt {
        min-height: var(--p3-tap);
        padding: 0 14px;
    }

    .p3ac-durations { grid-template-columns: minmax(0, 1fr); }
    .p3ac-plan.p3ac-duration,
    .p3ac-plan.p3ac-duration + .p3ac-duration {
        padding: 18px 0;
        border-right: 0;
        border-bottom: 1px solid var(--p3-rule);
    }
    .p3ac-plan.p3ac-duration:last-child { border-bottom: 0; }
    .p3ac-duration .p3ac-plan__price { font-size: 30px; }
    .p3ac-duration > :nth-last-child(2) { margin-bottom: 12px; }

    .p3ac-promo__row { flex-direction: column; }
    .p3ac-promo__apply { width: 100%; }
    .p3ac-promo__panel { padding: 14px; }

    .p3ac-manage__head .p3ac-muted { margin-left: 0; }
    .p3ac-sub { padding: 14px 0; }
    .p3ac-sub__actions,
    .p3ac-sub__actions .p3ac-sub__btn { width: 100%; }
    .p3ac-sub__actions .p3ac-sub__btn { flex: 1 1 100%; }

    .p3ac-pro { padding: 32px 0 24px; }
    .p3ac-pro__head .p3ac-pro__title { font-size: 28px; }
    .p3ac-pro__nav { gap: 0 16px; margin-top: 20px; }
    .p3ac-pro__chapter {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
        padding: 26px 0;
    }
    .p3ac-pro__chapter:nth-child(even) .p3ac-pro__fig { order: 0; }
    .p3ac-pro__lead,
    .p3ac-pro__fig figcaption { max-width: none; }

    .p3ac-footer > span:last-child { margin-left: 0; }
}

/* 320px-class phones: the last refinement keeps the ledger readable without
   hiding any control or introducing page-level horizontal overflow. */
@media (max-width: 380px) {
    .p3ac-shell { padding-left: 12px; padding-right: 12px; }
    .p3ac-title { font-size: 31px; }
    .p3ac-brand small { font-size: 8px; letter-spacing: 0.2em; }
    .p3ac-topbar__actions .p3ac-btn {
        padding: 0 10px;
        font-size: 9px;
    }
    .p3ac-tab {
        padding: 0 8px;
        font-size: 8.5px;
    }
    .p3ac-card h2 { font-size: 20px; }
    .p3ac-duration .p3ac-plan__price { font-size: 27px; }
    .p3ac-pro__head .p3ac-pro__title { font-size: 25px; }
    .p3ac-pro__nav a { font-size: 9.5px; }
    .p3ac-sources { font-size: 11.5px; }
    .p3ac-sources th,
    .p3ac-sources td { padding-right: 8px; }
}

/* Motion is optional: readers who ask for less get the final state at once. */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
    .p3ac-spinner { animation: none; }
    .p3ac-pro--motion .p3ac-pro__chapter { opacity: 1; transform: none; }
    .p3ac-pro__chapter,
    .p3ac-pro__chapter.is-in { transition: none; }
    .p3ac-pro--motion .p3ac-draw {
        stroke-dasharray: none;
        stroke-dashoffset: 0;
        transition: none;
    }
    .p3ac-pro--motion .p3ac-pop { opacity: 1; transform: none; transition: none; }
    .p3ac-pro--motion .p3ac-fade { opacity: 1; transition: none; }
}
