/* The free Preemptive negative keywords tool
   (templates/tools/preemptive_negative_keywords.html, js/preemptive_negatives.js).
   D1 look, tokens from site.css only, so light and dark both follow. The
   pieces copy the app's Preemptive negatives shot and its Rules and words
   (css/tools/preemptive_negatives.css, account_rules.css): the set-up is the
   one framed panel; the list sits on the page beside a sidebar; lines
   separate rows, not items. */

.pn-head { padding: clamp(28px, 4vw, 56px) 0 clamp(18px, 2.4vw, 28px); }
.pn-back { display: inline-block; color: var(--muted); font-size: 14px; text-decoration: none; }
.pn-back:hover { color: var(--ink); }
.pn-title-row { display: flex; align-items: center; gap: clamp(14px, 2vw, 22px); margin-top: 14px; }
@media (max-width: 640px) {
    .pn-title-row .shot-ico-lg { width: 56px; height: 56px; border-radius: 14px; }
    .pn-title-row .shot-ico-lg .glyph { width: 42px; height: 42px; }
}
.pn-title { margin: 0;font: 800 clamp(36px, 5vw, 64px)/.98 var(--sans); letter-spacing: -.035em; font-variation-settings: "wdth" 84; color: var(--ink); }
.pn-lede { max-width: 44em; margin: 18px 0 0; font-size: clamp(17px, 1.5vw, 20px); line-height: 1.5; color: var(--ink-2); }
.pn-free { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; color: var(--muted); font-size: 14px; }
.pn-free .bi { color: var(--blue); }

.pn-tool { padding: 0 0 clamp(40px, 6vw, 80px); }
.pn-tool .pn-panel[hidden] { display: none; }

/* ---------- tabs: one per step, the chosen one always marked ---------- */
.pn-tabs { display: flex; gap: 4px; margin: 0 0 24px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.pn-tabs::-webkit-scrollbar { display: none; }
.pn-tab {
    position: relative; flex: none; display: inline-flex; align-items: center; gap: 10px;
    height: 54px; padding: 0 18px 0 4px; margin: 0 14px 0 0; border: 0; background: none;
    color: var(--muted); font: 600 15px/1 var(--body); cursor: pointer; white-space: nowrap;
}
.pn-tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: transparent; transition: background .15s; }
.pn-tab:hover { color: var(--ink); }
.pn-tab[aria-selected="true"] { color: var(--ink); }
.pn-tab[aria-selected="true"]::after { background: var(--blue); }
.pn-tab:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; border-radius: 8px; }
.pn-tab-n {
    display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
    background: var(--tint); color: var(--ink-2); font: 700 13px/1 var(--body); transition: background .15s, color .15s;
}
.pn-tab[aria-selected="true"] .pn-tab-n { background: var(--blue); color: #fff; }
:root[data-theme="dark"] .pn-tab[aria-selected="true"] .pn-tab-n { color: var(--bg); }
.pn-tab-c { min-width: 9ch; color: var(--muted); font-weight: 500; font-size: 13px; font-variant-numeric: tabular-nums; }

/* ---------- headings and notes ---------- */
.pn-h2 { margin: 0; font: 800 clamp(22px, 2vw, 28px)/1.15 var(--sans); letter-spacing: -.02em; color: var(--ink); }
.pn-h3 { margin: 0 0 12px; font: 700 18px/1.2 var(--sans); letter-spacing: -.01em; color: var(--ink); }
.pn-note { max-width: 72ch; margin: 6px 0 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }
.pn-sm { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 8px; }
.btn-s[aria-disabled="true"], .btn-p[aria-disabled="true"] { opacity: .5; cursor: default; }
.btn-s[aria-disabled="true"]:hover { background: var(--card); }
.btn-p[aria-disabled="true"]:hover { background: var(--blue); }

/* ---------- 1. Your business: the set-up panel (the one frame) ---------- */
.pn-setup { border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 22px clamp(16px, 2.4vw, 28px) 8px; }
.pn-setup-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px 24px; padding: 0 0 16px; border-bottom: 1px solid var(--line); }
.pn-setup-acts { display: flex; align-items: center; gap: 14px; }
.pn-sum { min-width: 17ch; color: var(--ink-2); font-size: 14px; font-variant-numeric: tabular-nums; text-align: right; }
.pn-sec { margin: 22px 0 0; padding: 0 0 8px; color: var(--muted); font: 600 12px/1.2 var(--body); letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.pn-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 24px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.pn-row:last-child { border-bottom: 0; }
.pn-row-keywords { grid-template-columns: 1fr; margin-top: 18px; border-top: 1px solid var(--line); }
.pn-gname { display: block; font-weight: 700; color: var(--ink); font-size: 15px; }
.pn-gq { margin-top: 2px; color: var(--ink-2); font-size: 14px; line-height: 1.45; }
.pn-gmeta { margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.pn-opt { margin-left: 4px; color: var(--muted); font-weight: 500; font-size: 13px; }
.pn-tag { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px; margin-right: 6px; vertical-align: 1px; }
.pn-tag:empty { display: none; }
.pn-tag.is-def { background: var(--tint); color: var(--muted); }
.pn-tag.is-you { background: var(--tint-2); color: var(--ink); }

/* a segmented choice: the one in force has a white fill and a blue bold label */
.pn-seg { display: inline-flex; flex: none; gap: 2px; padding: 3px; border-radius: 9px; background: var(--tint); }
.pn-seg-btn {
    position: relative; border: 0; background: none; color: var(--ink-2); font: 600 13px/1 var(--body);
    padding: 8px 14px; border-radius: 7px; cursor: pointer; white-space: nowrap; transition: background .12s, color .12s;
}
.pn-seg-btn:hover { color: var(--ink); }
.pn-seg-btn[aria-pressed="true"] { background: var(--bg); color: var(--blue); font-weight: 700; box-shadow: 0 0 0 1px var(--line-2); }
.pn-seg-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }

.pn-textarea {
    display: block; width: 100%; max-width: 760px; margin-top: 10px; padding: 10px 12px; resize: vertical;
    border: 1px solid var(--line-2); border-radius: 8px; background: var(--card); color: var(--ink);
    font: 14px/1.55 'Fragment Mono', ui-monospace, monospace;
}
.pn-textarea:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.pn-textarea::placeholder { color: var(--muted); opacity: .8; }
.pn-kw-line { min-height: 20px; margin-top: 6px; color: var(--ink-2); font-size: 13px; }

/* the foot of a step: its Next, right-aligned */
.pn-foot { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.pn-foot-sp { flex: 1 1 auto; }

/* ---------- 2. Negative keywords ---------- */
.pn-progress { margin: 0 0 18px; }
.pn-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--tint); }
.pn-bseg { display: block; height: 100%; transition: width .3s ease; }
.pn-bseg.is-checked, .pn-pl.is-checked .pn-dot { background: var(--blue); }
.pn-bseg.is-blocked, .pn-pl.is-blocked .pn-dot { background: #c98a00; }
.pn-bseg.is-answered, .pn-pl.is-answered .pn-dot { background: var(--line-2); }
.pn-bseg.is-you, .pn-pl.is-you .pn-dot { background: var(--tint-2); }
.pn-progress-line { min-height: 20px; margin: 8px 0 0; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.pn-pl { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.pn-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }

.pn-terms-layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 0 32px; align-items: start; }
.pn-side { position: sticky; top: 16px; max-height: calc(100vh - 120px); overflow-y: auto; padding: 0 16px 0 0; border-right: 1px solid var(--line); scrollbar-width: thin; }
.pn-side-sec + .pn-side-sec { margin-top: 18px; }
.pn-side-h { margin: 0 0 6px; padding: 0 10px; color: var(--muted); font: 600 12px/1.2 var(--body); letter-spacing: .06em; text-transform: uppercase; }
.pn-side-item {
    display: flex; align-items: center; gap: 8px; width: 100%; min-height: 34px; padding: 6px 10px; border: 0; border-radius: 8px;
    background: none; color: var(--ink-2); font: 500 14px/1.25 var(--body); text-align: left; cursor: pointer;
}
.pn-side-item:hover { background: var(--tint); color: var(--ink); }
.pn-side-item[aria-pressed="true"] { background: var(--blue-soft); color: var(--blue); font-weight: 700; }
.pn-side-item:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.pn-side-t { flex: 1 1 auto; min-width: 0; }
.pn-side-n { flex: none; color: var(--muted); font-size: 12.5px; font-weight: 500; font-variant-numeric: tabular-nums; display: inline-block; }
.pn-side-item[aria-pressed="true"] .pn-side-n { color: var(--blue); }

.pn-tools { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 0; background: var(--bg); border-bottom: 1px solid var(--line); }
.pn-tools-sp { flex: 1 1 auto; }
.pn-search { position: relative; flex: 0 1 320px; min-width: 200px; }
.pn-search .bi { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; pointer-events: none; }
.pn-search-in { width: 100%; height: 36px; padding: 0 12px 0 32px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--card); color: var(--ink); font: 14px var(--body); }
.pn-search-in:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.pn-shown { min-width: 15ch; color: var(--muted); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; display: inline-block; }

.pn-group { padding: 16px 0 18px; border-bottom: 1px solid var(--line); scroll-margin-top: 64px; }
.pn-group:last-child { border-bottom: 0; }
.pn-ghead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 -8px 10px; padding: 4px 8px; border-radius: 8px; }
.pn-gcheck { display: inline-flex; align-items: center; gap: 10px; margin: 0; cursor: pointer; }
.pn-glabel { font: 700 16px/1.25 var(--sans); letter-spacing: -.01em; color: var(--ink); }
.pn-sp { flex: 1 1 auto; }
.pn-gcount { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; display: inline-block; }
.pn-chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border: 0; border-radius: 999px; font: 700 12px/1 var(--body); cursor: pointer; }
.pn-chip.is-out { background: var(--blue-soft); color: var(--blue); }
.pn-chip.is-go { background: var(--tint-2); color: var(--ink-2); }
.pn-chip.is-none { background: var(--tint); color: var(--muted); cursor: default; }
.pn-chip:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.pn-tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 18px; }
.pn-term { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; min-height: 32px; margin: 0; padding: 4px 6px; border-radius: 6px; cursor: pointer; color: var(--ink); font-size: 14.5px; }
.pn-term:hover { background: var(--tint); }
.pn-term.is-off .pn-tt { color: var(--muted); }
.pn-tt { overflow-wrap: anywhere; }
.pn-tt mark { padding: 0 1px; border-radius: 3px; background: var(--hl); color: inherit; }
.pn-why { display: none; flex-basis: 100%; padding-left: 28px; font-size: 12px; line-height: 1.3; }
.pn-why.is-blocked { display: block; color: var(--mark-dark); cursor: default; }
:root[data-theme="dark"] .pn-why.is-blocked { color: var(--yellow); }
.pn-why .bi { font-size: 11px; }

.pn-gcheck input, .pn-term input {
    flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--blue); cursor: pointer;
}

.pn-empty { margin: 28px 0; color: var(--muted); font-size: 15px; }

/* the bottom bar: what's checked and Next, always in reach */
.pn-dock {
    position: sticky; bottom: 12px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
    margin-top: 22px; padding: 10px 12px 10px 18px; border-radius: 14px;
    background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(8px); box-shadow: var(--shadow);
}
.pn-dock-n { min-width: 19ch; color: var(--ink-2); font-size: 14.5px; }
.pn-dock-n b { display: inline-block; color: var(--ink); font: 800 20px/1 var(--sans); font-variant-numeric: tabular-nums; }

/* ---------- 3. Copy to clipboard ---------- */
.pn-copy { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 0 48px; align-items: start; }
.pn-copy-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px 24px; max-width: 760px; }
.pn-copy-head > div:first-child { flex: 1 1 320px; }
.pn-copy-head .pn-note { max-width: 44ch; }
.pn-copy-acts { display: flex; align-items: center; gap: 10px; }
.pn-copy-btn { min-width: 190px; }
.pn-edited { min-height: 20px; margin: 10px 0 0; color: var(--ink-2); font-size: 13px; }
.pn-out { min-height: 380px; margin-top: 6px; }
.pn-out-line { min-height: 20px; margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.btn-s.is-confirm { border-color: var(--blue); color: var(--blue); }
.pn-match { display: flex; align-items: center; gap: 8px; margin: 16px 0 0; }
.pn-match-label { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-weight: 600; color: var(--ink); font-size: 14.5px; cursor: pointer; }
.pn-match-label input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); cursor: pointer; }
.pn-q {
    display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
    background: var(--tint); color: var(--muted); font: 700 11px/1 var(--body); cursor: default;
}
.pn-q:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.pn-how { padding: 20px 22px; border-radius: 14px; background: var(--tint); color: var(--ink-2); font-size: 14.5px; line-height: 1.55; }
.pn-steps { margin: 0 0 14px; padding-left: 1.2em; }
.pn-steps li + li { margin-top: 6px; }
.pn-steps li::marker { color: var(--blue); font-weight: 700; }
.pn-steps b { color: var(--ink); font-weight: 600; }
.pn-how-note { margin: 0 0 10px; font-size: 13.5px; }
.pn-more { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line-2); }
.pn-more p { margin: 0 0 14px; font-size: 13.5px; }

/* ---------- feedback: ✓ over a button's own label, bumps and glows ---------- */
.btn-p.is-done, .btn-s.is-done, .pn-seg-btn.is-done { position: relative; color: transparent !important; }
.btn-p.is-done > *, .btn-s.is-done > * { visibility: hidden; }
.btn-p.is-done::after, .btn-s.is-done::after, .pn-seg-btn.is-done::after {
    content: attr(data-done); position: absolute; inset: 0; display: grid; place-items: center;
    color: var(--blue); font-weight: 700; animation: pn-pop .25s ease-out;
}
.btn-p.is-done::after { color: #fff; }
:root[data-theme="dark"] .btn-p.is-done::after { color: var(--bg); }

.is-bump { animation: pn-bump .35s ease-out; }
.is-glow { animation: pn-glow 1.1s ease-out; }
@keyframes pn-pop { from { transform: scale(.85); opacity: .4; } to { transform: scale(1); opacity: 1; } }
@keyframes pn-bump { 0% { transform: scale(1); } 40% { transform: scale(1.12); color: #1f8a4c; } 100% { transform: scale(1); } }
@keyframes pn-glow { 0% { background: color-mix(in srgb, var(--yellow) 45%, transparent); } 100% { background: transparent; } }
textarea.is-glow { animation-name: pn-glow-box; }
@keyframes pn-glow-box { 0% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--yellow) 60%, transparent); } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- the instant tooltip and the toast (at the end of <body>) ---------- */
.pn-tip {
    position: fixed; z-index: 2000; max-width: 320px; padding: 8px 10px; border-radius: 8px; pointer-events: none;
    background: var(--ink); color: var(--bg); font: 500 12.5px/1.4 var(--body); box-shadow: var(--shadow);
}
.pn-tip[hidden] { display: none; }

.pn-toasts { position: fixed; left: 20px; bottom: 20px; z-index: 1900; display: flex; flex-direction: column; gap: 8px; width: min(400px, calc(100vw - 32px)); pointer-events: none; }
.pn-toast {
    display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; border-radius: 12px; pointer-events: auto;
    border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 14px; box-shadow: var(--shadow);
    animation: pn-toast-in .22s ease-out;
}
.pn-toast.is-success { background: color-mix(in srgb, #1f8a4c 8%, var(--card)); }
.pn-toast.is-warning { background: color-mix(in srgb, var(--yellow) 14%, var(--card)); }
.pn-toast.is-danger { background: color-mix(in srgb, #c0392b 8%, var(--card)); }
.pn-toast.is-info { background: color-mix(in srgb, var(--blue) 8%, var(--card)); }
.pn-toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
.pn-toast-ico { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; font-size: 13px; }
.is-success .pn-toast-ico { background: #1f8a4c; }
.is-warning .pn-toast-ico { background: #c98a00; }
.is-danger .pn-toast-ico { background: #c0392b; }
.is-info .pn-toast-ico { background: var(--blue); }
.pn-toast-msg { flex: 1 1 auto; line-height: 1.35; }
.pn-toast-undo { flex: none; border: 0; background: none; color: var(--blue); font: 700 13.5px/1 var(--body); padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.pn-toast-undo:hover { background: var(--tint); }
.pn-toast-x { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.pn-toast-x:hover { background: var(--tint); color: var(--ink); }
@keyframes pn-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Feedback motion stays on under reduced motion (Motion is seen): it is small and moves nothing out of place. */

/* ---------- narrower screens ---------- */
@media (max-width: 1100px) {
    .pn-copy { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 900px) {
    .pn-terms-layout { grid-template-columns: minmax(0, 1fr); }
    .pn-side { position: static; max-height: none; overflow: visible; padding: 0 0 12px; border-right: 0; }
    .pn-side-sec + .pn-side-sec { margin-top: 8px; }
    .pn-side-sec .pn-side-h { display: none; }
    .pn-side-list { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
    .pn-side-item { flex: none; width: auto; background: var(--tint); }
}
@media (max-width: 640px) {
    /* Three equal tabs that always fit: labels wrap rather than scroll away */
    .pn-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; overflow: visible; }
    .pn-tab { height: auto; min-height: 54px; padding: 8px 2px; margin: 0; gap: 8px; font-size: 13.5px; line-height: 1.2; white-space: normal; text-align: left; }
    .pn-tab-n { flex: none; width: 22px; height: 22px; font-size: 12px; }
    .pn-tab-c { display: none; }
    .pn-row { grid-template-columns: 1fr; }
    .pn-row .pn-seg { justify-self: start; }
    .pn-sum { text-align: left; min-width: 0; }
    .pn-search { flex-basis: 100%; }
    .pn-tools-sp { display: none; }
    .pn-shown { flex-basis: 100%; text-align: left; order: 3; }
    .pn-tgrid { grid-template-columns: 1fr 1fr; gap: 2px 8px; }
    .pn-dock { bottom: 8px; padding: 10px 12px; }
    .pn-dock .pn-foot-sp { display: none; }
    .pn-dock .btn-p { flex: 1 1 100%; }
    .pn-dock .btn-s { display: none; }
    .pn-copy-acts { width: 100%; }
    .pn-copy-btn { flex: 1 1 auto; }
    /* Above the bottom bar, clear of the tabs and counts the user is reading */
    .pn-toasts { bottom: 96px; left: 16px; }
}
