:root {
  --bg: #f1f5fc; --panel: #ffffff; --ink: #121a33; --muted: #5a6482; --line: #d9e0ef;
  --accent: #2a4bff; --accent-ink: #ffffff; --accent-soft: #e6ebff;
  --sun: #ffc531; --sun-ink: #4a3500;
  --warn: #7a5200; --warn-bg: #fff1c9; --bad: #c2282d; --bad-bg: #fde6e7;
  --good: #0f7d57; --good-bg: #dff5ec;
  --round: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1326; --panel: #171e38; --ink: #eef1fb; --muted: #9aa5c7; --line: #2a3357;
    --accent: #8ea0ff; --accent-ink: #0b1030; --accent-soft: #212a55;
    --sun: #ffc531; --sun-ink: #2e2100;
    --warn: #ffd772; --warn-bg: #3b2f0c; --bad: #ff9a9d; --bad-bg: #421a1c;
    --good: #7fe0b8; --good-bg: #12352a;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1, h2, h3, .brand, button, .mate-name, .relay-name { font-family: var(--round); }
h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -0.01em; }
h1.hello { font-size: 30px; line-height: 1.15; font-weight: 700; margin: 10px 0 16px; max-width: 22em; }
h2 { font-size: 17px; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 0 0 6px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
main { max-width: 1040px; margin: 0 auto; padding: 16px; }
main.narrow { max-width: 440px; padding-top: 48px; }

header.bar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center;
  justify-content: space-between; max-width: 1040px; margin: 0 auto; padding: 14px 16px 0; }
header.bar .brand { font-weight: 700; font-size: 17px; }
nav.tabs { display: flex; gap: 4px; overflow-x: auto; max-width: 1040px; margin: 10px auto 0; padding: 0 16px 8px; }
nav.tabs button { border: 0; background: none; color: var(--muted); padding: 7px 14px; border-radius: 999px;
  font-size: 14px; cursor: pointer; white-space: nowrap; }
nav.tabs button:hover { background: var(--accent-soft); color: var(--ink); }
nav.tabs button[aria-current="page"] { color: var(--accent-ink); background: var(--accent); font-weight: 600; }
.count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 10px;
  background: var(--sun); color: var(--sun-ink); font-size: 12px; text-align: center; font-weight: 700; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 18px; margin-bottom: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.row.tight { gap: 6px; flex-wrap: nowrap; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid .panel { margin-bottom: 0; }
.stack > * + * { margin-top: 10px; }

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input, textarea, select { width: 100%; padding: 10px 12px; font: inherit; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
textarea { min-height: 84px; resize: vertical; }
input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px; }
button { font-size: 15px; font-weight: 600; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.primary:active, .chip:active, .mate:active { transform: translateY(1px); }
button.danger { color: var(--bad); border-color: var(--bad); }
button.danger.solid { background: var(--bad); color: var(--panel); }
button:disabled { opacity: 0.5; cursor: default; }
button.link { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; }

.tag { display: inline-block; padding: 1px 9px; border-radius: 10px; font-size: 12px;
  border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.tag.good { background: var(--good-bg); color: var(--good); border-color: transparent; }
.tag.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.tag.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.notice { padding: 10px 14px; border-radius: 12px; margin-bottom: 12px; }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.good { background: var(--good-bg); color: var(--good); }

pre.preview { margin: 8px 0; padding: 12px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.5 var(--mono);
  max-height: 320px; overflow: auto; }
code, .mono { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 13px; }
.scroll { overflow-x: auto; }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: 6px 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: 0; }
a { color: var(--accent); overflow-wrap: anywhere; }

.meter { height: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: 8px; }
.meter.warn > span { background: var(--sun); }
.meter.bad > span { background: var(--bad); }

/* ---- the team strip: the one loud thing on the page ---- */
.crew { margin-bottom: 14px; }
.mates { display: flex; gap: 6px; overflow-x: auto; padding: 6px 2px 10px; scroll-snap-type: x proximity; }
.mate { flex: 0 0 auto; width: 86px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 4px 8px; border-radius: 18px; border: 2px solid transparent; background: none; scroll-snap-align: start; }
.mate:hover { background: var(--panel); }
.mate[aria-pressed="true"] { background: var(--panel); border-color: var(--accent); }
.mate-name { font-size: 14px; font-weight: 700; }
.mate-job { font-size: 11px; font-weight: 400; color: var(--muted); text-align: center; line-height: 1.25;
  font-family: system-ui, sans-serif; }
.mate.intro { animation: arrive 0.45s cubic-bezier(.2, 1.4, .4, 1) backwards; }
@keyframes arrive { from { opacity: 0; transform: translateY(14px) scale(.8); } }

.avatar { position: relative; display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  font: 700 22px/1 var(--round); color: #fff; flex: none; }
.avatar.small { width: 24px; height: 24px; font-size: 12px; }
.relay .avatar { width: 34px; height: 34px; font-size: 15px; }
.avatar.working { animation: hop 1.4s ease-in-out infinite; box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--sun); }
.avatar.waiting { opacity: 0.4; }
.avatar.stopped { filter: grayscale(1); opacity: 0.5; }
.avatar.finished::after { content: "✓"; position: absolute; right: -4px; bottom: -4px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--good); color: var(--panel); font: 700 11px/16px system-ui; text-align: center;
  box-shadow: 0 0 0 2px var(--panel); }
@keyframes hop { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }
.jersey-0 { background: #2a4bff; } .jersey-1 { background: #0f8a6a; } .jersey-2 { background: #5b5f97; }
.jersey-3 { background: #d9480f; } .jersey-4 { background: #0b7285; } .jersey-5 { background: #c2255c; }
.jersey-6 { background: #7048e8; } .jersey-7 { background: #a8590a; } .jersey-8 { background: #1971c2; }
.jersey-9 { background: #d6336c; } .jersey-10 { background: #2f9e44; }

.brief { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; }
.brief p { margin-bottom: 10px; max-width: 70ch; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-weight: 500; font-size: 14px; background: var(--accent-soft); border-color: transparent; color: var(--ink);
  text-align: left; }
.chip:hover { border-color: var(--accent); }

.composer { border: 2px solid var(--accent); }
.check { display: flex; gap: 8px; align-items: flex-start; }
.check input { width: auto; margin-top: 4px; }
.check label { margin: 0; font-size: 14px; color: var(--ink); }

/* ---- tasks ---- */
.task h2 { margin: 0; overflow-wrap: anywhere; }
.task h3 { margin: 14px 0 6px; }
.task .muted .tag { margin-left: 8px; }
.relay { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 4px; margin: 12px 0 6px; padding: 0; }
.relay li { display: grid; grid-template-columns: auto auto; column-gap: 8px; align-items: center;
  padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--bg); }
.relay li.on { background: var(--warn-bg); }
.relay li + li { margin-left: 14px; position: relative; }
.relay li + li::before { content: ""; position: absolute; left: -16px; top: 50%; width: 14px; border-top: 2px dotted var(--line); }
.relay .avatar { grid-row: span 2; }
.relay-name { font-weight: 700; font-size: 13px; line-height: 1.2; }
.relay-what { font-size: 11px; color: var(--muted); line-height: 1.2; }
.now { color: var(--muted); margin: 0; }
.answer { padding: 14px 16px; margin: 10px 0; background: var(--accent-soft); border-radius: 14px; }
.answer h3 { margin-top: 0; }
.answer p { margin: 0; font-size: 16px; }
.just-done .answer { animation: land 0.5s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes land { from { opacity: 0; transform: scale(.96); } }
.approval { padding: 12px; border: 1px solid var(--line); border-radius: 14px; }
.approval h3 { margin: 0; }
.action { margin: 8px 0 8px 2px; padding-left: 12px; border-left: 2px solid var(--line); }
dl.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 4px 14px; margin: 6px 0; font-size: 14px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
details.steps { margin-top: 12px; }
details.steps summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.pulse { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }

/* ---- connections ---- */
.link { display: flex; flex-direction: column; gap: 10px; }
.link.is-on { border-color: var(--good); }
.link h2 { margin: 0; }
.does { margin: 0; padding-left: 18px; font-size: 14px; flex: 1; }
.does li { margin-bottom: 3px; }
.who { font-size: 13px; color: var(--muted); gap: 6px 12px; }

/* ---- deleting the account ---- */
.warning-zone { border: 2px solid var(--bad); }
.warning-zone h2 { color: var(--bad); }
.warning-zone ul { margin: 0 0 10px; padding-left: 20px; }
.warning-zone li { margin-bottom: 6px; }

@media (max-width: 560px) { h1.hello { font-size: 24px; } .relay li + li { margin-left: 0; } .relay li + li::before { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .pulse, .avatar.working, .mate.intro, .just-done .answer { animation: none; }
}
.task table { display: block; overflow-x: auto; }
.mates { max-width: 100%; }
main, .crew, .task { min-width: 0; }
body { overflow-x: hidden; }

/* ---- portraits, help, ownership ---- */
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; }
.mate .avatar { width: 64px; height: 64px; }
.mate { width: 92px; }
h2.flat { margin: 0; }
.faq details { padding: 14px 18px; margin-bottom: 8px; }
.faq summary { cursor: pointer; font: 700 16px var(--round); }
.faq p { margin: 10px 0 0; max-width: 70ch; }
footer.owner { max-width: 1040px; margin: 8px auto 24px; padding: 0 16px; font-size: 12px; color: var(--muted); }
.mates .mate { flex: 1 1 0; min-width: 80px; width: auto; }

/* ---- team page: what each agent does, what it costs, what it needs ---- */
.grid.members { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); align-items: stretch; grid-auto-rows: 1fr; }
.member { display: flex; flex-direction: column; gap: 10px; }
.member p { margin: 0; }
.member .check { margin-top: auto; }
.member { position: relative; }
.member details.dropdown { position: static; }
.member .drop-body { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; margin-top: 4px; padding: 12px 14px; background: #161b33; border: 1px solid #3b4cca; border-radius: 8px; box-shadow: 0 10px 28px rgba(0,0,0,.55); }
.member.out { opacity: 0.6; }
.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); }
.price strong { font: 700 22px var(--round); }
.price .check { margin-left: auto; align-items: center; }
.price .check input { margin-top: 0; }
.does-group h3 { margin: 0 0 4px; font-size: 13px; }
.does-group ul { margin: 0; padding-left: 18px; font-size: 14px; }
.does-group li { margin-bottom: 2px; }
.does-group.gated h3 { color: var(--warn); }
.does-group.never h3, .does-group.never li { color: var(--muted); }
.does-group.never li { text-decoration: line-through; }
.asks { border-left: 4px solid var(--sun); padding-left: 12px; }
.panel.asks { border-left-width: 4px; }
.asks h3 { margin: 0 0 4px; }
.asks p { margin: 0 0 6px; }
.plan { border: 2px solid var(--accent); }
.plan .total { font: 700 24px var(--round); }
.ladder { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; padding: 0; }
.ladder li { font-size: 12px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.ladder li.hit { background: var(--good-bg); color: var(--good); border-color: transparent; font-weight: 600; }
@media (max-width: 700px) { .plan { position: static; } }

/* ---- history ---- */
.histbar input { flex: 1 1 220px; width: auto; }
.histbar select { flex: 0 0 170px; width: auto; }
.hist > li { padding: 0; border-bottom: 0; margin-bottom: 8px; }
.histrow { display: grid; grid-template-columns: 150px 1fr auto auto auto; gap: 10px 14px; align-items: center; width: 100%;
  text-align: left; padding: 12px 16px; border-radius: 14px; background: var(--panel); font-weight: 400; font-family: system-ui, sans-serif; }
.histrow:hover, .hist li.open .histrow { border-color: var(--accent); }
.hist-when { font-size: 12px; color: var(--muted); }
.hist-goal { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.hist-who { display: flex; gap: 3px; }
.hist-detail { padding: 10px 0 4px 18px; border-left: 3px solid var(--accent); margin: 8px 0 14px 12px; }
.notice.row { align-items: center; }
@media (max-width: 700px) { .histrow { grid-template-columns: 1fr auto; } .hist-when, .hist-who { display: none; } }
.jersey-11 { background: #9c36b5; }

/* ---- connecting a real store ---- */
.link.wide { grid-column: 1 / -1; }
.link ol.does { padding-left: 20px; }

/* autopilot */
.auto-form textarea { width: 100%; margin: 8px 0; }
.auto-form select { width: auto; }
.auto-form .row { margin: 8px 0; }
.auto-list { display: grid; gap: 10px; margin-bottom: 14px; }
.auto-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin: 0; }
.auto-row p { margin: 4px 0 0; }
.lines li { padding: 9px 0; border-top: 1px solid var(--line); gap: 12px; }
.lines li:first-child { border-top: 0; }
.lines li > span:first-child { flex: 1 1 260px; }
.auto-form input[type="checkbox"] { width: auto; flex: 0 0 auto; margin: 0; }
.auto-form label.row { justify-content: flex-start; flex-wrap: nowrap; }
.auto-row { padding: 14px 18px; }

/* meta structure report */
.meta-report details.panel { margin: 0; }
.meta-report summary { cursor: pointer; }
.meta-list h3 { margin: 12px 0 4px; font-size: 14px; }
.meta-list ul { margin: 0; }
.meta-list li { padding: 2px 0; overflow-wrap: anywhere; }
.meta-report .notice ul { margin: 6px 0 0; padding-left: 18px; }

/* update progress */
.update-progress progress { width: 100%; height: 10px; margin: 10px 0 6px; accent-color: var(--accent); }
.update-progress .stages { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; list-style: none; }
.update-progress .stages li { opacity: .55; }
.update-progress .stages li.past, .update-progress .stages li.now { opacity: 1; }
.update-progress .stages li.now { font-weight: 600; }

/* meta posting pages */
.post-list li { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); }
.post-list li:first-child { border-top: 0; }
.post-list input[type="checkbox"] { width: auto; margin: 0; }
.post-list input:not([type]) { flex: 0 1 220px; width: auto; }
.post-list label { flex: 1 1 300px; flex-wrap: wrap; }

.does-group.planned h3 { color: var(--muted, #667); }
.does-group.planned li { opacity: .8; }

/* Privacy Policy and Terms of Use pages */
.legal h2 { margin-top: 1.6em; font-size: 1.1rem; }
.legal li { margin-bottom: 0.3em; }
footer.owner a { color: inherit; }

nav.tabs button[aria-expanded="true"] { background: var(--accent-soft); color: var(--ink); }
.megamenu { max-width: 1040px; margin: 0 auto; padding: 8px 16px 12px; display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.megamenu button { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 2px; padding: 10px 12px;
  border-radius: 12px; border: 1px solid var(--line, #3a3f5c); background: none; color: var(--ink); cursor: pointer; }
.megamenu button:hover { background: var(--accent-soft); }
.megamenu button[aria-current="page"] { border-color: var(--accent); }

a.button { display: inline-block; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--accent); color: var(--ink);
  text-decoration: none; font-weight: 600; }
a.button.primary { background: var(--accent); color: var(--accent-ink); }

/* Visual Studio */
.vs-ready { flex-wrap: wrap; gap: 8px; margin: 10px 0 16px; }
.vs-grid { display: grid; gap: 14px; grid-template-columns: minmax(260px, 340px) 1fr; align-items: start; }
@media (max-width: 820px) { .vs-grid { grid-template-columns: 1fr; } }
.vs-chat { margin-bottom: 0; max-height: 78vh; overflow: auto; }
.vs-feed { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.vs-line { display: grid; grid-template-columns: 20px 1fr; gap: 8px; font-size: 14px; color: var(--muted); }
.vs-line.ok, .vs-line.done { color: var(--good); } .vs-line.bad { color: var(--bad); } .vs-line.warn { color: var(--warn); }
.vs-line.you { color: var(--ink); font-weight: 600; } .vs-line.reply, .vs-line.advice { color: var(--ink); }
.vs-ico { text-align: center; font-weight: 700; }
.vs-say input { flex: 1; min-width: 160px; }
.vs-slides { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.vs-slide { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.vs-slide img, .vs-wait { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--accent-soft); }
.vs-wait { display: grid; place-items: center; color: var(--muted); font-weight: 600; }
.vs-slide figcaption { padding: 10px 12px 12px; display: grid; gap: 4px; }
.vs-thumb { width: 44px; height: 55px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.vs-when { gap: 10px; flex-wrap: wrap; }
.member details > summary { cursor: pointer; font-weight: 700; color: #fff; background: #3b4cca; border-radius: 6px; padding: 6px 10px; }
.member details > summary:hover { background: #4c5de0; }
.composer { position: relative; }
.agent-pick > summary { cursor: pointer; list-style: none; padding: 8px 10px; border: 1px solid #3b4cca; border-radius: 8px; background: #161b33; }
.agent-pick .drop-body { position: absolute; left: 0; right: 0; z-index: 20; padding: 12px 14px; background: #161b33; border: 1px solid #3b4cca; border-radius: 8px; box-shadow: 0 10px 28px rgba(0,0,0,.55); max-height: 60vh; overflow-y: auto; }
.agent-pick .drop-body.up { bottom: 100%; margin-bottom: 4px; }
.agent-pick .chip { text-align: left; }
.vs-brand { margin: 0 0 12px; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px; border: 1px solid var(--line, #888); }
.pickrow { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { display: grid; gap: 2px; text-align: left; min-width: 150px; padding: 10px 12px; border: 2px solid var(--line, #3a3f5c); border-radius: 10px; background: transparent; }
.pick.on, .prod.on { border-color: #6b7cff; box-shadow: 0 0 0 2px rgba(107,124,255,.35); }
.pick:disabled { opacity: .5; cursor: not-allowed; }
.prodgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; max-height: 340px; overflow-y: auto; padding: 2px; }
.prod { display: grid; gap: 4px; justify-items: center; padding: 6px; border: 2px solid var(--line, #3a3f5c); border-radius: 10px; background: transparent; text-align: center; }
.prod img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; }
.vs-video { width: min(100%, 320px); border-radius: 12px; }
/* Everything can be selected and copied: text, buttons' labels, tables and pictures. */
html, body, body * { -webkit-user-select: text; user-select: text; }
img { -webkit-user-drag: auto; user-drag: auto; }
/* Long labels wrap inside their own box instead of pushing the page wider (small phones and folded screens). */
.tag { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
/* A long web address or code in a step breaks onto the next line instead of widening the page on phones. */
main li, main p, main td, main dd, main code, main label { overflow-wrap: anywhere; }
