/* migrated from admin-analysis-profile-hotfix.css */
/* финальный узкий слой:
   только analysis + profile
   без повторного командования графиком */

[data-collapse-panel="1"] {
  min-height: 0;
  height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

[data-collapse-panel="1"][data-collapse-open="1"] {
  opacity: 1;
  pointer-events: auto;
}

#analysis-body {
  display: grid !important;
  gap: 16px !important;
  align-content: start;
}

#screen-analysis .analysis-period-card,
#screen-analysis .analysis-counts-card,
#screen-analysis .analysis-top-card,
#screen-analysis .analysis-ai-card {
  width: min(100%, 980px);
  margin-left: 0;
  margin-right: 0;
}

#screen-analysis .analysis-period-card,
#screen-analysis .analysis-counts-card {
  padding: 0 !important;
  overflow: hidden;
}

#screen-analysis .analysis-period-row,
#screen-analysis .analysis-counts-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 18px;
  min-height: 58px;
  padding: 16px 18px !important;
  border-bottom: 1px solid rgba(150, 118, 45, 0.12);
}

#screen-analysis .analysis-period-row:last-child,
#screen-analysis .analysis-counts-row:last-child {
  border-bottom: none;
}

#screen-analysis .analysis-period-row span,
#screen-analysis .analysis-counts-row span {
  flex: 1 1 auto;
  min-width: 0;
  padding-right: 8px;
  line-height: 1.42;
}

#screen-analysis .analysis-period-row strong,
#screen-analysis .analysis-counts-row strong {
  flex: 0 0 auto;
  min-width: 84px;
  max-width: 48%;
  text-align: right;
  line-height: 1.35;
  word-break: break-word;
}

#screen-analysis .analysis-list {
  display: grid;
  gap: 10px;
}

#screen-analysis .analysis-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(150, 118, 45, 0.10);
}

#screen-analysis .analysis-item:last-child {
  border-bottom: none;
}

#screen-analysis .analysis-item-main {
  flex: 1 1 auto;
  min-width: 0;
}

#screen-analysis .analysis-item strong {
  flex: 0 0 auto;
  min-width: 72px;
  text-align: right;
}

#screen-analysis .analysis-empty,
#screen-analysis .analysis-ai-text {
  line-height: 1.72;
}

#screen-analysis .analysis-glossary-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

#screen-today .today-section-body {
  padding: 0 !important;
}

#screen-today .today-section-content {
  padding: 0 18px 18px;
}

@media (max-width: 900px) {
  #screen-analysis .analysis-glossary-list {
    grid-template-columns: 1fr;
  }

  #screen-analysis .analysis-period-card,
  #screen-analysis .analysis-counts-card,
  #screen-analysis .analysis-top-card,
  #screen-analysis .analysis-ai-card {
    width: 100%;
  }
}

@media (max-width: 640px) {
  #screen-analysis .analysis-period-row,
  #screen-analysis .analysis-counts-row {
    min-height: 52px;
    padding: 14px 14px !important;
    gap: 12px;
  }

  #screen-analysis .analysis-period-row strong,
  #screen-analysis .analysis-counts-row strong {
    min-width: 70px;
    max-width: 44%;
    font-size: 13px;
  }

  #screen-analysis .analysis-list-title {
    letter-spacing: 0.03em;
  }

}

/* migrated from analysis-chart-text-polish.css */
/* единый смысловой слой типографики и дорогой поверхности для graph/analysis */

#screen-analysis,
#screen-chart,
#screen-notes {
  --text-card-max: 920px;
}

#screen-analysis .analysis-empty,
#screen-analysis .analysis-ai-text,
#screen-analysis .analysis-glossary-item span,
#screen-chart .analysis-empty,
#screen-chart .analysis-ai-text,
#screen-chart .chart-details-body,
#screen-chart .chart-help-note,
#screen-chart .chart-detail-line,
#screen-chart .chart-detail-empty,
#screen-notes .notes-entry-text,
#screen-notes .notes-recent-text {
  font-size: 15px;
  line-height: 1.76;
  letter-spacing: 0.01em;
  color: #2d2417;
}

#screen-analysis .analysis-top-card,
#screen-analysis .analysis-counts-card,
#screen-analysis .analysis-period-card,
#screen-analysis .analysis-ai-card,
#screen-chart .analysis-ai-card,
#screen-chart .chart-details-card,
#screen-notes .notes-recent-card,
#screen-notes .notes-entry {
  max-width: var(--text-card-max);
}

#screen-analysis .analysis-top-card,
#screen-analysis .analysis-ai-card,
#screen-chart .analysis-ai-card,
#screen-chart .chart-details-card,
#screen-notes .notes-recent-card,
#screen-notes .notes-entry {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(202,166,75,.16);
  background:
    radial-gradient(circle at top right, rgba(202,166,75,.10), transparent 26%),
    linear-gradient(180deg, rgba(255,250,241,.98) 0%, rgba(247,238,216,.94) 100%);
  box-shadow: 0 12px 30px rgba(56, 39, 10, 0.08);
}

#screen-analysis .analysis-top-card::before,
#screen-analysis .analysis-ai-card::before,
#screen-chart .analysis-ai-card::before,
#screen-chart .chart-details-card::before,
#screen-notes .notes-recent-card::before,
#screen-notes .notes-entry::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #d7b86a 0%, #9a7428 48%, #0f6b52 100%);
  opacity: .95;
}

#screen-analysis .analysis-list-title,
#screen-chart .chart-details-title,
#screen-analysis .analysis-ai-title,
#screen-chart .analysis-ai-title {
  font-size: 15px;
  line-height: 1.3;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #3f2e12;
}

#screen-analysis .analysis-list-title {
  padding: 18px 20px 10px 24px;
}

#screen-analysis .analysis-list {
  padding: 0 20px 18px 24px;
}

#screen-analysis .analysis-top-card .analysis-empty {
  color: #2b2112 !important;
  font-size: 15px !important;
  line-height: 1.82 !important;
}

#screen-analysis .analysis-period-row,
#screen-analysis .analysis-counts-row {
  min-height: 54px;
  padding: 15px 18px;
}

#screen-analysis .analysis-period-row span,
#screen-analysis .analysis-counts-row span {
  color: #5c4a26;
  font-weight: 600;
}

#screen-analysis .analysis-period-row strong,
#screen-analysis .analysis-counts-row strong {
  color: #23180c;
  font-weight: 900;
}

#screen-analysis .analysis-ai-title,
#screen-chart .analysis-ai-title {
  font-size: 16px;
  margin-bottom: 12px;
  color: #2b2112;
}

#screen-analysis .analysis-ai-text,
#screen-chart .analysis-ai-text {
  color: #2b2112;
  white-space: pre-wrap;
}

#screen-analysis .analysis-glossary-item {
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255,252,246,0.9);
  border: 1px solid rgba(202,166,75,.16);
  box-shadow: 0 8px 18px rgba(56, 39, 10, 0.05);
}

#screen-analysis .analysis-glossary-item strong {
  font-size: 13px;
  line-height: 1.35;
  color: #3f2e12;
  font-weight: 900;
}

#screen-analysis .analysis-glossary-item span {
  margin-top: 2px;
  color: #5b4b29;
}

#screen-notes .notes-recent-title,
#screen-notes .notes-entry-title {
  color: #23180c;
}

#screen-notes .notes-recent-date,
#screen-notes .notes-entry-date {
  color: #8a6928;
}

#screen-notes .notes-recent-text,
#screen-notes .notes-entry-text {
  color: #332716;
}

@media (min-width: 901px) {
  #screen-analysis .analysis-top-card,
  #screen-chart .chart-details-card,
  #screen-analysis .analysis-ai-card,
  #screen-chart .analysis-ai-card,
  #screen-notes .notes-recent-card,
  #screen-notes .notes-entry {
    border-radius: 20px;
  }

  #screen-analysis .analysis-top-card .analysis-empty,
  #screen-chart .chart-details-body,
  #screen-notes .notes-recent-text,
  #screen-notes .notes-entry-text {
    font-size: 16px !important;
    line-height: 1.82 !important;
  }
}

@media (max-width: 900px) {
  #screen-analysis,
  #screen-chart,
  #screen-notes {
    --text-card-max: 100%;
  }
}

@media (max-width: 640px) {
  #screen-analysis .analysis-list-title,
  #screen-chart .chart-details-title,
  #screen-analysis .analysis-ai-title,
  #screen-chart .analysis-ai-title {
    font-size: 13px;
  }

  #screen-analysis .analysis-list-title {
    padding: 15px 14px 8px 18px;
  }

  #screen-analysis .analysis-list {
    padding: 0 14px 14px 18px;
  }

  #screen-analysis .analysis-top-card .analysis-empty,
  #screen-analysis .analysis-ai-text,
  #screen-chart .chart-details-body,
  #screen-chart .chart-help-note,
  #screen-chart .chart-detail-line,
  #screen-chart .chart-detail-empty,
  #screen-notes .notes-entry-text,
  #screen-notes .notes-recent-text {
    font-size: 14px !important;
    line-height: 1.72 !important;
  }

  #screen-analysis .analysis-period-row,
  #screen-analysis .analysis-counts-row {
    min-height: 48px;
    padding: 13px 14px;
  }

  #screen-chart .chart-details-card,
  #screen-notes .notes-recent-card,
  #screen-notes .notes-entry {
    border-radius: 18px;
  }

  #screen-analysis .analysis-ai-title,
  #screen-chart .analysis-ai-title {
    font-size: 15px;
  }
}

/* migrated from chart-surface-grid-fix.css */
/* главный авторитет по сеткам и карточкам графика */

#screen-chart .chart-wrap {
  margin-top: 0;
  margin-bottom: 14px;
}

#screen-chart .chart-summary {
  margin-top: 0;
}

#screen-chart .chart-landing-summary-line,
#screen-chart .chart-landing-forecast-line {
  display: none !important;
}

#screen-chart .chart-landing-hero,
#screen-chart .chart-landing-hero-compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

#screen-chart .chart-hero-card,
#screen-chart .chart-hero-card-metric {
  position: relative;
  min-width: 0;
  min-height: 72px;
  padding: 10px 12px 10px;
  border-radius: 18px;
  box-sizing: border-box;
}

#screen-chart .chart-hero-label {
  font-size: 11px;
  line-height: 1.25;
  opacity: .82;
  padding-right: 28px;
}

#screen-chart .chart-hero-value {
  margin-top: 4px;
  font-size: 20px;
  line-height: 1.15;
  font-weight: 800;
  word-break: break-word;
}

#screen-chart .chart-help-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

#screen-chart .chart-help-note {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  line-height: 1.45;
  font-size: 13px;
}

#screen-chart .chart-inline-total {
  margin: 6px 0 12px;
  font-size: 13px;
  line-height: 1.35;
  opacity: .82;
}

#screen-chart .chart-details-card {
  margin-top: 16px;
  padding: 16px;
  border-radius: 20px;
  box-sizing: border-box;
}

#screen-chart .chart-details-title {
  margin-bottom: 12px;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 800;
}

#screen-chart .chart-detail-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

#screen-chart .chart-detail-metrics-grid.compact {
  margin-top: 14px;
}

#screen-chart .chart-detail-metric {
  min-width: 0;
  min-height: 92px;
  padding: 12px 12px 10px;
  border-radius: 16px;
  box-sizing: border-box;
}

#screen-chart .chart-detail-metric-label {
  font-size: 12px;
  line-height: 1.25;
  opacity: .8;
}

#screen-chart .chart-detail-metric-value {
  margin-top: 6px;
  font-size: 18px;
  line-height: 1.15;
  font-weight: 800;
  word-break: break-word;
}

#screen-chart .chart-detail-panel + .chart-detail-panel {
  margin-top: 14px;
}

#screen-chart .chart-detail-panel {
  padding: 16px 16px 14px 18px;
  border-radius: 18px;
}

#screen-chart .chart-detail-panel-title {
  margin-bottom: 8px;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 800;
}

#screen-chart .chart-detail-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#screen-chart .chart-detail-line,
#screen-chart .chart-detail-empty {
  padding: 10px 12px;
  border-radius: 14px;
  line-height: 1.4;
  font-size: 14px;
  word-break: break-word;
}

#chart-metric-glossary.metric-glossary {
  margin-top: 18px;
  padding: 16px;
  border-radius: 22px;
  box-sizing: border-box;
}

#chart-metric-glossary .metric-glossary-head {
  margin-bottom: 12px;
}

#chart-metric-glossary .metric-glossary-kicker {
  font-size: 12px;
  line-height: 1.2;
  opacity: .72;
  text-transform: uppercase;
  letter-spacing: .04em;
}

#chart-metric-glossary .metric-glossary-title {
  margin-top: 4px;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 800;
}

#chart-metric-glossary .metric-glossary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#chart-metric-glossary .metric-glossary-item {
  min-width: 0;
  padding: 12px;
  border-radius: 16px;
  box-sizing: border-box;
}

#chart-metric-glossary .metric-glossary-item-title {
  font-size: 14px;
  line-height: 1.25;
  font-weight: 800;
  margin-bottom: 6px;
}

#chart-metric-glossary .metric-glossary-item-text {
  font-size: 13px;
  line-height: 1.45;
  opacity: .9;
}

@media (max-width: 640px) {
  #screen-chart .chart-landing-hero,
  #screen-chart .chart-landing-hero-compact,
  #screen-chart .chart-detail-metrics-grid,
  #screen-chart .chart-detail-metrics-grid.compact,
  #chart-metric-glossary .metric-glossary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  #screen-chart .chart-hero-card,
  #screen-chart .chart-hero-card-metric {
    border-radius: 16px;
  }

  #screen-chart .chart-detail-metric-value {
    font-size: 16px;
  }

  #chart-metric-glossary .metric-glossary-title {
    font-size: 18px;
  }
}

@media (max-width: 380px) {
  #screen-chart .chart-landing-hero,
  #screen-chart .chart-landing-hero-compact,
  #screen-chart .chart-detail-metrics-grid,
  #chart-metric-glossary .metric-glossary-grid {
    gap: 8px;
  }

  #screen-chart .chart-hero-card,
  #screen-chart .chart-hero-card-metric,
  #screen-chart .chart-detail-metric,
  #chart-metric-glossary .metric-glossary-item {
    padding: 10px;
    border-radius: 14px;
  }

  #screen-chart .chart-detail-metric-value {
    font-size: 15px;
  }
}

/* migrated from commercial-surface-fix.css */
/* коммерческий стабилизирующий слой:
   не решает сетку заново, а лишь добивает чистоту поверхности */

#screen-chart .chart-inline-total {
  margin: 2px 0 10px;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 800;
  color: #6e5120;
}

#chart-metric-glossary {
  margin-top: 16px;
}

.metric-glossary {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(202,166,75,.16);
  background:
    radial-gradient(circle at top right, rgba(202,166,75,.10), transparent 28%),
    linear-gradient(180deg, rgba(255,250,241,.98) 0%, rgba(247,238,216,.94) 100%);
  box-shadow: 0 10px 22px rgba(56, 39, 10, 0.06);
  padding: 16px;
}

.metric-glossary::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #d7b86a 0%, #9a7428 48%, #0f6b52 100%);
}

.metric-glossary-head {
  position: relative;
  z-index: 1;
  margin-bottom: 12px;
}

.metric-glossary-kicker {
  font-size: 11px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 900;
  color: #8a6928;
  margin-bottom: 5px;
}

.metric-glossary-title {
  font-size: 16px;
  line-height: 1.35;
  font-weight: 900;
  color: #23180c;
}

.metric-glossary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metric-glossary-item {
  border-radius: 14px;
  border: 1px solid rgba(202,166,75,.14);
  background: rgba(255,252,246,.84);
  box-shadow: 0 8px 18px rgba(56, 39, 10, 0.05);
  padding: 12px 13px;
}

.metric-glossary-item-title {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 900;
  color: #3f2e12;
}

.metric-glossary-item-text {
  display: block;
  font-size: 12px;
  line-height: 1.58;
  color: #5c4a26;
}

#screen-notes .notes-date-label,
#screen-notes .notes-days-count:empty,
#screen-notes .notes-current-date,
#screen-notes .notes-current-date-line,
#screen-notes .notes-current-date-divider,
#screen-notes .notes-current-date-row {
  display: none !important;
}

#screen-notes .notes-date-row {
  margin-top: 0 !important;
  margin-bottom: 10px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

#screen-notes .notes-ai-actions .analysis-ai-pro-btn {
  line-height: 1.25 !important;
}

#screen-analysis .analysis-date-label {
  display: none !important;
}

#screen-analysis .analysis-glossary-item strong {
  display: block !important;
  margin-bottom: 6px !important;
  font-size: 13px !important;
  line-height: 1.3 !important;
}

#screen-analysis .analysis-glossary-item span {
  display: block !important;
  margin-top: 0 !important;
  font-size: 12px !important;
  line-height: 1.56 !important;
}

#screen-chart .chart-details-card,
#screen-chart .analysis-ai-card,
#screen-analysis .analysis-ai-card,
#screen-notes .analysis-ai-card {
  overflow: hidden;
}

#screen-analysis .analysis-ai-card[data-state="loading"] .analysis-ai-title,
#screen-analysis .analysis-ai-card[data-state="empty"] .analysis-ai-title {
  color: var(--text);
}

#screen-analysis .analysis-ai-card[data-state="loading"] .analysis-ai-text,
#screen-analysis .analysis-ai-card[data-state="empty"] .analysis-ai-text {
  color: var(--muted);
}

#screen-analysis .analysis-ai-card[data-state="error"] .analysis-ai-title,
#screen-analysis .analysis-ai-card[data-state="error"] .analysis-ai-text {
  color: var(--danger, #b04848);
}

@media (max-width: 640px) {
  #screen-chart .chart-controls,
  #screen-analysis .analysis-period-btns,
  #screen-notes .notes-range-row {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px !important;
    overflow: visible !important;
    padding: 0 0 8px !important;
    margin-bottom: 12px !important;
  }

  #screen-chart .chart-btn,
  #screen-analysis .analysis-period-btn,
  #screen-notes .notes-range-btn {
    width: 100% !important;
    min-width: 0 !important;
    padding: 8px 6px !important;
    min-height: 38px !important;
    font-size: 11px !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
  }

  #screen-chart .chart-hero-card,
  #screen-chart .chart-detail-metric {
    min-height: 88px !important;
    padding: 13px 13px 12px !important;
  }

  #screen-chart .chart-hero-value,
  #screen-chart .chart-detail-metric-value {
    font-size: 17px !important;
  }

  .metric-glossary {
    padding: 14px;
    border-radius: 16px;
  }

  .metric-glossary-title {
    font-size: 15px;
  }

  .metric-glossary-item {
    padding: 11px 11px 10px;
  }

  .metric-glossary-item-title {
    font-size: 12px;
  }

  .metric-glossary-item-text {
    font-size: 11px;
    line-height: 1.52;
  }
}

/* migrated from surface-final-cleanup.css */
/* финальный авторитет внешнего слоя для graph/analysis/notes */

#screen-chart .chart-inline-total:empty,
#screen-chart .chart-help-note:empty,
#screen-chart .chart-detail-empty:empty,
#screen-chart .chart-detail-line:empty,
#screen-notes .notes-days-count:empty,
#screen-notes .notes-meta-line:empty,
#screen-notes .notes-meta-row:empty,
#screen-analysis .analysis-date-label:empty {
  display: none !important;
}

#screen-chart .chart-details-card[style*="display: none"],
#screen-chart .chart-detail-panel[style*="display: none"],
#screen-notes [style*="display: none"],
#screen-analysis [style*="display: none"] {
  pointer-events: none;
}

#screen-chart .chart-wrap,
#screen-chart .chart-summary,
#screen-chart .chart-details-card,
#chart-metric-glossary.metric-glossary,
#screen-analysis .analysis-period-card,
#screen-analysis .analysis-counts-card,
#screen-analysis .analysis-top-card,
#screen-analysis .analysis-ai-card,
#screen-notes .notes-recent-block,
#screen-notes .notes-recent-card,
#screen-notes .notes-entry {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

#screen-chart .chart-help-note,
#screen-chart .chart-detail-line,
#screen-chart .chart-detail-empty,
#screen-analysis .analysis-empty,
#screen-analysis .analysis-ai-text,
#screen-notes .notes-entry-text,
#screen-notes .notes-recent-text {
  overflow-wrap: anywhere;
}

#screen-chart .chart-help-note {
  display: block;
  margin-bottom: 12px;
}

#screen-chart .chart-details-card + .chart-details-card {
  margin-top: 16px;
}

#screen-chart .chart-detail-panel + .chart-detail-panel {
  margin-top: 14px;
}

#screen-notes .notes-date-row,
#screen-notes .notes-range-row,
#screen-analysis .analysis-period-btns,
#screen-analysis .range-picker-row {
  margin-bottom: 14px;
}

#screen-analysis .analysis-list-title {
  line-height: 1.25;
}

#screen-analysis .analysis-period-row,
#screen-analysis .analysis-counts-row,
#screen-analysis .analysis-period-row span,
#screen-analysis .analysis-counts-row span,
#screen-analysis .analysis-period-row strong,
#screen-analysis .analysis-counts-row strong {
  min-width: 0;
}

#screen-analysis .analysis-top-card,
#screen-analysis .analysis-counts-card,
#screen-analysis .analysis-period-card,
#screen-notes .notes-recent-card,
#screen-notes .notes-entry,
#screen-chart .chart-details-card {
  overflow: hidden;
}

#screen-chart .chart-landing-summary-line,
#screen-chart .chart-landing-forecast-line {
  display: none !important;
}

#screen-chart .chart-landing-hero,
#screen-chart .chart-landing-hero-compact,
#screen-chart .chart-detail-metrics-grid,
#screen-chart .chart-detail-metrics-grid.compact,
#chart-metric-glossary .metric-glossary-grid,
#screen-analysis .analysis-glossary-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px;
}

#screen-chart .chart-hero-card,
#screen-chart .chart-hero-card-metric,
#screen-chart .chart-detail-metric,
#chart-metric-glossary .metric-glossary-item,
#screen-analysis .analysis-glossary-item {
  min-width: 0;
}

#screen-analysis #analysis-body {
  display: grid;
  gap: 16px;
  align-content: start;
}

#screen-analysis .analysis-period-card,
#screen-analysis .analysis-counts-card,
#screen-analysis .analysis-top-card,
#screen-analysis .analysis-ai-card {
  width: min(100%, 980px);
  margin-left: 0;
  margin-right: 0;
}

#screen-analysis .analysis-list {
  display: grid;
  gap: 10px;
}

#screen-analysis .analysis-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(150,118,45,.10);
}

#screen-analysis .analysis-item:last-child {
  border-bottom: none;
}

#screen-analysis .analysis-item-main {
  flex: 1 1 auto;
  min-width: 0;
}

#screen-analysis .analysis-item strong {
  flex: 0 0 auto;
  min-width: 72px;
  text-align: right;
}

#screen-chart .chart-details-body {
  display: grid;
  gap: 14px;
}

#screen-chart .chart-detail-list {
  display: grid;
  gap: 8px;
}

#screen-notes .notes-recent-block {
  display: grid;
  gap: 12px;
}

#screen-notes .notes-recent-card {
  margin-bottom: 0;
}

#screen-notes .notes-recent-panel {
  overflow: hidden;
}

#screen-notes .notes-entry {
  margin-bottom: 0;
}

@media (max-width: 900px) {
  #screen-analysis .analysis-period-card,
  #screen-analysis .analysis-counts-card,
  #screen-analysis .analysis-top-card,
  #screen-analysis .analysis-ai-card {
    width: 100%;
  }

  #screen-today .today-section-content {
    padding: 0 12px 12px;
  }
}

@media (max-width: 640px) {
  #screen-today .today-section-content {
    padding: 0 8px 10px;
  }

  .date-picker-row,
  .notes-date-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    align-items: stretch !important;
  }

  .date-picker-row > *,
  .notes-date-row > *,
  .range-picker-row > * {
    flex: 1 1 calc(50% - 4px) !important;
    min-width: 0 !important;
  }

  .range-picker-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .date-picker-row input[type=date],
  .range-picker-row input[type=date],
  .notes-date-row input[type=date] {
    width: 100% !important;
    min-width: 0 !important;
  }

  .notes-date-row .btn-sm {
    width: 100% !important;
    min-width: 0 !important;
    padding: 9px 8px !important;
  }

  #screen-chart .chart-landing-hero,
  #screen-chart .chart-landing-hero-compact,
  #screen-chart .chart-detail-metrics-grid,
  #screen-chart .chart-detail-metrics-grid.compact,
  #chart-metric-glossary .metric-glossary-grid,
  #screen-analysis .analysis-glossary-list {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
  }

  #screen-chart .chart-details-card,
  #screen-analysis .analysis-period-card,
  #screen-analysis .analysis-counts-card,
  #screen-analysis .analysis-top-card,
  #screen-analysis .analysis-ai-card,
  #screen-notes .notes-recent-card,
  #screen-notes .notes-entry {
    border-radius: 16px;
  }

  #screen-analysis .analysis-period-row,
  #screen-analysis .analysis-counts-row {
    min-height: 52px;
    padding: 14px 14px !important;
    gap: 12px;
  }

  #screen-analysis .analysis-period-row strong,
  #screen-analysis .analysis-counts-row strong {
    min-width: 70px;
    max-width: 44%;
    font-size: 13px;
  }
}
