/* #region zone:desk.style.bonds — หน้าพันธบัตร: การ์ด ตารางทั่วโลก กราฟ (สีชุดข้อมูลคงที่) */
/* Spec docs/superpowers/specs/2026-10-14-desk-bonds.md. The page reuses the Desk view shell (.stage-view, .stage-note,
   .stage-message, .seg), tokens only. Series colours are the validated categorical slots 1-3 (dataviz palette; slot order is
   fixed and a colour follows its entity). Text never wears a series colour; a line sample beside the label carries identity,
   and slots 2 and 3 are also dashed so colour is never the only cue. Fluid: cards reflow by container width, the table drops
   its date and frequency columns into a sub-line when its card is narrow, the charts redraw at their real width. */
:root {
  --bond-s1: #2a78d6;
  --bond-s2: #eb6834;
  --bond-s3: #1baf7a;
}
:root[data-theme='dark'] {
  --bond-s1: #3987e5;
  --bond-s2: #d95926;
  --bond-s3: #199e70;
}

.bond-back-btn {
  width: var(--tap-min);
  height: var(--tap-min);
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  background: var(--panel);
}
.bond-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  min-width: 0;
}
.bond-body[hidden] {
  display: none;
}
.bond-curves {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: var(--sp-4);
}
.bond-world {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-4);
}
/* ---- cards ---- */
.bond-card {
  container-type: inline-size;
  min-width: 0;
  padding: var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-inner);
  background: var(--panel);
}
.bond-h2 {
  margin: 0;
  font-size: var(--fs-xl);
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}
.bond-sub {
  margin: var(--sp-1) 0 var(--sp-3);
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--muted);
}
.bond-empty {
  margin: var(--sp-4) 0;
  font-size: var(--fs-md);
  line-height: 1.6;
  color: var(--muted);
}
.bond-hist-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-3);
}
.bond-hist-head .bond-h2 {
  flex: 1 1 12rem;
  min-width: 0;
}
.bond-card.is-loading #bond-hist-body {
  opacity: 0.5;
  transition: opacity var(--dur-base) ease;
}
.bond-retry {
  min-height: var(--tap-min);
  padding: 0 var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  background: var(--panel);
  color: var(--text);
  font-size: var(--fs-md);
  font-weight: 600;
}
.bond-view .num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ---- legend and swatches (a line sample, dashed for slots 2 and 3) ---- */
.bond-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-4);
  margin: 0 0 var(--sp-2);
  padding: 0;
  list-style: none;
}
.bond-key {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-md);
  color: var(--text);
}
.bond-swatch {
  display: inline-block;
  flex-shrink: 0;
  width: 20px;
  height: 0;
  border-top: 2px solid var(--bond-s1);
}
.bond-swatch[data-slot='2'] {
  border-top-color: var(--bond-s2);
  border-top-style: dashed;
}
.bond-swatch[data-slot='3'] {
  border-top-color: var(--bond-s3);
  border-top-style: dotted;
}

/* ---- the chart ---- */
.bond-chart {
  position: relative;
  width: 100%;
  min-width: 0;
}
.bond-plot {
  position: relative;
}
.bond-svg {
  display: block;
  width: 100%;
  height: auto;
}
.bond-svg:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
  border-radius: var(--r-control);
}
.bond-grid {
  stroke: var(--line);
  stroke-width: 1;
}
.bond-zero {
  stroke: var(--muted);
  stroke-width: 1;
  opacity: 0.6;
}
.bond-tick {
  fill: var(--muted);
  font-family: var(--font-sans);
  font-size: var(--u-text-xs);
}
.bond-line {
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke: var(--bond-s1);
}
.bond-line[data-slot='2'] {
  stroke: var(--bond-s2);
  stroke-dasharray: 6 4;
}
.bond-line[data-slot='3'] {
  stroke: var(--bond-s3);
  stroke-dasharray: 2 4;
}
.bond-dot {
  fill: var(--bond-s1);
  stroke: var(--panel);
  stroke-width: 2;
}
.bond-dot[data-slot='2'] {
  fill: var(--bond-s2);
}
.bond-dot[data-slot='3'] {
  fill: var(--bond-s3);
}
.bond-cross {
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}
.bond-hit {
  fill: transparent;
  cursor: crosshair;
  touch-action: pan-y;
}
.bond-tip {
  position: absolute;
  z-index: 2;
  min-width: 140px;
  max-width: min(260px, 80%);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  background: var(--bg);
  box-shadow: var(--pop-shadow);
  color: var(--text);
  font-size: var(--fs-md);
  line-height: 1.4;
  pointer-events: none;
}
.bond-tip[hidden] {
  display: none;
}
.bond-tip-title {
  margin-bottom: var(--sp-1);
  font-weight: 700;
}
.bond-tip-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.bond-tip-label {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--muted);
}
.bond-tip-value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.bond-summary {
  margin: var(--sp-2) 0 0;
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--text);
}

/* ---- the 2s10s note ---- */
.bond-spread {
  margin-top: var(--sp-3);
  padding: var(--sp-3);
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: var(--r-control);
  background: var(--panel2);
}
.bond-spread[data-kind='inverted'] {
  border-left-color: var(--amber);
  background: var(--amber-soft);
}
.bond-spread-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-1) var(--sp-3);
}
.bond-spread-title {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--muted);
}
.bond-spread-value {
  font-size: var(--fs-xl);
  color: var(--text);
}
.bond-spread-note {
  margin: var(--sp-1) 0 0;
  font-size: var(--fs-md);
  line-height: 1.55;
  color: var(--text);
}

/* ---- "show as a table" ---- */
.bond-details {
  margin-top: var(--sp-3);
  font-size: var(--fs-md);
}
.bond-details > summary {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  cursor: pointer;
  color: var(--accent-text);
  font-weight: 600;
}
.bond-mini-wrap {
  max-width: 100%;
  margin-top: var(--sp-2);
  overflow-x: auto;
}
.bond-mini {
  border-collapse: collapse;
  width: 100%;
  font-size: var(--fs-md);
}
.bond-mini th,
.bond-mini td {
  padding: var(--sp-1) var(--sp-3);
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
  font-weight: 500;
  color: var(--text);
}
.bond-mini thead th {
  color: var(--muted);
  font-weight: 600;
}
.bond-mini td.num {
  text-align: right;
}

/* ---- the world table ---- */
.bond-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}
.bond-table {
  border-collapse: collapse;
  width: 100%;
  font-size: var(--fs-md);
}
.bond-table th,
.bond-table td {
  padding: var(--sp-1) var(--sp-3);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  color: var(--text);
  font-weight: 500;
}
.bond-table thead th {
  position: sticky;
  top: 0;
  background: var(--panel);
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.bond-table th.num {
  text-align: right;
}
.bond-sort {
  min-width: var(--tap-min);
  min-height: var(--tap-min);
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.bond-sort:hover {
  color: var(--text);
}
th[aria-sort='ascending'] .bond-sort::after {
  content: ' \25B2';
  font-size: var(--fs-xs);
}
th[aria-sort='descending'] .bond-sort::after {
  content: ' \25BC';
  font-size: var(--fs-xs);
}
.bond-row {
  cursor: pointer;
}
.bond-row:hover {
  background: var(--hover);
}
.bond-row.is-selected {
  background: var(--acc-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}
.bond-pick {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: var(--sp-2);
  width: 100%;
  min-height: var(--tap-min);
  padding: var(--sp-1) 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.bond-code {
  min-width: 2.4em;
  padding: 2px var(--sp-2);
  border-radius: 6px;
  background: var(--panel2);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  text-align: center;
}
.bond-name {
  min-width: 0;
  overflow-wrap: anywhere;
}
.bond-meta {
  display: none;
  grid-column: 2;
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--muted);
}
.bond-badge {
  display: inline-block;
  padding: 2px var(--sp-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--muted);
  font-size: var(--fs-sm);
  white-space: nowrap;
}
.bond-value {
  font-weight: 700;
}
@container (max-width: 600px) {
  .bond-table .hide-narrow {
    display: none;
  }
  .bond-meta {
    display: block;
  }
}
@media (pointer: coarse) {
  .bond-pick,
  .bond-sort {
    min-height: var(--tap-min);
  }
  .bond-details > summary {
    min-height: var(--tap-min);
  }
}
@media (max-width: 1023px) {
  .bond-view {
    padding: var(--sp-4);
  }
}
@media (prefers-reduced-motion: reduce) {
  .bond-card.is-loading #bond-hist-body {
    transition: none;
  }
}
/* #endregion */
/* #region zone:desk.style.auction-card — ตารางผลประมูลและเส้นเฉลี่ยที่ยืดตามหน้าจอ */
.auction-name {
  text-align: start;
}
.auction-details summary {
  cursor: pointer;
  min-height: var(--tap-min);
  display: list-item;
  line-height: var(--tap-min);
}
.auction-details p {
  max-width: 34ch;
  font-weight: 400;
  white-space: normal;
}
.auction-phone-meta {
  display: none;
  font-size: var(--fs-sm);
  color: var(--muted);
  font-weight: 400;
}
.auction-warning {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  margin-inline-start: var(--sp-1);
  font-size: var(--fs-sm);
  color: var(--text);
  white-space: nowrap;
}
.auction-warning svg {
  vertical-align: text-bottom;
  margin-inline-end: var(--sp-1);
}
@container (max-width: 600px) {
  .auction-table .auction-extra {
    display: none;
  }
  .auction-phone-meta {
    display: block;
    white-space: normal;
  }
  .auction-table td,
  .auction-table th {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}
@media (max-width: 1023px) {
  .auction-details summary {
    min-height: var(--tap-min);
    line-height: var(--tap-min);
  }
}
/* #endregion */
/* #region zone:desk.style.bonds-narrow-table — ตารางในการ์ดแคบ: ชื่อประเทศไม่ถูกบีบจนตัดเป็นตัวๆ */
@container (max-width: 600px) {
  .bond-table {
    table-layout: fixed;
  }
  .bond-table th:nth-child(2),
  .bond-table th:nth-child(3) {
    width: 27%;
  }
  .bond-table thead th {
    white-space: normal;
    vertical-align: bottom;
  }
  .bond-table th,
  .bond-table td {
    padding-inline: var(--sp-2);
  }
  .bond-name,
  .bond-meta {
    overflow-wrap: normal;
  }
}
/* #endregion */
/* #region zone:desk.style.bonds-scroll — หน้าเลื่อนไปกับเอกสาร เพื่อให้การ์ดประวัติค้าง (sticky) ใต้หัวเว็บที่ค้างอยู่ */
/* The page scrolls with the document (the Desk shell has only a min-height), so the view must not be its own scroller:
   an overflow:auto ancestor would become the sticky container and the history card would never stick. */
.bond-view {
  overflow: visible;
}
/* #endregion */

/* #region zone:desk.style.bonds-today — สรุปวันนี้และตารางประมูลกะทัดรัด */
.bond-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  gap: var(--sp-3);
}
.bond-tile {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: 0;
  padding: var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-inner);
  background: var(--panel);
}
.bond-tile h3 {
  margin: 0;
  font-size: var(--fs-md);
  color: var(--muted);
  font-weight: 600;
}
.bond-tile-value {
  font-size: var(--fs-4xl);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.bond-tile-change,
.bond-tile-sentence {
  margin: 0;
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--muted);
}
.bond-tile-change[data-direction='up'] {
  color: var(--up-text);
}
.bond-tile-change[data-direction='down'] {
  color: var(--down-text);
}
.bond-tile[data-kind='inverted'] {
  border-color: var(--amber);
}
.auction-toggle {
  margin-top: var(--sp-3);
}
.auction-table tr[hidden] {
  display: none;
}
.auction-coverage {
  white-space: nowrap;
}
.auction-history-title {
  margin-top: var(--sp-4);
}
.auction-observed {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--muted);
}
.auction-comparison th,
.auction-comparison td {
  white-space: normal;
  padding: var(--sp-2) var(--sp-1);
}
.bond-range {
  gap: var(--sp-2);
  height: auto;
}
.bond-range .seg-btn {
  min-width: var(--tap-min);
  min-height: var(--tap-min);
}
.bond-mini th,
.bond-mini td {
  white-space: normal;
  overflow-wrap: anywhere;
}
@container (max-width: 600px) {
  .auction-table th:nth-child(2) {
    width: 40%;
  }
  .auction-table th:nth-child(4) {
    width: 28%;
  }
  .auction-table th:nth-child(5) {
    width: 32%;
  }
  .auction-warning {
    margin-inline-start: 0;
  }
}
/* #endregion */

/* #region zone:desk.bonds.flags-style — ธงชาติขนาดเล็ก ขอบบางให้เห็นบนพื้นสว่างและมืด */
.bond-flag {
  inline-size: 20px;
  block-size: 15px;
  flex: none;
  border-radius: 2px;
  box-shadow: 0 0 0 1px var(--line);
  object-fit: cover;
  vertical-align: -2px;
}
.bond-code:has(.bond-flag) {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
}
.bond-tile-label .bond-flag {
  margin-inline-end: var(--sp-2);
}
/* #endregion */
