/* Mini-panel. Desktop: right sidebar with tabs on top. Mobile: tab bar fixed at the bottom, sheet slides up. */
.panel { background: var(--surface); border-left: 1px solid var(--line); min-height: 0; display: flex; flex-direction: column; }
.panel-sheet { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.panel-backdrop { display: none; }
.panel-tabs { flex: none; display: flex; border-bottom: 1px solid var(--line); }
.ptab {
  flex: 1 1 auto; min-height: 46px; padding: 0 8px; white-space: nowrap; display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--muted); box-shadow: inset 0 -2px 0 transparent; text-align: center;
}
.ptab .icon { display: none; }
.ptab:hover { color: var(--ink); background: var(--surface-2); }
.ptab[aria-selected="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.panel-body { flex: 1; min-height: 0; overflow: auto; }
.panel-pane { padding: 14px 14px 20px; }
.panel-pane:focus-visible { outline-offset: -2px; }

.p-section { display: grid; gap: 8px; }
.p-h { font-size: 13px; font-weight: 700; color: var(--ink-2); margin-top: 8px; }
.p-section > .p-h:first-child { margin-top: 0; }
.p-list { display: grid; gap: 4px; }
.p-row {
  --ev: var(--accent); display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 8px; align-items: start;
  width: 100%; padding: 8px 8px 8px 9px; border-radius: 8px; border-left: 3px solid var(--ev); background: var(--surface-2);
  min-height: 52px;
}
.p-row:hover { background: var(--surface-3); }
.p-row--reminder { --ev: var(--sun); grid-template-columns: 24px minmax(0, 1fr); }
.p-row--reminder .p-when { color: var(--ink-2); }
.p-when { display: grid; gap: 1px; }
.p-time { font-weight: 700; font-size: 14.5px; }
.p-rel { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.p-main { display: grid; gap: 1px; min-width: 0; }
.p-title { display: flex; align-items: center; gap: 6px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-badge { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--ev); color: var(--surface); flex: none; }
.p-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-row.ev--cancelled .p-title { text-decoration: line-through; }

.p-chat { display: grid; align-content: space-between; gap: 18px; min-height: 100%; }
.p-chat-form { display: grid; gap: 8px; }

@media (max-width: 720px) {
  .panel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; border: 0; background: transparent; pointer-events: none; }
  .panel > * { pointer-events: auto; }
  .panel-sheet { flex-direction: column-reverse; flex: none; }
  .panel-tabs {
    border-bottom: 0; border-top: 1px solid var(--line); background: var(--surface);
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  }
  .ptab { flex-direction: column; gap: 2px; font-size: 11.5px; box-shadow: inset 0 2px 0 transparent; min-height: var(--tabbar-h); }
  .ptab .icon { display: block; }
  .ptab[aria-selected="true"] { box-shadow: inset 0 2px 0 var(--accent); }
  .ptab[aria-selected="true"] .icon { color: var(--accent); }
  .panel-body { display: none; background: var(--surface); border-radius: var(--r-l) var(--r-l) 0 0; box-shadow: 0 -10px 30px -12px rgba(6, 16, 26, 0.4); }
  .panel.is-open .panel-body { display: block; flex: none; max-height: 62dvh; animation: sheet-up 0.2s ease-out; }
  .panel.is-open .panel-backdrop { display: block; position: fixed; inset: 0; background: var(--scrim); pointer-events: auto; }
  .panel.is-open .panel-sheet { position: relative; }
  .p-row { min-height: 56px; }
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } }
