/* ---------------------------------------------------------------------------
   Developer API portal: page layout only.
   Tokens, type and shared components come from /brand-static/surface.css,
   which base.html loads first.
   --------------------------------------------------------------------------- */

h1 { font-size: 32px; letter-spacing: -0.03em; }
h2 { font-size: 17px; letter-spacing: -0.01em; }

/* ----------------------------- Buttons ----------------------------- */
.btn-primary, .btn-secondary, .btn-danger, .auth-card button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 16px;
    border: 0;
    border-radius: var(--tw-pill);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--tw-ease), color var(--tw-ease), opacity var(--tw-ease);
}
.btn-primary, .auth-card button[type="submit"] { background: var(--tw-graphite); color: #fff; }
.btn-primary:hover:not(:disabled), .auth-card button[type="submit"]:hover:not(:disabled) {
    background: #000;
    text-decoration: none;
}
.btn-secondary { background: var(--tw-bg-2); color: var(--tw-text); }
.btn-secondary:hover:not(:disabled) { background: var(--tw-bg-3); }
.btn-danger { background: transparent; color: var(--tw-danger); }
.btn-danger:hover:not(:disabled) { background: var(--tw-danger-bg); }
button:disabled { opacity: 0.5; cursor: default; }

.btn-copy {
    min-height: 28px;
    padding: 0 12px;
    border: 0;
    border-radius: var(--tw-pill);
    background: var(--tw-bg-2);
    color: var(--tw-text);
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}
.btn-copy:hover:not(:disabled) { background: var(--tw-bg-3); }
.btn-copy:disabled { color: var(--tw-link); opacity: 1; }
.btn-copy:focus-visible { outline-offset: 1px; }

/* ----------------------------- Auth pages ----------------------------- */
.auth-page {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 clamp(16px, 4vw, 40px);
    background: var(--tw-bg-2);
}
.portal-auth-top,
.portal-auth-foot {
    width: 100%;
    max-width: 1200px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.portal-auth-top { min-height: 72px; }
.portal-auth-top__link { font-size: 13.5px; color: var(--tw-muted); }
.portal-auth-foot { min-height: 64px; font-size: 12.5px; color: var(--tw-muted); }
.portal-auth-foot a { color: var(--tw-muted); }

.auth-box {
    width: 100%;
    max-width: 420px;
    margin: auto 0;
    padding: 40px 0 56px;
    text-align: center;
}
.auth-box:focus { outline: none; }
.auth-box h1 { font-size: clamp(28px, 4vw, 34px); line-height: 1.12; text-wrap: balance; }
.auth-subtitle { margin-top: 10px; font-size: 16px; line-height: 1.45; color: var(--tw-muted); text-wrap: pretty; }
.auth-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: var(--tw-bg);
    color: var(--tw-link);
    box-shadow: var(--tw-shadow-card);
}
.auth-cta { margin-top: 28px; }
.auth-cta .portal-auth-submit { width: auto; padding: 0 28px; }

.auth-card {
    margin-top: 28px;
    padding: 24px;
    background: var(--tw-bg);
    border-radius: 20px;
    box-shadow: var(--tw-shadow-card);
    text-align: left;
}
.auth-card label { display: block; margin: 14px 0 6px; font-size: 13.5px; font-weight: 600; }
.auth-card label:first-of-type { margin-top: 0; }
.auth-card input,
.form-group input {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    background: var(--tw-bg);
    border: 1px solid var(--tw-line-2);
    border-radius: var(--tw-radius);
    color: var(--tw-text);
    font: inherit;
    font-size: 16px;
    transition: border-color var(--tw-ease), box-shadow var(--tw-ease);
}
.auth-card input::placeholder, .form-group input::placeholder { color: var(--tw-faint); }
.auth-card input:focus,
.form-group input:focus {
    outline: none;
    border-color: var(--tw-text);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.07);
}
.auth-card button[type="submit"],
button.portal-auth-submit,
a.portal-auth-submit { width: 100%; min-height: 46px; margin-top: 18px; font-size: 15px; }
a.portal-auth-submit:hover { text-decoration: none; }

.form-group { margin-bottom: 14px; }
.form-group label { margin: 0 0 6px; }

.password-input-wrapper { position: relative; display: flex; align-items: center; }
.password-input-wrapper input { padding-right: 48px; }
.password-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: var(--tw-radius-sm);
    color: var(--tw-muted);
    cursor: pointer;
}
.password-toggle:hover { color: var(--tw-text); }
.password-icon { width: 18px; height: 18px; }
.password-icon[hidden] { display: none; }

.auth-card-links {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    font-size: 14px;
    font-weight: 600;
}
.auth-alt { margin-top: 22px; font-size: 14.5px; color: var(--tw-muted); }
.auth-alt a { font-weight: 600; }
.auth-message { margin-top: 16px; font-size: 14px; color: var(--tw-muted); }
.auth-card .auth-message:not(#portal-error) { margin-bottom: 0; }

/* ----------------------------- Banners ----------------------------- */
#portal-error {
    margin: 0 0 20px;
    padding: 12px 16px;
    background: var(--tw-danger-bg);
    color: var(--tw-danger);
    border-radius: var(--tw-radius);
    font-size: 14px;
    text-align: left;
}
#portal-notice {
    margin: 0 0 20px;
    padding: 12px 16px;
    background: var(--tw-success-bg);
    color: var(--tw-link);
    border-radius: var(--tw-radius);
    font-size: 14px;
    text-align: left;
}
.auth-card #portal-error, .auth-card #portal-notice { margin: 16px 0 0; }
.auth-inline-link {
    display: inline; padding: 0; border: 0; background: none;
    font: inherit; font-weight: 600; color: var(--tw-link); cursor: pointer; text-decoration: underline;
}
.auth-inline-link:disabled { color: inherit; font-weight: 400; text-decoration: none; cursor: default; }
.panel-loading { color: var(--tw-muted); font-size: 14px; }
.panel-error { color: var(--tw-danger); font-size: 14px; }
.portal-empty { color: var(--tw-muted); font-size: 14px; line-height: 1.5; }
.portal-empty a { font-weight: 600; }
.portal-empty code {
    padding: 1px 6px;
    background: var(--tw-bg-2);
    border-radius: 6px;
    font-size: 0.9em;
}

/* ----------------------------- App shell ----------------------------- */
.portal-shell { display: flex; height: 100vh; height: 100dvh; }

.portal-sidebar {
    width: 236px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    padding: 16px 12px 12px;
    background: var(--tw-bg-2);
    border-right: 1px solid var(--tw-line);
    overflow-y: auto;
    transition: width var(--tw-ease);
}
.portal-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 4px 22px 10px;
}
.portal-sidebar-brand { display: flex; min-width: 0; }
.portal-sidebar-brand .tw-brandswitch-logo { height: 28px; }
.portal-sidebar-brand .tw-brandswitch-menu { left: -10px; }
.tw-brandswitch-trigger--static { color: inherit; text-decoration: none; }
.tw-brandswitch-trigger--static:hover { text-decoration: none; }

.portal-sidebar-toggle {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: var(--tw-radius-sm);
    color: var(--tw-faint);
    cursor: pointer;
}
.portal-sidebar-toggle:hover { background: var(--tw-bg-3); color: var(--tw-text); }
.portal-sidebar-toggle .icon-expand { display: none; }
html.portal-sidebar-collapsed .portal-sidebar-toggle .icon-collapse { display: none; }
html.portal-sidebar-collapsed .portal-sidebar-toggle .icon-expand { display: block; }

.portal-sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.portal-sidebar-link,
.portal-sidebar-footer-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    padding: 0 10px;
    border-radius: 9px;
    color: var(--tw-text);
    font-size: 14px;
}
.portal-sidebar-link svg, .portal-sidebar-footer-link svg { flex-shrink: 0; color: var(--tw-muted); }
.portal-sidebar-link:hover, .portal-sidebar-footer-link:hover { background: var(--tw-bg-3); text-decoration: none; }
.portal-sidebar-link.active { background: var(--tw-bg); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07); font-weight: 600; }
.portal-sidebar-link.active svg { color: var(--tw-text); }

.portal-sidebar-footer { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.portal-sidebar-footer-value { font-variant-numeric: tabular-nums; color: var(--tw-text); font-weight: 600; }

.portal-sidebar-plan {
    display: block;
    margin: 6px 0 2px;
    padding: 12px 10px;
    border-top: 1px solid var(--tw-line);
    color: var(--tw-muted);
    font-size: 12.5px;
}
.portal-sidebar-plan:hover { text-decoration: none; color: var(--tw-text); }
.portal-sidebar-plan-name { display: block; color: var(--tw-text); font-size: 13.5px; font-weight: 600; }
.portal-sidebar-plan-usage { display: block; margin-top: 2px; }
.portal-sidebar-plan-meter {
    display: block;
    height: 4px;
    margin-top: 10px;
    border-radius: 4px;
    background: var(--tw-bg-3);
    overflow: hidden;
}
.portal-sidebar-plan-meter span { display: block; width: 0; height: 100%; background: var(--tw-text); transition: width 400ms ease; }

.portal-sidebar-profile { position: relative; }
.portal-sidebar-profile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    background: transparent;
    border: 0;
    border-radius: 9px;
    color: var(--tw-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.portal-sidebar-profile-trigger:hover { background: var(--tw-bg-3); }
.portal-sidebar-avatar {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--tw-bg-3);
    color: var(--tw-muted);
}
.portal-sidebar-profile-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.portal-sidebar-name,
.portal-sidebar-subtitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-sidebar-name { font-size: 13px; font-weight: 600; }
.portal-sidebar-subtitle { font-size: 12px; color: var(--tw-muted); }
.portal-sidebar-chevron { flex-shrink: 0; color: var(--tw-faint); transition: transform var(--tw-ease); }
.portal-sidebar-profile-trigger[aria-expanded="true"] .portal-sidebar-chevron { transform: rotate(180deg); }
.portal-sidebar-profile-menu {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 6px);
    padding: 6px;
    background: var(--tw-bg);
    border-radius: var(--tw-radius-md);
    box-shadow: var(--tw-shadow-pop);
    z-index: 10;
}
.portal-sidebar-profile-head { margin-bottom: 4px; padding: 8px 10px 10px; border-bottom: 1px solid var(--tw-line); }
.portal-sidebar-profile-company { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 650; }
.portal-sidebar-profile-company > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-sidebar-profile-plan {
    flex-shrink: 0; padding: 2px 8px; border-radius: var(--tw-pill); background: var(--tw-bg-2);
    color: var(--tw-muted); font-size: 11.5px; font-weight: 600; text-decoration: none;
}
.portal-sidebar-profile-plan:hover { background: var(--tw-bg-3); color: var(--tw-text); text-decoration: none; }
.portal-sidebar-profile-plan[hidden] { display: none; }
.portal-sidebar-profile-email { margin-top: 2px; color: var(--tw-muted); font-size: 12.5px; overflow-wrap: anywhere; }
.portal-sidebar-profile-sep { height: 1px; margin: 4px 0; background: var(--tw-line); }

.portal-sidebar-profile-item,
.portal-sidebar-profile-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 36px;
    padding: 0 10px;
    background: transparent;
    border: 0;
    border-radius: var(--tw-radius-sm);
    color: var(--tw-text);
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}
.portal-sidebar-profile-logout:hover { background: var(--tw-bg-2); color: var(--tw-danger); }
.portal-sidebar-profile-item { color: var(--tw-text); text-decoration: none; }
.portal-sidebar-profile-item:hover { background: var(--tw-bg-2); text-decoration: none; }
.portal-sidebar-profile-item[aria-current="page"] { background: var(--tw-bg-2); }
.portal-sidebar-profile-item:focus-visible,
.portal-sidebar-profile-logout:focus-visible { outline: 2px solid var(--tw-link); outline-offset: -2px; }
/* Log out sits apart from the pages, so it isn't hit by accident. */
.portal-sidebar-profile-logout { margin-top: 4px; border-top: 1px solid var(--tw-line); border-radius: 0 0 var(--tw-radius-sm) var(--tw-radius-sm); }
/* On Account or Billing, the menu's trigger shows as the current place, like a nav link. */
.portal-sidebar-profile-trigger.is-current { background: var(--tw-bg); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07); }

.portal-main {
    flex: 1; min-width: 0; height: 100vh; height: 100dvh; overflow-y: auto; background: var(--tw-bg);
    /* Layouts inside respond to the space beside the sidebar, not the window:
       a 1000px window leaves only ~760px here. */
    container: portal-main / inline-size;
}
.portal-main:focus { outline: none; }

/* Collapsed rail (desktop only). The preference is applied pre-paint by the
   inline script in base.html and toggled by initSidebarFooter(). */
@media (min-width: 769px) {
    html.portal-sidebar-collapsed .portal-sidebar { width: 64px; padding-left: 10px; padding-right: 10px; }
    html.portal-sidebar-collapsed .portal-sidebar-header { justify-content: center; padding: 6px 0 22px; }
    html.portal-sidebar-collapsed .portal-sidebar-brand,
    html.portal-sidebar-collapsed .portal-sidebar-plan { display: none; }
    html.portal-sidebar-collapsed .portal-sidebar-link,
    html.portal-sidebar-collapsed .portal-sidebar-footer-link,
    html.portal-sidebar-collapsed .portal-sidebar-profile-trigger { justify-content: center; padding: 0; min-height: 40px; }
    html.portal-sidebar-collapsed .portal-sidebar-link span,
    html.portal-sidebar-collapsed .portal-sidebar-footer-link > span,
    html.portal-sidebar-collapsed .portal-sidebar-profile-text,
    html.portal-sidebar-collapsed .portal-sidebar-chevron { display: none; }
    html.portal-sidebar-collapsed .portal-sidebar-profile-menu {
        left: calc(100% + 8px);
        right: auto;
        bottom: 0;
        width: 220px;
    }
}

/* ----------------------------- Page content ----------------------------- */
.dash-page { max-width: 1040px; margin: 0 auto; padding: 40px clamp(16px, 4vw, 48px) 64px; }
.dash-header, .panel-header-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}
.dash-header { margin-bottom: 28px; }
/* Usage › key filter: Explore's pill menu, with a name + masked key per option. */
.usage-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.usage-get-key { min-height: 36px; padding: 0 16px; font-size: 14px; text-decoration: none; }
.usage-get-key:hover { text-decoration: none; }
.usage-key-dd .ex-dd__pop { width: 300px; }
.usage-key-opt { display: grid; gap: 2px; }
.usage-key-opt__name { font-size: 14px; }
.usage-key-opt__key { font-family: var(--tw-mono); font-size: 12px; font-weight: 400; color: var(--tw-muted); }
.dash-subtitle { margin-top: 6px; font-size: 15px; color: var(--tw-muted); }
.panel-header-row { align-items: center; margin-bottom: 16px; }
.panel-header-row h2 { margin: 0; }
.panel-header-row .tw-more { font-size: 13.5px; }

.panel {
    margin-bottom: 20px;
    padding: 22px 24px;
    background: var(--tw-bg);
    border: 1px solid var(--tw-line);
    border-radius: var(--tw-radius-lg);
}
.panel > h2 { margin-bottom: 14px; }
.panel--table { padding: 8px 12px; }

.panel-subheading {
    margin: 28px 0 12px;
    padding-top: 22px;
    border-top: 1px solid var(--tw-line);
    font-size: 15px;
}

/* Summary strip: one bordered row with hairline dividers. */
.dash-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 20px;
    border: 1px solid var(--tw-line);
    border-radius: var(--tw-radius-lg);
    overflow: hidden;
}
.dash-stats-row:empty { display: none; }
.dash-stats-row > .panel-loading,
.dash-stats-row > .panel-error { padding: 20px 24px; }
.dash-stat-tile { padding: 20px 24px; border-left: 1px solid var(--tw-line); margin-left: -1px; }
.dash-stat-label { margin: 0; font-size: 13px; color: var(--tw-muted); }
.dash-stat-value {
    margin: 6px 0 0;
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.dash-stat-quota { font-size: 15px; font-weight: 400; letter-spacing: 0; color: var(--tw-muted); }
.dash-stat-sub { margin: 6px 0 0; font-size: 12.5px; color: var(--tw-muted); }
.dash-stat-sub a { font-weight: 600; }
.dash-quota-bar { height: 4px; margin-top: 12px; border-radius: 4px; background: var(--tw-bg-3); overflow: hidden; }
.dash-quota-bar__fill { height: 100%; background: var(--tw-text); border-radius: inherit; }
.dash-stat-tile--warning .dash-quota-bar__fill { background: var(--tw-danger); }
.dash-stat-sub--warning { color: var(--tw-danger); font-weight: 600; }

.dash-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}
/* Side by side the Quickstart column drops under ~380px, too narrow for code. */
@container portal-main (max-width: 1000px) {
    .dash-columns { grid-template-columns: minmax(0, 1fr); }
}
/* Copyable snippets wrap rather than hide behind a sideways scroll. */
#quickstart-panel .tw-code { white-space: pre-wrap; overflow-wrap: anywhere; }
.dash-columns .panel { margin-bottom: 0; }

/* ----------------------------- Usage chart ----------------------------- */
.usage-bars { position: relative; display: flex; align-items: flex-end; gap: 6px; height: 170px; margin-top: 8px; }
.usage-bars--tall { height: 240px; }
.usage-bars > .portal-empty { margin: auto; text-align: center; max-width: 34ch; }
.usage-bar {
    flex: 1;
    min-height: 2px;
    background: var(--tw-bg-3);
    border-radius: 4px;
    cursor: default;
    transition: background-color var(--tw-ease);
}
.usage-bar--latest { background: var(--tw-signal); }
.usage-bar:hover { background: var(--tw-graphite); }
.usage-bars-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 12px;
    color: var(--tw-muted);
}
.usage-tooltip {
    position: absolute;
    padding: 5px 10px;
    background: var(--tw-graphite);
    color: #fff;
    border-radius: var(--tw-radius-sm);
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 5;
}

/* ----------------------------- Code ----------------------------- */
.code-block { position: relative; margin: 14px 0; }
.code-block pre {
    margin: 0;
    padding: 16px 70px 16px 18px;
    background: var(--tw-graphite);
    color: #e5e5ea;
    border-radius: var(--tw-radius-md);
    font-size: 12.5px;
    line-height: 1.7;
    white-space: pre;
    overflow-x: auto;
}
.code-block .btn-copy {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--tw-graphite-3);
    color: var(--tw-on-dark);
}
.code-block .btn-copy:hover:not(:disabled) { background: #4a4a4d; }
.code-block .btn-copy:disabled { color: var(--tw-signal); }

.quickstart-sdk-row {
    display: grid;
    gap: 4px;
    padding: 12px 0;
    border-top: 1px solid var(--tw-line);
    font-size: 13.5px;
}
.snip + .quickstart-sdk-row { margin-top: 16px; }
.quickstart-sdk-row:last-child { padding-bottom: 0; }
.quickstart-sdk-row__label { font-size: 12px; font-weight: 600; color: var(--tw-muted); }
.quickstart-sdk-row__cmd { display: flex; align-items: center; gap: 10px; }
.quickstart-sdk-row code { flex: 1; min-width: 0; font-size: 12.5px; overflow-wrap: anywhere; }

/* ----------------------------- API keys ----------------------------- */
table#keys-table { width: 100%; border-collapse: collapse; }
#keys-table th, #keys-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--tw-line);
    text-align: left;
    font-size: 14px;
    vertical-align: middle;
}
#keys-table th { padding-top: 12px; padding-bottom: 12px; font-size: 12.5px; font-weight: 400; color: var(--tw-muted); }
#keys-table tbody tr:last-child td { border-bottom: 0; }
#keys-table td:nth-child(3), #keys-table td:nth-child(4) { color: var(--tw-muted); }
#keys-table td:nth-child(5) { font-variant-numeric: tabular-nums; }
#keys-table tr.key-row--revoked td { color: var(--tw-faint); }
#keys-table tr.key-row--revoked .btn-copy { display: none; }
.key-prefix-cell { display: flex; align-items: center; gap: 8px; font-family: var(--tw-mono); font-size: 13px; }
.key-mask { margin-left: -8px; color: var(--tw-faint); letter-spacing: 0.08em; }
.key-status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--tw-muted); }
.key-actions { text-align: right; white-space: nowrap; }
.key-actions .btn-secondary, .key-actions .btn-danger { min-height: 32px; font-size: 13px; }
.key-actions .btn-danger { margin-left: 2px; }

.new-key-box {
    margin-bottom: 20px;
    padding: 20px 22px;
    background: var(--tw-graphite);
    color: var(--tw-on-dark);
    border-radius: var(--tw-radius-lg);
}
.new-key-box { position: relative; }
.new-key-dismiss {
    position: absolute;
    top: 14px;
    right: 14px;
    min-height: 32px;
    padding: 0 12px;
    background: transparent;
    border: 0;
    border-radius: var(--tw-pill);
    color: var(--tw-on-dark-muted);
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
}
.new-key-dismiss:hover { color: var(--tw-on-dark); background: var(--tw-graphite-2); }
.new-key-title { font-size: 15px; font-weight: 600; }
.new-key-hint { margin-top: 2px; font-size: 13px; color: var(--tw-on-dark-muted); }
.new-key-value {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding: 10px 10px 10px 14px;
    background: var(--tw-graphite-2);
    border-radius: var(--tw-radius);
}
.new-key-value code { font-size: 13.5px; overflow-wrap: anywhere; }
.new-key-box .btn-copy { background: #fff; color: var(--tw-text); flex-shrink: 0; }
.new-key-box .btn-copy:disabled { color: var(--tw-link); }

/* ----------------------------- Billing ----------------------------- */
.billing-intro { margin-bottom: 20px; font-size: 15px; color: var(--tw-muted); }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.plan-grid--single { max-width: 360px; }
.plan-card {
    display: flex;
    flex-direction: column;
    min-height: 260px;
    padding: 24px;
    border: 1px solid var(--tw-line);
    border-radius: 20px;
}
.plan-card--current { background: var(--tw-bg-2); border-color: transparent; }
.plan-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan-card-head h2 { font-size: 20px; }
.plan-card-badge {
    padding: 3px 10px;
    border-radius: var(--tw-pill);
    background: var(--tw-bg);
    color: var(--tw-muted);
    font-size: 12px;
}
.plan-card-quota {
    margin-top: 18px;
    font-size: 34px;
    font-weight: 600;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}
.plan-card-quota span { font-size: 14px; font-weight: 400; letter-spacing: 0; color: var(--tw-muted); }
.plan-card-features { display: grid; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--tw-text-2); }
.plan-card-features li::before { content: "✓"; margin-right: 8px; color: var(--tw-link); font-weight: 600; }
.billing-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 22px; }
.billing-actions button { width: 100%; min-height: 42px; }
.billing-manage {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 20px;
    padding: 22px 24px;
    border: 1px solid var(--tw-line);
    border-radius: var(--tw-radius-lg);
}
.billing-manage p { margin-top: 4px; font-size: 14px; color: var(--tw-muted); }

/* ----------------------------- Account ----------------------------- */
.account-field {
    display: grid;
    grid-template-columns: 200px minmax(0, 420px);
    align-items: center;
    gap: 8px 24px;
    padding: 12px 0;
    border-top: 1px solid var(--tw-line);
    font-size: 14px;
}
.panel > h2 + .account-field, .panel-subheading + .account-field { border-top: 0; }
.account-field label { font-weight: 600; }
.account-field input {
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    background: var(--tw-bg);
    border: 1px solid var(--tw-line-2);
    border-radius: var(--tw-radius);
    color: var(--tw-text);
    font: inherit;
    font-size: 15px;
}
.account-field input:focus { outline: none; border-color: var(--tw-text); box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.07); }
.account-field input:disabled { background: var(--tw-bg-2); color: var(--tw-muted); border-color: transparent; }
.account-field + button, .account-field ~ button { margin-top: 12px; }
#account-panel > p { margin-top: 16px; font-size: 14px; color: var(--tw-muted); }

/* ----------------------------- Dialogs ----------------------------- */
.portal-dialog-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.32); z-index: 100; }
.portal-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 101;
    width: calc(100% - 32px);
    max-width: 380px;
    padding: 24px;
    background: var(--tw-bg);
    border-radius: var(--tw-radius-xl);
    box-shadow: var(--tw-shadow-pop);
}
.portal-dialog h2 { margin: 0 0 8px; font-size: 19px; }
.portal-dialog p { margin: 0 0 18px; font-size: 14.5px; color: var(--tw-muted); }
.portal-dialog-input {
    width: 100%;
    min-height: 44px;
    margin-bottom: 18px;
    padding: 0 14px;
    border: 1px solid var(--tw-line-2);
    border-radius: var(--tw-radius);
    color: var(--tw-text);
    font: inherit;
    font-size: 15px;
}
.portal-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Phones: each key becomes a stacked card so Rotate/Revoke stay on screen
   instead of behind a sideways scroll. */
@media (max-width: 640px) {
    #keys-table thead { display: none; }
    #keys-table, #keys-table tbody { display: block; }
    #keys-table tr { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; padding: 16px 0; border-bottom: 1px solid var(--tw-line); }
    #keys-table tbody tr:last-child { border-bottom: 0; }
    #keys-table td { display: contents; }
    #keys-table td[data-label]::before { content: attr(data-label); color: var(--tw-muted); font-size: 13px; }
    #keys-table td:first-child > .key-prefix-cell { grid-column: 1 / -1; }
    #keys-table td.key-actions { display: flex; grid-column: 1 / -1; gap: 8px; margin-top: 6px; padding: 0; border: 0; text-align: left; }
    #keys-table td.key-actions:empty { display: none; }
}

/* Phone bottom bar swaps in shorter nav labels so none wrap. */
.nav-label--short { display: none; }

/* ----------------------------- Responsive ----------------------------- */
@media (max-width: 860px) {
    /* minmax(0, …): a bare 1fr track grows to its <pre>'s min-content and
       pushes panels past the viewport on phones. */
    .dash-columns { grid-template-columns: minmax(0, 1fr); }
    .account-field { grid-template-columns: minmax(0, 1fr); }
    #keys-table th:nth-child(3), #keys-table td:nth-child(3),
    #keys-table th:nth-child(4), #keys-table td:nth-child(4) { display: none; }
}

/* Phone: the sidebar becomes a bottom tab bar. */
@media (max-width: 768px) {
    .portal-shell { flex-direction: column; }
    .portal-sidebar {
        order: 2;
        width: 100%;
        height: auto;
        flex-direction: row;
        padding: 0;
        border-right: 0;
        border-top: 1px solid var(--tw-line);
        background: rgba(255, 255, 255, 0.94);
        -webkit-backdrop-filter: saturate(180%) blur(20px);
        backdrop-filter: saturate(180%) blur(20px);
        overflow: visible;
    }
    .portal-sidebar-header, .portal-sidebar-footer-link, .portal-sidebar-plan { display: none; }
    .portal-sidebar-nav { flex-direction: row; justify-content: space-around; gap: 0; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
    .portal-sidebar-link {
        flex: 1;
        flex-direction: column;
        gap: 3px;
        min-height: 48px;
        padding: 4px 2px;
        font-size: 10.5px;
        color: var(--tw-faint);
        justify-content: center;
    }
    .portal-sidebar-link svg { width: 20px; height: 20px; }
    .portal-sidebar-link span { white-space: nowrap; }
    .portal-sidebar-link .nav-label--full { display: none; }
    .portal-sidebar-link .nav-label--short { display: inline; }
    .portal-sidebar-link.active { background: none; box-shadow: none; color: var(--tw-text); }
    .portal-sidebar-profile-trigger.is-current { background: none; box-shadow: inset 0 0 0 2px var(--tw-text); }
    .portal-sidebar-footer { margin: 0; justify-content: center; padding-right: 8px; }
    .portal-sidebar-profile-trigger { padding: 6px; }
    .portal-sidebar-profile-text, .portal-sidebar-chevron { display: none; }
    .portal-sidebar-profile-menu { left: auto; right: 0; bottom: calc(100% + 8px); min-width: 220px; }
    .portal-main { height: auto; flex: 1; }
    .dash-page { padding-top: 28px; }
    h1 { font-size: 28px; }
    .dash-header { flex-wrap: wrap; align-items: flex-start; }
    .dash-stats-row { grid-template-columns: 1fr 1fr; }
    .dash-stat-tile { border-top: 1px solid var(--tw-line); margin-top: -1px; }
    .dash-stat-tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .dash-stat-value { font-size: 24px; }
    .billing-manage { flex-direction: column; align-items: flex-start; }
    .panel--table { overflow-x: auto; }
}

@media (max-width: 480px) {
    .auth-card { padding: 20px; }
    .auth-card-links { flex-direction: column; align-items: center; gap: 10px; }
    .portal-auth-top__link { display: none; }
}

/* ---------------------- Recent requests + segmented control ---------------------- */
.panel-sub { margin: 4px 0 0; color: var(--tw-muted); font-size: 13.5px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--tw-bg-2); border-radius: 999px; flex-shrink: 0; }
.seg button {
    min-height: 30px; padding: 0 14px; border: 0; border-radius: 999px;
    background: transparent; color: var(--tw-muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.seg button.is-active { background: #fff; color: var(--tw-text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.table-scroll { overflow-x: auto; }
.req-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
/* Fixed layout: the request path takes whatever is left and truncates, so the
   table never runs wider than its panel. */
.req-table { table-layout: fixed; }
.req-table th:nth-child(1) { width: 168px; }
.req-table th:nth-child(3) { width: 72px; }
.req-table th:nth-child(4) { width: 96px; }
.req-table th:nth-child(5) { width: 150px; }
.req-table th, .req-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--tw-line); white-space: nowrap; }
.req-table th { font-size: 12.5px; font-weight: 400; color: var(--tw-muted); }
.req-table tbody tr:last-child td { border-bottom: 0; }
.req-when, .req-ms { color: var(--tw-muted); font-variant-numeric: tabular-nums; }
.req-path code, .req-key code {
    display: block; overflow: hidden; text-overflow: ellipsis;
    font-family: var(--tw-mono); font-size: 12.5px; background: none; padding: 0;
}
.req-status {
    display: inline-flex; min-width: 40px; justify-content: center; padding: 2px 8px; border-radius: 999px;
    font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.req-status--ok { background: rgba(10, 215, 143, 0.14); color: var(--tw-link); }
.req-status--warn { background: #fff4e0; color: #8a5300; }
.req-status--error { background: var(--tw-danger-bg); color: var(--tw-danger); }
.req-pager {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--tw-line);
}
.req-pager__range { font-size: 13px; color: var(--tw-muted); font-variant-numeric: tabular-nums; }
.req-pager__buttons { display: flex; gap: 8px; }
.req-pager .btn-secondary { min-height: 34px; font-size: 13.5px; }
@container portal-main (max-width: 860px) {
    .req-table th:nth-child(5), .req-table td:nth-child(5) { display: none; }
}
@container portal-main (max-width: 600px) {
    .req-table th:nth-child(4), .req-table td:nth-child(4) { display: none; }
    .req-table th:nth-child(1) { width: 112px; }
    .req-when { white-space: normal; }
}

/* ------------------------------ Playground ------------------------------ */
.play-no-key { display: grid; justify-items: start; gap: 10px; padding: 16px; border-radius: var(--tw-radius-md); background: var(--tw-bg-2); }
.play-no-key p { font-size: 14px; color: var(--tw-text-2); }
.play { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; align-items: start; }
.play .panel { margin-bottom: 0; }
.play-request h2 { margin: 0 0 18px; }
.play-request .tw-label { margin-top: 18px; }
.play-request .tw-label:first-of-type { margin-top: 0; }
.play-hint { margin: 8px 0 0; color: var(--tw-muted); font-size: 13px; line-height: 1.5; }
.play-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.play-presets button {
    min-height: 30px; padding: 0 12px; border: 1px solid var(--tw-line-2); border-radius: 999px;
    background: #fff; color: var(--tw-text); font: inherit; font-size: 13px; cursor: pointer;
}
.play-presets button:hover { background: var(--tw-bg-2); }
.play-line { display: flex; align-items: stretch; gap: 8px; }
.play-method {
    display: inline-flex; align-items: center; padding: 0 12px; border-radius: var(--tw-radius-sm);
    background: var(--tw-bg-2); font-family: var(--tw-mono); font-size: 12.5px; font-weight: 600;
}
.play-line .tw-input { font-family: var(--tw-mono); font-size: 13px; }
.play-actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; }
.play-meta { display: flex; align-items: center; gap: 10px; color: var(--tw-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.play-headers dl { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 14px; font-size: 12.5px; }
.play-headers dl div { display: flex; gap: 6px; }
.play-headers dt { color: var(--tw-muted); font-family: var(--tw-mono); }
.play-headers dd { margin: 0; font-family: var(--tw-mono); font-variant-numeric: tabular-nums; }
.play-body { max-height: 560px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
@container portal-main (max-width: 820px) {
    .play { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------------- Public pages: guides + changelog ---------------------- */
.pub { min-height: 100vh; display: flex; flex-direction: column; background: var(--tw-bg); }
.pub-top {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    min-height: 56px; padding: 0 clamp(16px, 4vw, 40px);
    background: rgba(255, 255, 255, 0.84);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--tw-line);
}
.pub-nav { display: flex; align-items: center; gap: 22px; font-size: 13.5px; }
.pub-nav a { color: var(--tw-muted); }
.pub-nav a:hover { color: var(--tw-text); text-decoration: none; }
.pub-nav a[aria-current="page"] { color: var(--tw-text); font-weight: 600; }
.pub-nav .pub-cta {
    display: inline-flex; align-items: center; min-height: 34px; padding: 0 16px;
    border-radius: var(--tw-pill); background: var(--tw-graphite); color: #fff; font-weight: 600;
}
.pub-nav .pub-cta:hover { background: #000; color: #fff; }
.pub-main { flex: 1; width: 100%; }
.pub-main:focus { outline: none; }
.pub-foot {
    display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center;
    padding: 28px clamp(16px, 4vw, 40px); border-top: 1px solid var(--tw-line);
    font-size: 12.5px; color: var(--tw-muted);
}
.pub-foot a { color: var(--tw-muted); }

.pub-head { max-width: 760px; margin: 0 auto; padding: clamp(56px, 9vw, 88px) clamp(20px, 4vw, 40px) clamp(28px, 4vw, 40px); text-align: center; }
.pub-head h1 { font-size: clamp(36px, 5.6vw, 56px); letter-spacing: -0.035em; }
.pub-head p { margin-top: 12px; font-size: clamp(17px, 2vw, 19px); color: var(--tw-muted); }
.pub-chip {
    align-self: flex-start; display: inline-flex; padding: 4px 11px; border-radius: var(--tw-pill);
    background: var(--tw-bg-2); color: var(--tw-muted); font-size: 12.5px;
}
.pub-meta { display: inline-flex; gap: 14px; font-size: 13px; color: var(--tw-muted); }

.pub-guides {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px;
    max-width: 1080px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); list-style: none;
}
.pub-guides > li { display: flex; }
.pub-guide-card {
    display: flex; flex-direction: column; gap: 8px; width: 100%; padding: 22px;
    border: 1px solid var(--tw-line); border-radius: var(--tw-radius-xl);
    background: var(--tw-bg); color: var(--tw-text); transition: box-shadow var(--tw-ease);
}
.pub-guide-card:hover { text-decoration: none; box-shadow: var(--tw-shadow-card); }
.pub-guide-card h2 { margin-top: 6px; font-size: 19px; letter-spacing: -0.02em; line-height: 1.2; }
.pub-guide-card p { font-size: 14px; line-height: 1.5; color: var(--tw-muted); }
.pub-guide-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 12px; }
.pub-guide-card__action { font-size: 14px; font-weight: 600; color: var(--tw-link); }
@media (min-width: 900px) {
    .pub-guides > li.is-lead { grid-column: span 2; }
    .pub-guides > li.is-lead .pub-guide-card { justify-content: center; padding: 32px; background: var(--tw-graphite); color: var(--tw-on-dark); border-color: transparent; }
    .pub-guides > li.is-lead .pub-chip { background: var(--tw-graphite-2); color: var(--tw-on-dark-muted); }
    .pub-guides > li.is-lead h2 { font-size: 28px; }
    .pub-guides > li.is-lead p, .pub-guides > li.is-lead .pub-meta { color: var(--tw-on-dark-muted); }
    .pub-guides > li.is-lead .pub-guide-card__action { color: var(--tw-signal); }
}
.pub-band {
    display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
    max-width: 1000px; margin: clamp(48px, 7vw, 72px) auto clamp(64px, 9vw, 96px);
    padding: 28px; border-radius: var(--tw-radius-xl); background: var(--tw-bg-2);
    width: calc(100% - 2 * clamp(16px, 4vw, 40px));
}
.pub-band h2 { font-size: 20px; letter-spacing: -0.015em; }
.pub-band p { margin-top: 4px; color: var(--tw-muted); font-size: 14.5px; }

.pub-guide {
    display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(32px, 5vw, 56px);
    max-width: 1080px; margin: 0 auto;
    padding: clamp(40px, 6vw, 56px) clamp(16px, 4vw, 40px) clamp(72px, 10vw, 96px);
}
.pub-guide__main { min-width: 0; overflow-wrap: anywhere; }
.pub-crumb { font-size: 13px; color: var(--tw-muted); }
.pub-crumb a { color: var(--tw-muted); }
.pub-guide__main h1 { margin-top: 10px; font-size: clamp(32px, 4.6vw, 46px); line-height: 1.06; letter-spacing: -0.03em; text-wrap: balance; }
.pub-lede { margin-top: 12px; font-size: 19px; line-height: 1.45; color: var(--tw-muted); }
.pub-guide__meta { margin-top: 16px; }
.pub-steps { list-style: none; margin: 28px 0 0; padding: 28px 0 0; border-top: 1px solid var(--tw-line); counter-reset: step; }
.pub-step { position: relative; padding: 0 0 36px 62px; counter-increment: step; }
.pub-step::before {
    content: counter(step); position: absolute; left: 0; top: 0;
    width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: var(--tw-bg-2); font-weight: 600; font-size: 15px;
}
.pub-step:not(:last-child)::after {
    content: ""; position: absolute; left: 21px; top: 52px; bottom: 8px;
    width: 2px; border-radius: 2px; background: var(--tw-bg-3);
}
.pub-step h2 { padding-top: 9px; font-size: 22px; scroll-margin-top: 80px; }
.pub-step > p { margin-top: 8px; font-size: 16px; line-height: 1.6; color: var(--tw-text-2); }
.pub-step code, .pub-log code { font-size: 0.9em; padding: 1px 5px; border-radius: 5px; background: var(--tw-bg-2); }

.snip { margin-top: 16px; }
.snip-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; margin-bottom: 8px; }
.snip-tabs { display: flex; gap: 4px; }
.snip-tabs button {
    min-height: 28px; padding: 0 12px; border: 0; border-radius: var(--tw-pill);
    background: transparent; color: var(--tw-muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.snip-tabs button[aria-selected="true"] { background: var(--tw-bg-2); color: var(--tw-text); }
.snip-name { font-size: 13px; font-weight: 600; color: var(--tw-muted); padding-left: 2px; }
.snip-copy { margin-left: auto; }
.snip-pane + .snip-pane { margin-top: 12px; }
.snip-label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--tw-muted); }
.snip.is-tabbed .snip-label { display: none; }
.snip .tw-code { overflow-x: auto; white-space: pre; overflow-wrap: normal; }
.snip .tw-code code { padding: 0; background: none; font-size: inherit; }

.pub-guide__aside { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 80px; align-self: start; }
.pub-aside-card { display: block; padding: 20px; border-radius: 20px; background: var(--tw-bg-2); color: var(--tw-text); }
.pub-aside-card h2 { font-size: 16px; letter-spacing: -0.01em; }
.pub-aside-card p { margin-top: 6px; font-size: 13.5px; line-height: 1.5; color: var(--tw-muted); }
.pub-aside-card .tw-more { display: inline-block; margin-top: 10px; font-size: 13.5px; }
.pub-aside-card--dark { background: var(--tw-graphite); color: var(--tw-on-dark); }
.pub-aside-card--dark p { color: var(--tw-on-dark-muted); }
.pub-aside-card__button {
    display: inline-flex; align-items: center; margin-top: 12px; min-height: 36px; padding: 0 16px;
    border-radius: var(--tw-pill); background: #fff; color: var(--tw-text); font-size: 13.5px; font-weight: 600;
}
.pub-aside-card__button:hover { text-decoration: none; background: var(--tw-bg-2); }
.pub-aside-card--link { transition: background-color var(--tw-ease); }
.pub-aside-card--link:hover { text-decoration: none; background: var(--tw-bg-3); }
.pub-aside-card__label { display: block; margin-bottom: 4px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--tw-muted); }
.pub-aside-card__title { font-size: 15px; font-weight: 600; }

.pub-log { max-width: 760px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) clamp(72px, 10vw, 96px); list-style: none; }
.pub-log__entry { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 24px; padding: 28px 0; border-top: 1px solid var(--tw-line); }
.pub-log__date { font-size: 13.5px; color: var(--tw-muted); font-variant-numeric: tabular-nums; padding-top: 4px; }
.pub-log h2 { font-size: 20px; letter-spacing: -0.015em; }
.pub-log ul { margin: 12px 0 0; padding-left: 18px; }
.pub-log li li { margin-top: 8px; font-size: 15px; line-height: 1.55; color: var(--tw-text-2); }

@media (max-width: 900px) {
    .pub-guide { grid-template-columns: 1fr; }
    .pub-guide__aside { position: static; }
}
@media (max-width: 640px) {
    .pub-nav a:not(.pub-cta) { display: none; }
    .pub-top .tw-brandswitch-logo { height: 20px; }
    .pub-top .tw-brandswitch-trigger { gap: 8px; }
    .pub-nav .pub-cta { padding: 0 14px; white-space: nowrap; }
    /* Code samples wrap on phones instead of hiding most of each line. */
    .snip .tw-code { white-space: pre-wrap; overflow-wrap: anywhere; }
    .pub-step { padding-left: 0; }
    .pub-step::before { position: static; display: flex; margin-bottom: 10px; width: 36px; height: 36px; }
    .pub-step::after { display: none; }
    .pub-log__entry { grid-template-columns: 1fr; gap: 6px; }
}

/* ------------------------------ Webhooks ------------------------------ */
.wh-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; margin-top: 16px; }
.wh-field--wide { grid-column: 1 / -1; }
.wh-optional { font-weight: 400; color: var(--tw-faint); }
.wh-tags { display: flex; flex-direction: column; gap: 10px; }
.wh-tags .tw-input { max-width: 320px; }
.wh-actions { display: flex; gap: 10px; }
.wh-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wh-chip {
    display: inline-flex; align-items: center; gap: 4px; padding: 4px 11px; border-radius: var(--tw-pill);
    background: var(--tw-bg-2); color: var(--tw-text); font-size: 12.5px;
}
.wh-chip--muted { color: var(--tw-muted); }
.wh-chip__remove {
    border: 0; background: none; padding: 0 0 0 2px; cursor: pointer; color: var(--tw-muted); font: inherit; font-size: 14px; line-height: 1;
}
.wh-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.wh-card__head h2 { margin: 0 0 4px; }
.wh-url { font-family: var(--tw-mono); font-size: 12.5px; color: var(--tw-muted); overflow-wrap: anywhere; background: none; padding: 0; }
.wh-warning { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: var(--tw-danger-bg); color: var(--tw-danger); font-size: 13.5px; }
.wh-secret { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.wh-secret .tw-label { margin: 0 6px 0 0; }
.wh-secret code { font-family: var(--tw-mono); font-size: 12.5px; padding: 4px 8px; border-radius: 6px; background: var(--tw-bg-2); overflow-wrap: anywhere; }
.wh-card__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--tw-line); }
.wh-card__actions .btn-secondary, .wh-card__actions .btn-danger { min-height: 34px; font-size: 13.5px; }
.wh-card__actions .btn-danger { margin-left: auto; }
.wh-deliveries { margin-top: 16px; }
.wh-err { color: var(--tw-danger); font-size: 12.5px; white-space: normal; }
.wh-limit { margin: 0 0 20px; color: var(--tw-muted); font-size: 13.5px; }
.wh-help ul { margin: 10px 0 14px; padding-left: 18px; color: var(--tw-text-2); font-size: 14px; line-height: 1.6; }
.wh-help li + li { margin-top: 6px; }
.wh-help code { font-size: 12.5px; padding: 1px 5px; border-radius: 5px; background: var(--tw-bg-2); }
@media (max-width: 720px) {
    .wh-form { grid-template-columns: 1fr; }
    .wh-card__actions .btn-danger { margin-left: 0; }
}

/* Coming-soon page: centred chip + a single action under the lede. */
.pub-chip--center { align-self: center; }
.pub-cta-row { display: flex; justify-content: center; margin-top: 28px; }

/* --- Analytics consent (anonymous visitors only) ------------------------ */
.portal-consent {
    position: fixed; left: 50%; transform: translateX(-50%);
    bottom: clamp(12px, 3vw, 24px); z-index: 50;
    display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
    width: min(680px, calc(100vw - 2 * clamp(12px, 4vw, 32px)));
    padding: 16px 20px;
    background: var(--tw-bg); border: 1px solid var(--tw-line-2);
    border-radius: var(--tw-radius-lg); box-shadow: var(--tw-shadow-pop);
}
.portal-consent[hidden] { display: none; }
.portal-consent__text { flex: 1 1 320px; font-size: 14px; line-height: 1.45; color: var(--tw-text-2); }
.portal-consent__actions { display: flex; align-items: center; gap: 14px; }
.portal-consent__decline {
    border: 0; background: none; padding: 0; cursor: pointer;
    font: inherit; font-size: 14px; color: var(--tw-muted);
}
.portal-consent__decline:hover { color: var(--tw-text); text-decoration: underline; }
@media (max-width: 560px) {
    .portal-consent { flex-direction: column; align-items: stretch; gap: 14px; }
    .portal-consent__actions { justify-content: space-between; }
}

/* ------------------------------ Docs home ------------------------------ */
.docs-home {
    display: flex; flex-direction: column; gap: clamp(40px, 6vw, 64px);
    max-width: 1080px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) clamp(64px, 9vw, 96px);
}
.docs-start {
    display: grid; gap: 8px; padding: clamp(24px, 4vw, 36px);
    border-radius: var(--tw-radius-xl); background: var(--tw-graphite); color: var(--tw-on-dark);
}
.docs-start:hover { text-decoration: none; }
.docs-start__eyebrow { font-size: 13px; font-weight: 600; color: var(--tw-signal); }
.docs-start__title { font-size: clamp(24px, 3.4vw, 32px); font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; }
.docs-start__text { max-width: 56ch; font-size: 15.5px; line-height: 1.5; color: var(--tw-on-dark-muted); }
.docs-start__action { margin-top: 8px; font-size: 14.5px; font-weight: 600; color: var(--tw-signal); }
.docs-start:hover .docs-start__action { text-decoration: underline; }

.docs-section__head { margin-bottom: 18px; }
.docs-section__head h2 { font-size: 24px; letter-spacing: -0.02em; }
.docs-section__head p { margin-top: 6px; font-size: 15px; color: var(--tw-muted); }
.docs-concepts {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px;
    margin: 0; padding: 0; list-style: none;
}
.docs-concepts > li { display: flex; }
.docs-concept {
    display: grid; align-content: start; gap: 4px; width: 100%; padding: 18px 20px;
    border: 1px solid var(--tw-line); border-radius: var(--tw-radius-lg); color: var(--tw-text);
    transition: box-shadow var(--tw-ease), border-color var(--tw-ease);
}
.docs-concept:hover { text-decoration: none; border-color: transparent; box-shadow: var(--tw-shadow-card); }
.docs-concept__title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.docs-concept__title::after { content: " ›"; color: var(--tw-muted); }
.docs-concept__text { font-size: 14px; line-height: 1.5; color: var(--tw-muted); }

.docs-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.docs-tile {
    display: flex; flex-direction: column; gap: 6px; padding: 22px;
    border-radius: var(--tw-radius-lg); background: var(--tw-bg-2); color: var(--tw-text);
}
.docs-tile:hover { text-decoration: none; background: var(--tw-bg-3); }
.docs-tile__title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.docs-tile__text { font-size: 14px; line-height: 1.5; color: var(--tw-muted); }
.docs-tile__action { margin-top: auto; padding-top: 10px; font-size: 14px; font-weight: 600; color: var(--tw-link); }

/* ---------------------------- Concept pages ---------------------------- */
.doc-layout {
    display: grid; grid-template-columns: 200px minmax(0, 720px); gap: clamp(32px, 5vw, 64px);
    justify-content: center; max-width: 1080px; margin: 0 auto;
    padding: clamp(40px, 6vw, 56px) clamp(16px, 4vw, 40px) clamp(72px, 10vw, 96px);
}
.doc-rail { position: sticky; top: 80px; align-self: start; }
.doc-rail__title { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--tw-muted); }
.doc-rail__list { margin: 0 0 24px; padding: 0; list-style: none; }
.doc-rail__list a {
    display: block; padding: 6px 10px; margin-left: -10px; border-radius: var(--tw-radius-sm);
    font-size: 14px; color: var(--tw-text-2);
}
.doc-rail__list a:hover { text-decoration: none; background: var(--tw-bg-2); }
.doc-rail__list a[aria-current="page"] { background: var(--tw-bg-2); color: var(--tw-text); font-weight: 600; }

.doc-article { min-width: 0; overflow-wrap: anywhere; }
.doc-article h1 { margin-top: 10px; font-size: clamp(32px, 4.6vw, 44px); line-height: 1.06; letter-spacing: -0.03em; text-wrap: balance; }
.doc-section { margin-top: 36px; }
.doc-section:first-of-type { padding-top: 28px; border-top: 1px solid var(--tw-line); }
.doc-section h2 { font-size: 21px; letter-spacing: -0.015em; scroll-margin-top: 80px; }
.doc-body { margin-top: 8px; font-size: 16px; line-height: 1.65; color: var(--tw-text-2); }
.doc-body code { font-size: 0.88em; padding: 1px 5px; border-radius: 5px; background: var(--tw-bg-2); overflow-wrap: anywhere; }
.doc-body strong { color: var(--tw-text); }

.doc-table { width: 100%; margin-top: 16px; border-collapse: collapse; font-size: 14px; line-height: 1.45; }
.doc-table th { padding: 8px 12px 8px 0; text-align: left; font-size: 12.5px; font-weight: 400; color: var(--tw-muted); border-bottom: 1px solid var(--tw-line); }
.doc-table td { padding: 10px 12px 10px 0; vertical-align: top; border-bottom: 1px solid var(--tw-line); }
.doc-table tbody tr:last-child td { border-bottom: 0; }
.doc-table td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; }

.doc-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--tw-line); }
.doc-pager__link {
    display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--tw-line); border-radius: var(--tw-radius-md);
    font-size: 15px; font-weight: 600; color: var(--tw-text);
}
.doc-pager__link span { font-size: 12.5px; font-weight: 400; color: var(--tw-muted); }
.doc-pager__link:hover { text-decoration: none; border-color: transparent; box-shadow: var(--tw-shadow-card); }
.doc-pager__link--next { text-align: right; }

/* Below ~860px the rail becomes a wrapping row of links above the article. */
@media (max-width: 860px) {
    .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .doc-rail { position: static; margin-bottom: 28px; padding-bottom: 16px; border-bottom: 1px solid var(--tw-line); }
    .doc-rail__title { display: none; }
    .doc-rail__list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
    .doc-rail__list + .doc-rail__title + .doc-rail__list { display: none; }
    .doc-rail__list a { margin: 0; padding: 6px 12px; border: 1px solid var(--tw-line); border-radius: var(--tw-pill); font-size: 13.5px; }
}
@media (max-width: 560px) {
    /* Error codes stack above their meaning so a code never breaks mid-word. */
    .doc-table--codes thead { display: none; }
    .doc-table--codes, .doc-table--codes tbody { display: block; }
    .doc-table--codes tr { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; padding: 10px 0; border-bottom: 1px solid var(--tw-line); }
    .doc-table--codes tbody tr:last-child { border-bottom: 0; }
    .doc-table--codes td { padding: 0; border: 0; }
    .doc-table--codes td:nth-child(1) { color: var(--tw-muted); }
    .doc-table--codes td:nth-child(3) { grid-column: 1 / -1; }
    .doc-table--codes code { overflow-wrap: normal; white-space: nowrap; }
    .doc-pager { grid-template-columns: minmax(0, 1fr); }
    .doc-pager__link--next { text-align: left; }
}

/* ------------------------------ Explore ------------------------------ */
.ex-filters { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.ex-toprow { display: flex; align-items: center; gap: 12px; }
.ex-search { position: relative; flex: 1; min-width: 0; }
.ex-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--tw-faint); pointer-events: none; }
.ex-search .tw-input { padding-left: 40px; border-radius: var(--tw-pill); background: var(--tw-bg-2); border-color: transparent; }
.ex-search .tw-input:focus { background: var(--tw-bg); border-color: var(--tw-text); }
.ex-view button { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; padding: 0 10px; }

.ex-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ex-dd { position: relative; display: inline-flex; align-items: center; }
.ex-dd__btn {
    display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px 0 15px;
    border: 1px solid var(--tw-line-2); border-radius: var(--tw-pill); background: var(--tw-bg);
    color: var(--tw-text); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
    max-width: 260px; transition: background var(--tw-ease), border-color var(--tw-ease);
}
.ex-dd__btn:hover { background: var(--tw-bg-2); }
.ex-dd__btn:focus-visible { outline: 2px solid var(--tw-text); outline-offset: 2px; }
.ex-dd__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-dd__chev { flex-shrink: 0; color: var(--tw-muted); transition: transform var(--tw-ease); }
.ex-dd.is-open .ex-dd__chev { transform: rotate(180deg); }
.ex-dd.is-set .ex-dd__btn { background: var(--tw-text); border-color: var(--tw-text); color: var(--tw-bg); padding-right: 34px; }
.ex-dd.is-set .ex-dd__chev { display: none; }
.ex-dd__x {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
    border: 0; border-radius: var(--tw-pill); background: rgba(255, 255, 255, 0.16); color: var(--tw-bg); cursor: pointer;
}
.ex-dd__x[hidden], .ex-dd__pop[hidden] { display: none; }
.ex-dd__x:hover { background: rgba(255, 255, 255, 0.3); }
.ex-dd__pop {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: 280px; max-width: calc(100vw - 32px);
    padding: 6px; border-radius: var(--tw-radius-md); background: var(--tw-bg); box-shadow: var(--tw-shadow-pop);
}
.ex-dd__pop.is-right { left: auto; right: 0; }
.ex-dd__search {
    width: 100%; min-height: 36px; margin-bottom: 4px; padding: 0 12px; border: 0; border-radius: var(--tw-radius-sm);
    background: var(--tw-bg-2); color: var(--tw-text); font: inherit; font-size: 14px;
}
.ex-dd__search:focus { outline: 2px solid var(--tw-text); outline-offset: -2px; }
.ex-dd__list { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; overscroll-behavior: contain; }
.ex-dd__opt {
    position: relative; padding: 8px 32px 8px 10px; border-radius: var(--tw-radius-sm); font-size: 14px; cursor: pointer;
}
.ex-dd__opt:hover, .ex-dd__opt:focus { background: var(--tw-bg-2); outline: none; }
.ex-dd__opt[aria-selected="true"] { font-weight: 600; }
.ex-dd__opt[aria-selected="true"]::after {
    content: ""; position: absolute; right: 12px; top: 50%; width: 5px; height: 10px; margin-top: -7px;
    border: solid var(--tw-text); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.ex-dd__group { padding: 10px 10px 4px; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; color: var(--tw-faint); }
.ex-dd__none { padding: 10px; font-size: 13.5px; color: var(--tw-muted); }
.ex-clear { border: 0; background: none; padding: 6px 8px; color: var(--tw-link); font: inherit; font-size: 14px; cursor: pointer; }
.ex-clear:hover { text-decoration: underline; }
.ex-status { min-height: 20px; margin: 0 0 12px; color: var(--tw-muted); font-size: 13.5px; }

.ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.ex-grid[aria-busy="true"] { opacity: 0.55; transition: opacity var(--tw-ease); }
.ex-card {
    display: flex; flex-direction: column; min-width: 0; padding: 0; border: 1px solid var(--tw-line);
    border-radius: var(--tw-radius-md); background: var(--tw-bg); overflow: hidden; text-align: left;
    font: inherit; color: var(--tw-text); cursor: pointer;
    transition: box-shadow var(--tw-ease), transform var(--tw-ease);
}
.ex-card:hover { box-shadow: var(--tw-shadow-card); transform: translateY(-1px); }
.ex-card:focus-visible { outline: 2px solid var(--tw-text); outline-offset: 2px; }
.ex-card__media { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; background: var(--tw-bg-2); }
.ex-media--empty {
    background: linear-gradient(135deg, var(--tw-bg-2), var(--tw-bg-3));
}
.ex-card__body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; flex: 1; }
.ex-card__meta { font-size: 12px; font-weight: 600; color: var(--tw-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-card__title { font-size: 15.5px; font-weight: 650; line-height: 1.3; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.ex-card__essence {
    font-size: 13.5px; line-height: 1.45; color: var(--tw-muted);
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.ex-card__date { margin-top: auto; padding-top: 4px; font-size: 12px; color: var(--tw-faint); }

.ex-grid--list { grid-template-columns: minmax(0, 1fr); gap: 0; border-top: 1px solid var(--tw-line); }
.ex-grid--list .ex-card {
    flex-direction: row; align-items: flex-start; gap: 16px; padding: 14px 4px; border: 0;
    border-bottom: 1px solid var(--tw-line); border-radius: 0; background: none;
}
.ex-grid--list .ex-card:hover { box-shadow: none; transform: none; background: var(--tw-bg-2); }
.ex-grid--list .ex-card__media { flex: 0 0 132px; width: 132px; aspect-ratio: 4 / 3; border-radius: var(--tw-radius-sm); }
.ex-grid--list .ex-card__body { padding: 0; gap: 4px; }
.ex-grid--list .ex-card__title { font-size: 16px; }
.ex-grid--list .ex-card__essence { -webkit-line-clamp: 2; }
.ex-grid--list .ex-card__date { padding-top: 2px; }

.ex-empty { grid-column: 1 / -1; padding: 48px 16px; text-align: center; color: var(--tw-muted); }
.ex-empty__title { margin: 0 0 4px; font-weight: 600; color: var(--tw-text); }
.ex-more { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 24px; }
.ex-cap { margin: 0; max-width: 520px; text-align: center; color: var(--tw-muted); font-size: 13.5px; }

.ex-drawer {
    position: fixed; inset: 0 0 0 auto; margin: 0; width: min(560px, 100vw); max-width: 100vw;
    height: 100dvh; max-height: 100dvh; padding: 0; border: 0; background: var(--tw-bg); color: var(--tw-text);
    box-shadow: var(--tw-shadow-pop); display: none; flex-direction: column;
}
.ex-drawer[open] { display: flex; }
.ex-drawer::backdrop { background: rgba(0, 0, 0, 0.28); }
.ex-drawer__bar { display: flex; justify-content: flex-end; padding: 10px 12px 0; }
.ex-drawer__close {
    display: inline-flex; align-items: center; justify-content: center; width: var(--tw-target); height: var(--tw-target);
    border: 0; border-radius: var(--tw-pill); background: none; color: var(--tw-muted); cursor: pointer;
}
.ex-drawer__close:hover { background: var(--tw-bg-2); color: var(--tw-text); }
.ex-drawer__body { flex: 1; overflow-y: auto; padding: 4px 28px 40px; overscroll-behavior: contain; }
.ex-detail__media { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; border-radius: var(--tw-radius); margin-bottom: 18px; }
.ex-detail__meta { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--tw-muted); }
.ex-detail__title { margin: 0 0 12px; font-size: 24px; line-height: 1.2; letter-spacing: var(--tw-tracking-tight); overflow-wrap: anywhere; }
.ex-detail__essence { margin: 0 0 14px; font-size: 16px; line-height: 1.5; }
.ex-detail__brands { margin: 0 0 8px; font-size: 14px; }
.ex-detail__brands span { color: var(--tw-muted); margin-right: 4px; }
.ex-detail__story { margin: 12px 0 10px; font-size: 15px; line-height: 1.55; color: var(--tw-muted); }
.ex-detail__read { display: inline-flex; align-items: center; gap: 4px; font-size: 14.5px; font-weight: 600; color: var(--tw-link); }
.ex-detail__section { margin-top: 24px; }
.ex-detail__section h3 { margin: 0 0 8px; font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; color: var(--tw-muted); }
.ex-detail__section p { margin: 0 0 10px; font-size: 15px; line-height: 1.55; }
.ex-tags { margin: 24px 0 16px; display: grid; gap: 12px; }
.ex-tags div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; align-items: start; }
.ex-tags dt { font-size: 13px; color: var(--tw-muted); padding-top: 4px; }
.ex-tags dd { margin: 0; }
.ex-detail__api { padding-top: 20px; border-top: 1px solid var(--tw-line); }
.ex-detail__api .snip { margin-top: 0; }
.ex-detail__api .tw-code { white-space: pre-wrap; overflow-wrap: anywhere; }
.ex-detail__hint { margin-top: 10px; font-size: 13px; color: var(--tw-muted); }

@container portal-main (max-width: 560px) {
    .ex-grid { grid-template-columns: minmax(0, 1fr); }
    .ex-grid--list .ex-card { gap: 12px; }
    .ex-grid--list .ex-card__media { flex-basis: 88px; width: 88px; aspect-ratio: 1; }
    .ex-grid--list .ex-card__essence { display: none; }
    .ex-grid--list .ex-card__title { font-size: 15px; }
}
@media (max-width: 600px) {
    .ex-drawer__body { padding: 4px 18px 32px; }
    .ex-detail__title { font-size: 21px; }
    .ex-tags div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}

/* ------------------------------ Feedback dialog ------------------------------ */
.portal-dialog.fb-dialog { width: calc(100% - 32px); max-width: 460px; max-height: calc(100dvh - 32px); overflow-y: auto; }
.fb-dialog h2 { margin-bottom: 4px; padding-right: 40px; }
.fb-close {
    position: absolute; top: 14px; right: 14px; display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border: 0; border-radius: var(--tw-pill); background: none; color: var(--tw-muted); cursor: pointer;
}
.fb-close:hover { background: var(--tw-bg-2); color: var(--tw-text); }
.fb-close:focus-visible { outline: 2px solid var(--tw-link); outline-offset: 2px; }
.fb-dialog .fb-lead { margin: 0 0 20px; color: var(--tw-muted); font-size: 14px; }
.fb-dialog .fb-label { display: block; margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.fb-label span { margin-left: 4px; font-weight: 400; color: var(--tw-faint); font-size: 13px; }
.fb-scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.fb-scale button, .fb-topics button {
    min-height: 40px; border: 1px solid var(--tw-line-2); background: var(--tw-bg); color: var(--tw-text);
    font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
    transition: background var(--tw-ease), border-color var(--tw-ease), color var(--tw-ease);
}
.fb-scale button { border-radius: var(--tw-radius); }
.fb-scale button:hover, .fb-topics button:hover { background: var(--tw-bg-2); }
.fb-scale button.is-below { background: var(--tw-bg-2); border-color: transparent; }
.fb-scale button[aria-checked="true"], .fb-topics button[aria-pressed="true"] {
    background: var(--tw-text); border-color: var(--tw-text); color: var(--tw-bg);
}
.fb-scale button:focus-visible, .fb-topics button:focus-visible, .fb-help-link:focus-visible { outline: 2px solid var(--tw-link); outline-offset: 2px; }
.fb-scale-ends { display: flex; justify-content: space-between; margin: 6px 2px 18px; font-size: 12px; color: var(--tw-faint); }
.fb-topics { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.fb-topics button { min-height: 34px; padding: 0 13px; border-radius: var(--tw-pill); font-size: 13.5px; font-weight: 500; }
.portal-dialog .fb-message { display: block; min-height: 96px; margin-bottom: 8px; padding: 10px 14px; resize: vertical; line-height: 1.45; }
.fb-dialog .fb-privacy { margin: 0 0 18px; font-size: 12.5px; line-height: 1.45; color: var(--tw-faint); }
.fb-privacy a { color: var(--tw-muted); text-decoration: underline; text-underline-offset: 2px; }
.fb-privacy a:hover { color: var(--tw-text); }
.fb-actions { align-items: center; }
.fb-dialog .fb-help { margin: 0 auto 0 0; font-size: 13.5px; color: var(--tw-muted); }
.fb-help-link { padding: 0; border: 0; background: none; color: var(--tw-link); font: inherit; font-weight: 600; cursor: pointer; }
.fb-help-link:hover { text-decoration: underline; }
@media (max-width: 480px) {
    .fb-actions { flex-wrap: wrap; }
    .fb-help { flex-basis: 100%; margin-bottom: 4px; }
}

/* ------------------------------ Help dialog ------------------------------ */
.help-contact {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 14px 16px; border-radius: var(--tw-radius); background: var(--tw-bg-2);
}
.help-contact__address { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.help-contact__address span { font-size: 12.5px; color: var(--tw-muted); }
.help-contact__address strong { font-size: 15px; overflow-wrap: anywhere; }
.help-contact__actions { display: flex; gap: 8px; }
.help-contact__write { display: inline-flex; align-items: center; min-height: 36px; padding: 0 16px; font-size: 14px; text-decoration: none; }
.help-contact__write:hover { text-decoration: none; }
.help-dialog .help-tip { margin: 10px 2px 22px; font-size: 13px; line-height: 1.45; color: var(--tw-faint); }
.help-links { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--tw-line); }
.help-links li { border-bottom: 1px solid var(--tw-line); }
.help-links a {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 4px;
    color: var(--tw-text); text-decoration: none;
}
.help-links a:hover { background: var(--tw-bg-2); text-decoration: none; }
.help-links a:focus-visible { outline: 2px solid var(--tw-link); outline-offset: -2px; }
.help-links a > span { display: flex; flex-direction: column; gap: 2px; }
.help-links strong { font-size: 14.5px; font-weight: 600; }
.help-links a > span > span { font-size: 13px; color: var(--tw-muted); }
.help-links svg { flex-shrink: 0; color: var(--tw-faint); }
