/* Contract Overview — the visual brief (js/overview.js). Theme tokens only, so light and dark both work. */

#d-brief { display: flex; flex-direction: column; gap: 18px; margin-bottom: 18px; }

/* Overview toolbar (Contract infographic button) */
.ob-toolbar { display: flex; justify-content: flex-end; margin-bottom: -8px; }

/* Cover ticket (Friday brief design, in CMAI tokens): main part, dashed tear line, stub, Checker stamp */
.ob-pass { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 280px; background: var(--surface); border: 1px solid var(--border2); border-radius: 18px; overflow: hidden; }
.ob-pass-main { padding: 24px 28px 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ob-pass-stub { position: relative; border-left: 2px dashed var(--border2); padding: 22px 22px; display: flex; flex-direction: column; gap: 11px; background: var(--bg2); }
.ob-pass-stub::before, .ob-pass-stub::after { content: ""; position: absolute; left: -13px; width: 24px; height: 24px; border-radius: 50%; background: var(--bg); border: 1px solid var(--border2); }
.ob-pass-stub::before { top: -13px; } .ob-pass-stub::after { bottom: -13px; }
.ob-pass-expired .ob-pass-stub { background: repeating-linear-gradient(135deg, var(--bg2) 0 10px, color-mix(in srgb, var(--amber) 7%, var(--bg2)) 10px 20px); }
.ob-tkicker { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text3); }
.ob-route { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ob-tcode { font-size: clamp(34px, 5.4vw, 56px); font-weight: 800; letter-spacing: -.04em; line-height: 1; color: var(--text); }
.ob-tsub { font-size: 12px; color: var(--text2); margin-top: 4px; max-width: 36ch; overflow-wrap: anywhere; }
.ob-plane { flex: 1; min-width: 70px; height: 2px; position: relative; background: repeating-linear-gradient(90deg, var(--text3) 0 6px, transparent 6px 12px); }
.ob-plane::after { content: ""; position: absolute; right: -2px; top: -5px; border-left: 10px solid var(--text2); border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.ob-tchips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ob-tchip { font-family: var(--mono); font-size: 12.5px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--bg2); border: 1px solid var(--border2); color: var(--text); }
.ob-tchip.ob-dim { opacity: .6; }
.ob-tbadge { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border2); color: var(--text2); }
.ob-tbadge-type { color: var(--blue); border-color: var(--blue-border); }
.ob-texp { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--amber); border: 1px solid var(--amber-border); border-radius: 999px; padding: 2px 9px; }
.ob-since { display: flex; gap: 14px; align-items: center; }
.ob-ring { width: 56px; height: 56px; flex: none; }
.ob-ring-track { fill: none; stroke: var(--bg3); stroke-width: 5; }
.ob-ring-fill { fill: none; stroke: var(--green); stroke-width: 5; }
.ob-ring-end { stroke: var(--amber); } .ob-ring-open { opacity: .5; }
.ob-ring-text { font-size: 11px; font-weight: 700; fill: var(--text); font-family: var(--font); }
.ob-ring-inf { font-size: 19px; }
.ob-tfield { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ob-tfield span { font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--text3); }
.ob-tfield b { font-family: var(--mono); font-size: 13.5px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.ob-tfield b.ob-unv { color: var(--amber); }
.ob-tfield small { font-family: var(--mono); font-size: 11px; color: var(--text3); }
.ob-stamp { position: absolute; right: 310px; bottom: 26px; transform: rotate(-9deg); border: 3px solid currentColor; border-radius: 10px; padding: 6px 12px 5px; text-align: center; font-weight: 800; letter-spacing: .08em; line-height: 1.1; opacity: .92; }
.ob-stamp small { display: block; font-family: var(--mono); font-weight: 600; font-size: 12px; letter-spacing: .04em; }
.ob-stamp span { display: block; font-family: var(--mono); font-weight: 500; font-size: 10.5px; letter-spacing: 0; opacity: .85; margin-top: 2px; }
.ob-stamp-green { color: var(--green); } .ob-stamp-blue { color: var(--blue); } .ob-stamp-amber { color: var(--amber); } .ob-stamp-red { color: var(--red); } .ob-stamp-muted { color: var(--text2); }
/* Round "Delivered" stamp beside the Checker's stamp (newest delivery package Delivered to ContractManager stage) */
.ob-dstamp { position: absolute; right: 488px; bottom: 14px; width: 108px; height: 108px; border-radius: 50%; border: 3px double currentColor; box-shadow: inset 0 0 0 3px var(--surface, transparent), inset 0 0 0 4px currentColor; color: var(--blue); transform: rotate(8deg); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; opacity: .9; pointer-events: none; }
.ob-dstamp b { font-weight: 800; font-size: 13px; letter-spacing: .1em; }
.ob-dstamp small { font-family: var(--mono); font-weight: 600; font-size: 10px; letter-spacing: .02em; margin-top: 3px; white-space: nowrap; }
.ob-dstamp span { font-family: var(--mono); font-weight: 500; font-size: 10px; opacity: .85; margin-top: 2px; white-space: nowrap; }
@media (max-width: 900px) {
  .ob-pass { grid-template-columns: 1fr; }
  .ob-dstamp { position: static; grid-column: 1; grid-row: 2; justify-self: end; align-self: center; margin: 0 28px 18px; width: 96px; height: 96px; }
  .ob-pass-stub { border-left: 0; border-top: 2px dashed var(--border2); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ob-pass-stub::before, .ob-pass-stub::after { display: none; }
  .ob-stamp { position: static; grid-row: 2; justify-self: start; transform: rotate(-4deg); margin: 0 28px 18px; }
  .ob-pass-stub { grid-row: 3; }
}
@media (max-width: 560px) {
  .ob-pass-main { padding: 20px 16px; }
  .ob-pass-stub { grid-template-columns: 1fr; padding: 18px 16px; }
  .ob-stamp { margin: 0 16px 16px; }
}

/* Chapters */
.ob-ch { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px 20px; min-width: 0; }
.ob-ch-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.ob-ch-num { font-family: var(--mono); font-size: 12px; color: var(--blue); border: 1px solid var(--blue-border); background: var(--blue-bg); border-radius: var(--radius-sm); padding: 3px 7px; flex-shrink: 0; }
.ob-ch-title { margin: 0; font-family: var(--serif, var(--font)); font-size: 20px; font-weight: 600; color: var(--text); line-height: 1.2; }
.ob-ch-headline { margin: 4px 0 0; color: var(--text2); font-size: 13px; line-height: 1.45; }

.ob-sub { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--text3); font-family: var(--mono); margin-bottom: 6px; display: block; }
.ob-gap { margin-top: 16px; }
.ob-muted { color: var(--text3); font-size: 12px; }
.ob-mono { font-family: var(--mono); }

/* 01 — map + heatmap */
.ob-map-wrap { margin-bottom: 14px; }
.ob-map { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-md); min-height: 120px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ob-map-svg { width: 100%; height: auto; display: block; max-height: 360px; }
.ob-land { fill: var(--bg4); stroke: var(--border2); stroke-width: .3; }
.ob-lane { fill: none; stroke-linecap: round; opacity: .9; }
.ob-lane:hover { opacity: 1; filter: brightness(1.15); }
.ob-lane-any { stroke-dasharray: 5 4; }
.ob-node-origin { fill: var(--text); stroke: var(--bg); stroke-width: .4; }
.ob-node-market { fill: var(--text2); }
.ob-legend { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 11px; color: var(--text3); font-family: var(--mono); }
.ob-legend i { display: inline-block; width: 120px; height: 8px; border-radius: 4px; border: 1px solid var(--border); }

.ob-heat { margin-top: 12px; }
.ob-heat-scroll { overflow-x: auto; }
.ob-heat-table { border-collapse: separate; border-spacing: 2px; font-size: 12px; min-width: 100%; }
.ob-heat-table th { font-weight: 500; color: var(--text3); font-family: var(--mono); font-size: 10.5px; padding: 4px 6px; text-align: center; white-space: nowrap; }
.ob-heat-table tbody th { text-align: left; color: var(--text2); font-family: var(--font); font-size: 12px; white-space: normal; min-width: 160px; max-width: 320px; }
.ob-heat-table td { text-align: center; padding: 6px 8px; border-radius: 4px; color: var(--text); font-family: var(--mono); font-weight: 600; min-width: 46px; }
.ob-heat-table td small { display: block; font-weight: 400; font-size: 9.5px; color: var(--text2); }
.ob-heat-table td.ob-empty { color: var(--text3); font-weight: 400; background: var(--bg2); }

/* 02 — timeline */
.ob-timeline { position: relative; padding: 22px 0 6px; }
/* Ticks and "today" sit in an overlay aligned with the band tracks (label column 170px + 10px gap). */
.ob-tl-overlay { position: absolute; top: 0; bottom: 0; left: 180px; right: 0; pointer-events: none; }
.ob-tick, .ob-today { position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--border2); }
.ob-tick span, .ob-today span { position: absolute; top: 2px; left: 4px; font-size: 10px; color: var(--text3); font-family: var(--mono); }
.ob-today { border-left: 2px solid var(--red); }
.ob-today span { color: var(--red); }
.ob-band-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.ob-band-label { width: 170px; flex-shrink: 0; font-size: 12px; color: var(--text2); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-band-track { position: relative; flex: 1; height: 14px; background: var(--bg2); border-radius: 7px; }
.ob-band { position: absolute; top: 0; bottom: 0; border-radius: 7px; }
.ob-band-ticket { background: color-mix(in srgb, var(--blue) 70%, transparent); }
.ob-band-travel { background: color-mix(in srgb, var(--purple) 60%, transparent); }
.ob-open { background-image: linear-gradient(90deg, transparent 85%, var(--bg2)); }

.ob-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.ob-chip { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--chip-bg, var(--bg3)); border: 1px solid var(--border); color: var(--text2); }
.ob-chip b { font-family: var(--mono); color: var(--text); font-weight: 600; }

/* 03 — earned */
.ob-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.ob-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; min-width: 0; }
.ob-card-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.ob-card p { font-size: 13px; color: var(--text2); margin: 4px 0 10px; line-height: 1.5; }
.ob-rules { margin: 8px 0 0; padding-left: 16px; font-size: 12px; color: var(--text2); line-height: 1.5; }
.ob-cabin { margin-top: 8px; }
.ob-class { display: inline-flex; flex-direction: column; align-items: center; min-width: 34px; padding: 4px 6px; border-radius: 6px; background: var(--bg2); border: 1px solid var(--border2); font-family: var(--mono); font-weight: 700; font-size: 13px; color: var(--text); }
.ob-class small { font-weight: 400; font-size: 9.5px; color: var(--green); }
.ob-rule-list { margin: 0; padding-left: 16px; font-size: 12.5px; color: var(--text); line-height: 1.6; }

/* 04 — CMAI */
.ob-flow { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.ob-step { flex: 1; min-width: 120px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.ob-step span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text3); font-family: var(--mono); }
.ob-step strong { font-size: 15px; color: var(--text); }
.ob-step.muted strong { color: var(--text3); text-decoration: line-through; text-decoration-thickness: 1px; }
.ob-step.ok { border-color: var(--green-border); background: var(--green-bg); }
.ob-arrow { align-self: center; color: var(--text3); }
.ob-cmai-grid { display: grid; grid-template-columns: 220px 1fr; gap: 10px; }
.ob-wide { grid-column: 1 / -1; }
.ob-center { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ob-gauge { width: 150px; height: auto; }
.ob-gauge-num { font-family: var(--mono); font-size: 17px; font-weight: 700; fill: var(--text); }
.ob-bar-row { display: grid; grid-template-columns: 150px 1fr 120px; gap: 10px; align-items: center; font-size: 12px; color: var(--text2); margin: 5px 0; }
.ob-bar { height: 8px; background: var(--bg3); border-radius: 4px; overflow: hidden; }
.ob-bar i { display: block; height: 100%; background: var(--blue); border-radius: 4px; }
.ob-summary { margin: 14px 0 0; padding: 10px 14px; border-left: 3px solid var(--blue); background: var(--bg2); color: var(--text2); font-size: 13px; line-height: 1.55; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* Geography tab */
.ob-map-geo { margin-bottom: 16px; }
.ob-map-geo .ob-map-svg { max-height: 460px; }
.ob-label { fill: var(--text2); font-family: var(--font); paint-order: stroke; stroke: var(--bg2); stroke-width: .25em; stroke-linejoin: round; }
.ob-label-origin { fill: var(--text); font-weight: 600; font-family: var(--mono); }
.ob-geo-cols { display: grid; grid-template-columns: minmax(220px, 1fr) 2fr; gap: 16px; align-items: start; }
.ob-geo-cols > div:empty { display: none; }
.ob-origin { margin-bottom: 10px; }
#d-geo:empty::before { content: 'No destination groups: rates apply to all destinations.'; color: var(--text3); font-size: 12px; }
.ob-origin small { color: var(--text3); font-weight: 400; }

/* All the old key/value fields, folded below the brief */
.ob-details { margin-top: 4px; }
.ob-details > summary { cursor: pointer; color: var(--text2); font-size: 12px; padding: 6px 0; font-family: var(--mono); }
.ob-details[open] > summary { margin-bottom: 10px; }

@media (max-width: 760px) {
  .ob-geo-cols { grid-template-columns: 1fr; }
  .ob-ch { padding: 14px; }
  .ob-band-label { width: 110px; }
  .ob-tl-overlay { left: 120px; }
  .ob-cmai-grid { grid-template-columns: 1fr; }
  .ob-bar-row { grid-template-columns: 90px 1fr 92px; }
  .ob-ch-title { font-size: 17px; }
}
