
/* V4.6.9.5 final optical polish */
/* Goal: unify spacing rhythm, icon balance, card cadence, and page-to-page visual consistency */

:root{
  --space-2xs: 6px;
  --space-xs: 10px;
  --space-sm: 14px;
  --space-md: 18px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 44px;
  --radius-soft: 18px;
  --radius-card: 22px;
  --radius-panel: 26px;
}

/* Page rhythm */
.page,
.main,
.view,
.page-shell,
.page-body{
  gap: var(--space-lg) !important;
}

.page-header,
.hero,
.section-head,
.page-hero{
  margin-bottom: var(--space-lg) !important;
}

.page-header + .page-content,
.hero + .page-content,
.section-head + .section-body{
  margin-top: 0 !important;
}

/* Card cadence */
.note-card,
.panel,
.detail-card,
.review-card,
.stream-card,
.metric,
.attachment-card,
.section-card,
.resource-preview,
.modal,
.drawer-pane,
.desktop-composer{
  border-radius: var(--radius-card) !important;
}

.detail-card,
.modal,
.drawer-pane{
  border-radius: var(--radius-panel) !important;
}

.note-card,
.panel,
.detail-card,
.review-card,
.stream-card,
.metric,
.attachment-card,
.section-card{
  padding: 18px !important;
}

.desktop-composer{
  padding: 20px !important;
}

.modal-body,
.drawer-pane .modal-body,
.resource-preview,
.section-card,
.detail-card .section,
.detail-card .detail-block{
  padding: 18px !important;
}

/* Tighten overly loose bottom gaps if present */
.page > :last-child,
.page-content > :last-child,
.section-body > :last-child,
.panel > :last-child,
.note-card > :last-child,
.detail-card > :last-child,
.review-card > :last-child,
.stream-card > :last-child,
.metric > :last-child{
  margin-bottom: 0 !important;
}

/* Better vertical rhythm between stacked cards/blocks */
.feed,
.list,
.stack,
.cards,
.notes-list,
.resources-list,
.analytics-grid,
.review-stack,
.stream-list{
  gap: 14px !important;
}

.feed > *,
.list > *,
.stack > *,
.cards > *,
.notes-list > *,
.resources-list > *,
.analytics-grid > *,
.review-stack > *,
.stream-list > *{
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* Header + action alignment */
.topbar,
.page-header,
.section-head{
  align-items: center !important;
}

.topbar .actions,
.page-header .actions,
.section-head .actions{
  gap: 10px !important;
}

/* Icon balance */
.icon-btn,
.nav-item .icon,
.bottom-nav .icon,
.topbar .icon,
.sidebar .icon,
button .icon{
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
}

.icon-btn{
  width: 38px !important;
  height: 38px !important;
  border-radius: 12px !important;
  padding: 0 !important;
}

.topbar .icon-btn,
.bottom-nav .icon-btn{
  width: 36px !important;
  height: 36px !important;
}

/* Better nav label spacing */
.nav-item,
.bottom-nav .nav-item,
.segment-chip{
  gap: 8px !important;
  border-radius: 14px !important;
}

.sidebar .nav-item{
  padding: 10px 12px !important;
}

.bottom-nav .nav-item{
  padding: 8px 10px !important;
}

/* Inputs and chips feel cleaner */
.input,
.select,
.input-tagbox,
.command-input-wrap,
.secondary-btn,
.primary-btn,
.segment-chip,
.chip{
  border-radius: 14px !important;
}

.input,
.select,
.input-tagbox,
.command-input-wrap{
  min-height: 42px !important;
}

.primary-btn,
.secondary-btn{
  min-height: 40px !important;
  padding: 0 14px !important;
  gap: 8px !important;
}

/* Table / dense rows rhythm */
.row,
.list-row,
.resource-row,
.history-item,
.comment-item,
.ref-item,
.qa-row,
.result-item{
  border-radius: 16px !important;
  padding: 14px 16px !important;
}

/* Analytics / KPI optical cleanup */
.metric .label,
.kpi-label,
.stat-label{
  opacity: .72 !important;
  letter-spacing: .01em !important;
}

.metric .value,
.kpi-value,
.stat-value{
  letter-spacing: -.03em !important;
}

/* Composer/editor refinement */
.rich-toolbar{
  gap: 8px !important;
  padding-bottom: 10px !important;
}

.editor-input,
.rich-editor,
textarea,
input[type="text"],
input[type="search"]{
  line-height: 1.48 !important;
}

.desktop-composer .title-row,
.desktop-composer .actions,
.editor-shell .actions{
  gap: 10px !important;
}

/* Section separators removed in favor of space */
hr,
.divider,
.section-divider,
.list-divider,
.topbar-divider,
.sidebar-divider{
  display: none !important;
}

/* Sidebar visual grouping through spacing instead of lines */
.sidebar .nav-group,
.sidebar-section,
.sidebar-block{
  padding-top: 6px !important;
  padding-bottom: 6px !important;
  margin-bottom: 8px !important;
}

/* Modal optical balance */
.modal-head,
.modal-body,
.modal-foot{
  padding-left: 18px !important;
  padding-right: 18px !important;
}

.modal-head{
  padding-top: 18px !important;
  padding-bottom: 10px !important;
}

.modal-foot{
  padding-top: 12px !important;
  padding-bottom: 18px !important;
}

/* Card title rhythm */
.card-title,
.note-card h3,
.panel h3,
.detail-card h3,
.review-card h3,
.stream-card h3,
.section-card h3{
  margin-bottom: 6px !important;
}

.card-subtitle,
.meta,
.subtle,
.helper,
.description{
  margin-top: 0 !important;
}

/* Mobile tightening without making cramped */
@media (max-width: 860px){
  .note-card,
  .panel,
  .detail-card,
  .review-card,
  .stream-card,
  .metric,
  .attachment-card,
  .section-card,
  .resource-preview,
  .desktop-composer{
    padding: 16px !important;
  }

  .page,
  .main,
  .view,
  .page-shell,
  .page-body{
    gap: 16px !important;
  }

  .feed,
  .list,
  .stack,
  .cards,
  .notes-list,
  .resources-list,
  .analytics-grid,
  .review-stack,
  .stream-list{
    gap: 12px !important;
  }

  .sidebar .nav-item,
  .bottom-nav .nav-item,
  .segment-chip,
  .primary-btn,
  .secondary-btn{
    min-height: 38px !important;
  }
}
