/*
 * Wellnomics API documentation - shared stylesheet.
 *
 * Colour tokens, the light/dark split and the card/chip/tooltip vocabulary are
 * carried over from the original hand-built "Wellnomics Customer APIs" page so
 * the generated site looks like a continuation of it rather than a replacement.
 *
 * Dark is the base palette; [data-theme="light"] overrides it, and light is the
 * default applied by site.js.
 */

:root {
    --bg: #0e1726;
    --bg-soft: #16223a;
    --card: #1a2842;
    --card-2: #20335a;
    --ink: #eaf1ff;
    --ink-soft: #9fb2d4;
    --line: #2c4063;
    --accent: #3da9fc;
    --accent-ink: #04263f;
    --groups: #8b9cff;
    --wellbeing: #5ec8d8;
    --ergo: #f6a96b;
    --good: #4ade80;
    --grey: #8797b4;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    --pill-bg: #233456;
    --pill-ink: #aebfe2;
    --tip-bg: #0b1322;
    --tip-ink: #eaf1ff;
    --tip-line: #2c4063;
    --tip-soft: #9fb2d4;
    --tip-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    --get: #3da9fc;
    --post: #2bb673;
    --put: #d08a37;
    --delete: #e0625f;
    --warn-bg: #3a2415;
    --warn-line: #7a4a1e;
    --advice-bg: #12283a;
    --advice-line: #23516f;
    --code-bg: #0b1322;
}

[data-theme='light'] {
    --bg: #f3f6fc;
    --bg-soft: #e8eef9;
    --card: #ffffff;
    --card-2: #f4f8ff;
    --ink: #16243c;
    --ink-soft: #5a6b88;
    --line: #d4deef;
    --accent: #1f7ae0;
    --accent-ink: #ffffff;
    --groups: #4b5edb;
    --wellbeing: #1d97a8;
    --ergo: #d97a2b;
    --good: #1ca85a;
    --grey: #6b7c99;
    --shadow: 0 8px 24px rgba(40, 70, 120, 0.12);
    --pill-bg: #eaf1ff;
    --pill-ink: #4a5d80;
    --tip-bg: #ffffff;
    --tip-ink: #16243c;
    --tip-line: #cdd9ee;
    --tip-soft: #5a6b88;
    --tip-shadow: 0 10px 28px rgba(40, 70, 120, 0.22);
    --get: #1f7ae0;
    --post: #1f9d57;
    --put: #c07d2a;
    --delete: #cf4b4b;
    --warn-bg: #fdf4e7;
    --warn-line: #e6c48d;
    --advice-bg: #eef6fd;
    --advice-line: #b9d8f2;
    --code-bg: #f4f8ff;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    transition:
        background 0.25s ease,
        color 0.25s ease;
}

.wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 28px 22px 64px;
}

svg.icon {
    display: block;
    width: 18px;
    height: 18px;
}

.mono,
code {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

code {
    background: var(--card-2);
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 0.5px 5px;
    font-size: 0.9em;
    overflow-wrap: anywhere;
}

a {
    color: var(--accent);
}

/* ---------- header ---------- */

header.top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.title-block h1 {
    font-size: clamp(22px, 4vw, 32px);
    margin: 0 0 6px;
    letter-spacing: -0.4px;
}

.title-block p.sub {
    margin: 0;
    color: var(--ink-soft);
    font-size: clamp(14px, 2.4vw, 16px);
    max-width: 72ch;
}

.controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
}

.lang {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
    background: var(--card);
    box-shadow: var(--shadow);
}

.lang-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 12px;
    color: var(--ink-soft);
    padding: 7px 12px;
    letter-spacing: 0.3px;
}

.lang-btn.active {
    background: var(--accent);
    color: var(--accent-ink);
}

.lang-btn:not(.active):hover {
    color: var(--ink);
}

.toggle {
    cursor: pointer;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--ink);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow);
    font-family: inherit;
}

.toggle:hover {
    border-color: var(--accent);
}

.toggle svg {
    width: 16px;
    height: 16px;
}

.crumb {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: var(--ink-soft);
    margin-bottom: 14px;
}

.crumb:hover {
    color: var(--accent);
}

.crumb svg {
    width: 14px;
    height: 14px;
    transform: rotate(180deg);
}

/* ---------- badges ---------- */

.meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 4px 0 24px;
}

.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--ink);
}

.badge-pill .k {
    color: var(--ink-soft);
    font-weight: 600;
}

.badge-pill .v {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

.badge-pill svg {
    width: 15px;
    height: 15px;
    color: var(--ink-soft);
}

a.badge-pill {
    text-decoration: none;
    cursor: pointer;
    color: var(--ink);
}

a.badge-pill:hover {
    border-color: var(--accent);
}

a.badge-pill:hover .ext,
a.badge-pill:hover .v {
    color: var(--accent);
}

.badge-pill.restricted {
    border-color: var(--put);
}

.badge-pill.restricted svg {
    color: var(--put);
}

.badge-pill.deprecated {
    border-color: var(--delete);
    color: var(--delete);
}

.badge-pill.deprecated svg {
    color: var(--delete);
}

/* ---------- landing page ---------- */

.api-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
    margin: 8px 0 32px;
}

.api-tile {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 22px 20px 18px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition:
        border-color 0.15s ease,
        transform 0.15s ease;
}

.api-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--accent);
}

.api-tile:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* A coming-soon API. Rendered as a div rather than a link, so there is no
   pointer affordance to remove and no href in the markup to find. */
.api-tile.is-soon {
    cursor: default;
    position: relative;
    overflow: hidden;
}

.api-tile.is-soon::before {
    background: var(--grey);
}

.api-tile.is-soon:hover {
    border-color: var(--line);
    transform: none;
}

.api-tile.is-soon .tile-head .badge {
    background: color-mix(in srgb, var(--grey) 16%, transparent);
    color: var(--grey);
}

.api-tile.is-soon h2,
.api-tile.is-soon .direction {
    color: var(--ink-soft);
}

/* Corner ribbon, rather than a diagonal overlay across the whole tile, so it
   never sits on top of the text a reader is trying to take in.
 *
 * Two elements on purpose. The outer square is the clipping window; the inner
 * band is wider than the square's diagonal (120 * root2 is about 170) so it
 * reaches both edges, and is rotated about its own centre. Positioning a
 * rotated band with negative offsets instead leaves it at the mercy of the
 * parent's overflow, which is what clipped the text off the first version. */
.api-tile.is-soon .soon-ribbon {
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.api-tile.is-soon .soon-ribbon > span {
    position: absolute;
    display: block;
    top: 30px;
    right: -52px;
    width: 190px;
    padding: 5px 0;
    transform: rotate(45deg);
    text-align: center;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    line-height: 1.2;
    background: var(--grey);
    color: var(--card);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.api-tile .tile-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.api-tile .tile-head .badge {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex: none;
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    color: var(--accent);
}

.api-tile .tile-head .badge svg {
    width: 24px;
    height: 24px;
}

.api-tile h2 {
    margin: 0;
    font-size: 19px;
}

.api-tile .direction {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--ink-soft);
}

.api-tile .tile-lede {
    color: var(--ink-soft);
    font-size: 14px;
    margin: 0 0 16px;
}

.api-tile .tile-foot {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.tile-stat {
    font-size: 12px;
    color: var(--ink-soft);
    background: var(--card-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tile-stat svg {
    width: 13px;
    height: 13px;
}

.tile-stat.lock {
    color: var(--put);
    border-color: var(--put);
}

.tile-go {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
}

.tile-go svg {
    width: 15px;
    height: 15px;
}

/* ---------- tabs ---------- */

.tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--line);
    margin: 18px 0 28px;
}

.tab {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-family: inherit;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: var(--ink-soft);
    font-size: 15px;
    font-weight: 700;
    padding: 11px 16px;
    border-radius: 8px 8px 0 0;
}

.tab svg {
    width: 18px;
    height: 18px;
}

.tab:hover {
    color: var(--ink);
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab .tcount {
    font-size: 11px;
    font-weight: 700;
    color: var(--ink-soft);
    background: var(--pill-bg);
    border-radius: 999px;
    padding: 1px 8px;
}

.tab.active .tcount {
    color: var(--accent);
}

.panel {
    display: none;
}

.panel.active {
    display: block;
}

/* ---------- companion strip ---------- */

.companion {
    margin: 0 0 28px;
    padding: 14px 18px;
    border-radius: 14px;
    background: linear-gradient(90deg, var(--bg-soft), transparent);
    border: 1px solid var(--line);
    font-size: 14.5px;
}

.companion b {
    color: var(--accent);
}

.companion .small {
    display: block;
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--ink-soft);
}

/* ---------- flow diagram ---------- */

.flow {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1.1fr;
    align-items: center;
    margin: 8px 0 36px;
}

.node {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 18px 16px;
    text-align: center;
    box-shadow: var(--shadow);
    min-height: 132px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.node .ico {
    color: var(--accent);
}

.node .ico svg {
    width: 32px;
    height: 32px;
}

.node .nm {
    font-weight: 700;
    font-size: 15px;
}

.node .ds {
    font-size: 12.5px;
    color: var(--ink-soft);
}

.node.api {
    border-color: var(--accent);
    background: var(--card-2);
}

.node.key {
    border-style: dashed;
}

.arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.arrow svg {
    width: 100%;
    height: 26px;
}

/* ---------- capability cards ---------- */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 18px;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 20px 18px 18px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
}

.card.c-indigo::before {
    background: var(--groups);
}
.card.c-teal::before {
    background: var(--wellbeing);
}
.card.c-amber::before {
    background: var(--ergo);
}
.card.c-green::before {
    background: var(--good);
}
.card.c-grey::before {
    background: var(--grey);
}

.card .head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2px;
}

.card .head .badge {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex: none;
}

.card .head .badge svg {
    width: 24px;
    height: 24px;
}

.card.c-indigo .badge {
    background: color-mix(in srgb, var(--groups) 18%, transparent);
    color: var(--groups);
}
.card.c-teal .badge {
    background: color-mix(in srgb, var(--wellbeing) 18%, transparent);
    color: var(--wellbeing);
}
.card.c-amber .badge {
    background: color-mix(in srgb, var(--ergo) 18%, transparent);
    color: var(--ergo);
}
.card.c-green .badge {
    background: color-mix(in srgb, var(--good) 18%, transparent);
    color: var(--good);
}
.card.c-grey .badge {
    background: color-mix(in srgb, var(--grey) 18%, transparent);
    color: var(--grey);
}

.card h3 {
    margin: 0;
    font-size: 17px;
}

.card .question {
    color: var(--ink);
    font-size: 14px;
    font-style: italic;
    margin: 12px 0 8px;
}

.card .lede {
    color: var(--ink-soft);
    font-size: 13.5px;
    margin: 0 0 14px;
}

.card.is-deprecated {
    opacity: 0.92;
}

.dep-flag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--delete);
    border: 1px solid var(--delete);
    border-radius: 6px;
    padding: 2px 7px;
    margin-bottom: 10px;
}

.dep-flag svg {
    width: 12px;
    height: 12px;
}

.section-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--ink-soft);
    margin: 12px 0 8px;
    font-weight: 700;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.chip {
    background: var(--card-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 11px;
    font-size: 12.5px;
    color: var(--ink);
    white-space: nowrap;
}

.chip[data-tip-id] {
    cursor: help;
}

.chip[data-tip-id]:hover,
.chip[data-tip-id]:focus-visible {
    border-color: var(--accent);
    outline: none;
}

/* A field with no curated copy. Visible on purpose: an unexplained field in a
   customer document is a defect, and hiding it would hide the defect. */
.chip.uncurated {
    border-style: dashed;
    color: var(--ink-soft);
}

.chip.uncurated::after {
    content: ' ?';
    font-weight: 700;
    color: var(--put);
}

.card .foot {
    margin-top: auto;
    padding-top: 16px;
}

.card .foot .ops {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.api-call {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    max-width: 100%;
    flex-wrap: wrap;
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 11.5px;
    background: var(--card-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 7px 10px;
}

.api-call:hover {
    border-color: var(--accent);
}

.method {
    font-weight: 800;
    color: var(--accent-ink);
    background: var(--get);
    border-radius: 5px;
    padding: 1px 6px;
    font-size: 10.5px;
    letter-spacing: 0.3px;
}

.method.post {
    background: var(--post);
    color: #fff;
}
.method.put {
    background: var(--put);
    color: #fff;
}
.method.delete {
    background: var(--delete);
    color: #fff;
}

.api-call .path {
    color: var(--ink-soft);
    overflow-wrap: anywhere;
}

.api-call .ext {
    width: 13px;
    height: 13px;
    color: var(--ink-soft);
    margin-left: auto;
    flex: none;
}

.api-call:hover .ext,
.api-call:hover .path {
    color: var(--accent);
}

/* ---------- getting started steps ---------- */

.steps {
    counter-reset: step;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 8px 0 28px;
}

.step {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 20px 22px;
    box-shadow: var(--shadow);
    position: relative;
}

.step-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.step-num {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 800;
    font-size: 14px;
    display: grid;
    place-items: center;
    flex: none;
}

.step h3 {
    margin: 0;
    font-size: 16.5px;
}

.who {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--pill-bg);
    color: var(--pill-ink);
    flex: none;
}

.step p {
    margin: 0 0 10px;
    font-size: 14.5px;
}

.callout {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border-radius: 10px;
    padding: 11px 13px;
    font-size: 13.5px;
    margin: 12px 0 0;
    border: 1px solid var(--advice-line);
    background: var(--advice-bg);
}

.callout svg {
    flex: none;
    margin-top: 2px;
    width: 16px;
    height: 16px;
    color: var(--accent);
}

.callout.warning {
    border-color: var(--warn-line);
    background: var(--warn-bg);
}

.callout.warning svg {
    color: var(--put);
}

/* ---------- code blocks ---------- */

.code-tabs {
    margin: 12px 0 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: var(--code-bg);
}

.code-tabs .bar {
    display: flex;
    gap: 2px;
    background: var(--card-2);
    border-bottom: 1px solid var(--line);
    padding: 4px 4px 0;
}

.code-tabs .bar button {
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    border: none;
    background: transparent;
    color: var(--ink-soft);
    padding: 7px 12px;
    cursor: pointer;
    border-radius: 7px 7px 0 0;
}

.code-tabs .bar button.active {
    background: var(--code-bg);
    color: var(--accent);
}

.code-tabs pre {
    margin: 0;
    padding: 14px 16px;
    overflow-x: auto;
    font-size: 12.5px;
    line-height: 1.6;
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    color: var(--ink);
}

.code-tabs pre[hidden] {
    display: none;
}

/* ---------- tables ---------- */

.table-scroll {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card);
    box-shadow: var(--shadow);
    margin: 0 0 24px;
}

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    min-width: 640px;
}

table.data th,
table.data td {
    text-align: left;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

table.data th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--ink-soft);
    background: var(--card-2);
    white-space: nowrap;
}

table.data tr:last-child td {
    border-bottom: none;
}

table.data td.nowrap {
    white-space: nowrap;
}

/* Allowed values for an enum, listed under the description that mentions them. */
.enum-values {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 9px;
    padding-top: 9px;
    border-top: 1px dashed var(--line);
}

.enum-values .ev {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 7px;
    font-size: 12.5px;
}

.enum-values .ev code {
    flex: none;
    min-width: 2.2em;
    text-align: center;
}

.enum-values .ev b {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink);
}

.enum-values .ev span {
    color: var(--ink-soft);
}

.enum-values .ev-note {
    margin-top: 5px;
    font-size: 12px;
    font-style: italic;
    color: var(--ink-soft);
}

/* An integrator-facing warning inside a table cell. Deliberately not styled as
   an error: it is a "build for this" note, not a failure. */
.cell-note {
    display: flex;
    gap: 7px;
    align-items: flex-start;
    margin-top: 8px;
    padding: 8px 10px;
    border: 1px solid var(--warn-line);
    background: var(--warn-bg);
    border-radius: 8px;
    font-size: 12.5px;
    line-height: 1.45;
}

.cell-note svg {
    flex: none;
    margin-top: 2px;
    width: 14px;
    height: 14px;
    color: var(--put);
}

.req {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--delete);
    letter-spacing: 0.5px;
}

.opt {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--ink-soft);
    letter-spacing: 0.5px;
}

/* ---------- endpoint blocks ---------- */

.endpoint {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin: 0 0 18px;
    overflow: hidden;
}

.endpoint > summary {
    cursor: pointer;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-weight: 600;
}

.endpoint > summary::-webkit-details-marker {
    display: none;
}

.endpoint > summary:hover {
    background: var(--card-2);
}

.endpoint .ep-path {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.endpoint .ep-sum {
    font-size: 13px;
    font-weight: 400;
    color: var(--ink-soft);
    flex-basis: 100%;
}

.endpoint .ep-body {
    padding: 4px 20px 20px;
    border-top: 1px solid var(--line);
}

.endpoint .ep-body h4 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--ink-soft);
    margin: 20px 0 8px;
}

/* ---------- recipes ---------- */

.recipe {
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: 14px;
    padding: 18px 20px;
    margin: 0 0 16px;
    box-shadow: var(--shadow);
}

.recipe h3 {
    margin: 0 0 10px;
    font-size: 16.5px;
}

.recipe .rlabel {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--ink-soft);
    display: block;
    margin-top: 10px;
}

.recipe p {
    margin: 2px 0 0;
    font-size: 14px;
}

.recipe .ops {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

/* ---------- sample pack ---------- */

.sample-pack {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 20px 22px;
    box-shadow: var(--shadow);
    margin: 24px 0 0;
}

.sample-pack h3 {
    margin: 0 0 10px;
    font-size: 16.5px;
}

.sample-pack > p {
    margin: 0 0 14px;
    font-size: 14px;
    color: var(--ink-soft);
}

.script-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    flex: none;
}

.script-link svg {
    width: 14px;
    height: 14px;
    color: var(--ink-soft);
}

.script-link:hover code {
    border-color: var(--accent);
    color: var(--accent);
}

/* Read-only script viewer. */
.script {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin: 0 0 18px;
    overflow: hidden;
}

.script > header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 18px;
    background: var(--card-2);
    border-bottom: 1px solid var(--line);
}

.script > header svg {
    width: 15px;
    height: 15px;
    color: var(--ink-soft);
    flex: none;
}

.script .script-name {
    font-size: 13px;
    font-weight: 600;
}

.script .role {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 2px 7px;
    border-radius: 5px;
    background: var(--pill-bg);
    color: var(--pill-ink);
    flex: none;
}

.script .script-size {
    font-size: 12px;
    color: var(--ink-soft);
}

.copy-btn {
    margin-left: auto;
    flex: none;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--ink);
}

.copy-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.copy-btn.done {
    border-color: var(--good);
    color: var(--good);
}

.script .script-desc {
    margin: 0;
    padding: 12px 18px 0;
    font-size: 13.5px;
    color: var(--ink-soft);
}

/* Capped height: a 900-line module should not push everything else off the
   page, but it stays fully scrollable and fully selectable. */
.script pre {
    margin: 12px 0 0;
    padding: 14px 18px 18px;
    max-height: 460px;
    overflow: auto;
    font-size: 12.5px;
    line-height: 1.55;
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    background: var(--code-bg);
    border-top: 1px solid var(--line);
    tab-size: 4;
}

.script pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    white-space: pre;
    overflow-wrap: normal;
}

.small-note {
    margin: 16px 0 0;
    font-size: 12.5px;
    color: var(--ink-soft);
}

/* ---------- legend / footer ---------- */

.legend {
    margin-top: 34px;
    display: flex;
    flex-wrap: wrap;
    gap: 18px 26px;
    align-items: center;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--bg-soft);
    font-size: 13px;
    color: var(--ink-soft);
}

.legend .li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.legend .sw {
    width: 14px;
    height: 14px;
    border-radius: 4px;
}

.legend .li svg {
    width: 14px;
    height: 14px;
    color: var(--accent);
}

footer.note {
    margin-top: 22px;
    font-size: 12px;
    color: var(--ink-soft);
}

/* ---------- tooltip ---------- */

#tip {
    position: fixed;
    z-index: 100;
    max-width: 320px;
    pointer-events: none;
    background: var(--tip-bg);
    color: var(--tip-ink);
    border: 1px solid var(--tip-line);
    border-radius: 9px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.5;
    box-shadow: var(--tip-shadow);
    opacity: 0;
    transform: translateY(4px);
    transition:
        opacity 0.12s ease,
        transform 0.12s ease;
}

#tip.on {
    opacity: 1;
    transform: translateY(0);
}

#tip .m {
    display: block;
    margin-top: 7px;
    font-size: 11px;
    color: var(--tip-soft);
}

#tip .m .ex {
    color: var(--tip-ink);
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

#tip .f {
    display: block;
    margin-top: 4px;
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 10.5px;
    color: var(--tip-soft);
}

#tip .caveat {
    display: block;
    margin-top: 7px;
    padding-top: 7px;
    border-top: 1px solid var(--tip-line);
    font-size: 11px;
    color: var(--tip-soft);
}

#tip .codes {
    display: block;
    margin-top: 7px;
    padding-top: 7px;
    border-top: 1px solid var(--tip-line);
}

#tip .codes .row {
    display: block;
    font-size: 11px;
}

#tip .codes .row b {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    color: var(--tip-ink);
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
    .flow {
        grid-template-columns: 1fr;
        justify-items: stretch;
    }

    .flow .arrow {
        transform: rotate(90deg);
        height: 34px;
        padding: 6px 0;
    }

    .flow .arrow svg {
        height: 22px;
        width: 60px;
        margin: 0 auto;
    }
}

@media print {
    .controls,
    .tabs,
    .crumb {
        display: none;
    }

    .panel {
        display: block !important;
        page-break-before: always;
    }

    body {
        background: #fff;
        color: #000;
    }
}
