/* Shared trading components (docs/design/COMPONENTS.md). No colour-only meaning: every side,
   type and status also has a shape or border style. */

/* Side mark on board rows: ▲ bid, ▼ offer. */
.side-mark { display: inline-flex; align-items: center; gap: 5px; font-size: var(--text-sm); font-weight: 600; white-space: nowrap; }
.side-mark::before { content: ""; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; }
.side-mark--bid::before { border-bottom: 6px solid var(--ink); }
.side-mark--offer::before { border-top: 6px solid var(--ink); }

/* Side tag: "You buy" outlined, "You sell" filled. */
.side-tag { display: inline-flex; align-items: center; gap: 5px; font-size: var(--text-sm); font-weight: 600; padding: 2px 9px; border-radius: var(--radius-tag); white-space: nowrap; }
.side-tag::before { content: ""; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; }
.side-tag--buy { border: 1.5px solid var(--ink); }
.side-tag--buy::before { border-bottom: 6px solid var(--ink); }
.side-tag--sell { background: var(--ink); color: var(--ivory); border: 1.5px solid var(--ink); }
.side-tag--sell::before { border-top: 6px solid var(--ivory); }

/* Listing type badge: the border carries the type. */
.listing-type { display: inline-flex; align-items: center; gap: 5px; font-size: var(--text-sm); font-weight: 500; padding: 1px 8px; border-radius: var(--radius-tag); border: 1px solid var(--border-strong); white-space: nowrap; }
.listing-type--firm { border: 1.5px solid var(--ink); font-weight: 600; }
.listing-type--firm.is-expiring { border-color: var(--attention); color: var(--attention-ink); }
.listing-type--rfq { border-style: dashed; }
.listing-type__until { font-family: var(--font-mono); font-weight: 500; }

/* Status badge: ● live, ■ agreed, ○ ended. */
.status-badge { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); font-weight: 600; padding: 2px 9px; border-radius: var(--radius-tag); white-space: nowrap; }
.status-badge::before { content: ""; width: 7px; height: 7px; flex: none; }
.status-badge--live { background: var(--accent-tint); color: var(--accent-ink); }
.status-badge--live::before { border-radius: 50%; background: var(--accent); }
.status-badge--agreed { background: var(--agreed-tint); color: var(--agreed-ink); }
.status-badge--agreed::before { background: var(--agreed); }
.status-badge--ended { background: var(--ended-tint); color: var(--ink-2); }
.status-badge--ended::before { border-radius: 50%; border: 1.5px solid currentColor; }
.status-badge--contracted { background: var(--agreed); color: var(--ivory); }
.status-badge--contracted::before { background: currentColor; }
.status-badge--failed { background: var(--failed-tint); color: var(--failed-ink); }
.status-badge--failed::before { border: 1.5px solid currentColor; }
.status-badge--disputed { background: var(--attention-tint); color: var(--attention-ink); }
.status-badge--disputed::before { background: currentColor; transform: rotate(45deg) scale(.85); }
/* In table rows: glyph and text only. */
.status-badge--plain { background: transparent; padding-inline: 0; }
.status-badge--contracted.status-badge--plain { color: var(--agreed); }

/* Price block. */
.price { font-family: var(--font-mono); font-weight: 500; letter-spacing: var(--tracking-price); line-height: 1; white-space: nowrap; }
.price__unit { font-family: var(--font-sans); font-size: 13px; letter-spacing: 0; color: var(--muted); margin-left: 5px; font-weight: 400; }
.price--lg { font-size: var(--text-price-lg); }
.price--md { font-size: var(--text-price-sm); }
.price--drawer { font-size: 36px; }
.price--inline { font-size: var(--text-base); font-weight: 600; letter-spacing: 0; }
.price--inline .price__unit { display: none; }
.price.is-rfq { font-family: var(--font-sans); font-style: italic; letter-spacing: 0; color: var(--ink-2); font-weight: 400; }
.price--inline.is-rfq { font-size: 13px; }

/* Spread badge and "Yours" marker. */
.spread { display: inline-flex; align-items: center; gap: 8px; font-size: var(--text-xs); border: 1px solid var(--border); padding: 1px 8px; border-radius: var(--radius-tag); }
.spread__value { font-weight: 600; }
.yours { font-size: var(--text-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; background: var(--accent-tint); color: var(--accent-ink); padding: 1px 7px; border-radius: 4px; }
.ref { font-family: var(--font-mono); }

/* Countdown states (countdown_controller). */
.is-soon { color: var(--attention-ink); }
.is-expired { color: var(--muted); }

/* Tranche table. */
.tranches { font-size: 13px; }
.tranches__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 110px; gap: 12px; padding: 7px 0; border-top: 1px solid var(--hairline); }
.tranches__head { font-size: var(--text-xs); color: var(--muted); border-top: 0; }
.tranches__total { border-top: 1.5px solid var(--ink); font-weight: 600; }
.tranches__qty { text-align: right; }

.breadcrumb { color: var(--muted); }
.tabs__count { margin-left: 6px; font-size: var(--text-xs); color: var(--muted); }

/* Under negotiation: three dots + text, never a count. */
.under-negotiation { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); font-weight: 500; color: var(--accent-ink); }
.under-negotiation::before { content: "• • •"; letter-spacing: -1px; font-size: 9px; color: var(--accent); }

.counterparty.is-anonymous { font-weight: 600; }

/* Index badge (inline pill) and the ticket's suggestion card. */
.index-badge { display: inline-flex; align-items: center; gap: 8px; font-size: var(--text-sm); background: var(--accent-tint); padding: 3px 10px; border-radius: var(--radius-tag); }
.index-badge__label { font-weight: 600; color: var(--accent-ink); }
.index-badge__value { font-weight: 600; }
.index-badge.is-fallback { background: var(--panel-sunken); }

/* Own economics: label / per MWh / total. */
.own-economics { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 14px; font-size: 13px; }
.own-economics > :nth-child(3n+2), .own-economics > :nth-child(3n) { text-align: right; }
.own-economics__head { font-size: var(--text-xs); }
.own-economics--boxed { background: var(--panel-sunken); border-radius: var(--radius-control); padding: 12px 14px; }
.own-economics--boxed > .own-economics__head:first-child { font-size: 13px; color: var(--ink-2); }
.own-economics > strong { padding-top: 4px; border-top: 1px solid var(--hairline); }

/* Compact tranches (ticket rail): period and quantity only, delivery folded into the period. */
.tranches--compact .tranches__row { grid-template-columns: minmax(0, 1fr) auto; padding: 3px 0; border-top: 0; }
.tranches--compact .tranches__total { border-top: 0; }
