/* Integrations pages: ptally.ai's look (ptally repo app/globals.css), as agreed
   in the mock-up. Geist, the dotted ground, a bordered 1200px shell, sections
   divided by hairlines, dark buttons, mono tags. */

:root {
    --ink: #121212;
    --muted: #5c5c5c;
    --faint: #8a86a8;
    --line: #ebebe8;
    --line-violet: #e4e1f5;
    --row: #f1f0f9;
    --accent: #c2336f;
    --violet: #6d3df5;
    --violet-ink: #5a2fd6;
    --violet-wash: #f6f4ff;
    --navy: #1e1b3a;
    --navy-2: #262347;
    --navy-line: #4a4680;
    --lilac: #b4aef0;
    --mono: 'Geist Mono', ui-monospace, Menlo, monospace;
    --live-bg: #e5f7ee; --live: #157347;
    --sim-bg: #efeaff; --sim: #5a2fd6;
    --key-bg: #fbe9f1; --key: #a3245a;
    --none-bg: #f3f3f0; --none: #555;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background-color: #fbfbfa;
    background-image: radial-gradient(circle, rgba(17, 17, 17, 0.07) 1px, transparent 1.2px);
    background-size: 22px 22px;
    color: var(--ink);
    font-family: 'Geist', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent); }
button, input, select, textarea { font-family: inherit; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }

.shell { max-width: 1200px; margin: 0 auto; min-height: 100vh; background: #fff; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.shell.wide { max-width: none; border: 0; }
.bt { border-top: 1px solid var(--line); }
.mono { font-family: var(--mono); }

/* nav */
.nav { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 28px; background: rgba(255,255,255,0.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav-left { display: flex; align-items: center; gap: 36px; }
.logo { display: inline-flex; align-items: center; gap: 7px; line-height: 1; color: #0b0b0b; }
.logo svg { display: block; flex: none; }
.logo-word { font-weight: 600; font-size: 27px; letter-spacing: -0.045em; transform: translateY(-0.06em); }
.nav-links { display: flex; flex-wrap: wrap; gap: 24px; font-size: 14px; }
.nav-links a { color: #555; }
.nav-links a[aria-current="page"] { color: var(--ink); font-weight: 500; }
/* As the ptally.ai nav button (btn-dark btn-sm). */
.nav-login { display: inline-flex; align-items: center; height: 34px; padding: 8px 14px; border-radius: 8px; background: #121212; color: #fff; font-size: 14px; font-weight: 500; text-decoration: none; }
.nav-login:hover { background: #2a2a2a; }

/* type */
.eyebrow { font: 12px var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.h1 { margin: 0; font-size: clamp(40px, 6.5vw, 72px); line-height: 0.98; letter-spacing: -0.045em; font-weight: 600; text-wrap: balance; }
.h1.page { font-size: clamp(34px, 4.5vw, 52px); line-height: 1.02; letter-spacing: -0.04em; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.h2 { margin: 0; font-size: clamp(30px, 4vw, 48px); line-height: 1.02; letter-spacing: -0.04em; font-weight: 600; text-wrap: balance; }
.h3 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; }
.lead { margin: 0; font-size: 17px; line-height: 1.55; color: var(--muted); text-wrap: pretty; }
.num { font: 12px var(--mono); color: #999; }
.cap { font: 11px var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: #999; }

.hero { padding: 96px 28px 64px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero .lead { margin-top: 22px; max-width: 620px; font-size: 19px; }
.header { padding: 56px 28px 36px; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 24px; }
.header > div { flex: 1 1 520px; }

/* tags, badges, buttons */
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hero .tags { justify-content: center; margin-top: 28px; }
.header .tags { margin-top: 18px; }
.tag { font: 11px var(--mono); padding: 3px 8px; border-radius: 99px; background: var(--none-bg); color: #555; }
.badge { flex: none; font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 99px; }
.s-live { background: var(--live-bg); color: var(--live); }
.s-simulated { background: var(--sim-bg); color: var(--sim); }
.s-needs_key { background: var(--key-bg); color: var(--key); }
.s-preview { background: #eaf3ff; color: #0b5fb0; }
.dot.prepared { background: #fff; border-color: #0b5fb0; }
.s-not_built, .s-na { background: var(--none-bg); color: var(--none); }
.s-declined { background: #fdecec; color: #b42318; }
.btn { display: inline-block; font-size: 15px; font-weight: 500; padding: 12px 20px; border-radius: 10px; border: 0; cursor: pointer; text-align: center; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #333; color: #fff; }
.btn-dark:disabled { background: #bbb; cursor: not-allowed; }
.btn-ghost { border: 1px solid #e0e0dc; background: #fff; color: var(--ink); }
.btn-ghost:hover { background: #f6f6f4; color: var(--ink); }
.btn-sm { font-size: 14px; padding: 8px 14px; border-radius: 8px; white-space: nowrap; }
.btn-pill { font-size: 13px; padding: 7px 14px; border-radius: 99px; border: 0; background: #7c4dff; color: #fff; cursor: pointer; font-weight: 500; }

/* ingress: three columns */
.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.col { padding: 40px 28px; display: flex; flex-direction: column; gap: 18px; }
.col + .col { border-left: 1px solid var(--line); }
.col.violet { background: linear-gradient(180deg, var(--violet-wash), #fbf9ff); }
.col-head { display: flex; flex-direction: column; gap: 6px; }
.col-head .lead { font-size: 15px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.group-label { margin-top: 10px; }
.card { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 14px 16px; border-radius: 12px; background: #fff; border: 1px solid var(--line); text-align: left; cursor: pointer; color: var(--ink); }
.card:hover { border-color: #d6d6d2; }
.card[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), 0 20px 40px -24px rgba(60, 40, 140, 0.3); }
.card:disabled { cursor: not-allowed; background: #fbfbfa; opacity: 0.6; }
.card-top { display: flex; align-items: center; gap: 10px; width: 100%; }
.card-name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; flex: 1 1 auto; }
.card-desc { font-size: 13px; line-height: 1.45; color: var(--muted); }
.card-note { font: 11px var(--mono); color: var(--faint); }
.tile { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; background: #fff; border: 1px solid var(--line); color: var(--navy); font: 600 13px var(--mono); }
.tile img, .tile svg { width: 20px; height: 20px; object-fit: contain; display: block; }
.tile.sm { width: 22px; height: 22px; border-radius: 6px; font-size: 10px; }
.tile.sm img, .tile.sm svg { width: 14px; height: 14px; }
.tile.lg { width: 52px; height: 52px; border-radius: 14px; font-size: 22px; }
.tile.lg img, .tile.lg svg { width: 30px; height: 30px; }
.more { padding: 14px 16px; border-radius: 12px; border: 1px dashed #d9d4f2; color: var(--muted); font-size: 13px; line-height: 1.45; }

.model-pick { padding: 28px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 18px; align-items: start; }
.model-pick .col-head { padding: 0; }
.your-flow { padding: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 18px; background: #fbfbfa; }
.pair { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; flex: 1 1 480px; font-size: 22px; font-weight: 600; letter-spacing: -0.03em; }
.pair .arrow { color: #bbb; }
.pair .proc { color: var(--violet); }
.pair .ptally { color: var(--muted); font-weight: 500; }

.sec-head { padding: 96px 28px 40px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 28px; align-items: end; }
.sec-head .lead { max-width: 460px; }
.toolbar { padding: 0 28px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.seg { display: flex; padding: 3px; background: #f3f1fb; border-radius: 8px; }
.seg button { border: 0; font-size: 13px; padding: 6px 12px; border-radius: 6px; cursor: pointer; background: transparent; color: var(--muted); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--navy); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.grow { flex: 1 1 auto; }
.table-box { margin: 0 28px 96px; overflow-x: auto; border: 1px solid #ecebf7; border-radius: 12px; }
.matrix { border-collapse: collapse; width: 100%; min-width: 1080px; font-size: 13px; }
.matrix th { text-align: left; font-weight: 500; padding: 10px 8px; }
.matrix thead tr { background: #fbfbfa; }
.matrix thead th { border-bottom: 1px solid #ecebf7; }
.matrix tbody th { padding: 6px 14px; white-space: nowrap; border-top: 1px solid var(--row); }
.matrix td { padding: 4px; border-top: 1px solid var(--row); }
.th-in { display: inline-flex; align-items: center; gap: 6px; }
.cell { display: flex; align-items: center; min-height: 34px; padding: 0 10px; border-radius: 8px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.cell.on { box-shadow: 0 0 0 1.5px var(--ink); }

/* flow page */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.steps li { display: flex; }
.step { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 16px 18px; border: 0; border-left: 1px solid var(--line); background: #fff; text-align: left; cursor: pointer; }
.steps li:first-child .step { border-left: 0; }
.step[aria-current="step"] { background: var(--violet-wash); box-shadow: inset 0 -2px 0 var(--ink); }
.step-name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.step.pending .step-name { color: #999; }
.step-contract { font: 11px var(--mono); color: var(--faint); }
.panes { display: flex; flex-wrap: wrap; }
.pane { min-width: 0; padding: 32px 28px 48px; display: flex; flex-direction: column; gap: 18px; }
.pane.exp { flex: 999 1 480px; }
.pane.contract { flex: 1 1 360px; background: var(--navy); color: #fff; padding: 32px 24px; }
.pane.timeline { flex: 1 1 260px; border-left: 1px solid var(--line); padding: 32px 24px 48px; }
.pane-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.hint { font-size: 13px; color: var(--muted); }
.result-box { padding: 22px; border-radius: 14px; background: var(--violet-wash); display: flex; flex-wrap: wrap; align-items: flex-end; gap: 20px; }
.premium { font-size: 56px; line-height: 1; font-weight: 600; letter-spacing: -0.04em; color: var(--navy); }
.status-pill { font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; padding: 3px 9px; border-radius: 99px; text-transform: uppercase; }
.kv { border: 1px solid #ecebf7; border-radius: 12px; overflow: hidden; font-size: 14px; }
.kv > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 12px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--row); }
.kv > div:first-child { border-top: 0; }
.kv .k { color: var(--muted); overflow-wrap: anywhere; min-width: 0; }
.kv .v { font-weight: 500; color: var(--navy); overflow-wrap: anywhere; }
.code-label { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.code-label .cap { color: var(--lilac); letter-spacing: 0.12em; font-size: 10px; }
.code-label .title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.code { margin: 0; border: 1px solid var(--navy-line); border-radius: 10px; background: var(--navy-2); padding: 16px; font: 12.5px/1.6 var(--mono); color: #e9e7ff; white-space: pre-wrap; overflow-wrap: anywhere; overflow: auto; max-height: 620px; }
.code-foot { font: 11px var(--mono); color: var(--lilac); overflow-wrap: anywhere; }
textarea.code { width: 100%; min-height: 360px; resize: vertical; white-space: pre; }
.trail { list-style: none; margin: 0; padding: 0; }
.trail li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--row); }
.trail button { all: unset; cursor: pointer; display: contents; }
.dot { margin-top: 5px; width: 8px; height: 8px; border-radius: 50%; justify-self: center; border: 2px solid var(--ink); background: var(--ink); box-sizing: content-box; }
.dot.skipped { background: #fff; border-color: #d6d6d2; }
.dot.error { background: var(--key); border-color: var(--key); }
.dot.on { background: var(--violet); border-color: var(--violet); box-shadow: 0 0 0 3px var(--sim-bg); }
.trail .label { font-size: 14px; font-weight: 500; }
.trail .meta { font-size: 12px; color: var(--faint); }
.trail .at { font: 11px var(--mono); color: #999; }
.note { font-size: 12px; line-height: 1.5; color: var(--faint); margin: 0; }
.notice { margin: 28px; padding: 18px 20px; border-radius: 12px; border: 1px solid var(--line-violet); background: var(--violet-wash); font-size: 15px; line-height: 1.55; }
.error-box { padding: 12px 14px; border-radius: 10px; background: var(--key-bg); color: var(--key); font-size: 14px; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #22c28a; display: inline-block; }
.prompt-card { border-radius: 18px; background: #2b2850; color: #fff; padding: 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 30px 60px -25px rgba(30,27,58,0.55); }
.prompt-card p { margin: 0; font-size: 13px; line-height: 1.55; white-space: pre-wrap; }
ol.howto { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.5; }
.inline-code { font: 12px var(--mono); padding: 2px 6px; border-radius: 6px; background: #fff; border: 1px solid var(--line-violet); }

/* flow page: the board */
.header.compact { padding: 36px 28px 26px; }
.header.compact .h1.page { font-size: clamp(28px, 3.6vw, 40px); }
.board-wrap { position: relative; height: max(560px, calc(100vh - 250px)); overflow: hidden; background: #fbfbfa; }
.board { position: absolute; inset: 0; overflow: hidden; cursor: grab; touch-action: none; outline: none;
    background-image: radial-gradient(circle, rgba(17, 17, 17, 0.16) 1.1px, transparent 1.4px); background-size: 22px 22px; }
.board.grabbing { cursor: grabbing; }
.board:focus-visible { box-shadow: inset 0 0 0 2px var(--violet); }
.world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.edges { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.edge { fill: none; stroke-width: 1.6; stroke: #cfcfca; stroke-dasharray: 5 5; }
.edge.done { stroke: var(--ink); stroke-dasharray: none; }
.edge.live { stroke: var(--violet); animation: flowdash 0.9s linear infinite; }
.edge.error { stroke: var(--key); }
@keyframes flowdash { to { stroke-dashoffset: -20; } }
.edge-label rect { fill: #fff; stroke: #e0e0dc; }
.edge-label text { font: 500 10.5px var(--mono); fill: #777; }
.edge-label.done rect { stroke: var(--ink); } .edge-label.done text { fill: var(--ink); }
.edge-label.live rect { stroke: var(--violet); fill: var(--violet-wash); } .edge-label.live text { fill: var(--violet-ink); }
.node { position: absolute; display: flex; flex-direction: column; gap: 6px; padding: 14px 15px; border-radius: 14px; background: #fff; border: 1px solid var(--line);
    text-align: left; cursor: pointer; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 14px 30px -22px rgba(30, 27, 58, 0.35); transition: box-shadow .15s, border-color .15s; }
.node:hover { border-color: #cfcfca; }
.node.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), 0 22px 44px -24px rgba(60, 40, 140, 0.45); }
.node.small { padding: 10px 13px; gap: 4px; border-radius: 12px; }
.node-top { display: flex; align-items: center; gap: 8px; width: 100%; }
.node-name { font-size: 15px; font-weight: 600; letter-spacing: -0.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node.small .node-name { font: 500 12px var(--mono); letter-spacing: 0; }
.node-line { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node-dot { width: 8px; height: 8px; border-radius: 50%; background: #d6d6d2; flex: none; display: inline-block; }
.s-done .node-dot { background: #22a06b; }
.s-active .node-dot { background: var(--violet); box-shadow: 0 0 0 0 rgba(109, 61, 245, 0.5); animation: pulse 1.6s infinite; }
.s-prepared .node-dot { background: #0b5fb0; }
.s-error .node-dot { background: var(--key); }
.s-skipped .node-dot { background: #fff; border: 1.5px dashed #bbb; width: 6px; height: 6px; }
.node.s-active { border-color: #cbbcff; }
.node.s-skipped { border-style: dashed; background: #fcfcfb; }
.node.s-skipped .node-name { color: #888; }
.node.s-idle .node-name { color: #777; }
.node.s-error { border-color: #efc2d4; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(109, 61, 245, 0); } 100% { box-shadow: 0 0 0 0 rgba(109, 61, 245, 0); } }
.board-tools { position: absolute; left: 18px; bottom: 18px; display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: #fff; border: 1px solid var(--line); box-shadow: 0 6px 18px -10px rgba(0,0,0,0.2); z-index: 2; }
.board-tools button { min-width: 30px; height: 30px; border: 0; border-radius: 7px; background: transparent; font-size: 16px; cursor: pointer; color: var(--ink); }
.board-tools button.wide { font-size: 12px; padding: 0 10px; }
.board-tools button:hover { background: #f3f3f0; }
.board-legend { position: absolute; left: 18px; top: 16px; display: flex; flex-wrap: wrap; gap: 14px; font: 11px var(--mono); color: #888; pointer-events: none; z-index: 1; }
.board-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.board-legend .s-active .node-dot { animation: none; }
.drawer { position: absolute; top: 12px; right: 12px; bottom: 12px; width: 440px; max-width: calc(100% - 24px); overflow-y: auto; z-index: 4;
    background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 30px 60px -30px rgba(30, 27, 58, 0.45); padding: 20px 20px 28px; display: flex; flex-direction: column; gap: 18px; cursor: auto; }
.drawer-head { display: flex; align-items: center; gap: 12px; }
.drawer-title { font-size: 20px; font-weight: 600; letter-spacing: -0.025em; }
.drawer-close { width: 32px; height: 32px; flex: none; border: 0; border-radius: 8px; background: #f3f3f0; font-size: 18px; cursor: pointer; }
.drawer-pane { display: flex; flex-direction: column; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.drawer-pane .h3 { font-size: 19px; }
.drawer-pane .lead { font-size: 14px; }
.drawer-pane .premium { font-size: 40px; }
.drawer-pane textarea.code { min-height: 260px; }
.drawer-pane .fields { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.io { display: flex; flex-direction: column; gap: 10px; }
.io-cap { color: var(--accent); }
.io-note { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.io-block { border-radius: 12px; background: var(--navy); color: #fff; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.io-block .code { max-height: 360px; font-size: 11.5px; padding: 12px; }
.io-block .title { font-size: 13px; }
.io-block .cap { color: var(--lilac); }

/* the Email source's composer */
.mail { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.mail-row { display: grid; grid-template-columns: 60px minmax(0, 1fr); align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--row); }
.mail-row input { border: 0; font-size: 14px; padding: 2px 0; outline: none; min-width: 0; }
.mail-body { border: 0; min-height: 230px; padding: 12px; font: 13px/1.55 var(--mono); resize: vertical; outline: none; }
.mail-v { font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.mail-read { padding: 14px 14px 16px; font-size: 14px; line-height: 1.6; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 340px; overflow-y: auto; background: #fff; }
.mail.read { box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.mail .tags { align-items: center; }
.btn-link { border: 0; background: none; padding: 4px 6px; font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.btn-link:hover { color: var(--navy); }
.mail .tags { padding: 10px 12px; border-top: 1px solid var(--row); background: #fbfbfa; }

/* the Form source's pane */
.qform { display: flex; flex-direction: column; gap: 22px; }
.qform fieldset { border: 0; margin: 0; padding: 0; }
.qform legend { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 12px; padding: 0; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field input, .field select { font-size: 15px; color: var(--ink); padding: 11px 13px; border: 1px solid #e0e0dc; border-radius: 10px; background: #fff; }
.field.check { flex-direction: row; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; color: var(--ink); cursor: pointer; }
.field.check input { flex: none; width: 18px; height: 18px; accent-color: var(--ink); }
.field-help { font-size: 12px; color: var(--faint); }
.field-label { display: flex; align-items: center; gap: 8px; }
.field-label label.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; color: var(--ink); cursor: pointer; }
.field-label label.check input { flex: none; width: 18px; height: 18px; accent-color: var(--ink); }
.info { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; padding: 0; border-radius: 50%; border: 1px solid #cfcfca; background: #fff; color: var(--muted); font: italic 600 11px/1 Georgia, serif; cursor: pointer; }
.info:hover, .info[aria-expanded="true"] { border-color: var(--ink); color: var(--ink); }
.info:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.field-help.default { color: var(--key); }

/* keys people bring for a part: held in memory, never stored */
.keys-panel { padding: 14px 16px; border: 1px dashed #d9d9d4; border-radius: 12px; background: #fbfbfa; }
.keys-notice { margin: 0; padding: 10px 12px; border-radius: 10px; background: #eef6ee; color: #2f5d34; font-size: 13px; line-height: 1.5; }
.keys-panel textarea { font-size: 12px; color: var(--ink); padding: 10px 12px; border: 1px solid #e0e0dc; border-radius: 10px; background: #fff; resize: vertical; }
.field input.secret { -webkit-text-security: disc; font-family: var(--mono); }

@media (max-width: 640px) {
    .nav { padding: 14px 16px; }
    .nav-links { display: none; }
    .hero { padding: 56px 20px 40px; }
    .col + .col { border-left: 0; border-top: 1px solid var(--line); }
    .pane.timeline { border-left: 0; border-top: 1px solid var(--line); }
    .sec-head { padding: 64px 20px 32px; }
    .board-wrap { height: auto; overflow: visible; }
    .board { position: relative; height: 62vh; }
    .drawer { position: static; width: auto; max-width: none; margin: 12px; box-shadow: none; }
}

/* A section that opens on demand, behind a caret. */
.more > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font: 11px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: #999; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary::before { content: ''; width: 0; height: 0; border-left: 5px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform .15s; }
.more[open] > summary::before { transform: rotate(90deg); }
.more > summary:hover { color: var(--navy); }
.more[open] > .kv { margin-top: 10px; }

/* Start flow, with any refusal right under it. */
.your-flow .start { margin-left: auto; position: relative; }
.your-flow.refused { padding-bottom: 64px; }
.btn-red { background: #d92d20; color: #fff; }
.btn-red:hover { background: #b42318; color: #fff; }
.start-error { position: absolute; right: 0; top: calc(100% + 8px); width: max-content; max-width: min(440px, 80vw); margin: 0; font-size: 13px; line-height: 1.4; color: #b42318; text-align: right; }
.mail-sent { padding: 8px 14px; font: 11px var(--mono); color: #999; border-top: 1px solid var(--row); background: #fff; }

.retry { position: relative; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; max-width: 320px; }
.retry .start-error { text-align: right; }

/* Waiting on the server: a busy button spins and can't be clicked again. */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner, button[aria-busy="true"]::before { content: ''; display: inline-block; flex: none; width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; }
button[aria-busy="true"] { display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: progress; }
button[aria-busy="true"]::before { margin: 0; }
button:disabled { cursor: not-allowed; }
button[aria-busy="true"]:disabled { cursor: progress; }
/* And the board is locked in place until it resolves. */
.board-wrap { position: relative; }
.board-lock { display: none; position: absolute; inset: 0; z-index: 3; align-items: center; justify-content: center; background: rgba(250, 250, 248, .6); backdrop-filter: blur(1px); cursor: progress; }
html.is-locked .board-lock { display: flex; }
.lock-card { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 99px; background: #fff; border: 1px solid var(--line); box-shadow: 0 4px 16px rgba(0,0,0,.06); font-size: 14px; color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .spinner, button[aria-busy="true"]::before { animation-duration: 2s; } }

/* A step waiting on keys: amber, never "failed". */
.s-keys { background: #fff4e0; color: #8a5300; }
.s-keys .node-dot, .board-legend .s-keys .node-dot { background: #e19a1c; }
.node.s-keys { border-color: #f0d29b; background: #fffbf3; }
/* Steps not reached yet are greyed out. */
.node.s-idle { background: #f7f7f5; border-style: dashed; }
.node.s-idle .node-top, .node.s-idle .node-name, .node.s-idle .node-line { opacity: .5; }
.node.s-idle .tile { filter: grayscale(1); }
.node.s-idle.on { opacity: 1; }

/* The sample application call-out under a file picker (common.js sampleRow). */
.sample-callout { display: grid; grid-template-columns: 36px 1fr; align-items: center; column-gap: 12px; row-gap: 10px; padding: 12px 14px; border: 1px dashed #c9c2f4; border-radius: 12px; background: #f7f5ff; }
.sample-callout.is-using { border-style: solid; border-color: #b9e3c9; background: #f3fbf6; }
.sample-ico { flex: none; width: 36px; height: 36px; border-radius: 10px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237c4dff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 3v5h5M9 13h6M9 17h4'/%3E%3C/svg%3E") center / 20px no-repeat; border: 1px solid #e4e1f5; }
.sample-callout.is-using .sample-ico { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23198754' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); border-color: #cfe9d9; }
.sample-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 13px; line-height: 1.4; }
.sample-text span { color: #6b6b66; font-size: 12.5px; }
.sample-actions { grid-column: 2; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* The delivered step's policy documents (flow.js outcomePane). */
.doc-card { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line-violet); border-radius: 12px; background: #fff; color: var(--ink); }
.doc-card:hover { border-color: var(--violet); box-shadow: 0 12px 30px -20px rgba(60, 40, 140, .45); }
.doc-ico { width: 40px; height: 48px; border-radius: 6px; background: var(--navy) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b4aef0' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 3v5h5M9 13h6M9 17h4'/%3E%3C/svg%3E") center / 20px no-repeat; }
.doc-text { display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 1.4; min-width: 0; }
.doc-text span { color: var(--muted); font-size: 12.5px; }
.doc-open { font: 12px var(--mono); color: var(--violet-ink); white-space: nowrap; }

/* The models pages (models.js). */
.msection { padding: 48px 28px; }
.msection-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; max-width: 760px; }
.h-sec { margin: 0; font-size: 24px; letter-spacing: -0.02em; font-weight: 600; }
.model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.model-card { text-decoration: none; }
.model-card:hover { border-color: var(--violet); box-shadow: 0 16px 36px -24px rgba(60, 40, 140, 0.4); }
.model-counts { font-size: 11px; color: var(--faint); margin-top: 6px; }
.model-hero { padding-bottom: 48px; }
.model-hero .back { text-decoration: none; }
.model-hero .tags + .tags { margin-top: 14px; }
.prose { max-width: 760px; font-size: 15px; line-height: 1.6; color: #333; margin: 0 0 10px; }
.rate-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.step-row { display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); background: #fff; }
.step-row:first-child { border-top: 0; }
.step-n { color: var(--faint); font-size: 12px; padding-top: 2px; }
.step-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.step-desc { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; max-width: 860px; }
.kind-collection { background: var(--sim-bg); color: var(--sim); }
.kind-calculation { background: var(--live-bg); color: var(--live); }
.kind-exclusion { background: var(--key-bg); color: var(--key); }
.kind-refer { background: #fff4e0; color: #8a5a00; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; background: #fff; }
table.data th { text-align: left; font: 10.5px var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafaf8; }
table.data td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data .field-help { display: block; margin-top: 2px; }
.code-wrap { position: relative; }
.code-wrap .copy { position: absolute; top: 10px; right: 10px; }
.model-links { font-size: 12.5px; color: var(--faint); margin-top: 2px; }
.model-links a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line-violet); text-underline-offset: 3px; }
.model-links a:hover { color: var(--violet-ink); text-decoration-color: currentColor; }

/* The drawer's Next button (flow.js nextStep), beside the close button. */
.drawer-next { height: 32px; flex: none; padding: 0 12px; border: 0; border-radius: 8px; background: var(--ink); color: #fff; font: 500 13px inherit; font-family: inherit; cursor: pointer; }
.drawer-next:hover { background: var(--navy-2); }
