html, body { height: 100%; overflow: hidden; }
.console { height: 100vh; height: 100dvh; min-height: 0; grid-template-columns: 220px minmax(0, 1fr); overflow: hidden; }
.console.sidebar-folded { grid-template-columns: 0 minmax(0, 1fr); }
.sidebar { position: relative; height: 100%; min-height: 0; width: 220px; padding: 20px 14px 16px; overflow: hidden; }
.sidebar-folded .sidebar { visibility: hidden; }
.sidebar .brand { margin-bottom: 22px; }
.sidebar-heading, .sidebar .brand, .add-target-panel, .sidebar-divider, .archive-nav, .navigation-help, .sidebar-footer { flex-shrink: 0; }
.target-list { flex: 1; min-height: 0; max-height: none; display: block; overflow: auto; scrollbar-width: thin; }
.target-entry { position: relative; }
.target-actions { flex-shrink: 0; position: relative; align-self: center; }
.target-more { display: grid; place-items: center; list-style: none; width: 30px; height: 36px; border-radius: 5px; font-size: 18px; color: var(--soft); cursor: pointer; }
.target-more::-webkit-details-marker { display: none; }
.target-more:hover, .target-actions[open] .target-more { color: var(--ink); background: var(--surface-raised); }
.target-menu { position: absolute; right: 0; top: 32px; width: 120px; padding: 5px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-raised); box-shadow: 0 5px 20px #0005; z-index: 3; }
.target-actions.opens-up .target-menu { top: auto; bottom: 32px; }
.target-menu .target-toggle, .target-menu .target-remove { display: block; width: 100%; border: 0; background: transparent; text-align: left; min-height: 36px; padding: 7px 10px; color: var(--muted); font-size: 11px; cursor: pointer; }
.target-menu .target-remove { color: var(--red); }
.target-menu button:hover { background: var(--surface); border-radius: 4px; }
#unfollow-dialog strong { color: var(--ink); }
.sidebar-divider { margin: 15px 8px 10px; }
.sidebar-footer { margin-top: 10px; padding-top: 8px; }
.workspace { height: 100%; min-height: 0; max-width: none; padding: 0 22px 14px; display: flex; flex-direction: column; overflow: hidden; }
.topbar { flex-shrink: 0; min-height: 56px; margin-bottom: 12px; gap: 12px; justify-content: space-between; }
.navigation-controls { display: flex; align-items: center; min-width: 0; gap: 10px; }
.navigation-toggle { display: grid; place-items: center; padding: 0; width: 36px; height: 36px; flex-shrink: 0; border: 1px solid var(--border); border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; }
.navigation-toggle:hover { background: var(--surface-raised); color: var(--ink); }
.navigation-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.navigation-toggle svg { width: 18px; height: 18px; }
.breadcrumb { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.header-actions { width: auto; flex-shrink: 0; }
.connection-banner { flex-shrink: 0; margin-bottom: 8px; max-height: 60px; overflow: auto; }
#anchor-view { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.anchor-header { flex-shrink: 0; gap: 12px; flex-wrap: nowrap; }
.anchor-avatar { width: 44px; height: 44px; }
.anchor-name-row h1 { font-size: 21px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anchor-name-row { flex-wrap: nowrap; }
.anchor-title { font-size: 11px; max-width: 100%; }
.anchor-links { font-size: 10px; gap: 12px; }
.session-controls { flex-direction: row; flex-shrink: 0; align-items: center; margin-top: 0; width: auto; }
.session-controls select { width: 205px; max-width: 205px; }
.record-context { flex-shrink: 0; margin: 8px 0; font-size: 10px; line-height: 1.6; }
.session-stats { flex-shrink: 0; padding: 9px 15px; margin-bottom: 12px; gap: 15px; }
.session-stats strong { font-size: 20px; }
.session-stats>div>span { font-size: 10px; margin-bottom: 2px; }
.content-grid, .content-grid.expanded { flex: 1; min-height: 0; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; align-items: stretch; overflow: hidden; }
.content-grid.expanded { grid-template-columns: minmax(0, 1fr) minmax(340px, .9fr); }
.activity-section { display: flex; flex-direction: column; min-height: 0; }
.activity-toolbar, .event-tools, .stream-info, .activity-footer { flex-shrink: 0; }
.activity-toolbar { padding: 0 16px; }
.tabs button { padding: 11px 0 9px; }
.event-tools { padding: 9px 16px 5px; gap: 7px; }
.stream-info { padding: 4px 16px 7px; }
.stream-viewport { flex: 1; min-height: 0; overflow: hidden; }
.activity-pane { height: 100%; max-height: none; min-height: 0; overflow: auto; }
.activity-footer { padding: 7px 16px; }
.insights, .content-grid.expanded .insights { grid-row: auto; display: flex; flex-direction: column; gap: 0; min-height: 0; overflow: auto; scrollbar-width: thin; }
.chart-panel { flex-shrink: 0; padding: 13px 14px 10px; }
.chart-container, .content-grid.expanded .chart-container { height: 170px; }
.session-information { padding: 15px 5px 0; }
.session-information dl { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.session-information p { margin-top: 8px; padding-top: 8px; }
.console[data-record-tab="pk"] .content-grid { grid-template-columns: minmax(0, 1fr); }
.console[data-record-tab="pk"] .insights { display: none; }
.pk-surface { overflow: hidden; }
.archive-view { flex: 1; min-height: 0; overflow: auto; }
.archive-heading { margin-bottom: 18px; }
.drawer-close, .insights-toggle, .navigation-backdrop { display: none; }

@media (max-width: 1100px) {
  .console, .console.sidebar-folded { display: block; }
  .workspace { padding: 0 18px 12px; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(290px, calc(100vw - 54px)); z-index: 52; display: flex; flex-direction: column; visibility: hidden; box-shadow: 12px 0 40px #0005; }
  .navigation-open .sidebar { visibility: visible; }
  .sidebar .brand { padding-right: 32px; }
  .drawer-close { display: grid; position: absolute; top: 16px; right: 14px; width: 36px; height: 36px; }
  .insights-toggle { display: inline-flex; }
  .navigation-backdrop { display: block; position: fixed; inset: 0; z-index: 50; background: #060a1280; border: 0; cursor: pointer; }
  .content-grid, .content-grid.expanded { grid-template-columns: minmax(0, 1fr); }
  .insights, .content-grid.expanded .insights { display: none; }
  .insights-open .insights, .insights-open .content-grid.expanded .insights { display: flex; position: fixed; inset: 0 0 0 auto; z-index: 52; width: min(360px, calc(100vw - 44px)); padding: 70px 18px 20px; background: var(--surface-muted); box-shadow: -12px 0 40px #0005; }
  .session-information { padding-top: 18px; display: block; }
  .content-grid.expanded .session-information { display: block; }
  .console[data-record-tab="pk"] .insights-toggle { display: none; }
  .chart-panel { margin: 0; }
  .navigation-help { display: block; }
  .sidebar-heading { padding: 0 8px; }
  .target-more, .target-menu .target-toggle, .target-menu .target-remove { min-height: 44px; }
}
@media (max-width: 700px) {
  .workspace { padding: 0 10px 8px; }
  .topbar { min-height: 56px; margin-bottom: 9px; gap: 7px; }
  .navigation-controls { gap: 7px; }
  .navigation-toggle { width: 44px; height: 44px; }
  .breadcrumb { display: none; }
  .header-actions { gap: 5px; flex: 1; min-width: 0; justify-content: flex-end; }
  .header-actions .status-pill { display: none; }
  .header-actions .button { min-height: 44px; padding: 6px 7px; font-size: 10px; }
  .header-actions .account-button { min-height: 44px; }
  .header-actions .quiet { padding-left: 7px; padding-right: 7px; }
  .anchor-header { flex-wrap: wrap; gap: 8px; }
  .anchor-avatar { width: 38px; height: 38px; }
  .anchor-name-row { gap: 7px; }
  .anchor-name-row h1 { font-size: 19px; }
  .anchor-title { font-size: 10px; }
  .anchor-links { gap: 9px; font-size: 9px; margin-top: 1px; }
  .session-controls { width: 100%; gap: 8px; margin-top: 1px; }
  .session-controls select { width: auto; max-width: none; flex: 1; min-width: 0; height: 36px; }
  .session-controls .button { min-height: 36px; padding: 6px 9px; }
  .record-context { margin: 6px 0; font-size: 9px; gap: 5px; }
  .session-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 8px 10px; gap: 7px; margin-bottom: 9px; }
  .session-stats>div:nth-child(even) { border-right: 1px solid var(--border); }
  .session-stats>div:last-child { border: 0; }
  .session-stats>div>span { min-height: 0; font-size: 9px; line-height: 1.4; }
  .session-stats strong { font-size: 17px; white-space: normal; overflow-wrap: anywhere; }
  .session-stats strong>span { white-space: normal; }
  .session-stats small { font-size: 8px; display: inline; margin-left: 2px; }
  .activity-toolbar { padding: 0 11px; }
  .tabs { gap: 18px; overflow: auto; }
  .tabs button { min-height: 44px; font-size: 11px; padding: 10px 0 8px; }
  .event-tools { padding: 7px 11px 4px; }
  .event-filters { min-width: 0; }
  .event-filters button { min-height: 34px; }
  .search-field { width: 100%; }
  .search-field input { min-height: 32px; }
  .stream-info { padding: 3px 11px 6px; }
  .activity-footer { padding: 6px 11px; font-size: 9px; }
  .activity-footer span:first-child { max-width: none; min-width: 0; }
  .activity-footer #last-refresh { display: none; }
  .sidebar-footer { display: block; }
}
@media (max-height: 650px) and (min-width: 701px) {
  .topbar { min-height: 48px; margin-bottom: 8px; }
  .anchor-links, .anchor-title { display: none; }
  .session-stats { padding: 6px 12px; margin-bottom: 8px; }
  .session-stats strong { font-size: 18px; }
}
@media (max-height: 600px) and (max-width: 700px) {
  .topbar { min-height: 48px; margin-bottom: 5px; }
  .anchor-header { flex-wrap: nowrap; gap: 8px; }
  .anchor-avatar, .anchor-title, .anchor-links, .record-context { display: none; }
  .anchor-name-row h1 { font-size: 16px; }
  .anchor-state { font-size: 9px; }
  .session-controls { width: auto; max-width: 48%; flex-shrink: 0; }
  .session-controls select { width: 105px; height: 32px; }
  .session-controls .button { min-height: 32px; font-size: 10px; }
  .session-stats { margin: 6px 0; padding: 5px 8px; }
  .session-stats strong { font-size: 15px; }
  .session-stats small { display: none; }
  .event-tools { flex-wrap: nowrap; padding-top: 4px; padding-bottom: 4px; }
  .event-filters { width: auto; flex: 1; }
  .search-field { width: 110px; min-width: 110px; }
  .stream-info { display: none; }
  .activity-footer { padding: 4px 10px; }
}
@media (max-height: 500px) {
  .topbar { min-height: 44px; margin-bottom: 4px; }
  .anchor-avatar, .anchor-title, .anchor-links, .record-context { display: none; }
  .anchor-header { min-height: 32px; }
  .anchor-name-row h1 { font-size: 16px; }
  .session-controls select { height: 30px; }
  .session-controls .button { min-height: 30px; }
  .session-stats { padding: 4px 10px; margin: 5px 0 6px; }
  .session-stats strong { font-size: 16px; }
  .session-stats>div>span { font-size: 9px; }
  .event-tools { padding-top: 4px; padding-bottom: 4px; }
  .stream-info { display: none; }
  .activity-footer { padding: 4px 12px; }
}
