/* topbar.css - brand bar, menu buttons, dropdown menus, bridge pill, theme picker */

/* ── TOP BAR ── */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  height: 72px;
  background: var(--brand);
  color: var(--ink);
  flex: none;
  position: relative;
  z-index: 40;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .12)
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0
}

.brand img {
  height: 62px;
  width: auto;
  display: block;
  object-fit: contain
}

.brand-fb {
  display: none;
  align-items: center;
  gap: 9px
}

.brand b {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .2px
}

.brand small {
  font-size: 12px;
  font-weight: 500;
  padding-left: 9px;
  border-left: 2px solid rgba(0, 0, 0, .25);
  opacity: .8
}

.menus {
  display: flex;
  gap: 6px;
  margin-left: 6px
}

.spacer {
  flex: 1
}

/* ── NAV BUTTONS ── */

.caret {
  display: inline-block;
  border: 4px solid transparent;
  border-top-color: currentColor;
  border-bottom: 0;
  margin-left: 2px
}

/* ── SKETCH NAME ── */
.name-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  min-width: 0
}

#sketchName {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  padding: 4px 4px;
  width: 170px;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  border-radius: 0
}

#sketchName:hover {
  border-bottom-color: rgba(0, 0, 0, .3)
}

#sketchName:focus {
  border-bottom-color: var(--ink)
}

.name-wrap span {
  color: var(--ink);
  opacity: .6;
  font-size: 13px
}

/* ── BRIDGE STATUS PILL ── */
.spill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 100px;
  background: rgba(0, 0, 0, .12);
  font-size: 11px;
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.sdot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
  flex-shrink: 0;
  opacity: .5
}

#bridgePill .sdot {
  background: var(--red);
  opacity: 1
}

#bridgePill.on .sdot {
  background: #22C55E;
  opacity: 1;
  box-shadow: 0 0 6px rgba(34, 197, 94, .7)
}

#bridgePill.wait .sdot {
  background: var(--amber);
  opacity: 1;
  animation: pu .6s ease-in-out infinite
}

/* ── DROPDOWN MENUS ── */
.dd {
  position: relative
}

.dd-panel {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  min-width: 230px;
  background: var(--panel);
  border: 1px solid var(--border2);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 8px 0;
  z-index: 9999;
  animation: fIn .15s ease
}

.dd.open .dd-panel {
  display: block
}

.dd-panel.right {
  left: auto;
  right: 0
}

.dd-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 20px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: background .12s;
  text-decoration: none
}

.dd-item:hover {
  background: rgba(109, 165, 26, .16);
  color: var(--brand-dk)
}

.dd-item small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  margin-top: 2px
}

.dd-item.here {
  background: rgba(109, 165, 26, .14)
}

.dd-item.soon {
  opacity: .5;
  cursor: default
}

.dd-item.soon:hover {
  background: none;
  color: var(--text)
}

.dd-item:has(> img) {
  display: grid;
  grid-template-columns: 36px 1fr;
  column-gap: 12px;
  align-items: center;
  padding: 7px 20px
}

.dd-item>img {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 36px;
  height: 36px;
  object-fit: contain
}

.dd-item:has(> img) small {
  grid-column: 2;
  margin-top: 0
}

.dd-sep {
  height: 1px;
  background: var(--border);
  margin: 6px 0
}

/* ── THEME PICKER ── */
.theme-panel {
  min-width: 300px;
  padding: 12px
}

.theme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px
}

.theme-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  font-size: 11px;
  color: var(--text);
  cursor: pointer;
  border: 1px solid var(--border2);
  background: var(--panel2);
  border-radius: 6px;
  text-align: left;
  font-family: inherit;
  transition: all .12s;
  line-height: 1.2;
}

.theme-item .sw {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid var(--border2);
  flex-shrink: 0
}

.theme-item:hover {
  border-color: var(--brand-dk);
  background: rgba(109, 165, 26, .14);
  color: var(--brand-dk)
}

.theme-item.cur {
  border-color: var(--brand-dk);
  background: rgba(109, 165, 26, .14);
  color: var(--brand-dk);
  font-weight: 700
}