/**
 * Dashboard V2 - App Shell Styles (M7.6R)
 * 
 * Unified shell with:
 * - Header with nav tabs
 * - Global timer display (navbar only)
 * - Retractable/pinnable inspector drawer
 * 
 * Import after tokens.css, base.css, components.css
 */

/* ═══════════════════════════════════════════
   CSS VARIABLES
   ═══════════════════════════════════════════ */

:root {
  --shell-header-height: 56px;
  --shell-inspector-width: 360px;
  --shell-timer-height: 40px;
}

/* ═══════════════════════════════════════════
   BODY LAYOUT
   ═══════════════════════════════════════════ */

/* Pre-shell: reserve header space immediately to prevent flash */
body {
  padding-top: var(--shell-header-height);
}

body.no-shell {
  padding-top: 0;
}

/* Placeholder bar shown before JS renders the real shell */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--shell-header-height);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  z-index: 999;
}

/* Once shell.js renders the real header, hide the placeholder */
body.has-shell::before {
  display: none;
}

body.has-shell {
  padding-top: var(--shell-header-height);
}

body.has-shell.inspector-open {
  padding-right: var(--shell-inspector-width);
}

/* ═══════════════════════════════════════════
   SHELL HEADER
   ═══════════════════════════════════════════ */

.shell-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--shell-header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--space-4);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  z-index: var(--z-header);
}

.shell-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.shell-header-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.shell-header-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* ═══════════════════════════════════════════
   LOGO
   ═══════════════════════════════════════════ */

.shell-logo {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  display: flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--text-primary);
  text-decoration: none;
}

.shell-logo span {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.shell-logo:hover {
  color: var(--accent);
}

/* ═══════════════════════════════════════════
   NAVIGATION TABS
   ═══════════════════════════════════════════ */

.shell-nav {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--border);
}

.shell-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 8px 16px;
  min-height: 44px;
  min-width: 44px;
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  text-decoration: none;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  cursor: pointer;
}

.shell-nav-btn:hover {
  background: var(--border);
  color: var(--text-primary);
}

.shell-nav-btn.active {
  background: var(--accent);
  border-color: var(--accent-hover);
  box-shadow: 0 0 0 1px var(--accent-hover);
  color: var(--text-primary);
}

.shell-nav-btn .icon {
  font-size: 24px;
  line-height: 1;
}

.shell-nav-btn .label {
  font-size: var(--text-sm);
}

/* Nav badges — unread/due counts */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: var(--font-semibold);
  line-height: 1;
  margin-left: 2px;
}

.shell-nav-btn.active .nav-badge {
  background: rgba(255, 255, 255, 0.3);
}

/* Focus-visible — accessible keyboard focus */
.shell-nav-btn:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Remove default focus ring for mouse clicks */
:focus:not(:focus-visible) {
  outline: none;
}

/* ═══════════════════════════════════════════
   GLOBAL TIMER (NAVBAR ONLY)
   ═══════════════════════════════════════════ */

.shell-timer {
  display: none; /* Hidden when inactive */
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.shell-timer .timer-clickable {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.shell-timer .timer-clickable:hover {
  background: rgba(255, 255, 255, 0.1);
}

.shell-timer .timer-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--success);
  animation: pulse 2s ease-in-out infinite;
}

.shell-timer.break .timer-dot {
  background: var(--info);
}

.shell-timer.paused .timer-dot {
  background: var(--warning);
  animation: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.shell-timer .timer-badge {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--success);
}

.shell-timer.break .timer-badge {
  color: var(--info);
}

.shell-timer.paused .timer-badge {
  color: var(--warning);
}

.shell-timer .timer-sep {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.shell-timer .timer-task {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}

.shell-timer .timer-display {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  font-variant-numeric: tabular-nums;
  color: var(--success);
}

.shell-timer.break .timer-display {
  color: var(--info);
}

.shell-timer .timer-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.shell-timer .timer-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.shell-timer .timer-action:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.shell-timer.paused .timer-display {
  color: var(--warning);
}

/* ═══════════════════════════════════════════
   STATUS & BADGES
   ═══════════════════════════════════════════ */

.shell-status {
  display: flex;
  align-items: center;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--text-muted);
}

.status-dot.connected {
  background: var(--success);
}

.status-dot.disconnected {
  background: var(--danger);
}

.demo-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: var(--warning-bg);
  color: var(--warning);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ═══════════════════════════════════════════
   THEME TOGGLE
   ═══════════════════════════════════════════ */

.shell-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-lg);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: var(--text-lg);
}

.shell-theme-toggle:hover {
  background: var(--border);
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════
   INSPECTOR TOGGLE
   ═══════════════════════════════════════════ */

.shell-inspector-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-lg);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.shell-inspector-toggle:hover {
  background: var(--border);
  color: var(--text-primary);
}

.shell-inspector-toggle.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.shell-user-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.shell-user-btn:hover {
  transform: scale(1.1);
}

.shell-user-btn #user-avatar {
  color: white;
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
}

/* User Dropdown */
.shell-user-dropdown {
  position: relative;
}

.user-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: var(--space-2);
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-fast);
  z-index: 1001;
}

.shell-user-dropdown.open .user-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown-current {
  padding: var(--space-3) var(--space-4);
}

.current-user-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.current-user-avatar {
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: var(--font-semibold);
  font-size: var(--text-base);
}

.current-user-details {
  display: flex;
  flex-direction: column;
}

.current-user-name {
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
}

.current-user-email {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-2) 0;
}

.user-dropdown-divider.hidden {
  display: none;
}

.user-dropdown-list {
  padding: var(--space-1) 0;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.user-dropdown-item:hover {
  background: var(--bg-elevated);
}

.user-dropdown-item.current {
  background: var(--bg-secondary);
}

.user-item-avatar {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: var(--font-semibold);
  font-size: var(--text-xs);
}

.user-item-name {
  flex: 1;
  font-size: var(--text-sm);
}

.user-item-check {
  color: var(--success);
  font-size: var(--text-sm);
}

.user-dropdown-action {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) var(--space-4);
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text-primary);
  text-align: left;
  transition: background var(--transition-fast);
}

.user-dropdown-action:hover {
  background: var(--bg-elevated);
}

.user-dropdown-action .action-icon {
  width: 20px;
  text-align: center;
}

/* ═══════════════════════════════════════════
   INSPECTOR DRAWER
   ═══════════════════════════════════════════ */

.shell-inspector {
  position: fixed;
  top: var(--shell-header-height);
  right: 0;
  bottom: 0;
  width: var(--shell-inspector-width);
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  z-index: calc(var(--z-header) - 1);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-base);
}

.shell-inspector.open {
  transform: translateX(0);
}

.shell-inspector.pinned .inspector-header {
  background: var(--accent-bg);
}

/* Inspector Header */
.inspector-header {
  padding: var(--space-3);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.inspector-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.inspector-title-row h3 {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--accent);
}

.inspector-header-actions {
  display: flex;
  gap: var(--space-1);
}

/* Inspector Body */
.inspector-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-3);
}

/* Inspector Content Styles */
.inspector-node-header {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.inspector-title-input {
  flex: 1;
  padding: 8px 12px;
  font-size: var(--text-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
}

.inspector-title-input:focus {
  outline: none;
  border-color: var(--accent);
}

.inspector-actions-row {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.inspector-section {
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
}

.inspector-section-title {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.inspector-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-1) 0;
  font-size: var(--text-sm);
}

.inspector-field .label {
  color: var(--text-secondary);
}

.inspector-field .value {
  color: var(--text-primary);
  font-weight: var(--font-medium);
}

/* Source section — stack label/value vertically for long content */
.inspector-source-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-1) 0;
  font-size: var(--text-sm);
}
.inspector-source-field .label {
  color: var(--text-muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}
.inspector-source-field .value {
  color: var(--text-primary);
  word-break: break-word;
  line-height: 1.4;
}

.inspector-promote-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.inspector-promote-row input {
  width: 60px;
}

.inspector-full-width {
  width: 100%;
  margin-top: var(--space-2);
}

.inspector-timer-controls {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.inspector-timer-controls button {
  flex: 1;
}

.inspector-state-row {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.inspector-state-row button {
  flex: 1;
}

.btn-inline-edit {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0 var(--space-1);
  font-size: var(--text-sm);
  opacity: 0.5;
  transition: opacity var(--transition-fast);
}

.btn-inline-edit:hover {
  opacity: 1;
}

/* ═══════════════════════════════════════════
   INSPECTOR TABS (M7.8)
   ═══════════════════════════════════════════ */

.inspector-tabs {
  display: flex;
  gap: var(--space-1);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-3);
}

.inspector-tab {
  flex: 1;
  padding: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.inspector-tab:hover {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.inspector-tab.active {
  background: var(--accent-bg);
  color: var(--accent);
}

.inspector-tab-content {
  flex: 1;
  overflow-y: auto;
}

.inspector-loading {
  padding: var(--space-4);
  text-align: center;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════
   DESCRIPTION (M7.8)
   ═══════════════════════════════════════════ */

.inspector-description {
  width: 100%;
  min-height: 80px;
  padding: var(--space-2);
  font-size: var(--text-sm);
  font-family: inherit;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  resize: vertical;
}

.inspector-description:focus {
  outline: none;
  border-color: var(--accent);
}

.inspector-description::placeholder {
  color: var(--text-muted);
}

.inspector-description-status {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
  min-height: 1em;
}

/* ═══════════════════════════════════════════
   OUTLINE EDITOR (M7.8)
   ═══════════════════════════════════════════ */

.outline-editor {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.outline-help {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-2);
}

.outline-tree {
  flex: 1;
  overflow-y: auto;
}

.outline-item {
  user-select: none;
}

.outline-row {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
}

.outline-row:hover {
  background: var(--bg-tertiary);
}

.outline-caret {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-muted);
  cursor: default;
  flex-shrink: 0;
}

.outline-caret.has-children {
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.outline-caret.has-children.expanded {
  transform: rotate(90deg);
}

.outline-input {
  flex: 1;
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-sm);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

.outline-input:focus {
  outline: none;
  background: var(--bg-secondary);
  border-color: var(--border);
}

.outline-add-child-btn {
  width: 20px;
  height: 20px;
  padding: 0;
  margin-left: var(--space-1);
  font-size: 14px;
  font-weight: bold;
  line-height: 1;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition-fast), background var(--transition-fast);
  flex-shrink: 0;
}

.outline-row:hover .outline-add-child-btn {
  opacity: 0.6;
}

.outline-add-child-btn:hover {
  opacity: 1 !important;
  background: var(--bg-tertiary);
  border-color: var(--border);
  color: var(--accent);
}

.outline-children {
  /* Indentation handled via inline style */
}

.outline-add-root {
  margin-top: var(--space-3);
}

/* ═══════════════════════════════════════════
   LINKS SECTION (M7.8)
   ═══════════════════════════════════════════ */

.links-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.links-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.links-empty {
  padding: var(--space-3);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.link-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-2);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.link-info {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  flex: 1;
  min-width: 0;
}

.link-icon {
  flex-shrink: 0;
}

.link-details {
  flex: 1;
  min-width: 0;
}

.link-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  margin-bottom: 2px;
}

.link-value {
  font-size: var(--text-xs);
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-actions {
  display: flex;
  gap: var(--space-1);
  flex-shrink: 0;
}

.link-actions .btn {
  padding: 2px 6px;
  font-size: var(--text-xs);
}

.links-add-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
}

.links-type-toggle {
  display: flex;
  gap: var(--space-1);
}

.link-type-btn {
  flex: 1;
  padding: var(--space-2);
  font-size: var(--text-xs);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.link-type-btn:hover {
  border-color: var(--text-muted);
}

.link-type-btn.active {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
}

.input-sm {
  padding: 6px 10px;
  font-size: var(--text-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════
   SHARE SECTION (M12)
   ═══════════════════════════════════════════ */

.share-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.share-info-banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--accent-bg);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
}

.share-icon {
  font-size: 1.5rem;
}

.share-info-text {
  flex: 1;
}

.share-info-title {
  font-weight: var(--font-medium);
  color: var(--text-primary);
}

.share-info-detail {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.share-permissions {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}

.share-perm-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
}

.perm-icon {
  font-size: 1rem;
}

.perm-label {
  color: var(--text-secondary);
}

.share-current {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.share-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.share-empty {
  padding: var(--space-3);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.share-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.share-user-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  min-width: 0;
}

.share-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-medium);
  font-size: var(--text-sm);
  flex-shrink: 0;
}

.share-user-details {
  flex: 1;
  min-width: 0;
}

.share-user-name {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-user-perms {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.share-remove-btn {
  padding: 4px 8px !important;
  font-size: var(--text-xs);
}

.share-add-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
}

.share-perms-toggle {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}

.share-perm-check {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  cursor: pointer;
}

.share-perm-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

/* ═══════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════ */

.shell-toast {
  position: fixed;
  top: calc(var(--shell-header-height) + var(--space-4));
  right: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: var(--z-toast);
  pointer-events: none;
}

body.inspector-open .shell-toast {
  right: calc(var(--shell-inspector-width) + var(--space-4));
}

.toast-item {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: var(--text-sm);
  max-width: 300px;
  opacity: 0;
  transform: translateX(100%);
  transition: all var(--transition-base);
  pointer-events: auto;
}

.toast-item.visible {
  opacity: 1;
  transform: translateX(0);
}

.toast-item.success {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success);
}

.toast-item.error {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger);
}

.toast-item.undo-toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-primary);
  padding-right: var(--space-2);
}

.toast-item.undo-toast .toast-text {
  flex: 1;
}

.toast-item.undo-toast .toast-undo-btn {
  padding: var(--space-1) var(--space-3);
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.toast-item.undo-toast .toast-undo-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.toast-item.undo-toast .toast-undo-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════
   SELECTION STATES
   ═══════════════════════════════════════════ */

.selectable {
  cursor: pointer;
  transition: all var(--transition-fast);
}

.selectable:hover {
  border-color: var(--text-muted);
}

.selectable.selected {
  border-color: var(--accent);
  background: var(--accent-bg);
}

/* ═══════════════════════════════════════════
   HIDE OLD ELEMENTS
   ═══════════════════════════════════════════ */

/* Hide any old headers/timers when shell is active */
body.has-shell .header,
body.has-shell .dashboard-header,
body.has-shell .review-header,
body.has-shell .timer-strip,
body.has-shell .old-inspector {
  display: none !important;
}

/* ═══════════════════════════════════════════
   MODAL DIALOGS
   ═══════════════════════════════════════════ */

.shell-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.shell-modal-overlay.active {
  display: flex;
}

.shell-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  max-width: 400px;
  width: 100%;
  overflow: hidden;
  animation: modal-in 0.2s ease-out;
}

.shell-modal.shell-modal-wide {
  max-width: 700px;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.shell-modal-header {
  padding: var(--space-4);
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  border-bottom: 1px solid var(--border);
}

.shell-modal-body {
  padding: var(--space-4);
  color: var(--text-secondary);
  line-height: 1.6;
}

.shell-modal-actions {
  padding: var(--space-3) var(--space-4);
  background: var(--bg-tertiary);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.shell-modal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.shell-modal-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--text-muted);
}

.shell-modal-btn:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-bg);
}

.shell-modal-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.shell-modal-btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.shell-modal-btn.success {
  background: var(--success);
  border-color: var(--success);
  color: #000;
}

.shell-modal-btn.success:hover {
  filter: brightness(1.1);
}

.shell-modal-btn.warning {
  background: var(--warning);
  border-color: var(--warning);
  color: #000;
}

.shell-modal-btn.warning:hover {
  filter: brightness(1.1);
}

.shell-modal-btn.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

.shell-modal-btn.danger:hover:not(:disabled) {
  filter: brightness(1.1);
}

.shell-modal-btn.danger:disabled {
  background: var(--bg-secondary);
  border-color: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
}

.shell-modal-btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}

.shell-modal-btn.ghost:hover {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.shell-modal-btn .icon {
  font-size: var(--text-base);
}

.shell-modal-input {
  width: 100%;
  padding: var(--space-3);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.shell-modal-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.15);
}

.shell-modal-input::placeholder {
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════
   FOCUS MODE OVERLAY
   ═══════════════════════════════════════════ */

.focus-mode-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: hidden;
}

.focus-mode-overlay.active {
  display: flex;
}

body.focus-mode {
  overflow: hidden;
}

/* Animated background glow */
.focus-mode-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(34, 197, 94, 0.15) 0%, transparent 70%);
  animation: glow-pulse 4s ease-in-out infinite;
}

.focus-mode-overlay.paused .focus-mode-glow {
  background: radial-gradient(ellipse at center, rgba(251, 191, 36, 0.15) 0%, transparent 70%);
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* Scanlines effect */
.focus-mode-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.3) 2px,
    rgba(0, 0, 0, 0.3) 4px
  );
  pointer-events: none;
  opacity: 0.3;
}

/* Content */
.focus-mode-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: var(--space-6);
}

.focus-mode-status {
  font-size: 1.5rem;
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--success);
  margin-bottom: var(--space-4);
  text-shadow: 0 0 20px var(--success), 0 0 40px var(--success);
  animation: status-glow 2s ease-in-out infinite;
}

.focus-mode-status.paused {
  color: var(--warning);
  text-shadow: 0 0 20px var(--warning), 0 0 40px var(--warning);
}

@keyframes status-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.focus-mode-task {
  font-size: 2rem;
  font-weight: var(--font-medium);
  color: var(--text-primary);
  margin-bottom: var(--space-6);
  max-width: 600px;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.focus-mode-timer {
  font-family: ui-monospace, 'SF Mono', 'Cascadia Code', monospace;
  font-size: clamp(4rem, 15vw, 12rem);
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  color: var(--success);
  text-shadow: 
    0 0 20px var(--success),
    0 0 40px var(--success),
    0 0 80px rgba(34, 197, 94, 0.5);
  letter-spacing: 0.1em;
  margin-bottom: var(--space-6);
  animation: timer-glow 1s ease-in-out infinite;
}

.focus-mode-overlay.paused .focus-mode-timer {
  color: var(--warning);
  text-shadow: 
    0 0 20px var(--warning),
    0 0 40px var(--warning),
    0 0 80px rgba(251, 191, 36, 0.5);
  animation: none;
}

.focus-mode-overlay.running .focus-mode-timer {
  animation: timer-glow 1s ease-in-out infinite;
}

@keyframes timer-glow {
  0%, 100% { text-shadow: 0 0 20px var(--success), 0 0 40px var(--success), 0 0 80px rgba(34, 197, 94, 0.5); }
  50% { text-shadow: 0 0 30px var(--success), 0 0 60px var(--success), 0 0 100px rgba(34, 197, 94, 0.7); }
}

.focus-mode-controls {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}

.focus-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 2px solid var(--success);
  background: transparent;
  color: var(--success);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.focus-mode-btn:hover {
  background: var(--success);
  color: #000;
  box-shadow: 0 0 20px var(--success);
}

.focus-mode-btn.secondary {
  border-color: var(--warning);
  color: var(--warning);
}

.focus-mode-btn.secondary:hover {
  background: var(--warning);
  color: #000;
  box-shadow: 0 0 20px var(--warning);
}

.focus-mode-btn.ghost {
  border-color: var(--text-muted);
  color: var(--text-muted);
}

.focus-mode-btn.ghost:hover {
  border-color: var(--text-secondary);
  color: var(--text-secondary);
  background: transparent;
  box-shadow: none;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */

@media (max-width: 1024px) {
  .shell-timer {
    min-width: 200px;
  }
  
  .shell-timer .timer-task {
    max-width: 100px;
  }
}

@media (max-width: 768px) {
  :root {
    --shell-inspector-width: 100%;
    --shell-header-height: 48px;
  }

  .shell-header-center {
    display: none;
  }

  .shell-nav-btn .label {
    display: none;
  }
}

/* ═══════════════════════════════════════════
   COMMAND PALETTE
   ═══════════════════════════════════════════ */

.cmd-palette-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: calc(var(--z-modal) + 10);
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}

.cmd-palette-overlay.open {
  display: flex;
}

.cmd-palette {
  width: 600px;
  max-width: calc(100vw - 2rem);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.cmd-palette-input-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
}

.cmd-palette-search-icon {
  font-size: 16px;
  opacity: 0.5;
  flex-shrink: 0;
}

.cmd-palette-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: var(--text-lg);
  font-family: var(--font-family);
}

.cmd-palette-input::placeholder {
  color: var(--text-muted);
}

.cmd-palette-esc {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: var(--text-xs);
  padding: 2px 5px;
  flex-shrink: 0;
  font-family: var(--font-family);
}

.cmd-palette-results {
  max-height: 400px;
  overflow-y: auto;
  padding: var(--space-2) 0;
}

.cmd-palette-empty {
  padding: var(--space-3) var(--space-4);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.cmd-palette-loading {
  padding: var(--space-3) var(--space-4);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.cmd-palette-section-header {
  padding: var(--space-2) var(--space-4) var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.cmd-palette-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.cmd-palette-item:hover,
.cmd-palette-item.active {
  background: var(--accent-bg);
}

.cp-item-icon {
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  font-size: 16px;
}

.cp-item-label {
  flex: 1;
  color: var(--text-primary);
  font-size: var(--text-base);
}

.cp-item-hint {
  color: var(--text-muted);
  font-size: var(--text-xs);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   KEYBOARD SHORTCUTS OVERLAY
   ═══════════════════════════════════════════ */

.shortcuts-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  z-index: calc(var(--z-modal) + 5);
  align-items: center;
  justify-content: center;
}

.shortcuts-overlay.open {
  display: flex;
}

.shortcuts-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 480px;
  max-width: calc(100vw - 2rem);
  max-height: 80vh;
  overflow-y: auto;
}

.shortcuts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.shortcuts-header h3 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.shortcuts-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.shortcuts-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.shortcuts-body {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.shortcuts-section-title {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  margin-bottom: var(--space-2);
}

.shortcut-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-1) 0;
  font-size: var(--text-sm);
}

.shortcut-row kbd {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: var(--text-xs);
  padding: 2px 8px;
  min-width: 32px;
  text-align: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.shortcut-row span {
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════
   MOBILE RESPONSIVE
   ═══════════════════════════════════════════ */

@media (max-width: 768px) {
  /* Nav bar: horizontal scroll instead of wrapping */
  .shell-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: var(--space-1);
  }

  .shell-nav-btn {
    font-size: 0.75rem;
    padding: 0.4rem 0.6rem;
    white-space: nowrap;
    min-width: 44px;
    min-height: 44px;
    text-align: center;
    flex: 0 0 auto;
  }

  .shell-nav-btn .icon {
    font-size: 24px;
  }
  
  /* Header compact */
  .shell-header { padding: 0 0.5rem; }
  .shell-header .logo { font-size: 1rem; }
  .shell-user-menu { font-size: 0.85rem; }
  
  /* Inspector: full-width overlay on mobile */
  .shell-inspector { position: fixed; top: var(--shell-header-height); left: 0; right: 0; bottom: 0; width: 100% !important; min-width: unset; z-index: 100; }
  .shell-inspector.closed { display: none; }
  
  /* Main content fills screen */
  .shell-main { padding: 0.5rem; }
  
  /* Touch targets: min 44px */
  button, .btn, a.nav-link, .contact-card, .inbox-item, .task-item { min-height: 44px; }
  
  /* Stack grids vertically */
  .home-grid, .dashboard-grid, .review-grid { grid-template-columns: 1fr !important; }
  
  /* Inbox: full width */
  .inbox-container { flex-direction: column; }
  .inbox-list { width: 100%; max-width: 100%; }
  .inbox-detail { width: 100%; }
  
  /* Calendar: scroll horizontally */
  .cal-week-grid { overflow-x: auto; min-width: 600px; }
  
  /* Relationships: stack */
  .relationships-container { flex-direction: column; }
  .contacts-list-panel { width: 100%; }
}

@media (max-width: 480px) {
  :root {
    --shell-header-height: 44px;
  }

  .shell-nav-btn { padding: 0.35rem; }
  .ci-scores { flex-direction: column; align-items: center; }
  .ci-sub-scores { flex-direction: row; flex-wrap: wrap; justify-content: center; }
}

/* ═══════════════════════════════════════════
   SIDEBAR LAYOUT (GPT-5.4 Design Update)
   ═══════════════════════════════════════════ */

:root {
  --shell-sidebar-width: 220px;
}

/* --- Sidebar --- */
.shell-sidebar {
  position: fixed;
  top: var(--shell-header-height);
  left: 0;
  bottom: 0;
  width: var(--shell-sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 90;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.shell-sidebar .shell-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: var(--space-2) 0;
  flex: 1;
  overflow: hidden;
}

/* --- Nav Sections --- */
.shell-nav-section {
  padding: 0 var(--space-2);
  margin-bottom: var(--space-1);
}

.shell-nav-section + .shell-nav-section {
  border-top: 1px solid var(--border);
  padding-top: var(--space-2);
  margin-top: var(--space-1);
}

.shell-nav-section-title {
  font-size: 10px;
  font-weight: var(--font-semibold, 600);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: var(--space-2) var(--space-3) var(--space-1);
  user-select: none;
}

/* --- Sidebar Nav Buttons --- */
.shell-sidebar .shell-nav-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: var(--radius-md, 8px);
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-sm, 14px);
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  text-align: left;
  position: relative;
}

.shell-sidebar .shell-nav-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.shell-sidebar .shell-nav-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.shell-sidebar .shell-nav-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: var(--font-medium, 500);
}

.shell-sidebar .shell-nav-btn.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.shell-sidebar .shell-nav-btn .icon {
  font-size: 16px;
  flex-shrink: 0;
  width: 22px;
  text-align: center;
}

/* --- Nav Copy (label + meta) --- */
.shell-nav-copy {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  flex: 1;
}

.shell-nav-copy .label {
  font-size: var(--text-sm, 14px);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-meta {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  max-height: 0;
  transition: opacity 0.2s ease, max-height 0.2s ease;
}

.shell-nav-btn:hover .nav-meta,
.shell-nav-btn.active .nav-meta {
  opacity: 1;
  max-height: 20px;
}

/* --- Nav Badge (sidebar) --- */
.shell-sidebar .nav-badge {
  font-size: 11px;
  font-weight: var(--font-semibold, 600);
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-full, 999px);
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  flex-shrink: 0;
  margin-left: auto;
}

/* --- Sidebar Footer --- */
.shell-sidebar-footer {
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.shell-command-hint {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px);
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.shell-command-hint:hover {
  background: var(--bg-elevated);
  border-color: var(--text-muted);
}

.shell-command-copy {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
  min-width: 0;
}

.shell-command-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.shell-command-meta {
  font-size: 10px;
  color: var(--text-muted);
}

.shell-command-hint kbd {
  font-size: 11px;
  font-family: inherit;
  padding: 2px 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* --- Header Brand (logo + page meta) --- */
.shell-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.shell-page-meta {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.2;
}

.shell-page-kicker {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.shell-page-title {
  font-size: var(--text-base, 15px);
  font-weight: var(--font-semibold, 600);
  color: var(--text-primary);
}

/* --- Body offset for sidebar --- */
body.has-shell {
  padding-left: var(--shell-sidebar-width);
}

body.has-shell.inspector-open {
  padding-right: var(--shell-inspector-width);
}

/* Fixed containers need left offset */
.shell-inspector {
  right: 0;
}

/* Canvas fixed positioning with sidebar */
body.has-shell .canvas-container {
  left: var(--shell-sidebar-width);
}

/* Inbox fixed height with sidebar */
body.has-shell .inbox-container {
  margin-left: 0; /* already offset by body padding */
}

/* --- Hide header nav (now in sidebar) --- */
.shell-header .shell-nav {
  display: none;
}

/* ═══════════════════════════════════════════
   SIDEBAR RESPONSIVE
   ═══════════════════════════════════════════ */

@media (max-width: 900px) {
  :root {
    --shell-sidebar-width: 0px;
  }

  .shell-sidebar {
    transform: translateX(-100%);
    width: 220px;
    opacity: 0;
    pointer-events: none;
  }

  .shell-sidebar.open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  body.has-shell {
    padding-left: 0;
  }

  /* Show nav meta always when sidebar is open on mobile */
  .shell-sidebar.open .nav-meta {
    opacity: 1;
    max-height: 20px;
  }
}

@media (max-width: 480px) {
  .shell-page-meta {
    display: none;
  }
}
