/* Top bar: brand, national yields, buttons, search and its results, share popover, toast. */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h); z-index: 10;
  display: flex; align-items: center; gap: 16px; padding: 0 12px;
  background: linear-gradient(180deg, #24364a, #131e2a);
  border-bottom: 1px solid var(--gold);
  box-shadow: 0 2px 10px rgba(0,0,0,.5), inset 0 -3px 0 rgba(0,0,0,.25);
  font-variant-numeric: tabular-nums;
}
.brand {
  font-family: var(--serif); font-weight: bold; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold-bright); white-space: nowrap; display: flex; align-items: center; flex: none;
}
.brand-emblem {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: #a5262c; border: 1px solid var(--gold); color: #f8f0d8; font-size: 13px;
  margin-right: 6px; box-shadow: 0 0 0 2px rgba(0,0,0,.4);
}
.yields { display: flex; gap: 14px; flex: none; }
.yield {
  position: relative; display: flex; align-items: center; gap: 5px; font-weight: 600;
  font-size: 14px; white-space: nowrap; cursor: pointer; border-radius: 4px;
  background: none; border: 1px solid transparent; padding: 2px 4px; margin: 0 -5px;
  line-height: 20px; font-variant-numeric: tabular-nums;
}
.yield .ico { display: inline-flex; filter: drop-shadow(0 1px 1px rgba(0,0,0,.6)); }
/* The caret sits over the button's bottom padding (out of the flex flow), so the bar is exactly as
   wide as before. */
.yield .caret {
  position: absolute; left: 50%; bottom: 0; margin-left: -3.5px; width: 0; height: 0;
  border-left: 3.5px solid transparent; border-right: 3.5px solid transparent;
  border-top: 3px solid var(--gold); opacity: .45; transition: transform .15s, opacity .15s;
  pointer-events: none;
}
.yield:hover { background: rgba(201,164,92,.12); border-color: rgba(201,164,92,.35); }
.yield:hover .caret { opacity: 1; }
.yield.open {
  background: linear-gradient(180deg, rgba(90,74,36,.85), rgba(58,47,21,.85));
  border-color: var(--gold-bright);
}
.yield.open .caret { opacity: 1; transform: rotate(180deg); border-top-color: var(--gold-bright); }
.spacer { flex: 1; min-width: 0; }
.turn {
  font-family: var(--serif); color: var(--ink-dim); font-size: 13px; white-space: nowrap;
  flex: none;
}
.turn b { color: var(--gold-bright); }
.tb-buttons { display: flex; gap: 6px; flex: none; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; flex: none;
  background: linear-gradient(180deg, #3a5068, #223244); border: 1px solid var(--gold);
  border-radius: 4px;
  padding: 4px 10px; cursor: pointer; font-family: var(--serif); font-size: 13px;
  color: var(--gold-bright); line-height: 18px;
  box-shadow: inset 0 1px 0 rgba(255,235,190,.15), 0 1px 2px rgba(0,0,0,.5);
}
.btn:hover { background: linear-gradient(180deg, #4a6584, #2b4057); }
.btn[aria-expanded="true"] { background: linear-gradient(180deg, #5a4a24, #3a2f15); }
.btn-icon { padding: 4px 7px; }

/* search */
.search {
  position: relative; display: flex; align-items: center; flex: 0 1 290px; min-width: 150px;
}
.search-ic {
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%); color: var(--ink-dim);
  display: inline-flex; pointer-events: none;
}
#search-input {
  width: 100%; height: 28px; padding: 0 34px 0 28px; border-radius: 14px; text-overflow: ellipsis;
  font: 13px var(--sans); color: var(--ink);
  background: rgba(0,0,0,.35); border: 1px solid rgba(201,164,92,.5); outline: none;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.5);
}
#search-input::placeholder { color: rgba(185,171,136,.75); }
#search-input:focus { border-color: var(--gold-bright); background: rgba(0,0,0,.5); }
#search-input::-webkit-search-cancel-button { display: none; }
.search-kbd {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%); pointer-events: none;
}
#search-input:focus ~ .search-kbd { display: none; }
kbd {
  display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 3px;
  font: 11px/16px var(--sans); text-align: center;
  color: var(--gold-bright); background: rgba(255,235,190,.08);
  border: 1px solid rgba(201,164,92,.5); border-bottom-width: 2px;
}
.search-results {
  position: fixed; z-index: 40; max-height: min(420px, 70vh); overflow-y: auto; padding: 4px;
}
.sr-item {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 4px;
  cursor: pointer; font-size: 13px;
}
.sr-item.sel { background: linear-gradient(90deg, rgba(201,164,92,.28), rgba(201,164,92,.08)); }
.sr-ic { color: var(--gold); display: inline-flex; }
.sr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sr-main b {
  font-family: var(--serif); color: var(--gold-bright); font-weight: normal; font-size: 14px;
}
.sr-sub {
  color: var(--ink-dim); font-size: 11px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
.sr-pop { color: var(--ink-dim); font-variant-numeric: tabular-nums; font-size: 12px; }
.sr-empty { padding: 10px; color: var(--ink-dim); font-size: 13px; }

/* share popover + toast */
.share-pop { position: fixed; z-index: 40; width: 250px; padding: 8px; }
.sp-title {
  font-family: var(--serif); color: var(--gold); font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; padding: 2px 6px 6px;
}
.sp-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px;
  border-radius: 4px; cursor: pointer; background: none; border: 1px solid transparent;
  color: var(--ink); font-size: 13px;
}
.sp-item svg { color: var(--gold-bright); }
.sp-item:hover, .sp-item:focus-visible {
  background: rgba(201,164,92,.15); border-color: rgba(201,164,92,.35);
}
.sp-item .muted { font-size: 11px; margin-left: 4px; }
.sp-status { font-size: 12px; color: var(--ink-dim); padding: 4px 8px 0; min-height: 0; }
.sp-status:empty { display: none; }
.sp-url {
  width: 100%; margin-top: 6px; font: 12px var(--sans); padding: 5px; color: var(--ink);
  background: rgba(0,0,0,.4); border: 1px solid var(--line); border-radius: 3px;
}
.toast {
  position: fixed; top: 54px; left: 50%; transform: translateX(-50%); z-index: 45;
  padding: 7px 14px; border-radius: 16px;
  background: rgba(16,25,35,.96); border: 1px solid var(--gold); color: var(--gold-bright);
  font: 13px var(--serif); letter-spacing: .04em;
  box-shadow: 0 6px 18px rgba(0,0,0,.5);
}
