/* ── The bar panel of Layout mode (js/topbar/topbar-layout-panel.js) ───────────────
   A side sheet over the dashboard, under the Settings modal (220) and above
   the rails (58) and the Layout dock. Its controls are the Settings page's
   own, styled by SettingsModal.css and TopbarLookSettings.css; this file only
   lays out the sheet. */
.tbp {
  position: fixed;
  top: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  width: min(400px, calc(100vw - 24px));
  border: 1px solid var(--floating-ui-border);
  border-radius: 16px;
  background: rgba(var(--panel-rgb), 0.96);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(14px);
  color: var(--text);
  overflow: hidden;
  animation: tbp-in 0.2s ease;
}
@keyframes tbp-in { from { opacity: 0; transform: translateX(12px); } }

.tbp-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 6px 18px; }
.tbp-title { flex: 1; min-width: 0; margin: 0; font-size: 16px; font-weight: 900; }
.tbp-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted-text);
  cursor: pointer;
}
.tbp-close:hover { background: rgba(255,255,255,0.07); color: var(--text); }
.tbp-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tbp-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.tbp-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 14px 14px;
  scrollbar-width: thin;
}
.tbp-sec { display: grid; gap: 10px; padding: 14px 0 6px; border-top: 1px solid rgba(255,255,255,0.075); }
.tbp-sec:first-child { border-top: 0; padding-top: 4px; }
.tbp-sec-head { display: grid; gap: 2px; }
.tbp-sec-title { margin: 0; font-size: 13px; font-weight: 900; }
.tbp-sec-head > .settings-hint { margin: 0; line-height: 1.35; }

.tbp-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
/* In a 400px sheet the label always sits over its control. */
.tbp-rows { display: grid; gap: 12px; }
.tbp-rows > .settings-row { display: grid; gap: 6px; }
.tbp-list .island-edit-row > .tbo-panel { flex-basis: 100%; margin-left: 0; }

.tbp-foot { padding: 10px 14px 14px; border-top: 1px solid rgba(255,255,255,0.075); }
.tbp-foot > .settings-btn { width: 100%; min-height: 40px; }

/* Phone: a sheet from the bottom, full width. */
@media (max-width: 560px) {
  .tbp { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 82vh; }
  .tbp-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tbp-close { width: 44px; height: 44px; }
  .tbp-foot > .settings-btn { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .tbp { animation: none; }
}

/* The panel is used on the touchscreen while looking at the bar: the list's
   small side switch and chevron get a finger-sized target here. */
.tbp .island-edit-side-btn { min-height: 32px; padding: 0 10px; }
.tbp .island-edit-caret,
.tbp .island-edit-eye { min-width: 36px; min-height: 36px; }
@media (max-width: 560px) {
  .tbp .island-edit-side-btn { min-height: 44px; }
  .tbp .island-edit-caret,
  .tbp .island-edit-eye { min-width: 44px; min-height: 44px; }
}
