/* ISA Network Partner Portal. "Old Glory": a real American flag fills the page background, and every word sits on a solid
   panel (white, navy, or red) so it is always easy to read. Official flag colors: red #BF0A30, blue #002868, white. */
:root {
  --ink: #0b1633;
  --navy: #001a4d;
  --glory: #002868;
  --blue: #0a3d91;
  --volt: #2a5fc4;
  --accent: #0a3d91;
  --accent-hi: #2a5fc4;
  --red: #bf0a30;
  --red-deep: #8f0724;
  --hot: #ff6b82;
  --sheet: rgba(246, 249, 255, .95);
  --paper: #ffffff;
  --line: #cfd9ef;
  --field: #8da0cc;
  --muted: #45557a;
  --mist: #dbe6ff;
  --ok: #0a5f37;
  --ok-bg: #d9f3e5;
  --warn: #6e3f00;
  --warn-bg: #ffecc2;
  --flag: linear-gradient(90deg, #bf0a30 0 33.34%, #ffffff 33.34% 66.67%, #0a3d91 66.67%);
  --display: "Oswald", "Helvetica Neue", Arial, system-ui, sans-serif;
  --hud: "Chakra Petch", "Helvetica Neue", Arial, system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 1px 2px rgba(0, 10, 40, .12), 0 14px 34px -16px rgba(0, 10, 40, .45);
}
* { box-sizing: border-box; }
html { color-scheme: light; background: #0a2a6b; }

/* ---------- the flag: stripes, canton with stars, fabric folds, soft vignette ---------- */
html::before {
  content: ""; position: fixed; inset: 0; z-index: -4; pointer-events: none;
  background: repeating-linear-gradient(to bottom, #c8102e 0 7.6923%, #f3f6fc 7.6923% 15.3846%);
}
html::after {
  content: ""; position: fixed; left: 0; top: 0; width: 40%; height: 53.846%; z-index: -3; pointer-events: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2 2'%3E%3Cg fill='white'%3E%3Cpolygon transform='translate(1 .5) scale(.3)' points='0,-1 .2245,-.309 .9511,-.309 .3633,.118 .5878,.809 0,.382 -.5878,.809 -.3633,.118 -.9511,-.309 -.2245,-.309'/%3E%3Cpolygon transform='translate(0 1.5) scale(.3)' points='0,-1 .2245,-.309 .9511,-.309 .3633,.118 .5878,.809 0,.382 -.5878,.809 -.3633,.118 -.9511,-.309 -.2245,-.309'/%3E%3Cpolygon transform='translate(2 1.5) scale(.3)' points='0,-1 .2245,-.309 .9511,-.309 .3633,.118 .5878,.809 0,.382 -.5878,.809 -.3633,.118 -.9511,-.309 -.2245,-.309'/%3E%3C/g%3E%3C/svg%3E") 0 0 / calc(100% / 6) auto repeat,
    linear-gradient(160deg, #0d43a0, #002060);
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    linear-gradient(100deg, rgba(0, 0, 0, .20) 0%, rgba(255, 255, 255, .12) 14%, rgba(0, 0, 0, .22) 30%, rgba(255, 255, 255, .14) 46%, rgba(0, 0, 0, .22) 62%, rgba(255, 255, 255, .12) 78%, rgba(0, 0, 0, .22) 100%) 0 0 / 180% 100%,
    radial-gradient(90% 60% at 18% 12%, rgba(255, 255, 255, .18), transparent 62%);
  animation: wave 40s ease-in-out infinite alternate;
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at 50% 38%, transparent 52%, rgba(0, 8, 36, .5) 100%);
}
@keyframes wave { from { background-position: 0% 0, 0 0; } to { background-position: 100% 0, 0 0; } }
@media (prefers-reduced-motion: reduce) { body::before { animation: none; } * { scroll-behavior: auto !important; } }
@media (max-width: 700px) { html::after { width: 100%; height: 34%; } }

body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  color: var(--ink); font-family: var(--body); line-height: 1.6; -webkit-font-smoothing: antialiased;
}
main { flex: 1; padding-bottom: 8px; }
img { max-width: 100%; }
code, pre, .pre { overflow-wrap: anywhere; word-break: break-word; }
code { font-size: .92em; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid #ffbf47; outline-offset: 2px; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }
.narrow { max-width: 620px; }
.mid { max-width: 860px; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }

h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: .01em; color: var(--glory); }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); }
h3 { font-size: 1.25rem; }
.kicker { margin: 0 0 10px; font-family: var(--hud); font-weight: 700; font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; color: var(--red); }
.lede { max-width: 38em; margin: 14px 0 0; font-size: clamp(1.02rem, 2vw, 1.18rem); color: var(--muted); }
.rule { display: block; width: 84px; height: 5px; margin: 14px 0 0; border-radius: 3px; background: var(--flag); box-shadow: inset 0 0 0 1px rgba(0, 26, 77, .25); }

/* ---------- every block of content sits on a solid panel over the flag ---------- */
main .section > .wrap, main .pagehead > .wrap {
  width: min(1180px, calc(100% - 24px));
  padding: clamp(18px, 3.2vw, 36px) clamp(18px, 3.4vw, 40px);
  background: var(--sheet);
  border: 1px solid rgba(255, 255, 255, .65);
  border-radius: 26px;
  box-shadow: 0 26px 50px -28px rgba(0, 8, 36, .8);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
main .section > .narrow { max-width: 620px; }
main .section > .mid { max-width: 860px; }
.section { padding: clamp(12px, 2.4vw, 24px) 0; }
.pagehead { padding: clamp(14px, 3vw, 28px) 0 clamp(4px, 1vw, 8px); }
.pagehead h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.sec-title { margin: 34px 0 12px; }
.flashes { width: min(1180px, calc(100% - 24px)); padding: 16px 0 0; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 40; background: linear-gradient(180deg, #00225c, #001540); border-bottom: 3px solid var(--red); box-shadow: 0 10px 30px -14px rgba(0, 0, 0, .7); }
.top::before { content: ""; display: block; height: 5px; background: var(--flag); }
.top-in { display: flex; align-items: center; gap: 14px; min-height: 66px; max-width: 1400px; }
.top .wrap { max-width: 1400px; }
.nav { min-width: 0; }
@media (max-width: 1500px) { .brand-tag { display: none; } }
.has-chip .brand-tag { display: none; }
.nav a, .more summary { white-space: nowrap; }
@media (max-width: 1280px) { .userbox span { display: none; } }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.brand img { display: block; height: 34px; width: auto; box-sizing: content-box; padding: 5px 12px; background: #fff; border-radius: 12px; }
.brand-tag { padding-left: 12px; border-left: 2px solid rgba(255, 255, 255, .4); font-family: var(--hud); font-weight: 700; font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; line-height: 1.2; color: var(--mist); }
.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; flex-wrap: nowrap; }
.nav > a, .nav > .more > summary { padding: 10px 12px; border-radius: 10px; color: #fff; text-decoration: none; font-weight: 500; font-size: .94rem; }
.nav > a:hover, .more summary:hover, .more[open] summary { background: rgba(255, 255, 255, .16); color: #fff; }
.nav > a[aria-current="page"] { background: #fff; color: var(--glory); font-weight: 700; }
.more { position: relative; }
.more summary { list-style: none; cursor: pointer; }
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: " \25BE"; font-size: .75rem; }
.more-panel { position: absolute; right: 0; top: calc(100% + 10px); min-width: 220px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); display: grid; gap: 2px; z-index: 5; }
.nav .more-panel a, .mnav-panel a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; }
.nav .more-panel a:hover, .mnav-panel a:hover, .mnav-panel button:hover { background: #e6eeff; color: var(--glory); }
.nav .more-panel a[aria-current="page"] { background: #e6eeff; color: var(--red); font-weight: 700; }
.badge { display: inline-block; margin-left: 6px; min-width: 1.5em; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: .72rem; font-weight: 700; line-height: 1.6; text-align: center; }
.userbox { display: flex; align-items: center; gap: 10px; margin-left: 8px; padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, .35); }
.userbox span { font-size: .85rem; color: var(--mist); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mnav { display: none; margin-left: auto; position: relative; }
.mnav summary { list-style: none; cursor: pointer; padding: 10px 16px; border: 1px solid rgba(255, 255, 255, .55); border-radius: 10px; font-weight: 700; color: #fff; background: rgba(255, 255, 255, .12); }
.mnav summary::-webkit-details-marker { display: none; }
.mnav-panel { position: absolute; right: 0; top: calc(100% + 10px); width: min(320px, 88vw); max-height: 78vh; overflow: auto; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); display: grid; gap: 2px; }
.mnav-panel button { display: block; width: 100%; text-align: left; padding: 12px; border: 0; border-radius: 10px; background: none; font: inherit; color: var(--ink); cursor: pointer; }
@media (max-width: 1100px) { .nav { display: none; } .mnav { display: block; } .brand-tag { display: none; } }
.userbox .btn { white-space: nowrap; flex: none; }
.top .btn.ghost { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .55); }
.top .btn.ghost:hover { background: #fff; color: var(--glory); }

/* ---------- buttons and forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: .7rem 1.3rem; border: 0; border-radius: 12px; font: inherit; font-weight: 700; color: #fff; background: linear-gradient(180deg, var(--accent-hi), var(--accent)); text-decoration: none; cursor: pointer; box-shadow: 0 10px 20px -12px rgba(0, 10, 40, .8); transition: transform .12s ease, filter .12s ease; }
.btn:hover { color: #fff; filter: brightness(1.1); transform: translateY(-1px); }
.btn.red { background: linear-gradient(180deg, #dc1f43, var(--red-deep)); box-shadow: 0 10px 20px -12px rgba(143, 7, 36, .9); }
.btn.ghost { color: var(--glory); background: #fff; border: 2px solid var(--field); box-shadow: none; }
.btn.ghost:hover { color: var(--red); border-color: var(--red); filter: none; }
.btn.small { min-height: 36px; padding: .4rem .9rem; font-size: .88rem; border-radius: 10px; }
.btn.wide { width: 100%; }
.btn[disabled], .btn.off { opacity: .55; pointer-events: none; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.card { padding: clamp(18px, 3vw, 28px); background: var(--paper); border: 1px solid var(--line); border-top: 5px solid var(--blue); border-radius: 18px; box-shadow: var(--shadow); }
.card.tight { padding: 16px 18px; }
.card h2, .card h3 { margin-bottom: 8px; }
.form { display: grid; gap: 16px; margin-top: 16px; }
.field { display: grid; gap: 6px; }
.field label, .lbl { font-family: var(--hud); font-weight: 700; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--glory); }
.field small, .hint { color: var(--muted); font-size: .85rem; margin: 0; }
input, select, textarea { width: 100%; min-height: 44px; padding: .7rem .9rem; border: 2px solid var(--field); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; }
input:disabled, select:disabled, textarea:disabled { background: #e9eef9; color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(42, 95, 196, .28); }
textarea { resize: vertical; min-height: 96px; }
input[type="checkbox"], input[type="radio"] { width: 22px; min-height: 22px; height: 22px; accent-color: var(--blue); }
input[type="file"] { padding: .6rem; }
input[type="color"] { padding: 2px; height: 46px; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 640px) { .row, .row3 { grid-template-columns: minmax(0, 1fr); } }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; font-size: .95rem; }
.check input { margin-top: .15rem; flex: none; }
.formcap { margin: 22px 0 0; font-family: var(--hud); font-weight: 700; font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; color: var(--red); }
.flash { margin: 0 0 8px; padding: 13px 18px; border-radius: 12px; border: 1px solid var(--line); border-left: 6px solid var(--blue); background: #fff; color: var(--ink); box-shadow: var(--shadow); font-weight: 500; }
.flash.error { border-color: #efb3be; border-left-color: var(--red); background: #fff1f3; color: #6d0f21; }
.flash.info { border-color: #b9ccf5; border-left-color: var(--blue); background: #eef3ff; color: var(--glory); }

/* ---------- layout helpers ---------- */
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .grid3, .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid2, .grid3, .grid4 { grid-template-columns: minmax(0, 1fr); } }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: minmax(0, 1fr); } }

/* ---------- home: the hero is a navy glass panel over the flag ---------- */
.hero { padding: clamp(22px, 5vw, 56px) 0 clamp(10px, 2vw, 20px); }
.hero .hero-in { width: min(1180px, calc(100% - 24px)); display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(20px, 5vw, 60px); align-items: center; padding: clamp(22px, 4.5vw, 52px) clamp(20px, 4vw, 48px); border-radius: 30px; color: #fff; background: linear-gradient(135deg, rgba(0, 20, 64, .93), rgba(0, 40, 104, .9)); border: 1px solid rgba(255, 255, 255, .28); box-shadow: 0 34px 60px -30px rgba(0, 0, 0, .85); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
@media (max-width: 860px) { .hero .hero-in { grid-template-columns: minmax(0, 1fr); } .hero-art { order: -1; } }
.hero h1 { color: #fff; font-size: clamp(2.3rem, 6vw, 4rem); }
.hero h1 em { font-style: normal; color: var(--hot); }
.hero .kicker { color: #ffa3b3; }
.hero .lede { color: #dbe6ff; }
.hero .btn.ghost { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .6); }
.hero .btn.ghost:hover { background: #fff; color: var(--glory); border-color: #fff; }
.hero-art { position: relative; display: grid; place-items: center; padding: 26px; border-radius: 24px; background: #fff; border: 4px solid var(--red); box-shadow: 0 0 0 4px #fff, 0 0 0 8px var(--blue), var(--shadow); }
.hero-art img { display: block; width: min(420px, 100%); height: auto; }
.countdown-chip { position: absolute; right: 14px; bottom: 14px; padding: 8px 14px; border-radius: 999px; background: var(--navy); color: #fff; font-family: var(--hud); font-weight: 700; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; }
.countdown-chip b { color: var(--hot); font-size: 1.05rem; margin-right: 4px; }
.role-card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.role-card:hover { color: var(--ink); transform: translateY(-3px); border-top-color: var(--red); }
.role-card .ico { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(135deg, var(--blue), var(--glory)); color: #fff; font-family: var(--display); font-size: 1.4rem; }
.role-card p { margin: 0; color: var(--muted); }
.role-card .go { margin-top: auto; padding-top: 6px; font-weight: 700; color: var(--red); }
.stepsline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; counter-reset: s; padding: 0; list-style: none; margin: 0; }
.stepsline li { counter-increment: s; padding: 16px; border-radius: 16px; background: #fff; border: 1px solid var(--line); border-top: 5px solid var(--red); }
.stepsline li::before { content: counter(s); display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 8px; border-radius: 50%; background: var(--glory); color: #fff; font-family: var(--display); font-size: 1.15rem; }
.stepsline b { display: block; font-family: var(--display); font-size: 1.1rem; color: var(--glory); }
.stepsline span { color: var(--muted); font-size: .92rem; }
@media (max-width: 900px) { .stepsline { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .stepsline { grid-template-columns: minmax(0, 1fr); } }
.band { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: clamp(20px, 4vw, 32px); border-radius: 22px; color: #fff; background: linear-gradient(120deg, #a50a2b 0%, #5d0a35 28%, #002868 62%, #001a4d 100%); box-shadow: var(--shadow); }
.band h2, .band h3 { color: #fff; }
.band p { margin: 6px 0 0; color: #e4ebff; max-width: 40em; }
.band .btn.ghost { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .7); }
.band .btn.ghost:hover { background: #fff; color: var(--glory); }

/* ---------- lists, tables, pills ---------- */
.ticks { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.ticks li { position: relative; padding-left: 28px; }
.ticks li::before { content: ""; position: absolute; left: 4px; top: .5em; width: 12px; height: 7px; border-left: 3px solid var(--ok); border-bottom: 3px solid var(--ok); transform: rotate(-45deg); }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
table.grid { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 520px; }
.grid th, .grid td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.grid tbody tr:nth-child(even) td { background: #f4f7ff; }
.grid tr:last-child td { border-bottom: 0; }
.grid th { background: var(--glory); font-family: var(--hud); font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #fff; }
.grid td.num, .grid th.num { text-align: right; white-space: nowrap; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-family: var(--hud); font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; background: #dbe7ff; color: var(--glory); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.wait { background: var(--warn-bg); color: var(--warn); }
.pill.red { background: #ffdbe2; color: #8f0724; }
.pill.gray { background: #e3e8f4; color: #3a4668; }
.stat { padding: 16px 18px; border-radius: 16px; background: linear-gradient(160deg, var(--blue), var(--glory)); border: 0; box-shadow: var(--shadow); }
.stat b { display: block; font-family: var(--display); font-size: 2rem; line-height: 1; color: #fff; }
.stat span { font-size: .85rem; color: #dbe6ff; }
.stat.alert { background: linear-gradient(160deg, #d3213f, var(--red-deep)); }
.stat.alert span { color: #ffe3e8; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; margin: 0; }
.kv dt { font-family: var(--hud); font-weight: 700; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; } .kv dd { margin-bottom: 8px; } }
.pre { white-space: pre-line; }

/* ---------- onboarding checklist ---------- */
.progress { height: 12px; border-radius: 999px; background: #d5dff5; overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--red), var(--accent-hi)); }
.steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; counter-reset: st; }
.step { counter-increment: st; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.step::before { content: counter(st); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #dbe7ff; color: var(--glory); font-family: var(--display); font-size: 1rem; }
.step h3 { font-size: 1.05rem; margin: 0 0 2px; }
.step p { margin: 0; font-size: .9rem; color: var(--muted); }
.step.done::before { content: "\2713"; background: var(--ok-bg); color: var(--ok); font-family: var(--body); font-weight: 700; }
.step.todo { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(42, 95, 196, .22); }
.step.todo::before { background: var(--accent); color: #fff; }
.step.wait::before { background: var(--warn-bg); color: var(--warn); }
.step.locked { opacity: .82; background: #eef2fb; }
@media (max-width: 640px) { .step { grid-template-columns: 34px minmax(0, 1fr); } .step .act { grid-column: 2; } }
.next-card { border: 1px solid #9fb6ee; border-top: 5px solid var(--red); background: linear-gradient(135deg, #eaf0ff, #fff); }

/* ---------- agreement and printable documents ---------- */
.agreement-box { max-height: 520px; overflow: auto; padding: clamp(16px, 3vw, 28px); border: 1px solid var(--line); border-radius: 14px; background: #fff; font-size: .95rem; }
.doc { background: #fff; padding: clamp(18px, 4vw, 40px); border: 1px solid var(--line); border-top: 6px solid var(--red); border-radius: 18px; box-shadow: var(--shadow); font-size: .96rem; }
.doc h2.ag-title { text-align: center; font-size: 1.8rem; }
.doc .ag-sub { text-align: center; margin-top: 4px; color: var(--muted); }
.doc h3 { margin: 22px 0 6px; font-size: 1.15rem; color: var(--glory); }
.doc p { margin: 0 0 9px; }
.doc p.sub { margin-left: 1.4em; }
.doc ul { margin: 6px 0 10px; padding-left: 1.3em; }
.sigs { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 14px; }
@media (max-width: 640px) { .sigs { grid-template-columns: minmax(0, 1fr); } }
.sig { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; }
.sig .typed { margin: 6px 0; font-family: "Brush Script MT", "Segoe Script", "Snell Roundhand", cursive; font-size: 1.7rem; color: var(--glory); border-bottom: 1px solid var(--ink); min-height: 2.2rem; }
.sig p { margin: 2px 0; font-size: .88rem; }
.stamp { display: inline-block; padding: 4px 12px; border: 2px solid var(--ok); border-radius: 8px; color: var(--ok); font-family: var(--hud); font-weight: 700; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; transform: rotate(-2deg); }
.stamp.wait { border-color: var(--warn); color: var(--warn); }
.stamp.red { border-color: var(--red); color: var(--red); }

/* ---------- messages ---------- */
.thread { display: grid; gap: 10px; margin: 14px 0; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.msg.me { margin-left: auto; background: #e3ecff; border-color: #aac0f2; }
.msg.internal { background: #fff4d6; border: 1px dashed #c99a1d; }
.msg .who { font-family: var(--hud); font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.msg p { margin: 4px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.logo-prev { display: block; width: 120px; height: 120px; object-fit: cover; border-radius: 16px; border: 1px solid var(--line); background: #fff; }

/* ---------- footer ---------- */
.foot { margin-top: 40px; background: linear-gradient(180deg, #001a4d, #00102f); color: #dbe6ff; border-top: 3px solid var(--red); }
.foot::before { content: ""; display: block; height: 5px; background: var(--flag); }
.foot-in { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 24px clamp(16px, 4vw, 32px); }
.foot img { display: block; height: 32px; width: auto; box-sizing: content-box; padding: 5px 12px; background: #fff; border-radius: 10px; }
.foot a { color: #fff; text-decoration-color: rgba(255, 255, 255, .5); }
.foot a:hover { color: var(--hot); }
.foot p { margin: 8px 0 0; font-size: .86rem; }
.foot-links { display: flex; gap: 6px 18px; flex-wrap: wrap; font-size: .9rem; }

/* ---------- legal pages ---------- */
.legal { max-width: 800px; }
.legal h2 { margin: 28px 0 8px; font-size: 1.45rem; }
.legal ul { display: grid; gap: 6px; padding-left: 1.2em; }
.keybox { padding: 18px 20px; border: 1px solid #9fb6ee; border-left: 6px solid var(--red); border-radius: 14px; background: #eaf0ff; }
.keybox h2 { margin: 0 0 6px; }

.copybox { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.copybox input { flex: 1; min-width: 220px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }
.titles-table input { min-width: 110px; }

/* ---------- one-of-one channel portals: the channel's own logo and color ---------- */
.chan-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 220px; padding: 5px 12px 5px 5px; border-radius: 999px; background: #fff; border: 2px solid var(--accent); }
.chan-chip img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.chan-chip b { font-family: var(--hud); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--glory); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 700px) { .chan-chip b { display: none; } .chan-chip { padding: 3px; } }
.chip-logo { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
.chan-hero { display: flex; align-items: center; gap: clamp(14px, 3vw, 24px); flex-wrap: wrap; padding: clamp(16px, 3vw, 26px); border-radius: 22px; color: #fff; background: linear-gradient(120deg, #a50a2b 0%, #5d0a35 30%, #002868 68%, #001a4d 100%); box-shadow: var(--shadow); }
.branded .chan-hero { background: linear-gradient(135deg, var(--accent), var(--navy)); }
.chan-hero img.logo { width: 92px; height: 92px; border-radius: 22px; object-fit: cover; border: 3px solid rgba(255, 255, 255, .9); background: #fff; }
.chan-hero .initial { display: grid; place-items: center; width: 92px; height: 92px; border-radius: 22px; background: rgba(255, 255, 255, .2); border: 3px solid rgba(255, 255, 255, .7); font-family: var(--display); font-size: 2.6rem; }
.chan-hero h1 { color: #fff; font-size: clamp(1.7rem, 4vw, 2.5rem); }
.chan-hero p { margin: 4px 0 0; color: #fff; }
.chan-hero .pill { background: rgba(255, 255, 255, .95); }
.chan-hero .push { margin-left: auto; text-align: right; }
.chan-hero .count b { display: block; font-family: var(--display); font-size: 2.4rem; line-height: 1; }
.chan-hero .count span { font-family: var(--hud); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 4px; padding: 8px; border-radius: 18px; background: var(--sheet); border: 1px solid rgba(255, 255, 255, .65); box-shadow: var(--shadow); }
.tabs a { padding: 8px 18px; border-radius: 999px; color: var(--glory); text-decoration: none; font-weight: 700; font-size: .92rem; border: 2px solid var(--field); background: #fff; }
.tabs a:hover { color: var(--red); border-color: var(--red); }
.tabs a[aria-current="page"] { color: #fff; background: var(--accent); border-color: var(--accent); }
main .section > .wrap .tabs { background: none; border: 0; box-shadow: none; padding: 0; }

/* ---------- analytics grid ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .tiles { grid-template-columns: minmax(0, 1fr); } }
.tile { position: relative; overflow: hidden; padding: 14px 16px 0; border: 1px solid var(--line); border-top: 5px solid var(--blue); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.t-label { margin: 0; color: var(--muted); font-family: var(--hud); font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.t-value { margin: 2px 0 0; font-family: var(--display); font-size: 2.3rem; font-weight: 600; line-height: 1.1; color: var(--glory); }
.t-delta { margin: 0 0 8px; font-size: .82rem; font-weight: 700; }
.t-delta span { color: var(--muted); font-weight: 400; }
.t-delta.up { color: var(--ok); } .t-delta.down { color: var(--red); } .t-delta.flat { color: var(--muted); }
.t-spark { display: block; width: calc(100% + 32px); height: 38px; margin: 0 -16px; }
.t-spark .line, .chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.t-spark .area, .chart .area { fill: color-mix(in srgb, var(--accent) 16%, transparent); stroke: none; }
.chart { display: block; width: 100%; height: 150px; }
.bars6 { display: flex; gap: 10px; align-items: flex-end; height: 110px; padding-top: 8px; }
.bars6 > div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 2px; }
.bars6 i { display: block; width: 100%; min-height: 3px; border-radius: 6px 6px 2px 2px; background: var(--accent); }
.bars6 i.ok { background: var(--ok); }
.bars6 span { font-size: .72rem; color: var(--muted); } .bars6 b { font-size: .8rem; color: var(--glory); }
.viewing { padding: 10px 14px; border-radius: 12px; background: #fff4d6; border: 1px dashed #c99a1d; font-size: .9rem; }

/* ---------- small screens ---------- */
@media (max-width: 700px) {
  .btn { width: 100%; }
  .cta-row .btn, .hero .btn { width: 100%; }
  .btn.small { width: auto; }
  .kicker a { display: inline-block; padding: 13px 0; }
  details > summary { min-height: 44px; display: flex; align-items: center; }
  a.tap { display: inline-flex; align-items: center; min-height: 44px; }
  main .section > .wrap, main .pagehead > .wrap { border-radius: 20px; }
  .hero .hero-in { border-radius: 22px; }
}

/* ---------- printing: contracts and forms print as clean white pages ---------- */
@media print {
  html, body { background: #fff; }
  html::before, html::after, body::before, body::after { display: none; }
  .top, .foot, .noprint, .flashes { display: none !important; }
  main .section > .wrap, main .pagehead > .wrap { background: none; border: 0; box-shadow: none; padding: 0; width: auto; backdrop-filter: none; }
  .doc, .card { border: 0; box-shadow: none; padding: 0; }
  .wrap { max-width: none; padding: 0; }
  a { color: inherit; text-decoration: none; }
  .sig, .tablewrap { break-inside: avoid; }
}
