/* =========================================================
   iPullRank IDP — portal component layer
   Built on the brand foundation in colors_and_type.css.
   Brand rules honored throughout: sharp corners (radius 0),
   no soft shadows, small yellow/blue/black palette, Oswald
   display headings, Recia serif body, JetBrains Mono for all
   UI/labels, and the //.code_label eyebrow motif.
   ========================================================= */

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

html, body { margin: 0; }
body {
    background: var(--ipr-ink-100);
    color: var(--ipr-black);
    font-family: var(--font-serif);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============= Layout ============= */

.page-wrap {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 32px 72px;
    flex: 1 0 auto;
}

/* ============= Top nav ============= */

.nav-bar {
    position: sticky; top: 0; z-index: 40;
    background: var(--ipr-white);
    border-bottom: 1px solid var(--rule);
}
.nav-inner {
    max-width: 1100px; margin: 0 auto;
    padding: 12px 32px;
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.nav-brand { display: inline-flex; align-items: center; }
.nav-brand img { height: 26px; display: block; }
.nav-right { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-link {
    position: relative;
    font-family: var(--font-mono); font-size: 13px;
    text-transform: uppercase; letter-spacing: var(--ls-eyebrow);
    color: var(--ipr-black); text-decoration: none;
    background: none; border: none; cursor: pointer; padding: 0 0 4px;
}
/* Brand spec: nav items reveal a yellow underscore on hover. */
.nav-link::after {
    content: ""; position: absolute; left: 0; bottom: 0;
    height: 2px; width: 0; background: var(--ipr-yellow);
    transition: width .15s ease;
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-link.active { color: var(--ipr-blue); }
.nav-user {
    font-family: var(--font-mono); font-size: 12px;
    color: var(--fg-muted); letter-spacing: 0.02em;
}
.nav-sep { color: var(--rule-strong); }

/* ----- Nav dropdowns ----- */
/* inline-flex + center so the toggle's text is vertically centered in the nav
   row (matching the plain .nav-link-plain), instead of sitting on the block
   wrapper's baseline a few px low. */
.nav-dropdown { position: relative; display: inline-flex; align-items: center; }
.nav-dropdown-toggle {
    position: relative;
    font-family: var(--font-mono); font-size: 13px;
    text-transform: uppercase; letter-spacing: var(--ls-eyebrow);
    color: var(--ipr-black); background: none; border: none; cursor: pointer;
    padding: 0 0 4px; display: inline-flex; align-items: center; gap: 6px;
}
.nav-dropdown-toggle::after {
    content: ""; position: absolute; left: 0; bottom: 0;
    height: 2px; width: 0; background: var(--ipr-yellow);
    transition: width .15s ease;
}
.nav-dropdown:hover .nav-dropdown-toggle::after,
.nav-dropdown.is-open .nav-dropdown-toggle::after { width: 100%; }
.nav-dropdown.is-open .nav-dropdown-toggle { color: var(--ipr-blue); }
.nav-caret { font-size: 10px; line-height: 1; transition: transform .15s ease; }
.nav-dropdown.is-open .nav-caret { transform: rotate(180deg); }

/* Standalone top-level nav link (no dropdown), styled to match the toggles.
   inline-flex + center mirrors .nav-dropdown-toggle so its text sits on the same
   baseline as the dropdown labels (otherwise a plain <a> aligns by line-height). */
.nav-link-plain {
    position: relative;
    font-family: var(--font-mono); font-size: 13px;
    text-transform: uppercase; letter-spacing: var(--ls-eyebrow);
    color: var(--ipr-black); text-decoration: none; padding: 0 0 4px;
    display: inline-flex; align-items: center;
}
.nav-link-plain::after {
    content: ""; position: absolute; left: 0; bottom: 0;
    height: 2px; width: 0; background: var(--ipr-yellow);
    transition: width .15s ease;
}
.nav-link-plain:hover::after { width: 100%; }

.nav-menu {
    position: absolute; top: calc(100% + 8px); left: 0; z-index: 50;
    min-width: 160px; display: none; flex-direction: column;
    background: var(--ipr-white); border: 1px solid var(--rule-strong);
    box-shadow: 0 6px 20px rgba(21, 22, 24, 0.12);
}
.nav-dropdown.is-open .nav-menu { display: flex; }
.nav-menu-item {
    font-family: var(--font-mono); font-size: 13px;
    color: var(--ipr-black); text-decoration: none;
    padding: 10px 14px; white-space: nowrap;
    border-bottom: 1px solid var(--rule);
}
.nav-menu-item:last-child { border-bottom: none; }
.nav-menu-item:hover, .nav-menu-item:focus-visible {
    background: var(--ipr-ink-100); color: var(--ipr-blue);
}

/* ============= Footer ============= */

.footer {
    flex-shrink: 0;
    background: var(--ipr-blue); color: #fff;
    padding: 28px 32px;
}
.footer-inner {
    max-width: 1100px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
    flex-wrap: wrap;
}
.footer-inner img { height: 24px; display: block; }
.footer-meta {
    font-family: var(--font-mono); font-size: 12px;
    letter-spacing: 0.04em; color: rgba(255, 255, 255, 0.85);
}

/* ============= Page + section headings ============= */

.page-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 20px; flex-wrap: wrap; margin-bottom: 32px;
}
.page-title {
    font-family: var(--font-display); font-weight: 700;
    font-size: 44px; line-height: 0.95; letter-spacing: var(--ls-display);
    text-transform: uppercase; margin: 0;
}
.page-sub {
    font-family: var(--font-serif); font-size: 16px;
    color: var(--fg-muted); margin: 8px 0 0; max-width: 640px;
}
.section { margin-bottom: 44px; }
.section-title {
    font-family: var(--font-display); font-weight: 700;
    font-size: 24px; line-height: 1.1; text-transform: uppercase;
    margin: 0 0 16px;
}

/* ============= Code-label eyebrow (//.foo) ============= */
/* .code-label / .eyebrow base lives in colors_and_type.css */
.code-label {
    display: inline-block;
    text-transform: lowercase;
    color: var(--ipr-blue);
    letter-spacing: 0.02em;
}

/* ============= Buttons ============= */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 12px 22px; min-height: 44px;
    font-family: var(--font-mono); font-weight: 700; font-size: 13px;
    text-transform: uppercase; letter-spacing: var(--ls-eyebrow);
    border: 1px solid transparent; border-radius: 0;
    text-decoration: none; cursor: pointer;
    transition: filter .15s ease;
}
.btn:hover { filter: brightness(0.93); }
.btn:active { filter: brightness(0.86); }
.btn-dark   { background: var(--ipr-black); color: var(--ipr-yellow); }
.btn-yellow { background: var(--ipr-yellow); color: var(--ipr-black); }
.btn-blue   { background: var(--ipr-blue); color: #fff; }
.btn-outline { background: transparent; color: var(--ipr-black); border-color: var(--rule-strong); }
.btn-outline:hover { filter: none; background: var(--ipr-ink-100); }
.btn-danger { background: #c0341d; color: #fff; }
.btn-sm { padding: 8px 14px; min-height: 34px; font-size: 12px; }
.btn-block { width: 100%; }

/* Plain text action links (edit / cancel / promote) */
.tlink {
    font-family: var(--font-mono); font-size: 12px;
    text-transform: uppercase; letter-spacing: var(--ls-eyebrow);
    color: var(--fg-muted); text-decoration: none;
    background: none; border: none; padding: 0; cursor: pointer;
}
.tlink:hover { color: var(--ipr-black); }
.tlink.danger { color: #c0341d; }
.tlink.danger:hover { color: #8f2415; }
.tlink.underline { text-decoration: underline; text-underline-offset: 3px; }

/* ============= Cards ============= */

.card-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.card-stack { display: flex; flex-direction: column; gap: 14px; }
.card {
    position: relative;
    background: var(--ipr-white);
    border: 1px solid var(--rule);
    border-radius: 0;
    padding: 22px;
    display: flex; flex-direction: column;
}
.card-trigger { cursor: pointer; }
.card-title {
    font-family: var(--font-serif); font-weight: 600; font-size: 19px;
    line-height: 1.25; margin: 0; color: var(--ipr-black);
    text-transform: none; letter-spacing: 0;
}
.card-trigger:hover .card-title { text-decoration: underline; text-underline-offset: 3px; }
.card-desc {
    font-family: var(--font-serif); font-size: 15px; line-height: 1.5;
    color: var(--fg-muted); margin: 8px 0 0;
}
.card-meta {
    font-family: var(--font-mono); font-size: 12px;
    color: var(--fg-muted); margin: 10px 0 0; word-break: break-word;
}
.card-foot {
    margin-top: 16px; padding-top: 14px;
    border-top: 1px solid var(--rule);
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    flex-wrap: wrap;
}
.card-actions { display: flex; align-items: center; gap: 16px; }
.card-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ============= Status / role badges ============= */

.badge {
    display: inline-block;
    font-family: var(--font-mono); font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    padding: 3px 8px; border-radius: 0; line-height: 1.4;
    border: 1px solid transparent;
}
.badge-published     { background: var(--ipr-blue); color: #fff; }
.badge-pending       { background: var(--ipr-yellow); color: var(--ipr-black); }
.badge-draft         { background: var(--ipr-ink-300); color: var(--ipr-ink-900); }
.badge-rejected      { background: var(--ipr-black); color: #fff; }
.badge-access_pending { background: var(--ipr-marigold); color: var(--ipr-black); }
.badge-admin  { background: var(--ipr-blue); color: #fff; }
.badge-member { background: var(--ipr-ink-300); color: var(--ipr-ink-900); }
.badge-update { background: var(--ipr-marigold); color: var(--ipr-black); border-color: var(--ipr-black); }

/* ============= Tags + filter chips ============= */

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-pill {
    font-family: var(--font-mono); font-size: 11px;
    color: var(--fg-muted); background: var(--ipr-ink-100);
    border: 1px solid var(--rule); padding: 2px 8px; border-radius: 0;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.cat-chip {
    font-family: var(--font-mono); font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em;
    background: var(--ipr-black); color: #fff;
    border: 1px solid var(--ipr-black); border-radius: 0;
    padding: 6px 12px; cursor: pointer;
}
.cat-chip.off { opacity: .4; text-decoration: line-through; }

/* ============= Live search toolbar ============= */
.catalog-toolbar { margin-bottom: 20px; }
/* Search + (docs only) grouping toggle share a row; the empty note sits below. */
.catalog-toolbar-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.group-toggle { display: inline-flex; border: 1px solid var(--rule-strong); }
.group-toggle-opt {
    font-family: var(--font-mono); font-size: 12px; text-transform: uppercase;
    letter-spacing: var(--ls-eyebrow); padding: 9px 14px; min-height: 44px;
    display: inline-flex; align-items: center;
    color: var(--ipr-black); text-decoration: none; background: var(--ipr-white);
}
.group-toggle-opt + .group-toggle-opt { border-left: 1px solid var(--rule-strong); }
.group-toggle-opt.is-active { background: var(--ipr-black); color: var(--ipr-white); }
.catalog-search {
    width: 100%; max-width: 420px;
    font-family: var(--font-mono); font-size: 14px;
    color: var(--ipr-black); background: var(--ipr-white);
    border: 1px solid var(--rule-strong); border-radius: 0;
    padding: 11px 14px; min-height: 44px;
    appearance: none; -webkit-appearance: none;
}
.catalog-search::placeholder { color: var(--fg-muted); }
.catalog-search:focus-visible { outline: 2px solid var(--ipr-blue); outline-offset: 1px; }
.catalog-empty {
    font-family: var(--font-serif); color: var(--fg-muted);
    font-size: 16px; margin: 8px 0 0;
}
.catalog-empty [data-catalog-empty-query] {
    font-family: var(--font-mono); color: var(--ipr-black);
}

/* ============= WIP stamp ============= */
.wip-stamp {
    position: absolute; top: 12px; right: 12px;
    transform: rotate(8deg);
    background: var(--ipr-yellow); color: var(--ipr-black);
    border: 2px solid var(--ipr-black);
    font-family: var(--font-mono); font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    padding: 2px 6px;
}

/* ============= Forms ============= */

.form-card {
    background: var(--ipr-white); border: 1px solid var(--rule);
    border-radius: 0; padding: 28px;
    display: flex; flex-direction: column; gap: 20px;
}
.form-narrow { max-width: 640px; margin: 0 auto; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field-label {
    font-family: var(--font-mono); font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: var(--ls-eyebrow);
    color: var(--ipr-black);
}
.field input[type="text"], .field input[type="url"], .field input[type="number"],
.field input:not([type]), .field textarea, .field select {
    width: 100%; border: 1px solid var(--rule-strong); border-radius: 0;
    padding: 10px 12px; font-family: var(--font-serif); font-size: 15px;
    background: var(--ipr-white); color: var(--ipr-black); outline: none;
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
    border-color: var(--ipr-blue);
}
.field-hint {
    font-family: var(--font-mono); font-size: 11px; line-height: 1.5;
    color: var(--fg-muted); margin: 0;
}
.field-hint.warn { color: var(--ipr-marigold); }
.field-hint a { color: inherit; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.checkrow {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-mono); font-size: 13px; text-transform: uppercase;
    letter-spacing: 0.03em;
}
.checkrow input { width: 16px; height: 16px; accent-color: var(--ipr-blue); }
.form-actions { display: flex; align-items: center; gap: 18px; padding-top: 4px; }

/* Additional-links editor (repeating rows) */
.link-row {
    display: grid;
    grid-template-columns: minmax(110px, 0.6fr) minmax(0, 1fr) minmax(0, 1.6fr) auto;
    gap: 10px; align-items: center; margin-bottom: 10px;
}
.link-row [data-link-label][hidden] { display: none; }
@media (max-width: 640px) {
    .link-row { grid-template-columns: 1fr; }
}

/* ============= Data table (admin) ============= */

.data-table-wrap { background: var(--ipr-white); border: 1px solid var(--rule); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
    font-family: var(--font-mono); font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: var(--ls-eyebrow);
    color: var(--fg-muted); text-align: left;
    padding: 12px 16px; border-bottom: 1px solid var(--rule);
    background: var(--ipr-ink-100);
}
.data-table tbody td {
    padding: 12px 16px; border-bottom: 1px solid var(--rule);
    font-family: var(--font-serif); font-size: 15px; vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .col-right { text-align: right; }
.data-table .muted-cell { color: var(--fg-muted); }

/* ============= Activity log (filters + pager) ============= */
.activity-filters {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
    margin-bottom: 20px;
}
.activity-filter {
    font-family: var(--font-mono); font-size: 13px;
    color: var(--ipr-black); background: var(--ipr-white);
    border: 1px solid var(--rule-strong); border-radius: 0;
    padding: 8px 12px; min-height: 38px;
}
.activity-filter:focus-visible { outline: 2px solid var(--ipr-blue); outline-offset: 1px; }
.activity-pager { margin-top: 16px; display: flex; gap: 16px; }

/* ============= Modal (native <dialog>) ============= */

.modal {
    border: 1px solid var(--ipr-black); border-radius: 0; padding: 0;
    width: 100%; max-width: 560px; background: var(--ipr-white);
    color: var(--ipr-black);
}
.modal.modal-wide { max-width: 720px; }
.modal::backdrop { background: rgba(21, 22, 24, 0.55); }
.modal-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 22px; border-bottom: 1px solid var(--rule);
}
.modal-title {
    font-family: var(--font-display); font-weight: 700; font-size: 22px;
    text-transform: uppercase; line-height: 1; margin: 0;
}
.modal-close {
    font-family: var(--font-mono); font-size: 22px; line-height: 1;
    background: none; border: none; cursor: pointer; color: var(--fg-muted);
}
.modal-close:hover { color: var(--ipr-black); }
.modal-body {
    padding: 20px 22px; display: flex; flex-direction: column; gap: 14px;
    font-family: var(--font-serif); font-size: 15px; line-height: 1.55;
    max-height: 70vh; overflow-y: auto;
}
.modal-body p { margin: 0; }
.modal-desc {
    font-family: var(--font-ui); font-size: 14px; line-height: 1.5;
    color: var(--fg);
}
.modal-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.modal-foot {
    padding: 14px 22px; border-top: 1px solid var(--rule);
    display: flex; justify-content: flex-end; gap: 12px; flex-wrap: wrap;
}

/* ============= Code blocks ============= */

pre.code-block {
    background: var(--ipr-black); color: var(--ipr-ink-100);
    font-family: var(--font-mono); font-size: 12px; line-height: 1.5;
    padding: 14px 16px; border-radius: 0; overflow-x: auto; margin: 0;
}
code {
    font-family: var(--font-mono); font-size: 0.88em;
    background: var(--ipr-ink-100); border: 1px solid var(--rule);
    padding: 1px 5px;
}
pre.code-block code { background: none; border: none; padding: 0; font-size: 1em; color: inherit; }

/* ============= Alerts ============= */

.alert {
    border-left: 4px solid var(--ipr-blue);
    background: var(--ipr-white); border-top: 1px solid var(--rule);
    border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
    padding: 12px 16px; font-family: var(--font-serif); font-size: 14px;
    line-height: 1.5;
}
.alert-error { border-left-color: #c0341d; }
.alert-ok    { border-left-color: var(--ipr-blue); }
.alert-warn  { border-left-color: var(--ipr-marigold); }
.alert ul { margin: 0; padding-left: 18px; }
.alert .alert-title {
    font-family: var(--font-mono); font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em; display: block; margin-bottom: 4px;
}

/* ============= Flash stack ============= */
.flash-stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }

/* ============= Login ============= */
.login-wrap {
    flex: 1 0 auto;
    display: flex; align-items: center; justify-content: center;
    padding: 64px 24px;
}
.login-card {
    width: 100%; max-width: 380px;
    background: var(--ipr-white); border: 1px solid var(--rule);
    padding: 40px 32px; text-align: center;
}
.login-card .page-title { font-size: 34px; }
.login-card p { font-family: var(--font-serif); color: var(--fg-muted); font-size: 15px; }

/* ============= Sync overlay ============= */
#sync-overlay {
    position: fixed; inset: 0; z-index: 60;
    display: none; align-items: center; justify-content: center;
    background: rgba(21, 22, 24, 0.55);
}
#sync-overlay.show { display: flex; }
.sync-box {
    display: flex; align-items: center; gap: 14px;
    background: var(--ipr-white); border: 1px solid var(--ipr-black);
    padding: 18px 26px;
    font-family: var(--font-mono); font-size: 13px; text-transform: uppercase;
    letter-spacing: 0.05em;
}
.sync-spinner {
    width: 18px; height: 18px; border-radius: 999px;
    border: 2px solid var(--rule); border-top-color: var(--ipr-black);
    animation: sync-spin .7s linear infinite;
}
@keyframes sync-spin { to { transform: rotate(360deg); } }

/* ============= Misc utilities ============= */
.muted { color: var(--fg-muted); }
.mono { font-family: var(--font-mono); }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-end { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.empty-note { font-family: var(--font-serif); color: var(--fg-muted); font-size: 16px; }
/* Used on inline forms (close buttons, delete actions) to kill default margins. */
.m-0 { margin: 0; }

/* ============= Support / feedback bubble ============= */

/* Fixed shell in the bottom-right corner. Sits below the sync overlay
   (z-index 60) so a marketplace sync still covers it. */
.support-widget {
    position: fixed; right: 22px; bottom: 22px; z-index: 50;
    display: flex; flex-direction: column; align-items: flex-end; gap: 14px;
}

/* The round launcher button. */
.support-toggle {
    width: 56px; height: 56px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--ipr-black); color: var(--ipr-yellow);
    border: 2px solid var(--ipr-black); cursor: pointer;
    box-shadow: var(--shadow-pop);
    transition: transform .15s ease, filter .15s ease;
}
.support-toggle:hover { filter: brightness(1.08); }
.support-toggle:active { transform: translateY(1px); }
.support-icon-close {
    display: none;
    font-family: var(--font-mono); font-size: 30px; line-height: 1;
}
/* Swap glyphs when the panel is open. */
.support-widget.is-open .support-icon-open { display: none; }
.support-widget.is-open .support-icon-close { display: inline; }

/* The popover card. Sharp corners + hard shadow, per brand. */
.support-panel {
    width: min(360px, calc(100vw - 44px));
    background: var(--ipr-white);
    border: 1px solid var(--ipr-black);
    box-shadow: var(--shadow-pop);
    /* Anchor the panel above the button (button is the last flex child). */
    order: -1;
    transform-origin: bottom right;
    animation: support-pop .14s ease;
}
@keyframes support-pop {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .support-panel { animation: none; }
    .support-toggle { transition: none; }
}

.support-panel-head {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px; border-bottom: 1px solid var(--rule);
    background: var(--ipr-black); color: var(--ipr-white);
}
.support-panel-title {
    flex: 1 1 auto; margin: 0;
    font-family: var(--font-display); font-weight: 700; font-size: 20px;
    text-transform: uppercase; line-height: 1; letter-spacing: var(--ls-heading);
    color: var(--ipr-yellow);
}
.support-panel-close,
.support-back {
    background: none; border: none; cursor: pointer;
    color: var(--ipr-white); padding: 0;
    font-family: var(--font-mono); line-height: 1;
}
.support-panel-close { font-size: 24px; }
.support-back { font-size: 20px; }
.support-panel-close:hover,
.support-back:hover { color: var(--ipr-yellow); }

.support-panel-body {
    padding: 18px 16px;
    display: flex; flex-direction: column; gap: 14px;
}
/* The message/iframe views toggle via the `hidden` attribute. The body uses
   display:flex, which would otherwise beat the UA [hidden] rule (equal
   specificity, author wins) and leave a "hidden" view visible — so force it. */
.support-widget [hidden] { display: none !important; }
.support-message {
    margin: 0;
    font-family: var(--font-serif); font-size: 15px; line-height: 1.55;
    color: var(--fg);
}
.support-cta { text-decoration: none; }

/* Iframe view — the embedded form fills a tall, scrollable area. */
.support-panel-form { padding: 0; }
.support-iframe {
    display: block; width: 100%; height: min(70vh, 560px);
    border: 0; background: var(--ipr-white);
}
/* Escape hatch under the embedded form — always opens the form full-page, which
   works even when framing hits a sign-in wall. */
.support-form-foot {
    padding: 10px 16px; border-top: 1px solid var(--rule);
    background: var(--ipr-ink-100);
}
.support-newtab {
    font-family: var(--font-mono); font-size: 12px;
    text-transform: uppercase; letter-spacing: var(--ls-eyebrow);
    color: var(--fg-muted); text-decoration: none;
}
.support-newtab:hover { color: var(--ipr-black); text-decoration: underline; }

@media (max-width: 480px) {
    .support-widget { right: 14px; bottom: 14px; }
}

/* ============= Docs wiki ============= */

/* Card that navigates to a page (docs) rather than opening a modal. */
.card-link { text-decoration: none; color: inherit; display: block; }
.card-link:hover .card-title { text-decoration: underline; text-underline-offset: 3px; }
.tag-inline { font-family: var(--font-mono); color: var(--ipr-blue); }
.category-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Tag filter chips — a lighter, outlined variant of the category chip. */
.chip-row-tags { margin-top: -12px; }
.cat-chip-tag {
    background: var(--ipr-white); color: var(--ipr-black);
    border: 1px solid var(--rule-strong);
}
.cat-chip-tag:hover { border-color: var(--ipr-blue); color: var(--ipr-blue); }

.form-narrow-wide { max-width: 860px; }

/* Doc reading view. */
.doc-article { max-width: 820px; margin: 0 auto; }
.doc-breadcrumb {
    display: flex; align-items: center; gap: 12px;
    font-family: var(--font-mono); font-size: 12px;
    color: var(--fg-muted); margin: 0 0 16px;
}
.doc-title { font-size: 40px; }
.doc-meta {
    font-family: var(--font-mono); font-size: 12px;
    color: var(--fg-muted); margin: 10px 0 0;
}
/* Page content sits on a white card; title/meta above and controls below stay
   on the page background. Card padding owns the internal top gap. */
.doc-card {
    background: var(--ipr-white); border: 1px solid var(--rule);
    padding: 28px 32px; margin-top: 24px;
}
.doc-card > *:first-child { margin-top: 0; }
.doc-foot {
    margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--rule);
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap;
}

/* Content-type toggle on the doc form. */
.kind-toggle { display: flex; flex-direction: column; gap: 8px; }
.kind-opt {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-serif); font-size: 15px; cursor: pointer;
    text-transform: none; letter-spacing: 0;
}
.kind-opt input { width: 16px; height: 16px; accent-color: var(--ipr-blue); }

/* Responsive embed (Google Docs/Sheets/Slides iframe), 16:9 with a min height. */
.embed-frame {
    position: relative; width: 100%;
    padding-top: 62.5%; /* 16:10-ish, comfortable for docs + slides */
    border: 1px solid var(--rule); background: var(--ipr-ink-100);
}
.embed-frame iframe {
    position: absolute; inset: 0; width: 100%; height: 100%;
}

/* Rendered Markdown prose. */
.doc-body {
    font-family: var(--font-serif); font-size: 17px; line-height: 1.7;
    color: var(--ipr-black);
}
.doc-body > *:first-child { margin-top: 0; }
.doc-body h1, .doc-body h2, .doc-body h3, .doc-body h4 {
    font-family: var(--font-display); text-transform: none;
    line-height: 1.2; margin: 1.6em 0 0.5em;
}
.doc-body h1 { font-size: 30px; }
.doc-body h2 { font-size: 24px; }
.doc-body h3 { font-size: 20px; }
.doc-body h4 { font-size: 17px; }
.doc-body p, .doc-body ul, .doc-body ol, .doc-body blockquote, .doc-body pre, .doc-body table {
    margin: 0 0 1em;
}
.doc-body ul, .doc-body ol { padding-left: 1.4em; }
.doc-body li { margin: 0.3em 0; }
.doc-body a { color: var(--ipr-blue); text-underline-offset: 3px; }
.doc-body code {
    font-family: var(--font-mono); font-size: 0.88em;
    background: var(--ipr-ink-100); border: 1px solid var(--rule);
    padding: 1px 5px;
}
.doc-body pre {
    background: var(--ipr-black); color: var(--ipr-white);
    padding: 16px; overflow-x: auto;
}
.doc-body pre code { background: none; border: none; color: inherit; padding: 0; }
.doc-body blockquote {
    border-left: 3px solid var(--ipr-yellow);
    padding-left: 16px; color: var(--fg-muted);
}
.doc-body img { max-width: 100%; height: auto; }
.doc-body table { width: 100%; border-collapse: collapse; }
.doc-body th, .doc-body td {
    border: 1px solid var(--rule); padding: 8px 12px; text-align: left;
    font-family: var(--font-serif); font-size: 15px;
}
.doc-body th { background: var(--ipr-ink-100); }

/* ============= Text selection ============= */
::selection { background: var(--ipr-yellow); color: var(--ipr-black); }

/* ============= Focus-visible (keyboard) ============= */
/* Branded ring for keyboard users; mouse clicks stay clean via :focus-visible. */
.btn:focus-visible,
.nav-link:focus-visible,
.tlink:focus-visible,
.cat-chip:focus-visible,
.card-trigger:focus-visible,
.modal-close:focus-visible,
a:focus-visible {
    outline: 2px solid var(--ipr-blue);
    outline-offset: 2px;
}
.field input:focus-visible,
.field textarea:focus-visible,
.field select:focus-visible {
    outline: 2px solid var(--ipr-blue);
    outline-offset: 1px;
}

/* ============= Reduced motion ============= */
@media (prefers-reduced-motion: reduce) {
    .sync-spinner { animation: none; }
    * { transition-duration: 0.01ms !important; }
}

/* ============= Responsive ============= */
@media (max-width: 900px) {
    .card-grid { grid-template-columns: 1fr; }
    .catalog-search { max-width: none; }
    .form-row { grid-template-columns: 1fr; }
    .nav-links { gap: 18px; }
    .page-title { font-size: 36px; }
    .doc-title { font-size: 32px; }
}
@media (max-width: 640px) {
    .nav-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
    .nav-right { gap: 16px; }
    .nav-links { flex-wrap: wrap; row-gap: 12px; }
    /* When the bar stacks, anchor menus to the toggle's left edge and cap width
       so a menu can't overflow the viewport. */
    .nav-menu { min-width: 150px; max-width: calc(100vw - 40px); }
    .page-wrap { padding: 28px 20px 56px; }
    .doc-card { padding: 20px; }
}
