/* ==========================================================================
   PAN + PDF + Image Tools - shared interface styles
   Loaded on every page of the add-on. The original PAN crop tool keeps its
   own style.css; this file never overrides it.
   ========================================================================== */

:root {
    --ink:          #0f172a;
    --ink-soft:     #475569;
    --ink-faint:    #94a3b8;
    --line:         #e2e8f0;
    --line-strong:  #cbd5e1;
    --bg:           #f6f8fb;
    --surface:      #ffffff;
    --surface-alt:  #f8fafc;

    --brand:        #1d4ed8;
    --brand-dark:   #1e40af;
    --brand-soft:   #eff4ff;
    --accent:       #0d9488;
    --danger:       #dc2626;
    --danger-soft:  #fef2f2;
    --success:      #059669;
    --success-soft: #ecfdf5;
    --warn:         #b45309;
    --warn-soft:    #fffbeb;

    --pdf:          #dc2626;
    --image:        #7c3aed;
    --pan:          #0369a1;

    --radius:       14px;
    --radius-sm:    9px;
    --shadow:       0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px -12px rgba(15, 23, 42, .18);
    --shadow-lg:    0 24px 60px -28px rgba(15, 23, 42, .35);
    --font:         system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body.ps {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

body.ps img { max-width: 100%; height: auto; }
/*
 * Default link colour, wrapped in :where() so it carries ZERO specificity.
 * Without that it outranks every component rule below (footer, nav, brand,
 * buttons, breadcrumbs) and turns them all brand blue - unreadable on the
 * dark footer and on a coloured button.
 */
:where(body.ps a) { color: var(--brand); }
body.ps a { text-decoration: none; }
body.ps a:not([class]):hover { text-decoration: underline; }

/*
 * Page container: 80% of the viewport at every size, centred.
 * Long-form text stays readable regardless of how wide this gets, because
 * .ps-prose limits its own paragraphs to a ~76 character measure.
 */
.ps-wrap { width: 80%; margin-inline: auto; }
.ps-wrap--narrow { width: min(80%, 820px); }

/* Below ~600px, 10% side margins waste too much room - use a 16px gutter. */
@media (max-width: 600px) {
    .ps-wrap, .ps-wrap--narrow { width: calc(100% - 32px); }
}

/* ------------------------------------------------------------- skip link */
.ps-skip {
    position: absolute; left: -9999px; top: 0; z-index: 999;
    background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.ps-skip:focus { left: 0; }

/* ---------------------------------------------------------------- header */
.ps-head {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 50;
}
.ps-head__bar { display: flex; align-items: center; gap: 18px; min-height: 66px; }

.ps-brand { display: flex; align-items: center; gap: 11px; font-weight: 700; color: var(--ink); }
.ps-brand:hover { text-decoration: none; }
.ps-brand__mark {
    width: 38px; height: 38px; border-radius: 10px;
    display: grid; place-items: center;
    background: linear-gradient(140deg, var(--brand), #4f46e5);
    color: #fff; font-size: 15px; font-weight: 800; letter-spacing: .3px;
}
.ps-brand__mark img { width: 100%; height: 100%; object-fit: contain; border-radius: 10px; }
.ps-brand__name { font-size: 16.5px; line-height: 1.15; }
.ps-brand__tag { display: block; font-size: 11.5px; font-weight: 500; color: var(--ink-faint); }

.ps-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.ps-nav a {
    color: var(--ink-soft); font-size: 14.5px; font-weight: 550;
    padding: 8px 12px; border-radius: 8px;
}
.ps-nav a:hover { background: var(--surface-alt); color: var(--ink); text-decoration: none; }
.ps-nav a[aria-current="page"] { color: var(--brand); background: var(--brand-soft); }

.ps-burger {
    margin-left: auto; display: none; width: 42px; height: 40px;
    border: 1px solid var(--line); border-radius: 9px; background: var(--surface);
    cursor: pointer; align-items: center; justify-content: center; gap: 4px; flex-direction: column;
}
.ps-burger span { display: block; width: 18px; height: 2px; background: var(--ink-soft); border-radius: 2px; }

@media (max-width: 860px) {
    .ps-burger { display: flex; }
    .ps-nav {
        position: absolute; inset: 66px 0 auto; background: var(--surface);
        border-bottom: 1px solid var(--line); flex-direction: column;
        align-items: stretch; padding: 10px 16px 16px; gap: 2px; display: none;
        box-shadow: var(--shadow);
    }
    .ps-nav.is-open { display: flex; }
    .ps-nav a { padding: 11px 12px; }
}

/* ------------------------------------------------------------------- hero */
.ps-hero {
    background: linear-gradient(180deg, #ffffff, var(--bg));
    border-bottom: 1px solid var(--line);
    padding: 46px 0 40px;
    text-align: center;
}
.ps-hero h1 {
    margin: 0 0 12px; font-size: clamp(27px, 4.2vw, 40px); line-height: 1.16;
    letter-spacing: -.5px; font-weight: 800;
}
.ps-hero p { margin: 0 auto; max-width: 660px; color: var(--ink-soft); font-size: 17px; }
.ps-hero__badges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 22px; }

/* ------------------------------------------------------------ tool search */
.ps-search {
    position: relative; display: flex; align-items: center;
    width: min(520px, 100%); margin: 26px auto 0;
}
.ps-search__icon {
    position: absolute; left: 14px; display: grid; place-items: center;
    color: var(--ink-faint); pointer-events: none;
}
.ps-search__input {
    width: 100%; padding: 13px 76px 13px 42px; font: inherit; font-size: 15.5px;
    border: 1px solid var(--line-strong); border-radius: 999px;
    background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
    -webkit-appearance: none; appearance: none;
}
.ps-search__input::-webkit-search-cancel-button { display: none; }
.ps-search__input:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(29, 78, 216, .13);
}
.ps-search__input::placeholder { color: var(--ink-faint); }
.ps-search__clear {
    position: absolute; right: 44px; width: 26px; height: 26px; border: 0;
    border-radius: 50%; background: var(--surface-alt); color: var(--ink-soft);
    font-size: 17px; line-height: 1; cursor: pointer;
}
.ps-search__clear:hover { background: var(--line); color: var(--ink); }
.ps-search__kbd {
    position: absolute; right: 13px; min-width: 22px; padding: 2px 6px;
    border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px;
    background: var(--surface-alt); color: var(--ink-faint);
    font: 600 11.5px/1.5 var(--font); text-align: center;
}
@media (max-width: 560px) { .ps-search__kbd { display: none; } .ps-search__clear { right: 13px; } }

.ps-search__empty {
    text-align: center; color: var(--ink-soft); font-size: 15px;
    background: var(--surface); border: 1px dashed var(--line-strong);
    border-radius: var(--radius); padding: 26px 18px; margin: 26px 0 0;
}
.ps-search__empty strong { color: var(--ink); }
.ps-search__empty .ps-btn { margin-left: 8px; vertical-align: middle; }
.ps-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--surface); border: 1px solid var(--line);
    padding: 6px 12px; border-radius: 999px; font-size: 13px; color: var(--ink-soft); font-weight: 550;
}
.ps-badge svg { color: var(--accent); }

/* ------------------------------------------------------------- categories */
.ps-section { padding: 36px 0 8px; }
.ps-section__head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.ps-section__head h2 { margin: 0; font-size: 22px; font-weight: 750; letter-spacing: -.2px; }
.ps-section__head p { margin: 0; color: var(--ink-faint); font-size: 14.5px; }

.ps-chip {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
    padding: 5px 11px; border-radius: 999px;
}
.ps-chip--pan   { background: #e0f2fe; color: var(--pan); }
.ps-chip--pdf   { background: #fee2e2; color: var(--pdf); }
.ps-chip--image { background: #f3e8ff; color: var(--image); }

/* ------------------------------------------------------------- tool cards */
.ps-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); }
.ps-grid--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* Wider container (90%) means wider cards, not more empty columns. */
@media (min-width: 1400px) { .ps-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; } }
@media (min-width: 1800px) { .ps-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); } }

@media (max-width: 640px) { .ps-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; } }

.ps-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 20px; display: flex; flex-direction: column; gap: 10px;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
    position: relative;
}
.ps-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.ps-card__icon {
    width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center;
    background: var(--brand-soft); color: var(--brand);
}
.ps-card--pdf   .ps-card__icon { background: #fef2f2; color: var(--pdf); }
.ps-card--image .ps-card__icon { background: #f5f3ff; color: var(--image); }
.ps-card--pan   .ps-card__icon { background: #e0f2fe; color: var(--pan); }
.ps-card h3 { margin: 2px 0 0; font-size: 16.5px; font-weight: 700; letter-spacing: -.15px; }
.ps-card p { margin: 0; color: var(--ink-soft); font-size: 14px; flex: 1; }
.ps-card__cta {
    display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
    margin-top: 4px; font-weight: 650; font-size: 14.5px; color: var(--brand);
}
.ps-card__link { position: absolute; inset: 0; border-radius: var(--radius); }
.ps-card__link:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

@media (max-width: 640px) {
    .ps-card { padding: 15px; gap: 7px; }
    .ps-card__icon { width: 36px; height: 36px; border-radius: 9px; }
    .ps-card h3 { font-size: 14.5px; }
    .ps-card p { font-size: 12.5px; }
    .ps-card__cta { font-size: 13px; }
}

/* ---------------------------------------------------------------- buttons */
.ps-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 22px; border-radius: 10px; border: 1px solid transparent;
    font: inherit; font-weight: 650; font-size: 15px; cursor: pointer;
    background: var(--brand); color: #fff; transition: background .15s ease, opacity .15s ease;
    text-decoration: none;
}
.ps-btn:hover { background: var(--brand-dark); color: #fff; text-decoration: none; }
.ps-btn:disabled, .ps-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.ps-btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.ps-btn--ghost:hover { background: var(--surface-alt); color: var(--ink); }
.ps-btn--success { background: var(--success); }
.ps-btn--success:hover { background: #047857; }
.ps-btn--danger { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }
.ps-btn--danger:hover { background: #fee2e2; color: var(--danger); }
.ps-btn--sm { padding: 8px 14px; font-size: 13.5px; border-radius: 8px; }
.ps-btn--block { width: 100%; }
.ps-btn--lg { padding: 14px 28px; font-size: 16px; }

/* ------------------------------------------------------------- tool shell */
.ps-tool { padding: 26px 0 40px; }
.ps-tool__layout { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
.ps-tool__layout.has-aside { grid-template-columns: minmax(0, 1fr) 306px; }
@media (max-width: 1040px) { .ps-tool__layout.has-aside { grid-template-columns: minmax(0, 1fr); } }

.ps-tool__head { margin-bottom: 18px; }
.ps-tool__head h1 { margin: 6px 0 8px; font-size: clamp(24px, 3.4vw, 32px); letter-spacing: -.4px; font-weight: 800; }
.ps-tool__head p { margin: 0; color: var(--ink-soft); max-width: 720px; }

.ps-crumbs { font-size: 13px; color: var(--ink-faint); display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.ps-crumbs a { color: var(--ink-faint); }
.ps-crumbs span[aria-current] { color: var(--ink-soft); }

.ps-panel {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 22px;
}
.ps-panel + .ps-panel { margin-top: 18px; }
@media (max-width: 560px) { .ps-panel { padding: 16px; border-radius: 12px; } }

/* --------------------------------------------------------------- dropzone */
.ps-drop {
    border: 2px dashed var(--line-strong); border-radius: 12px;
    background: var(--surface-alt); text-align: center;
    padding: 38px 20px; cursor: pointer; transition: border-color .15s, background .15s;
}
.ps-drop:hover, .ps-drop:focus-visible { border-color: var(--brand); background: var(--brand-soft); outline: none; }
.ps-drop.is-drag { border-color: var(--brand); background: var(--brand-soft); }
.ps-drop__icon {
    width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 50%;
    display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line);
    color: var(--brand);
}
.ps-drop__title { margin: 0 0 4px; font-size: 17px; font-weight: 700; }
.ps-drop__hint { margin: 0; color: var(--ink-faint); font-size: 13.5px; }
.ps-drop__browse { color: var(--brand); font-weight: 650; }
.ps-drop__paste {
    display: inline-block; margin-top: 10px; font-size: 12.5px; color: var(--ink-faint);
}
.ps-drop__paste kbd {
    padding: 1px 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px;
    border-radius: 5px; background: var(--surface); font: 600 11.5px/1.6 var(--font);
    color: var(--ink-soft);
}

/* Full-page drop target: dragging a file anywhere over the page works. */
.ps-dropveil {
    position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
    background: rgba(15, 23, 42, .55); backdrop-filter: blur(2px);
    animation: ps-fade .12s ease;
}
.ps-dropveil__box {
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    padding: 40px 56px; border-radius: 18px;
    border: 2px dashed rgba(255, 255, 255, .65); color: #fff;
    background: rgba(29, 78, 216, .35); font-size: 18px; font-weight: 650;
}
.ps-dropveil__box svg { width: 38px; height: 38px; }
@keyframes ps-fade { from { opacity: 0; } to { opacity: 1; } }

/* ------------------------------------------------------------- file lists */
.ps-files { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ps-file {
    display: flex; align-items: center; gap: 12px; padding: 11px 13px;
    border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
}
.ps-file__icon { color: var(--pdf); flex: none; }
.ps-file__body { min-width: 0; flex: 1; }
.ps-file__name {
    font-weight: 600; font-size: 14.5px; margin: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ps-file__meta { margin: 1px 0 0; font-size: 12.5px; color: var(--ink-faint); }
.ps-file__drag {
    cursor: grab; color: var(--ink-faint); background: none; border: 0; padding: 4px;
    font-size: 16px; line-height: 1;
}
.ps-file.is-dragging { opacity: .45; }
.ps-file__remove {
    border: 0; background: none; color: var(--ink-faint); cursor: pointer;
    padding: 6px; border-radius: 6px; line-height: 1;
}
.ps-file__remove:hover { background: var(--danger-soft); color: var(--danger); }

/* --------------------------------------------------------------- controls */
.ps-field { margin-top: 18px; }
.ps-field__label { display: block; font-weight: 650; font-size: 14px; margin-bottom: 8px; }
.ps-field__hint { font-size: 12.5px; color: var(--ink-faint); margin: 6px 0 0; }

.ps-options { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.ps-option {
    display: flex; gap: 10px; align-items: flex-start; padding: 13px 14px;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s;
}
.ps-option:hover { border-color: var(--line-strong); }
.ps-option input { margin-top: 3px; accent-color: var(--brand); }
.ps-option strong { display: block; font-size: 14.5px; font-weight: 650; }
.ps-option span { display: block; font-size: 12.5px; color: var(--ink-faint); }
.ps-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }

.ps-input, .ps-select, .ps-textarea {
    width: 100%; padding: 10px 12px; font: inherit; font-size: 14.5px;
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--ink);
}
.ps-input:focus, .ps-select:focus, .ps-textarea:focus {
    outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(29, 78, 216, .12);
}
.ps-textarea { min-height: 110px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

.ps-range { width: 100%; accent-color: var(--brand); }
.ps-range-row { display: flex; align-items: center; gap: 14px; }
.ps-range-value {
    min-width: 58px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums;
    background: var(--brand-soft); color: var(--brand-dark); padding: 5px 8px; border-radius: 7px; font-size: 14px;
}

.ps-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; align-items: center; }

/* ---------------------------------------------------------------- pages */
.ps-pagegrid {
    display: grid; gap: 12px; margin-top: 16px;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
}
.ps-page {
    position: relative; border: 2px solid var(--line); border-radius: 10px;
    background: var(--surface); padding: 8px; cursor: pointer; text-align: center;
    transition: border-color .12s, background .12s;
}
.ps-page:hover { border-color: var(--line-strong); }
.ps-page img { display: block; width: 100%; border-radius: 5px; background: #fff; }
.ps-page__no { display: block; margin-top: 7px; font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }
.ps-page__box {
    position: absolute; top: 12px; left: 12px; width: 21px; height: 21px;
    border-radius: 6px; border: 2px solid var(--line-strong); background: rgba(255, 255, 255, .94);
    display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 800;
}
.ps-page.is-selected { border-color: var(--danger); background: var(--danger-soft); }
.ps-page.is-selected .ps-page__box { background: var(--danger); border-color: var(--danger); }
.ps-page.is-selected .ps-page__no { color: var(--danger); }

/* -------------------------------------------------------------- progress */
.ps-progress { margin-top: 20px; }
.ps-progress__bar {
    height: 9px; border-radius: 999px; background: var(--line); overflow: hidden;
}
.ps-progress__fill {
    height: 100%; width: 0; border-radius: 999px;
    background: linear-gradient(90deg, var(--brand), #4f46e5);
    transition: width .3s ease;
}
.ps-progress__row {
    display: flex; justify-content: space-between; gap: 12px;
    font-size: 13.5px; color: var(--ink-soft); margin-bottom: 8px; font-weight: 550;
}
.ps-progress__pct { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }

.ps-spinner {
    width: 15px; height: 15px; border-radius: 50%; flex: none;
    border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff;
    animation: ps-spin .7s linear infinite;
}
@keyframes ps-spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------- results */
.ps-result { border: 1px solid #bbf7d0; background: var(--success-soft); border-radius: var(--radius); padding: 20px; }
.ps-result__head { display: flex; align-items: center; gap: 10px; color: #065f46; font-weight: 750; font-size: 16.5px; }
.ps-stats {
    display: grid; gap: 12px; margin: 16px 0 0;
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
}
.ps-stat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.ps-stat dt { margin: 0; font-size: 12px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .5px; font-weight: 650; }
.ps-stat dd { margin: 3px 0 0; font-size: 19px; font-weight: 750; font-variant-numeric: tabular-nums; }
.ps-stat--good dd { color: var(--success); }

.ps-compare { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 16px; }
.ps-compare figure { margin: 0; }
.ps-compare figcaption { font-size: 12.5px; color: var(--ink-faint); font-weight: 650; margin-bottom: 6px; }
.ps-compare img {
    width: 100%; border-radius: 10px; border: 1px solid var(--line); display: block;
    background-color: #fff;
    background-image:
        linear-gradient(45deg, #eef2f6 25%, transparent 25%, transparent 75%, #eef2f6 75%),
        linear-gradient(45deg, #eef2f6 25%, transparent 25%, transparent 75%, #eef2f6 75%);
    background-size: 18px 18px; background-position: 0 0, 9px 9px;
}

/* --------------------------------------------------------------- messages */
.ps-msg {
    display: flex; gap: 10px; align-items: flex-start; padding: 13px 15px;
    border-radius: var(--radius-sm); font-size: 14.5px; margin-top: 16px; border: 1px solid;
}
.ps-msg--error   { background: var(--danger-soft);  border-color: #fecaca; color: #991b1b; }
.ps-msg--success { background: var(--success-soft); border-color: #a7f3d0; color: #065f46; }
.ps-msg--info    { background: var(--brand-soft);   border-color: #c7d7fe; color: #1e40af; }
.ps-msg--warn    { background: var(--warn-soft);    border-color: #fde68a; color: #92400e; }
.ps-msg svg { flex: none; margin-top: 1px; }

.ps-privacy {
    display: flex; gap: 9px; align-items: center; margin-top: 18px;
    font-size: 13px; color: var(--ink-faint);
}
.ps-privacy svg { color: var(--accent); flex: none; }

/* ------------------------------------------------------------- ad slots */
.ad-slot { margin: 26px 0; text-align: center; }
.ad-slot__label {
    display: block; font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase;
    color: var(--ink-faint); margin-bottom: 6px; font-weight: 650;
}
.ad-slot__body { display: block; min-height: 1px; overflow: hidden; }
/* Keep a firm gap between advertising and any action control. */
.ad-slot--tool_top      { margin: 22px 0 30px; }
.ad-slot--tool_middle   { margin: 34px 0; padding-top: 6px; border-top: 1px solid var(--line); }
.ad-slot--result_bottom { margin-top: 40px; padding-top: 10px; border-top: 1px solid var(--line); }
.ad-slot--sidebar       { margin: 0 0 20px; position: sticky; top: 88px; }
.ad-slot--footer        { margin: 30px 0 6px; }
.ad-slot--header        { margin: 18px 0 0; }
.ps-aside { min-width: 0; }

/* ------------------------------------------------------------ tool prose */
/* The panel matches the width of the tool above it; the text inside is
   limited to a comfortable measure rather than the panel being narrowed. */
.ps-prose h2 { font-size: 21px; margin: 32px 0 10px; font-weight: 750; letter-spacing: -.2px; }
.ps-prose h2:first-child { margin-top: 0; }
.ps-prose h3 { font-size: 16.5px; margin: 22px 0 8px; font-weight: 700; }
.ps-prose p, .ps-prose li { color: var(--ink-soft); font-size: 15.3px; max-width: 76ch; }
.ps-prose > ul, .ps-prose > ol { max-width: 78ch; }
.ps-prose ul, .ps-prose ol { padding-left: 20px; }
.ps-prose li { margin-bottom: 6px; }
.ps-prose table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 14.5px; }
.ps-prose th, .ps-prose td { text-align: left; padding: 9px 12px; border: 1px solid var(--line); }
.ps-prose th { background: var(--surface-alt); font-weight: 650; }
.ps-table-scroll { overflow-x: auto; }

.ps-faq { margin-top: 10px; }
.ps-faq details {
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--surface); padding: 0; margin-bottom: 9px;
}
.ps-faq summary {
    cursor: pointer; padding: 14px 16px; font-weight: 650; font-size: 15px; list-style: none;
    display: flex; justify-content: space-between; gap: 12px; align-items: center;
}
.ps-faq summary::-webkit-details-marker { display: none; }
.ps-faq summary::after { content: '+'; color: var(--ink-faint); font-size: 19px; font-weight: 500; }
.ps-faq details[open] summary::after { content: '\2212'; }
.ps-faq details > div { padding: 0 16px 15px; color: var(--ink-soft); font-size: 14.5px; }

/* ------------------------------------------------------------------ steps */
.ps-steps { list-style: none; counter-reset: step; padding: 0; margin: 14px 0 0; }
.ps-steps li {
    counter-increment: step; position: relative; padding-left: 40px;
    margin-bottom: 14px; color: var(--ink-soft); font-size: 15px;
}
.ps-steps li::before {
    content: counter(step); position: absolute; left: 0; top: -1px;
    width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center;
    background: var(--brand-soft); color: var(--brand-dark); font-weight: 750; font-size: 13.5px;
}

/* ---------------------------------------------------------------- footer */
.ps-foot { background: #0f172a; color: #cbd5e1; margin-top: 46px; padding: 40px 0 22px; }
.ps-foot a { color: #cbd5e1; }
.ps-foot a:hover { color: #fff; text-decoration: underline; }
.ps-foot__brand a { color: #93c5fd; }
.ps-foot__brand a:hover { color: #dbeafe; }
.ps-foot__grid { display: grid; gap: 28px; grid-template-columns: 1.6fr repeat(2, 1fr); }
@media (max-width: 760px) { .ps-foot__grid { grid-template-columns: 1fr 1fr; } .ps-foot__brand { grid-column: 1 / -1; } }
.ps-foot h4 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: #94a3b8; }
.ps-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14.3px; }
.ps-foot__brand p { font-size: 14.3px; color: #94a3b8; max-width: 380px; }
.ps-foot__social { display: flex; gap: 9px; margin-top: 14px; }
.ps-foot__social a {
    width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
    background: rgba(255, 255, 255, .07);
}
.ps-foot__social a:hover { background: rgba(255, 255, 255, .16); }
.ps-foot__bar {
    margin-top: 30px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .1);
    display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
    font-size: 13.3px; color: #94a3b8;
}

/* ----------------------------------------------------------------- misc */
.ps-hidden { display: none !important; }
.ps-visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.ps-note { font-size: 13.5px; color: var(--ink-faint); }
.ps-maintenance { background: var(--warn-soft); border: 1px solid #fde68a; color: #92400e; }
.ps-swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ps-swatch {
    width: 32px; height: 32px; border-radius: 8px; border: 2px solid var(--line-strong);
    cursor: pointer; padding: 0;
}
.ps-swatch.is-active { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(29, 78, 216, .15); }
