/**
 * Panel-left top zone — wayfinding strip (search slot + tab strip + breadcrumb slot).
 *
 * Phase 1a: only the tab strip is visible. Search and breadcrumb slots are
 * present in the DOM but hidden until Phase 1b.
 */

.pb-ptz {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--pb-panel-divider);
}

/* ── Search input (Phase 1b) ── */
.pb-ptz-search-slot {
  padding: var(--pb-space-4) var(--pb-space-5) var(--pb-space-2);
}

.pb-ptz-search {
  position: relative;
  display: flex;
  align-items: center;
  height: 32px;
  background: var(--pb-search-bg);
  border-radius: var(--pb-radius-md);
  transition: background var(--pb-transition), box-shadow var(--pb-transition);
}

.pb-ptz-search:focus-within {
  background: var(--pb-search-bg-focus);
  box-shadow: 0 0 0 1px var(--pb-accent), 0 0 0 4px var(--pb-accent-glow);
}

/* Phase 9 — first-launch onboarding pulse. Plays for ~4.5s on first mount, or
   until the user focuses the input (whichever comes first). */
.pb-ptz-search-pulse {
  animation: pb-ptz-search-pulse 1.4s ease-in-out 3;
}

@keyframes pb-ptz-search-pulse {
  0%   { box-shadow: 0 0 0 0   var(--pb-accent-glow); }
  50%  { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0   transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .pb-ptz-search-pulse { animation: none; }
}

.pb-ptz-search-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 100%;
  color: var(--pb-text-dim);
  flex-shrink: 0;
}

.pb-ptz-search-icon svg {
  width: 14px;
  height: 14px;
}

.pb-ptz-search-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  padding: 0 var(--pb-space-2) 0 0;
  border: none;
  background: transparent;
  color: var(--pb-text);
  font-family: inherit;
  font-size: var(--pb-font-md);
  outline: none;
  border-radius: 0;
}

.pb-ptz-search-input::placeholder {
  color: var(--pb-text-dim);
}

/* Hide the native clear button on Safari/Chromium type=search */
.pb-ptz-search-input::-webkit-search-cancel-button,
.pb-ptz-search-input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

.pb-ptz-search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-right: var(--pb-space-2);
  border: none;
  background: transparent;
  border-radius: var(--pb-radius);
  color: var(--pb-text-dim);
  cursor: pointer;
  transition: color var(--pb-transition), background var(--pb-transition);
  flex-shrink: 0;
}

.pb-ptz-search-clear:hover {
  color: var(--pb-text-bright);
  background: var(--pb-bg-hover);
}

.pb-ptz-search-clear[hidden] { display: none; }

.pb-ptz-search-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: var(--pb-space-3);
  padding: 0 var(--pb-space-3);
  height: 18px;
  border: 1px solid var(--pb-border);
  border-radius: var(--pb-radius-sm);
  font-size: var(--pb-font-xs);
  font-weight: 600;
  color: var(--pb-text-dim);
  background: transparent;
  flex-shrink: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1;
}

.pb-ptz-search-hint[hidden] { display: none; }

/* ── Breadcrumb (Phase 1b) ── */
.pb-ptz-breadcrumb-slot {
  padding: 0 var(--pb-space-5) var(--pb-space-3);
}

.pb-ptz-breadcrumb-slot[hidden] { display: none; }

.pb-ptz-breadcrumb {
  display: flex;
  align-items: center;
  min-height: 22px;
}

.pb-ptz-breadcrumb-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--pb-font-sm);
  color: var(--pb-text-dim);
  min-width: 0;
}

.pb-ptz-breadcrumb-item {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.pb-ptz-breadcrumb-label {
  display: inline-block;
  padding: 2px var(--pb-space-2);
  border-radius: var(--pb-radius-sm);
  background: var(--pb-scope-pill-bg);
  color: var(--pb-scope-pill-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 16ch;
  /* Reset for the <button> variant used by clickable back-segments. */
  border: none;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  cursor: default;
}

/* Clickable back-segment (a real <button>) — Phase 7 */
button.pb-ptz-breadcrumb-label {
  cursor: pointer;
  transition: background var(--pb-transition), color var(--pb-transition);
}

button.pb-ptz-breadcrumb-label:hover,
button.pb-ptz-breadcrumb-label:focus-visible {
  background: var(--pb-bg-hover);
  color: var(--pb-text-bright);
  outline: none;
}

.pb-ptz-breadcrumb-item[aria-current="location"] .pb-ptz-breadcrumb-label {
  color: var(--pb-text-bright);
  background: var(--pb-accent-muted);
  font-weight: 600;
}

.pb-ptz-breadcrumb-sep {
  display: inline-block;
  margin: 0 var(--pb-space-2);
  color: var(--pb-text-dim);
  user-select: none;
}

/* ── Tab strip ── */
.pb-ptz-tabs {
  display: flex;
  gap: var(--pb-space-1);
  padding: var(--pb-space-2) var(--pb-space-3) 0;
}

.pb-ptz-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--pb-space-3);
  padding: var(--pb-space-4) var(--pb-space-3);
  font-size: var(--pb-font-md);
  font-weight: 500;
  color: var(--pb-text-dim);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: var(--pb-radius-md) var(--pb-radius-md) 0 0;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--pb-transition),
              background var(--pb-transition),
              border-color var(--pb-transition);
}

.pb-ptz-tab:hover {
  color: var(--pb-text);
  background: var(--pb-bg-hover);
}

.pb-ptz-tab:focus-visible {
  outline: 2px solid var(--pb-accent);
  outline-offset: -2px;
  box-shadow: none;
}

.pb-ptz-tab[aria-selected="true"] {
  color: var(--pb-accent);
  background: var(--pb-accent-muted);
  border-bottom-color: var(--pb-accent);
  font-weight: 600;
}

.pb-ptz-tab[aria-selected="true"]:hover {
  background: var(--pb-accent-muted);
}

/* ── Tab icon ── */
.pb-ptz-tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.pb-ptz-tab-icon svg {
  width: 14px;
  height: 14px;
  display: block;
}

/* ── Tab label ── */
.pb-ptz-tab-label {
  min-width: 0;
}

/* ── Tab count badge ── */
.pb-ptz-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 16px;
  padding: 0 var(--pb-space-2);
  border-radius: var(--pb-radius-pill);
  font-size: var(--pb-font-xs);
  font-weight: 600;
  line-height: 1;
  color: var(--pb-text-dim);
  background: var(--pb-bg-hover);
  flex-shrink: 0;
}

.pb-ptz-tab[aria-selected="true"] .pb-ptz-tab-badge {
  color: var(--pb-on-accent);
  background: var(--pb-accent);
}

.pb-ptz-tab-badge[hidden] {
  display: none;
}

/* ── Responsive: drop label on very narrow rails to keep all 3 tabs visible ── */
@media (max-width: 900px) {
  .pb-ptz-tab {
    padding: var(--pb-space-4) var(--pb-space-2);
    font-size: var(--pb-font-sm);
    gap: var(--pb-space-2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pb-ptz-tab {
    transition: none;
  }
}

@media (forced-colors: active) {
  .pb-ptz-tab[aria-selected="true"] {
    background: Highlight;
    color: HighlightText;
  }
  .pb-ptz-tab-badge {
    border: 1px solid CanvasText;
  }
  .pb-ptz-tab[aria-selected="true"] .pb-ptz-tab-badge {
    background: HighlightText;
    color: Highlight;
  }
}
