/*
 * UnlimitedModel.com — User Dashboard design system
 *
 * The ADMIN backend (styles/admin.css, .admin-shell) is the design-system
 * reference for every authenticated surface. This file mirrors its token
 * values verbatim (warm canvas #f7f7f5, white surfaces, #e7e5e4 borders,
 * 236px sidebar, 60px topbar, 28px page padding, 22px stack gap) scoped to
 * the user dashboard root (.user-shell on #page-dashboard in index.html).
 *
 * Role changes CONTENT, never visuals: nav items, cards, tables, buttons,
 * badges, forms, empty/loading states and responsive behavior here use the
 * exact same measurements and colors as .admin-shell.
 *
 * Load order: theme.css → tokens.css → app-shell.css → base.css →
 * components.css → components-modals-dropdowns.css → pages.css →
 * landing.css → user-dashboard.css (last, replacing the cascade slot the
 * old migrated landing.css dashboard block held).
 */


/* ==== 1-8. Shell, sidebar, topbar, page header, cards, stat cards, tables,
   toolbars, pagination and empty/loading states are owned by
   styles/app-ui.css (shared verbatim with the super admin). They are
   intentionally NOT redefined here — one owner per component. ==== */

/* ==== Chat tab overview: the ONLY place the greeting + stat cards live ==== */
.user-shell .dash-overview {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.user-shell .dash-overview-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.user-shell .dash-overview-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  line-height: 1.35;
  color: var(--text-primary);
  margin: 0;
}

.user-shell .dash-overview-sub {
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
}

/* ==== 9. Chat Studio — same surfaces as the rest of the shell ==== */
.user-shell .chat-shell {
  display: flex;
  gap: 0;
  flex: 1;
  min-height: 0;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.03);
}
.user-shell .chat-sidebar {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  overflow: hidden;
}
.user-shell .chat-sidebar-header {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.user-shell .chat-sidebar-header .btn-primary { width: 100%; justify-content: center; min-height: 40px; font-size: 13px; }
.user-shell .chat-search-container { position: relative; }
.user-shell .chat-search-input {
  width: 100%;
  height: 36px;
  padding: 0 32px 0 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-sizing: border-box;
}
.user-shell .chat-search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(23, 105, 209, 0.1); }
.user-shell .chat-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-shell .chat-search-icon svg { width: 16px; height: 16px; }
.user-shell .chat-search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}
.user-shell .chat-search-clear svg { width: 14px; height: 14px; }
.user-shell .chat-conversation-list { flex: 1; min-height: 0; overflow-y: auto; padding: 8px; }
.user-shell .conversation-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition-fast);
}
.user-shell .conversation-item:hover { background: var(--bg-hover); }
.user-shell .conversation-item.active { background: var(--accent-light); }
.user-shell .conversation-item strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-shell .conversation-item span { font-size: 11px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-shell .chat-conversation-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  text-align: center;
  min-height: 160px;
}
.user-shell .chat-conversation-empty svg,
.user-shell .chat-conversation-empty i { width: 36px; height: 36px; margin-bottom: 12px; opacity: 0.4; color: var(--text-secondary); }
.user-shell .chat-conversation-empty p { font-size: 13px; line-height: 1.5; margin-bottom: 16px; }
.user-shell .chat-conversation-empty .btn { min-height: 36px; padding: 8px 16px; font-size: 13px; }
.user-shell .chat-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  overflow: hidden;
}
.user-shell .chat-toolbar {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
  background: var(--surface);
}
.user-shell .chat-toolbar #chat-model-status { font-size: 12px; color: var(--text-secondary); }
/* Model selector: styled like the shared select control */
.user-shell .model-selector { position: relative; min-width: 240px; max-width: 320px; flex: 1; }
.user-shell .model-selector-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 14px;
  min-height: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  font-family: inherit;
  text-align: left;
}
.user-shell .model-selector-trigger:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(23, 105, 209, 0.1); }
.user-shell .model-selector-trigger[aria-expanded="true"] { border-color: var(--accent); }
.user-shell .model-selector-icon { width: 20px; height: 20px; flex-shrink: 0; color: var(--accent); display: flex; align-items: center; justify-content: center; }
.user-shell .model-selector-icon svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; }
.user-shell .model-selector-info { flex: 1; min-width: 0; }
.user-shell .model-selector-name { font-size: 14px; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.user-shell .model-selector-context { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.user-shell .model-selector-chevron { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-secondary); transition: transform var(--transition-fast); display: flex; align-items: center; justify-content: center; }
.user-shell .model-selector-chevron svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; }
.user-shell .model-selector-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-dropdown, 0 8px 24px rgba(0, 0, 0, 0.12));
  max-height: 320px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 200ms ease-out, transform 200ms ease-out, visibility 200ms;
}
.user-shell .model-selector-empty { padding: 16px 14px; text-align: center; }
.user-shell .model-selector-empty .model-option-context { margin-top: 4px; }
.user-shell .model-selector-skeleton { padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.user-shell .model-selector-skeleton .skeleton-line { height: 38px; border-radius: 8px; background: var(--bg-surface); animation: user-skeleton-pulse 1.2s ease-in-out infinite; }
.user-shell .model-option {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--border-soft);
}
.user-shell .model-option:last-child { border-bottom: none; }
.user-shell .model-option:hover { background: var(--bg-hover); }
.user-shell .model-option.selected { background: var(--accent-light); }
.user-shell .model-option-name { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.user-shell .model-option.selected .model-option-name { color: var(--accent-hover); }
.user-shell .model-option-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary); }
.user-shell .model-option-tier { text-transform: uppercase; letter-spacing: 0.03em; font-weight: 500; }
.user-shell .model-option-tier.economy { color: var(--success); }
.user-shell .model-option-tier.standard { color: var(--accent); }
.user-shell .model-option-tier.premium { color: var(--warning); }
.user-shell .model-option-context { color: var(--text-secondary); }
.user-shell .model-option-check { margin-left: auto; width: 16px; height: 16px; color: var(--accent); display: none; align-items: center; justify-content: center; }
.user-shell .model-option.selected .model-option-check { display: flex; }
.user-shell .model-option-check svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2.5; }
.user-shell .chat-messages {
  flex: 1;
  padding: var(--space-xl);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scroll-behavior: smooth;
  min-height: 0;
}
.user-shell .chat-status { padding: 8px 20px; font-size: 13px; color: var(--text-secondary); min-height: 36px; flex-shrink: 0; display: flex; align-items: center; gap: 8px; }
.user-shell .chat-status-spinner { display: none; gap: 3px; padding: 4px; }
.user-shell .chat-status-spinner-dot { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; animation: chat-spinner-pulse 1.2s ease-in-out infinite; }
.user-shell .chat-status-spinner-dot:nth-child(2) { animation-delay: 0.2s; }
.user-shell .chat-status-spinner-dot:nth-child(3) { animation-delay: 0.4s; }
.user-shell .thinking-dots { display: none; }
.user-shell .thinking-dots span { display: inline-block; width: 4px; height: 4px; background: var(--accent); border-radius: 50%; animation: thinking-bounce 1.4s ease-in-out infinite; }
.user-shell .thinking-dots span:nth-child(1) { animation-delay: 0s; }
.user-shell .thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.user-shell .thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
.user-shell .streaming-indicator { display: none; }
.user-shell .streaming-indicator span { display: inline-block; width: 4px; height: 4px; background: var(--accent); border-radius: 50%; animation: streaming-pulse 1s ease-in-out infinite; }
.user-shell .streaming-indicator span:nth-child(1) { animation-delay: 0s; }
.user-shell .streaming-indicator span:nth-child(2) { animation-delay: 0.15s; }
.user-shell .streaming-indicator span:nth-child(3) { animation-delay: 0.3s; }
.user-shell .chat-composer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  gap: 12px;
  flex-shrink: 0;
  flex-wrap: wrap;
  align-items: flex-end;
  position: relative;
}
.user-shell .chat-composer-textarea-wrapper { flex: 1; position: relative; display: flex; flex-direction: column; }
.user-shell .chat-composer textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  line-height: 1.5;
  min-height: 48px;
  max-height: 200px;
  overflow-y: auto;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  background: var(--surface);
  color: var(--text-primary);
  box-sizing: border-box;
}
.user-shell .chat-composer textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(23, 105, 209, 0.1); }
.user-shell .chat-composer.is-loading textarea { opacity: 0.6; cursor: not-allowed; pointer-events: none; }
.user-shell .chat-composer-send {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}
.user-shell .chat-composer-send:hover { background: var(--accent-hover); }
.user-shell .chat-composer-send:disabled { background: #e5e7eb; color: #9ca3af; cursor: not-allowed; }
.user-shell .chat-composer-send svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; }
.user-shell .chat-composer-stop {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.user-shell .chat-composer-stop svg { width: 14px; height: 14px; fill: currentColor; }

/* ==== 10. Models grid ==== */
.user-shell .models-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.user-shell .model-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.03);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.user-shell .model-card:hover { border-color: var(--accent); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.04); }
.user-shell .model-card:disabled { opacity: 0.6; cursor: not-allowed; }
.user-shell .model-card .name { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.user-shell .model-card .tier { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); margin-bottom: 2px; }
.user-shell .model-card .ctx { font-size: 12px; color: var(--text-secondary); }

/* ==== 11. API Keys ==== */
/* Toolbar + table live in ONE card (see .card--flush in app-ui.css). The
   table is the desktop layout; below 768px rows stack as cards. */
.user-shell .key-table-card { box-shadow: var(--shadow-card); }
.user-shell .key-filter-select { width: auto; min-width: 140px; flex: 0 0 auto; }
.user-shell .key-created-card { padding: var(--space-5); border: 1px solid var(--success-border); border-radius: var(--radius-card); background: var(--success-bg); }
/* Desktop table: header cells and row cells share the same column widths
   (32/18/18/14/18 via <th> width), so every value sits under its header. */
.user-shell .key-table-wrap { width: 100%; overflow-x: auto; }
.user-shell .key-table { table-layout: fixed; }
/* Fixed desktop columns: Name 32% / Created 18% / Last Used 18% / Status 14% / Actions 18% */
.user-shell .key-table .col-name { width: 32%; }
.user-shell .key-table .col-created { width: 18%; }
.user-shell .key-table .col-last-used { width: 18%; }
.user-shell .key-table .col-status { width: 14%; }
.user-shell .key-table .col-actions { width: 18%; }
/* Compact 56px rows (two-line name cell fits inside the padding box) */
.user-shell .key-row td { height: 56px; box-sizing: border-box; }
.user-shell .key-name-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.user-shell .key-name {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.35;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-shell .key-masked {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-secondary);
  background: none;
  border: none;
  padding: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-shell .key-date-cell { color: var(--text-secondary); font-size: 13px; white-space: nowrap; }
.user-shell .key-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 999px;
  white-space: nowrap;
}
.user-shell .key-status-badge.active { background: #ecfdf5; color: #059669; }
.user-shell .key-status-badge.revoked { background: #fef2f2; color: #dc2626; }
.user-shell .key-status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
/* Actions: compact "..." menu (Copy key ID / Rename / Revoke) */
.user-shell .key-actions-cell { text-align: left; }
.user-shell .key-actions { position: relative; display: inline-flex; }
.user-shell .key-menu-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}
.user-shell .key-menu-btn svg { width: 18px; height: 18px; }
.user-shell .key-menu-btn:hover { background: var(--bg-surface); border-color: var(--border); color: var(--text-primary); }
.user-shell .key-menu-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.user-shell .key-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  min-width: 168px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
/* Last row: open upward so the menu stays inside the table card */
.user-shell .key-menu.key-menu-up { top: auto; bottom: calc(100% + 4px); }
.user-shell .key-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: none;
  font-size: 13px;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}
.user-shell .key-menu-item svg { width: 14px; height: 14px; color: var(--text-secondary); }
.user-shell .key-menu-item:hover { background: var(--bg-surface); }
.user-shell .key-menu-item.key-menu-danger { color: #dc2626; }
.user-shell .key-menu-item.key-menu-danger svg { color: #dc2626; }
.user-shell .key-menu-item.key-menu-danger:hover { background: #fef2f2; }
.user-shell .key-empty-row td { height: auto; padding: 32px 16px; text-align: center; }
.user-shell .key-empty-row:hover td { background: transparent; }
.user-shell .key-row.just-created td { background: rgba(16, 185, 129, 0.06); }
/* Mobile: rows become stacked cards; desktop keeps the table. */
@media (max-width: 767px) {
  .user-shell .key-list-toolbar { flex-wrap: wrap; padding: 12px; }
  .user-shell .key-search-wrapper { flex: 1 1 100%; max-width: none; }
  .user-shell .key-filter-wrapper { flex: 0 0 140px; }
  .user-shell .key-table-wrap { overflow: visible; }
  .user-shell .key-table,
  .user-shell .key-table tbody { display: block; width: 100%; }
  .user-shell .key-table thead { display: none; }
  .user-shell .key-table tbody tr.key-row {
    display: block;
    margin: 12px;
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
  }
  .user-shell .key-row td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: auto;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    text-align: left;
  }
  .user-shell .key-row td:last-child { border-bottom: none; }
  .user-shell .key-row td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
  }
  .user-shell .key-row td[data-label="Name"] { flex-direction: column; align-items: flex-start; gap: 2px; }
  .user-shell .key-row td[data-label="Name"]::before { margin-bottom: 2px; }
  .user-shell .key-name-cell { width: 100%; }
  .user-shell .key-empty-row td { display: block; padding: 24px 12px; }
  .user-shell .key-empty-row td::before { content: none; }
}

/* ==== 12. Usage ==== */
.user-shell .usage-page-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: var(--space-lg); margin-bottom: 0; }
.user-shell .usage-page-header .page-header-title { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; margin: 0; color: var(--text-primary); }
.user-shell .usage-page-header .page-header-subtitle { font-size: 14px; color: var(--text-secondary); margin: 6px 0 0; }
.user-shell .usage-date-picker { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.user-shell .usage-date-presets { display: flex; gap: 4px; background: var(--bg-surface); padding: 4px; border-radius: 8px; border: 1px solid var(--border); }
.user-shell .usage-preset-btn {
  padding: 8px 16px;
  min-height: 36px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}
.user-shell .usage-preset-btn.active { background: var(--surface); color: var(--accent); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06); }
.user-shell .usage-preset-btn svg { stroke: currentColor; }
.user-shell .usage-date-custom { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; }
.user-shell .usage-date-custom-row { display: flex; align-items: flex-end; gap: 8px; }
.user-shell .usage-date-field { display: flex; flex-direction: column; gap: 4px; }
.user-shell .usage-date-field label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.user-shell .usage-date-separator { padding-bottom: 10px; color: var(--text-secondary); }
.user-shell .usage-chart-legend { display: flex; gap: 24px; font-size: 13px; }
.user-shell .usage-chart-legend-item { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); }
.user-shell .usage-chart-legend-dot { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.user-shell .usage-chart-legend-dot.prompt { background: var(--info); }
.user-shell .usage-chart-legend-dot.completion { background: var(--accent); }
.user-shell .usage-chart-bar { display: flex; align-items: center; gap: 16px; position: relative; }
.user-shell .usage-chart-label { min-width: 160px; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary); }
.user-shell .usage-chart-bar-container { flex: 1; height: 28px; background: var(--bg-surface); border-radius: 6px; overflow: hidden; position: relative; }
.user-shell .usage-chart-bar-fill { height: 100%; border-radius: 6px; transition: width 0.5s ease; min-width: 4px; position: relative; }
.user-shell .usage-chart-bar-fill.prompt { background: var(--info); }
.user-shell .usage-chart-bar-fill.completion { background: var(--accent); margin-left: 4px; }
.user-shell .usage-chart-value { min-width: 80px; text-align: right; font-size: 13px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.user-shell .usage-chart-row { display: flex; flex-direction: column; gap: 6px; position: relative; }
.user-shell .usage-chart-row:hover .usage-chart-tooltip { opacity: 1; visibility: visible; }
.user-shell .usage-chart-empty { padding: 24px 20px; text-align: center; color: var(--text-secondary); min-height: 160px; display: flex; align-items: center; justify-content: center; }
.user-shell .usage-chart-tooltip {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  background: var(--text-primary);
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  pointer-events: none;
}
.user-shell .usage-chart-tooltip::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--text-primary);
  border-bottom: none;
}
.user-shell .usage-chart-tooltip-row { display: flex; align-items: center; gap: 8px; }
.user-shell .usage-chart-tooltip-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.user-shell .usage-chart-tooltip-dot.prompt { background: var(--info); }
.user-shell .usage-chart-tooltip-dot.completion { background: var(--accent); }

/* ==== 13. Support ==== */
/* The ticket form is a reading-width column, not a full-bleed container. */
.user-shell .support-form-card { max-width: 760px; }
/* Community help is secondary: tinted surface, same card anatomy. */
.user-shell .support-community-card { background: var(--bg-surface); max-width: 760px; }
.user-shell .support-community-card p {
  margin: 0 0 var(--space-4);
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text-secondary);
}

/* ==== 14. Status/state helpers kept from the migrated block ==== */
.user-shell #dash-access-status.is-subscribe { color: var(--accent); }
.user-shell .dashboard-stat-card-icon.is-subscribe-icon { background: var(--accent-light); color: var(--accent); }

/* ==== 15. Responsive — only user-dashboard-specific overrides live here.
   Shell padding, the sidebar drawer and the stat-card grid are owned by
   styles/app-ui.css (1024 drawer / 768 mobile). ==== */
@media (max-width: 767px) {
  .user-shell .chat-shell { flex-direction: column; height: auto; }
  .user-shell .chat-sidebar { width: 100%; max-height: 200px; border-right: none; border-bottom: 1px solid var(--border); }
  .user-shell .chat-main { flex: 1; min-height: 360px; }
  .user-shell .form-row { grid-template-columns: 1fr; }
  .user-shell .usage-page-header { flex-direction: column; align-items: stretch; }
  .user-shell .usage-date-picker { align-items: flex-start; }
}
