/*
 * The toolbox view.
 *
 * Tokens, the top bar, the wordmark and the buttons are in `shell.css`, which
 * both views share. What is here is the playground: the section rail, the
 * panels, the JSON viewer, the log drawer and the connect dialog.
 *
 * `.tb-layout` and not `.layout`: the reference has a two-column layout of its
 * own with different measurements, and when the two pages became one page the
 * bare name could only belong to one of them.
 */

/* ── Layout ───────────────────────────────────────────────────────────── */

.tb-layout {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  gap: 24px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 18px 80px;
}

/*
 * The rail is hidden until a key is connected, and `hidden` means
 * `display: none` — the element leaves the grid entirely. Without these two
 * rules the panel host slid up into the rail's 232px column and the whole
 * landing page rendered in a strip, with 948px of empty grid beside it. Place
 * both children explicitly, and collapse to one column while the rail is gone.
 */
.rail {
  grid-column: 1;
}

.stack {
  grid-column: 2;
}

body[data-connected="no"] .tb-layout {
  grid-template-columns: minmax(0, 1fr);
}

body[data-connected="no"] .stack {
  grid-column: 1;
}

.rail {
  position: sticky;
  top: calc(var(--header-h) + 22px);
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/*
 * Grid, not flex. Half the titles here are two words too long for 232px
 * ("Account & managerships", "Carrier & product register"), and with flex the
 * wrapped second line ran back under the verb while the verb itself floated to
 * the vertical middle of a two-line row. A three-column grid pins the verb and
 * the icon to the FIRST line — `align-items: start` plus a line-height nudge —
 * and lets only the label wrap.
 */
.rail a {
  display: grid;
  grid-template-columns: 30px 15px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.35;
}

.rail a > svg {
  /* Optical centring against a 13px/1.35 first line. */
  margin-top: 1px;
}

.rail a:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* The active row is the one place the violet earns its keep in the chrome: a
   left edge in the accent, so the eye finds it without reading. */
.rail a.active {
  position: relative;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 650;
}

.rail a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--violet);
}

.rail .rail-verb {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.85;
  color: var(--text-faint);
}

.rail a.active .rail-verb {
  color: var(--brand);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

@media (max-width: 880px) {
  .rail,
  .stack {
    grid-column: 1;
  }

  .tb-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .rail .rail-verb {
    display: none;
  }

  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 14px;
  }

  .sender-picker span {
    display: none;
  }
}

/* ── Panels ───────────────────────────────────────────────────────────── */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  scroll-margin-top: calc(var(--header-h) + 16px);
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(var(--surface-2), var(--surface));
}

.panel-head h2 {
  flex: 1;
  min-width: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.panel-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 18px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

.verb {
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.verb[data-verb="POST"] {
  background: var(--ok-soft);
  color: var(--ok);
}

.verb[data-verb="PUT"] {
  background: var(--warn-soft);
  color: var(--warn);
}

.verb[data-verb="DELETE"] {
  background: var(--danger-soft);
  color: var(--danger);
}

.step {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 2px;
}

/* ── Small pieces ─────────────────────────────────────────────────────── */

.muted {
  color: var(--text-muted);
}

.notice {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--border-strong);
  background: var(--surface-2);
  font-size: 13px;
}

.notice b {
  font-weight: 650;
}

.notice[data-tone="warn"] {
  border-left-color: var(--warn);
  background: var(--warn-soft);
  color: var(--warn);
}

.notice[data-tone="danger"] {
  border-left-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.notice[data-tone="info"] {
  border-left-color: var(--info);
  background: var(--info-soft);
  color: var(--info);
}

.error {
  color: var(--danger);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  background: var(--surface-2);
  color: var(--text-muted);
  white-space: nowrap;
}

.badge[data-tone="ok"] {
  background: var(--ok-soft);
  color: var(--ok);
}

.badge[data-tone="danger"] {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge[data-tone="warn"] {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge[data-tone="info"] {
  background: var(--info-soft);
  color: var(--info);
}

.rows {
  display: flex;
  flex-direction: column;
}

.row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}

.row:last-child {
  border-bottom: 0;
}

.row > span:first-child {
  color: var(--text-muted);
}

.row > span:last-child {
  text-align: right;
  word-break: break-word;
}

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

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

.spread {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.copy-btn {
  border: 0;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  padding: 0 3px;
  font: inherit;
}

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

.mono {
  font-family: var(--mono);
  font-size: 12.5px;
}

/* ── Cards inside panels (managerships, agreements, partners, printers) ── */

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.card + .card {
  margin-top: 10px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.card-head[aria-expanded="true"] {
  border-bottom: 1px solid var(--border);
}

.card-body {
  padding: 12px;
}

.card-body[hidden] {
  display: none;
}

.chev {
  transition: transform 0.15s ease;
  color: var(--text-faint);
}

[aria-expanded="true"] .chev {
  transform: rotate(90deg);
}

/* ── Pills (product / service pickers) ────────────────────────────────── */

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

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 12.5px;
  cursor: pointer;
  user-select: none;
  background: var(--surface);
}

.pill:hover {
  border-color: var(--brand);
}

.pill input {
  accent-color: var(--brand);
  margin: 0;
}

.pill:has(input:checked) {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
  font-weight: 600;
}

.pill-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.pill-group + .pill-group {
  margin-top: 8px;
}

.pill-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 12.5px;
  font-weight: 650;
}

/* ── Package editor ───────────────────────────────────────────────────── */

.pkg-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr)) 32px;
  gap: 8px;
  align-items: end;
}

.pkg-row + .pkg-row {
  margin-top: 8px;
}

.pkg-row label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.pkg-row input {
  padding: 6px 8px;
}

.icon-btn {
  height: 32px;
  width: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--danger);
  border-color: var(--danger);
}

@media (max-width: 720px) {
  .pkg-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ── JSON editor + viewer ─────────────────────────────────────────────── */

.editor {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

.editor textarea {
  border: 0;
  border-radius: 0;
  min-height: 190px;
  display: block;
}

.editor-status {
  font-size: 11.5px;
  font-weight: 650;
}

.editor-status[data-state="invalid"] {
  color: var(--danger);
}

.editor-status[data-state="valid"] {
  color: var(--ok);
}

.json-view {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  overflow-x: auto;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  max-height: 460px;
  overflow-y: auto;
}

.json-view ul {
  list-style: none;
  margin: 0;
  padding-left: 15px;
}

.json-view > ul {
  padding-left: 0;
}

.json-key {
  color: var(--info);
}

.json-str {
  color: var(--ok);
  word-break: break-all;
}

.json-num {
  color: var(--brand);
}

.json-bool,
.json-null {
  color: var(--warn);
}

.json-toggle {
  border: 0;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  font: inherit;
  padding: 0 4px 0 0;
}

.json-count {
  color: var(--text-faint);
}

pre.json-raw {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Result lists ─────────────────────────────────────────────────────── */

.result {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.result + .result {
  margin-top: 8px;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.result-title {
  font-weight: 650;
}

.price {
  font-size: 16px;
  font-weight: 700;
  color: var(--brand);
  white-space: nowrap;
}

.result[data-tone="error"] {
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
  background: var(--danger-soft);
}

.kv {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px 16px;
  font-size: 12.5px;
}

.kv div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 3px;
}

.kv span:first-child {
  color: var(--text-muted);
}

.empty {
  padding: 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
}

.spin {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .spin {
    animation-duration: 2s;
  }

  .chev {
    transition: none;
  }
}

/* ── Hero (disconnected) ──────────────────────────────────────────────── */

.hero {
  display: flex;
  flex-direction: column;
  gap: 34px;
}

/*
 * The lavender band. `isolation: isolate` is what keeps the arc behind the
 * copy without either one needing a z-index on the page's stacking context —
 * the band is its own context, so `z-index: 0` on the arc is local.
 */
.hero-band {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 56px 48px 52px;
  border-radius: 22px;
  background: linear-gradient(150deg, var(--lavender), #ece7fb);
  border: 1px solid var(--brand-line);
}

@media (prefers-color-scheme: dark) {
  .hero-band {
    background: linear-gradient(150deg, #241534, #1b1026);
  }
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 620px;
}

/* Profrakt's own arc, the shape at the top of profrakt.no. It is clipped by
   the band, so only the quarter that reads as a curve is ever visible. */
.hero-arc {
  position: absolute;
  z-index: 0;
  right: -90px;
  bottom: -160px;
  width: 380px;
  height: 380px;
  border-radius: 999px 999px 0 0;
  background: radial-gradient(
    circle at 50% 85%,
    color-mix(in srgb, var(--violet) 55%, transparent),
    color-mix(in srgb, var(--violet) 22%, transparent)
  );
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 18px;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--brand-line);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
}

.hero-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--violet);
}

.hero h1 {
  /* `clamp` and not a media query: the band is fluid, and the heading should
     stop being 44px the moment the band stops being wide, not at 880px. */
  font-size: clamp(30px, 4.4vw, 46px);
  margin-bottom: 16px;
  color: var(--purple);
}

@media (prefers-color-scheme: dark) {
  .hero h1 {
    color: var(--text);
  }
}

.hero-lede {
  max-width: 54ch;
  margin-bottom: 26px;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
}

.btn-lg {
  height: 44px;
  padding: 0 20px;
  font-size: 14.5px;
}

.hero-actions .btn:not(.btn-primary) {
  background: var(--surface);
  border-color: var(--brand-line);
  text-decoration: none;
}

.hero-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  max-width: 56ch;
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
}

.hero-note-icon {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: var(--brand);
}

.hero-grid-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin: -18px 0 0;
  padding: 0;
  list-style: none;
}

/*
 * Cards, not links: none of these sections can be opened without a key, and a
 * card that looks clickable and is not is worse than one that never claimed to
 * be. They become the rail the moment the key lands.
 */
.hero-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 3px 10px;
  padding: 15px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.hero-card-verb {
  grid-row: span 2;
  align-self: start;
  min-width: 38px;
  padding-top: 2px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.hero-card-verb[data-verb="POST"] {
  color: var(--brand);
}

.hero-card b {
  font-size: 13.5px;
  font-weight: 650;
}

.hero-card span:last-child {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-muted);
}

@media (max-width: 720px) {
  .hero-band {
    padding: 36px 24px 34px;
  }

  /*
   * On a narrow band the arc stops being a shape beside the copy and becomes a
   * tint underneath it, which drops the contrast of the muted note text. Shrink
   * it and push it into the corner so it stays decoration.
   */
  .hero-arc {
    right: -120px;
    bottom: -190px;
    width: 260px;
    height: 260px;
    opacity: 0.6;
  }
}

/* ── Dialog + drawer ──────────────────────────────────────────────────── */

.sheet {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  width: min(440px, calc(100vw - 32px));
  background: var(--surface);
  color: var(--text);
}

.sheet::backdrop {
  background: rgba(20, 18, 28, 0.55);
}

.sheet-body {
  padding: 20px;
}

.sheet-body h2 {
  font-family: var(--display);
  letter-spacing: -0.01em;
  font-size: 18px;
  margin-bottom: 6px;
}

/* The escape hatch in the connect dialog, for someone who has no key yet. */
.sheet-alt {
  margin: 14px 0 0;
  padding: 11px 13px;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* A button that reads as a link. It is a <button> and not an <a> because it
   performs an action rather than going somewhere — an anchor with no href is
   invisible to a keyboard. */
.linklike {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 650;
  color: var(--brand);
  text-decoration: underline;
  cursor: pointer;
}

.linklike:hover {
  text-decoration: none;
}

.linklike:disabled {
  opacity: 0.6;
  cursor: progress;
}

.sheet-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 100vw);
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -16px 0 40px rgba(0, 0, 0, 0.16);
}

.drawer[hidden] {
  display: none;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.drawer-head h2 {
  font-size: 15px;
}

.drawer-head-actions {
  display: flex;
  gap: 4px;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px 40px;
}

.log-entry {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
}

.log-entry-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.log-entry-head:hover {
  background: var(--surface-2);
}

.log-path {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-status {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
}

.log-status[data-ok="false"] {
  color: var(--danger);
}

.log-status[data-ok="true"] {
  color: var(--ok);
}

.log-ms {
  color: var(--text-faint);
  font-size: 11.5px;
}

.log-entry-body {
  padding: 10px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.log-entry-body h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin: 10px 0 4px;
}

.log-entry-body h4:first-child {
  margin-top: 0;
}

.tabs {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.tabs button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.tabs button[aria-selected="true"] {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 650;
}

/* ── Toasts ───────────────────────────────────────────────────────────── */

.toasts {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  font-weight: 550;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
}

.toast[data-tone="error"] {
  background: var(--danger);
  color: #fff;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Checkout prototype ───────────────────────────────────────────────────
 *
 * Deliberately styled like a shop's delivery step rather than like the rest of
 * the tool: the point of the panel is to show what the API looks like once it
 * reaches a customer, and a row of debug tables would not show that.
 */

.checkout {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
}

.checkout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-weight: 650;
}

.co-group {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px 4px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.co-option + .co-option {
  border-top: 1px solid var(--border);
}

.co-option-main {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
}

.co-option-main:hover {
  background: var(--surface-2);
}

.co-option-main input {
  accent-color: var(--brand);
  flex-shrink: 0;
}

.co-mark {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--surface);
  flex-shrink: 0;
}

.co-mark-text {
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.co-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.co-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.co-text small,
.co-partner small {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
}

.co-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.co-price small {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-faint);
}

.co-partners {
  padding: 4px 16px 14px 58px;
  background: var(--surface-2);
  border-top: 1px dashed var(--border);
}

.co-partner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 0;
  cursor: pointer;
}

.co-partner input {
  margin-top: 4px;
  accent-color: var(--brand);
}

.co-summary {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.co-json {
  margin: 10px 0;
  padding: 10px 12px;
  max-height: 260px;
  overflow: auto;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 12px;
  white-space: pre-wrap;
}

.co-errors {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.co-errors summary {
  cursor: pointer;
}

.co-errors ul {
  margin: 8px 0 0;
  padding-left: 20px;
}
