/* Top bar ----------------------------------------------------------------- */
.topbar { display: flex; align-items: center; gap: 10px; padding: 0 14px; background: var(--surface);
  border-bottom: 1px solid var(--line); z-index: 1001; }
.brand { display: flex; align-items: center; gap: 10px; width: 240px; flex: none; }
/* The grape cluster from the company's mammoth drawing. It is black ink, so it sits on a paper tile in both themes. */
.logo { width: 40px; height: 40px; padding: 4px; flex: none; object-fit: contain; background: var(--paper); border-radius: var(--radius); border: 1px solid var(--line); }
.brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand .name { font-family: var(--font-head); font-weight: 600; font-size: 17px; letter-spacing: -.01em; }
.brand .tag { color: var(--muted); font-size: 11px; }
.crumb { display: flex; align-items: baseline; gap: 8px; min-width: 0; padding-left: 14px; border-left: 1px solid var(--line); }
.crumb b { font-size: 14px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.spacer { flex: 1; }
.busy { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 12px; padding: 0 10px; height: 28px;
  border-radius: 14px; background: var(--surface-2); max-width: 340px; }
.busy span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent);
  animation: spin .8s linear infinite; flex: none; }
.spin.sm { width: 12px; height: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } }

.menu { position: relative; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); width: 290px; padding: 6px; background: var(--raised);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); z-index: 1100; }
.menu-list button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; height: auto;
  padding: 8px 10px; border: none; background: none; text-align: left; }
.menu-list button:hover { background: var(--surface-2); }
.menu-list button b { font-weight: 600; }
.menu-list button span { color: var(--muted); font-size: 11.5px; font-weight: 400; }
.menu-list hr { border: none; border-top: 1px solid var(--line); margin: 5px 4px; }

/* Panels ------------------------------------------------------------------ */
.panel { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.btns { display: flex; gap: 6px; }
details.panel > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::after { content: ""; width: 7px; height: 7px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted);
  transform: rotate(45deg); margin: -4px 4px 0 0; transition: transform .15s; }
details.panel[open] > summary::after { transform: rotate(225deg); margin-top: 2px; }
details.panel[open] > summary { margin-bottom: 2px; }

.empty { color: var(--muted); font-size: 12px; margin: 4px 0 0; padding: 12px; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); }
