.yorunge-workspace {
  container: yorunge-layout / inline-size;
  display: grid; gap: var(--space-3); min-width: 0;
  --yorunge-night: color-mix(in srgb, var(--rail) 83%, var(--brand-deep));
  --yorunge-line: color-mix(in srgb, var(--on-dark-muted) 23%, var(--rail));
  --yorunge-guide: color-mix(in srgb, var(--on-dark-muted) 64%, var(--brand-deep));
  --yorunge-state: var(--on-dark-muted);
}
.yorunge-instrument {
  min-width: 0; overflow: hidden; border: 1px solid var(--rail); border-radius: var(--radius);
  background: var(--yorunge-night); color: var(--on-dark);
}
.yorunge-header {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding: 13px clamp(15px, 2.4cqw, 31px); border-bottom: 1px solid var(--yorunge-line);
}
.yorunge-header h3 { margin: 0; color: var(--on-dark); font: 640 clamp(20px,2.25cqw,30px)/1.18 var(--font-sans); letter-spacing: -.044em; }
.yorunge-header p { margin: 4px 0 0; color: var(--on-dark-muted); font: 440 12.5px/1.4 var(--font-sans); }
.yorunge-key-title { color: var(--on-dark-muted); font: 480 11px/1.3 var(--font-mono); text-align: right; }
.yorunge-map {
  --yorunge-plot-size: clamp(305px, 38cqw, 410px);
  position: relative; display: grid; place-items: center; min-width: 0;
  margin: 0 clamp(10px, 2cqw, 24px);
}
.yorunge-geometry { position: relative; width: var(--yorunge-plot-size); max-width: 100%; aspect-ratio: 1; }
.yorunge-traces, .yorunge-plot { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.yorunge-plot { display: block; }
.yorunge-ring { fill: var(--brand-deep); stroke: var(--yorunge-guide); stroke-width: 1.15; }
.yorunge-ring[data-radius="42"] { fill: color-mix(in srgb, var(--brand-deep) 55%, var(--rail)); }
.yorunge-ring[data-radius="32"] { fill: color-mix(in srgb, var(--brand-deep) 92%, var(--on-dark-muted)); }
.yorunge-ring[data-radius="22"] { fill: color-mix(in srgb, var(--brand-deep) 85%, var(--on-dark-muted)); }
.yorunge-ring[data-radius="12"] { fill: color-mix(in srgb, var(--brand-deep) 78%, var(--on-dark-muted)); }
.yorunge-ring[data-active="true"] { stroke: var(--gold-hi); stroke-width: 1.65; }
.yorunge-datum { stroke: var(--on-dark-muted); stroke-width: 1.3; }
.yorunge-leader { stroke: var(--yorunge-guide); stroke-width: 1; stroke-linejoin: round; }
.yorunge-leader[data-selected="true"] { stroke: var(--gold-hi); stroke-width: 1.55; }
.yorunge-dot {
  position: absolute; z-index: 2; transform: translate(-50%, -50%); display: grid; place-items: center;
  width: clamp(24px, 9%, 33px); height: auto; aspect-ratio: 1; min-height: 0; padding: 0;
  border: 2px solid var(--rail); border-radius: 50%; background: var(--on-dark); color: var(--rail);
  font: 620 clamp(11px, 1.3cqw, 14px)/1 var(--font-mono); cursor: pointer;
}
.yorunge-dot:hover { background: var(--gold-hi); }
.yorunge-dot[aria-pressed="true"] { z-index: 3; background: var(--gold-hi); outline: 1.5px solid var(--gold-hi); outline-offset: 1px; }
.yorunge-dot:focus-visible, .yorunge-missing-account:focus-visible { outline: 2px solid var(--on-dark); outline-offset: 3px; }
.yorunge-callouts { position: absolute; inset: 0; pointer-events: none; }
.yorunge-bay {
  --yorunge-bay-y: 50%;
  position: absolute; top: var(--yorunge-bay-y); transform: translateY(-50%); pointer-events: auto; cursor: pointer;
  width: min(324px, calc((100% - var(--yorunge-plot-size)) / 2)); min-width: 0;
  display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: start; gap: 8px;
  padding: 7px 12px; border-inline-start: 2px solid transparent; color: var(--on-dark);
}
.yorunge-bay[data-side="left"] { right: calc(50% + var(--yorunge-plot-size) / 2); }
.yorunge-bay[data-side="right"] { left: calc(50% + var(--yorunge-plot-size) / 2); }
.yorunge-bay::after {
  content: ""; position: absolute; top: 50%; width: 9px; height: 1px; background: var(--yorunge-guide);
}
.yorunge-bay[data-side="left"]::after { right: 0; }
.yorunge-bay[data-side="right"]::after { left: -2px; }
.yorunge-bay[data-selected="true"] { border-inline-start-color: var(--gold-hi); background: rgba(var(--gold-rgb), .085); }
.yorunge-bay[data-selected="true"]::after { background: var(--gold-hi); }
.yorunge-bay:hover .yorunge-name { text-decoration: underline; text-underline-offset: 3px; }
.yorunge-code {
  width: 22px; height: 22px; display: grid; place-items: center;
  border: 1px solid var(--yorunge-guide); border-radius: 50%;
  color: var(--on-dark); font: 560 10.5px var(--font-mono);
}
.yorunge-bay[data-selected="true"] .yorunge-code { border-color: var(--gold-hi); color: var(--gold-hi); }
.yorunge-bay-copy { display: grid; gap: 2px; min-width: 0; }
.yorunge-name {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere;
  color: var(--on-dark); font: 640 clamp(13.5px,1.65cqw,19px)/1.2 var(--font-sans); letter-spacing: -.035em;
}
.yorunge-bank { display: block; color: var(--on-dark-muted); font: 450 11.5px/1.3 var(--font-sans); overflow-wrap: anywhere; }
.yorunge-condition { display: flex; align-items: baseline; gap: 5px; min-width: 0; color: var(--yorunge-state); font: 530 11.5px/1.35 var(--font-sans); overflow-wrap: anywhere; }
.yorunge-condition i { align-self: center; flex: none; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.yorunge-instrument [data-state="connected"] { --yorunge-state: color-mix(in srgb, var(--good) 40%, var(--on-dark)); }
.yorunge-instrument [data-state="reconnect_required"] { --yorunge-state: color-mix(in srgb, var(--bad) 40%, var(--on-dark)); }
.yorunge-instrument :is([data-state="withdrawing"],[data-state="result_check"]) { --yorunge-state: var(--gold-hi); }
.yorunge-instrument :is([data-state="logging_in"],[data-state="resuming"]) { --yorunge-state: color-mix(in srgb, var(--info) 46%, var(--on-dark)); }
.yorunge-instrument [data-stale="true"] { --yorunge-state: var(--on-dark-muted); }
.yorunge-instrument :is([data-stale="true"],[data-state="paused"],[data-state="pending"]) .yorunge-condition i { border: 1px solid currentColor; background: transparent; }
.yorunge-stamp { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 7px; font: 450 11px/1.35 var(--font-mono); }
.yorunge-stamp time { color: var(--on-dark); }
.yorunge-stamp > span { color: var(--on-dark-muted); }
.yorunge-legend {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 20px;
  padding: 9px 12px; border-top: 1px solid var(--yorunge-line); background: var(--rail);
}
.yorunge-legend-label { color: var(--on-dark-muted); font: 500 11.5px var(--font-sans); }
.yorunge-band { display: inline-flex; align-items: center; gap: 4px; color: var(--on-dark-muted); font: 460 11px var(--font-mono); white-space: nowrap; }
.yorunge-band svg { width: 21px; height: 21px; }
.yorunge-key-edge { stroke: var(--yorunge-guide); stroke-width: .85; }
.yorunge-key-ring { stroke: currentColor; stroke-width: 1.5; }
.yorunge-band[data-active="true"] { color: var(--gold-hi); }
.yorunge-missing { display: grid; gap: 6px; margin: 0; padding: 9px clamp(12px, 2cqw, 24px) 12px; border-top: 1px solid var(--yorunge-line); }
.yorunge-missing h4 { margin: 0; color: var(--on-dark-muted); font: 570 12px/1.35 var(--font-sans); }
.yorunge-missing-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(197px, 100%), 1fr)); gap: 5px; }
.yorunge-missing-account {
  min-width: 0; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px;
  min-height: 37px; padding: 5px 8px; border: 1px solid var(--yorunge-line); border-radius: var(--radius-sm);
  background: transparent; color: var(--on-dark); text-align: left; cursor: pointer;
}
.yorunge-missing-account:hover { border-color: var(--yorunge-guide); }
.yorunge-missing-account[aria-pressed="true"] { border-color: var(--gold-hi); background: rgba(var(--gold-rgb), .09); }
.yorunge-missing-account strong { display: block; color: var(--on-dark); font: 600 13px/1.3 var(--font-sans); overflow-wrap: anywhere; }

@container yorunge-layout (max-width: 765px) {
  .yorunge-header { padding: 10px 12px; gap: 8px; align-items: start; }
  .yorunge-header h3 { font-size: 20px; }
  .yorunge-header p { font-size: 11.5px; }
  .yorunge-key-title { font-size: 9.5px; }
  .yorunge-map { --yorunge-plot-size: min(100%, 290px); display: flex; flex-direction: column; align-items: center; margin: 0 9px 8px; }
  .yorunge-leader { display: none; }
  .yorunge-callouts { position: static; display: grid; width: 100%; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 3px 6px; }
  .yorunge-bay, .yorunge-bay[data-side] {
    position: relative; inset: auto; transform: none; width: 100%; min-height: 40px;
    grid-template-columns: 18px minmax(0,1fr); gap: 5px; padding: 5px 4px;
  }
  .yorunge-bay::after { display: none; }
  .yorunge-code { width: 17px; height: 17px; font-size: 9px; }
  .yorunge-name { font-size: 12px; }
  .yorunge-bank, .yorunge-condition { font-size: 10.5px; }
  .yorunge-stamp { font-size: 10px; }
  .yorunge-legend { gap: 4px 9px; padding: 6px 9px; }
  .yorunge-band svg { width: 17px; height: 17px; }
}
@container yorunge-layout (max-width: 410px) {
  .yorunge-map { --yorunge-plot-size: min(100%, 248px); }
  .yorunge-key-title { max-width: 66px; }
  .yorunge-bay-copy { gap: 1px; }
  .yorunge-band { gap: 2px; font-size: 10px; }
  .yorunge-legend-label { flex-basis: 100%; text-align: center; font-size: 10px; }
}
