:root {
  --primary: #e8450e;
  --primary-light: #ff6b35;
  --bg: #fafafa;
  --card-bg: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #666;
  --border: #e5e5e5;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 8px;
  --dashboard-max: min(1680px, 96vw);
  --dash-section-gap: 22px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }

/* Auth */
.auth-container { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 20px; }
.auth-card { background: var(--card-bg); border-radius: var(--radius); padding: 40px; max-width: 400px; width: 100%; box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.auth-card h1 { font-size: 24px; margin-bottom: 4px; }
.auth-subtitle { color: var(--primary); font-weight: 600; margin-bottom: 24px; }
.auth-alert { background: #fef2f2; color: var(--danger); padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.field input[type="tel"], .field input[type="password"], .field input[type="text"] { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 16px; }
.field input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(232,69,14,0.1); }
.field.remember { display: flex; align-items: center; gap: 8px; }
.btn { display: inline-block; padding: 10px 20px; border-radius: var(--radius); font-size: 15px; font-weight: 500; cursor: pointer; text-decoration: none; border: none; }
.btn-primary { background: var(--primary); color: #fff; width: 100%; text-align: center; }
.btn-primary:hover { background: var(--primary-light); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: #f5f5f5; }

/* Dashboard */
.dashboard-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; background: var(--card-bg); border-bottom: 1px solid var(--border); }
.header-left { display: flex; align-items: center; gap: 16px; }
.header-left h1 { font-size: 20px; color: var(--primary); }
.user-name { font-weight: 600; }
.restaurant-badge { background: #fff3ed; color: var(--primary); padding: 4px 10px; border-radius: 12px; font-size: 13px; }

.restaurant-tabs-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.restaurant-tab {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.restaurant-tab:hover { background: #fff3ed; border-color: var(--primary-light); color: var(--primary); }
.restaurant-tab.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.restaurant-tabs-empty { font-size: 13px; color: var(--text-secondary); }
.dashboard-content {
  max-width: var(--dashboard-max);
  margin: 28px auto 40px;
  padding: 0 28px 32px;
}
.dashboard-block {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 32px 36px;
  margin-bottom: 32px;
  border: 1px solid #e2e2e8;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}
.dashboard-block h2 {
  font-size: 20px;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid rgba(232, 69, 14, 0.22);
  letter-spacing: -0.02em;
}

.dashboard-block--summary {
  padding: 24px 28px 28px;
}
.summary-page-title {
  margin-bottom: 6px;
  padding-bottom: 10px;
  font-size: 18px;
}
.summary-page-lead {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: -12px 0 18px;
  max-width: 42rem;
}
.feed-page-lead {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: -12px 0 18px;
  max-width: 42rem;
}

/* Рабочая лента (oracul_public) */
.feed-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.feed-cards-details {
  margin-top: 14px;
}

.feed-card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}
.feed-timeline-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
}
.feed-timeline-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.feed-timeline-label {
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 12px;
}
.feed-timeline-time {
  font-variant-numeric: tabular-nums;
}
.feed-timeline-body {
  font-size: 16px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.feed-card-embed {
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff8f5;
  border-left: 4px solid var(--primary-light);
}
.feed-card-embed.severity-critical { border-left-color: #b91c1c; background: #fef2f2; }
.feed-card-embed.severity-high { border-left-color: #ea580c; }
.feed-card-embed.severity-medium { border-left-color: #ca8a04; }
.feed-card-embed.severity-low { border-left-color: #64748b; }
.feed-card-embed-title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 6px;
}
.feed-card-embed-row {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}
.feed-card-embed-type {
  font-family: ui-monospace, monospace;
  font-size: 12px;
}

@media (max-width: 640px) {
  .dashboard-content {
    padding: 0 6px 24px;
    margin: 18px auto 24px;
  }

  .dashboard-block {
    padding: 18px 10px;
  }

  .feed-timeline-item {
    padding: 14px 14px;
  }

  .feed-timeline-meta {
    font-size: 14px !important;
    margin-bottom: 10px;
  }

  .feed-timeline-label {
    font-size: 13px !important;
  }

  .feed-timeline-body {
    font-size: 18px !important;
  }

  .feed-card-embed {
    padding: 12px 14px;
  }

  .feed-card-embed-title {
    font-size: 19px !important;
  }

  .feed-card-embed-row {
    font-size: 15px !important;
    gap: 6px 12px;
  }

  .feed-card-embed-type {
    font-size: 12px !important;
  }

  /* Приоритеты / рекомендации: на мобильных текст сейчас слишком мелкий. */
  .priority-cards-row {
    gap: 10px;
  }

  .priority-card-inner {
    padding: 16px 14px;
    gap: 10px;
  }

  .priority-card-badge {
    font-size: 12px;
    min-width: 1.7rem;
    height: 1.7rem;
  }

  .priority-card-text {
    font-size: 18px !important;
  }

  .recommendation-card {
    padding: 12px 14px;
  }

  .rec-priority {
    font-size: 22px !important;
  }

  .rec-text {
    font-size: 16px !important;
  }

  .rec-context-summary {
    font-size: 14px !important;
  }

  .rec-why,
  .rec-effect {
    font-size: 15px !important;
  }
}

/* Summary */
.restaurant-summary-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.restaurant-summary-panel .dash-section,
.restaurant-summary-panel .staffing-guidance.dash-section {
  margin-top: 0;
  padding: 14px 16px;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.restaurant-summary-panel .dash-section > h3:first-child {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.restaurant-summary-panel .insights li,
.restaurant-summary-panel .people-risks li {
  margin-bottom: 4px;
}

.priority-cards-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.priority-cards-row--stack {
  grid-template-columns: 1fr;
}
@media (max-width: 900px) {
  .priority-cards-row:not(.priority-cards-row--stack) {
    grid-template-columns: 1fr;
  }
}
.priority-card {
  margin: 0;
  border-radius: 12px;
  border: 1px solid #ebebef;
  border-left: 4px solid var(--border);
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  min-height: 100%;
}
.priority-card.urgency-high {
  border-left-color: var(--danger);
  background: linear-gradient(180deg, #fef2f2 0%, #fff 48%);
}
.priority-card.urgency-medium {
  border-left-color: var(--warning);
  background: linear-gradient(180deg, #fffbeb 0%, #fff 48%);
}
.priority-card.urgency-low {
  border-left-color: var(--success);
  background: linear-gradient(180deg, #f0fdf4 0%, #fff 48%);
}
.priority-card-inner {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100%;
}
.priority-card-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.priority-card-badge {
  font-size: 12px;
  font-weight: 700;
  min-width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-secondary);
}
.priority-card.urgency-high .priority-card-badge {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}
.priority-card.urgency-medium .priority-card-badge {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}
.priority-card.urgency-low .priority-card-badge {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}
.priority-card-text {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  margin: 0;
}
.priority-card .rec-context {
  margin-top: 0;
}

.summary-more-recs {
  border-radius: 10px;
  border: 1px solid #e0e0e8;
  background: #fafafa;
  padding: 0 12px;
}
.summary-more-recs-summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 10px 4px;
  list-style: none;
}
.summary-more-recs-summary::-webkit-details-marker {
  display: none;
}
.summary-more-recs-summary::after {
  content: " ▾";
  font-size: 10px;
  opacity: 0.65;
}
.summary-more-recs[open] .summary-more-recs-summary::after {
  content: " ▴";
}
.summary-more-recs-inner {
  padding-bottom: 10px;
}

.insights-grid-section {
  padding: 14px 16px;
  background: #f6f6f9;
  border-radius: 12px;
  border: 1px solid #e0e0e8;
  border-left: 4px solid var(--primary);
}
.insights-grid-heading {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin: 0 0 10px;
}
.insights-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.insights-grid--stack {
  grid-template-columns: 1fr;
}
@media (max-width: 640px) {
  .insights-grid:not(.insights-grid--stack) {
    grid-template-columns: 1fr;
  }
}
.insight-cell {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.weekly-plan-details.dash-section {
  padding: 0;
  overflow: hidden;
}
.weekly-plan-summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  padding: 14px 16px;
  list-style: none;
  margin: 0;
}
.weekly-plan-summary::-webkit-details-marker {
  display: none;
}
.weekly-plan-summary::after {
  content: " ▾";
  font-size: 10px;
  opacity: 0.65;
}
.weekly-plan-details[open] .weekly-plan-summary::after {
  content: " ▴";
}
.weekly-plan-inner {
  padding: 0 16px 16px;
  border-top: 1px solid #e8e8ee;
}

.summary-appendix-summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  padding: 2px 0 0;
  list-style: none;
}
.summary-appendix-summary::-webkit-details-marker {
  display: none;
}
.summary-appendix-summary::after {
  content: " ▾";
  font-size: 10px;
  opacity: 0.65;
}
.summary-appendix[open] .summary-appendix-summary::after {
  content: " ▴";
}
.summary-appendix-inner {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.report-extra--inline h4 {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--text);
}
.report-extra--inline p,
.report-extra--inline li {
  font-size: 13px;
}
.report-extra--inline ul {
  list-style: disc;
  padding-left: 20px;
  margin: 0;
}

.staffing-guidance--nested {
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}
.staffing-guidance--nested .staffing-guidance-title {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text);
}
.staffing-guidance--nested .staffing-breakeven,
.staffing-guidance--nested .staffing-text p,
.staffing-guidance--nested .staffing-constraints li {
  font-size: 13px;
}

.data-limitations-muted {
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid #eaeaea;
}
.data-limitations-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin: 0 0 6px;
  opacity: 0.85;
}
.data-limitations-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.data-limitations-list li {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
  padding: 4px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.data-limitations-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.summary-header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin-bottom: 0;
  padding: 14px 18px;
  background: linear-gradient(135deg, #ffffff 0%, #fff8f4 55%, #fef5ef 100%);
  border: 1px solid #eee6e0;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(232, 69, 14, 0.06);
}
.summary-header.summary-bar {
  flex-direction: column;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 12px;
}
.summary-bar-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.summary-bar-metrics {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  padding-top: 10px;
  border-top: 1px solid rgba(232, 69, 14, 0.14);
}
.summary-lfl-top.dash-section {
  border-left-color: #0284c7;
  background: linear-gradient(180deg, #f0f9ff 0%, #f8fafc 55%);
}
.summary-waiter-top.dash-section {
  border-left-color: #7c3aed;
}

.recommendations-rest-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.text-muted { color: var(--text-secondary); font-size: 0.92em; }

.dash-section {
  margin-top: var(--dash-section-gap);
  padding: 22px 26px;
  background: #f6f6f9;
  border-radius: 12px;
  border: 1px solid #e0e0e8;
  border-left: 4px solid var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.dash-section > h3:first-child { margin-top: 0; }
.dash-section h3 { font-size: 16px; font-weight: 600; margin-bottom: 12px; color: var(--text); }
.dash-section h4 { font-size: 14px; margin: 14px 0 8px; color: var(--text); }
.dash-section p, .dash-section li { font-size: 14px; color: var(--text-secondary); line-height: 1.55; }
.dash-section > ul:not(.checkpoints-list) {
  list-style: disc;
  padding-left: 22px;
  margin-top: 10px;
}
.people-risks.dash-section li { margin-bottom: 8px; }

.report-extra h4 { font-size: 14px; margin: 14px 0 8px; }

.staffing-guidance h3 { font-size: 16px; margin-bottom: 12px; }
.staffing-breakeven { font-size: 14px; margin-bottom: 12px; }
.staffing-text { margin-bottom: 12px; }
.staffing-text p { font-size: 14px; color: var(--text-secondary); line-height: 1.5; }
.staffing-constraints { list-style: disc; padding-left: 20px; margin: 8px 0; }
.staffing-constraints li { margin-bottom: 6px; font-size: 14px; color: var(--text-secondary); }

.table-wrap { overflow-x: auto; margin-top: 10px; -webkit-overflow-scrolling: touch; }
.staffing-by-day { width: 100%; border-collapse: collapse; font-size: 13px; }
.staffing-by-day th, .staffing-by-day td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.staffing-by-day th { background: var(--bg); font-weight: 600; }
.staffing-by-day td:last-child { max-width: 360px; }

.checkpoints-list li { margin-bottom: 10px; font-size: 14px; line-height: 1.45; }
.checkpoint-comment { color: var(--text-secondary); }

.empty-state--inline { padding: 16px; text-align: left; font-size: 14px; }
.period { font-weight: 600; }
.state { padding: 4px 12px; border-radius: 12px; font-size: 13px; font-weight: 500; }
.state-risky { background: #fef2f2; color: var(--danger); }
.state-acceptable { background: #fffbeb; color: var(--warning); }
.state-good { background: #f0fdf4; color: var(--success); }
.metric { color: var(--text-secondary); font-size: 14px; }
.metric strong { color: var(--text); }

.insights ul { list-style: disc; padding-left: 20px; margin-top: 10px; }
.insights li { margin-bottom: 8px; font-size: 14px; color: var(--text-secondary); }
.recommendations.dash-section > h3,
.advice-cards.dash-section > h3 { margin-top: 0; }

.recommendation-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 8px;
  border: 1px solid #ebebef;
  border-left: 4px solid var(--border);
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.recommendation-card:last-child { margin-bottom: 0; }
.urgency-high { border-left-color: var(--danger); background: #fef2f2; }
.urgency-medium { border-left-color: var(--warning); background: #fffbeb; }
.urgency-low { border-left-color: var(--success); background: #f0fdf4; }
.rec-priority { font-weight: 700; font-size: 18px; color: var(--text-secondary); min-width: 30px; }
.rec-priority-badge {
  flex-shrink: 0;
  min-width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.06);
  border-radius: 6px;
}
.urgency-high .rec-priority-badge { background: rgba(239, 68, 68, 0.12); color: var(--danger); }
.urgency-medium .rec-priority-badge { background: rgba(245, 158, 11, 0.15); color: #b45309; }
.urgency-low .rec-priority-badge { background: rgba(34, 197, 94, 0.12); color: var(--success); }
.rec-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.rec-body { flex: 1; min-width: 0; }
.rec-text { font-weight: 500; margin-bottom: 0; line-height: 1.45; font-size: 15px; }
.rec-context {
  margin-top: 6px;
  border-radius: 8px;
}
.rec-context-summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  list-style: none;
}
.rec-context-summary::-webkit-details-marker { display: none; }
.rec-context-summary::after {
  content: " ▾";
  font-size: 10px;
  opacity: 0.7;
}
.rec-context[open] .rec-context-summary::after {
  content: " ▴";
}
.rec-context-body {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.rec-context-label {
  font-weight: 600;
  color: var(--text);
  margin-right: 4px;
}
.rec-why { font-size: 14px; color: var(--text-secondary); margin-bottom: 6px; line-height: 1.45; }
.rec-why:last-child { margin-bottom: 0; }
.rec-effect { font-size: 14px; color: var(--success); margin-bottom: 0; line-height: 1.45; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.cards-grid--stack {
  grid-template-columns: 1fr;
}
.advice-card {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  border: 1px solid #e8e8ee;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}
.advice-card h4 { font-size: 14px; margin-bottom: 8px; color: var(--primary); }
.advice-card ul { list-style: disc; padding-left: 18px; }
.advice-card li { font-size: 13px; margin-bottom: 4px; color: var(--text-secondary); }

/* Dishes */
/* Без overflow на предках thead: иначе sticky у th часто не работает (в т.ч. Safari). */
.dishes-table {
  position: relative;
  overflow: visible;
}
.dishes-table table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}
.dishes-table thead th {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  padding: 10px 8px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--card-bg);
  border-bottom: 2px solid var(--border);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
}
.dishes-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); }
.dish-row { cursor: pointer; }
.dish-row:hover { background: #f9f9f9; }
.dish-name { font-weight: 500; max-width: min(420px, 40vw); }
.category-badge { padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.cat-a { background: #f0fdf4; color: var(--success); }
.cat-b { background: #fffbeb; color: var(--warning); }
.cat-c { background: #fef2f2; color: var(--danger); }
.risk-badge { padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.risk-high { background: #fef2f2; color: var(--danger); }
.risk-medium { background: #fffbeb; color: var(--warning); }
.risk-low { background: #f0fdf4; color: var(--success); }

@media (max-width: 640px) {
  /* Таблица “Блюда” на мобилке: лучше скролл, чем сжатие текста. */
  .dishes-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .dishes-table table {
    min-width: 760px;
    font-size: 13px;
  }

  .dishes-table thead th {
    padding: 8px 6px;
    font-size: 12px;
  }

  .dishes-table td {
    padding: 8px 6px;
    font-size: 13px;
  }

  .dish-name {
    max-width: 64vw;
  }

  .category-badge,
  .risk-badge {
    font-size: 11px;
  }

  /* Мобильные карточки вместо таблицы */
  .dish-cards-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .dish-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 14px 12px;
  }

  .dish-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
  }

  .dish-card-name {
    font-weight: 700;
    font-size: 17px;
    line-height: 1.25;
    color: var(--text);
    min-width: 0;
  }

  .dish-card-metrics {
    margin-top: 12px;
  }

  .dish-metric-k {
    font-size: 11px;
  }

  .dish-metric-v {
    font-size: 16px;
  }

  .dish-card-details {
    margin-top: 12px;
  }

  .dish-card-details summary {
    cursor: pointer;
    list-style: none;
  }

  .dish-card-details summary::-webkit-details-marker {
    display: none;
  }

  .dish-card-more--sticky {
    position: sticky;
    top: calc(env(safe-area-inset-top, 0px) + 56px);
    z-index: 34;
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    border-radius: 10px;
    padding: 8px 12px;
    text-align: center;
    display: block;
    width: 100%;
    font-weight: 600;
    color: var(--pulse-accent, var(--primary));
  }

  .dish-card--open .dish-card-more--sticky {
    position: sticky;
    top: calc(env(safe-area-inset-top, 0px) + 56px);
  }

  .dish-card--open .dish-card-head {
    position: sticky;
    top: calc(env(safe-area-inset-top, 0px) + 8px);
    z-index: 35;
    background: var(--card-bg);
    padding-top: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  }

  .dish-card-details-body .dish-detail-shell {
    margin-top: 8px;
  }
}

.dish-detail-body { padding: 0; background: transparent; border-radius: 0; }
.dish-detail-shell {
  padding: 14px 12px;
  background: #f1f5f9;
  border-radius: 12px;
}
.dish-detail-masonry {
  column-count: 2;
  column-gap: 14px;
}
@media (max-width: 768px) {
  .dish-detail-masonry {
    column-count: 1;
  }
}
@media (min-width: 1200px) {
  .dish-detail-masonry {
    column-count: 3;
  }
}
.dish-detail-mod {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  margin-bottom: 14px;
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 2px 14px rgba(15, 23, 42, 0.07);
}
.dish-detail-mod-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin: 0 0 10px;
}
.dish-detail-mod-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 10px;
}
.dish-detail-mod-head .dish-detail-mod-title {
  margin: 0;
  flex: 1;
  min-width: 0;
}
.dish-detail-mod-head .pulse-fb-btn {
  align-self: flex-start;
  margin-top: -2px;
}
.dish-advice-model-caption {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: color-mix(in oklab, var(--color-base-content) 55%, transparent);
}

.dish-detail-mod-text {
  font-size: 14px;
  line-height: 1.65;
  color: #334155;
  margin: 0;
}
.dish-detail-mod-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dish-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}
.dish-metric-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.dish-metric-k {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}
.dish-metric-v {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.3;
}
.dish-mod-list {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 13px;
  line-height: 1.55;
  color: #475569;
}
.dish-mod-list li {
  margin-bottom: 6px;
}
.dish-mod-list li:last-child {
  margin-bottom: 0;
}
.dish-detail-mod--ingredients .ingredients-mini {
  max-width: none;
  width: 100%;
}
.dish-details td {
  vertical-align: top;
}
.dish-detail-mod--advice .dish-detail-mod-title {
  color: #4338ca;
}
.dish-subheading { font-size: 13px; font-weight: 600; margin: 12px 0 8px; color: var(--text-primary); }
.dish-subheading:first-child { margin-top: 0; }
.dish-ingredients { margin-bottom: 12px; }
.ingredients-mini { width: 100%; max-width: 640px; border-collapse: collapse; font-size: 13px; }
.ingredients-mini th,
.ingredients-mini td { text-align: left; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--border); }
.ingredients-mini th { color: var(--text-secondary); font-weight: 600; }
.dish-advice-cards-block { margin-bottom: 12px; }
.dish-advice-card-mini { margin-bottom: 10px; font-size: 13px; }
.dish-advice-card-mini strong { display: block; margin-bottom: 4px; color: var(--primary); }
.dish-advice-card-mini ul { margin: 0; padding-left: 18px; color: var(--text-secondary); }
.dish-summary { margin-bottom: 8px; }
.dish-advice { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.badge-ok { background: #f0fdf4; color: var(--success); padding: 4px 10px; border-radius: 4px; font-size: 12px; }
.badge-warn { background: #fef2f2; color: var(--danger); padding: 4px 10px; border-radius: 4px; font-size: 12px; }
.pagination-info { text-align: center; padding: 12px; color: var(--text-secondary); font-size: 13px; }

/* States */
.loading { text-align: center; padding: 5px; color: var(--text-secondary); }
.empty-state { text-align: center; padding: 20px; color: var(--text-secondary); }
.error-state { text-align: center; padding: 40px; color: var(--danger); }

/* —— Pulse dashboard (сводка ресторана) —— */
.dashboard {
  --pulse-accent: #3730a3;
  --pulse-accent-soft: #6366f1;
  --pulse-ink: #1e1b4b;
  --pulse-page-bg: #f5f7fa;
  --pulse-card: #ffffff;
  --pulse-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  --pulse-shadow-sm: 0 2px 12px rgba(15, 23, 42, 0.06);
  --pulse-radius: 12px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.dashboard .dashboard-content {
  background: var(--pulse-page-bg);
}
.dashboard-block--summary {
  background: transparent;
  border: none;
  box-shadow: none;
  padding-left: 20px;
  padding-right: 20px;
}
.dashboard-block--summary h2 {
  border-bottom-color: rgba(55, 48, 163, 0.2);
  color: var(--pulse-ink);
}
.dashboard .header-left h1 {
  color: var(--pulse-accent);
}
.dashboard .restaurant-tab.is-active {
  background: var(--pulse-accent);
  border-color: var(--pulse-accent);
  color: #fff;
}
.dashboard .restaurant-tab:hover {
  border-color: var(--pulse-accent-soft);
  color: var(--pulse-accent);
}

.pulse-redesign {
  display: flex;
  flex-direction: column;
  gap: 22px;
  line-height: 1.6;
}

.pulse-hero {
  background: var(--pulse-card);
  border-radius: var(--pulse-radius);
  padding: 18px 20px 20px;
  box-shadow: var(--pulse-shadow-sm);
}
.pulse-hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.pulse-period-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pulse-period-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}
.pulse-period-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--pulse-ink);
}
.pulse-status-badge {
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
}
.pulse-status--risky {
  background: #fef2f2;
  color: #b91c1c;
}
.pulse-status--ok {
  background: #fffbeb;
  color: #b45309;
}
.pulse-status--good {
  background: #ecfdf5;
  color: #047857;
}
.pulse-status--neutral {
  background: #f1f5f9;
  color: #475569;
}

.pulse-kpi-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: stretch;
}
.pulse-kpi-card {
  display: flex;
  flex-direction: column;
  flex: 1 1 calc(50% - 6px);
  min-width: 0;
  box-sizing: border-box;
  background: #f8fafc;
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: none;
  border: none;
}
@media (min-width: 640px) {
  .pulse-kpi-card:not(.pulse-kpi-card--lfl) {
    flex: 1 1 calc(33.333% - 8px);
  }
}
.pulse-kpi-card--lfl {
  flex: 1 1 100%;
  width: 100%;
  max-width: 100%;
  overflow: visible;
  min-width: 0;
}
.pulse-kpi-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 6px;
}
.pulse-kpi-value-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
}
.pulse-kpi-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--pulse-ink);
  letter-spacing: -0.02em;
}
.pulse-kpi-muted {
  font-size: 13px;
  color: #94a3b8;
}

.pulse-spark svg {
  display: block;
}
.pulse-spark--up path {
  stroke: #059669;
}
.pulse-spark--down path {
  stroke: #dc2626;
}
.pulse-spark--flat path {
  stroke: #94a3b8;
}

.pulse-meter {
  width: 36px;
  height: 10px;
  border-radius: 6px;
  background: #e2e8f0;
  position: relative;
  overflow: hidden;
}
.pulse-meter::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 6px;
  width: 65%;
}
.pulse-meter--ok::after {
  width: 42%;
  background: #22c55e;
}
.pulse-meter--warn::after {
  width: 58%;
  background: #eab308;
}
.pulse-meter--risk::after {
  width: 88%;
  background: #ef4444;
}
.pulse-meter--neutral::after {
  width: 50%;
  background: #94a3b8;
}

.pulse-ico {
  width: 22px;
  height: 22px;
  color: #64748b;
  flex-shrink: 0;
}
.pulse-kpi-card--risks .pulse-ico {
  color: #b45309;
}

.pulse-kpi-risks-drawer {
  margin-top: 8px;
  font-size: 12px;
}
.pulse-kpi-risks-drawer summary {
  cursor: pointer;
  color: var(--pulse-accent);
  font-weight: 600;
  list-style: none;
}
.pulse-kpi-risks-drawer summary::-webkit-details-marker {
  display: none;
}
.pulse-risk-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #475569;
  font-size: 13px;
  line-height: 1.5;
}
.pulse-risk-sev {
  color: #94a3b8;
  font-size: 12px;
}

.pulse-lfl-badges {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
  min-width: 0;
}
.pulse-kpi-card--lfl .pulse-lfl-badges {
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-width: 0;
}
@media (min-width: 520px) {
  .pulse-kpi-card--lfl .pulse-lfl-badges {
    flex-direction: row;
    flex-wrap: wrap;
  }
}
.pulse-lfl-badge {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  min-width: 0;
  flex: 1 1 auto;
  box-sizing: border-box;
}
@media (min-width: 520px) {
  .pulse-lfl-badge {
    flex: 1 1 calc(50% - 4px);
    max-width: calc(50% - 4px);
  }
}
.pulse-lfl-badge-label {
  font-weight: 500;
  color: #475569;
  font-size: 12px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.pulse-lfl-badge-val {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  white-space: nowrap;
}
.pulse-lfl-badge--down {
  background: #fef2f2;
  color: #b91c1c;
}
.pulse-lfl-badge--up {
  background: #ecfdf5;
  color: #047857;
}
.pulse-lfl-badge--flat {
  background: #f1f5f9;
  color: #475569;
}
.pulse-lfl-fallback {
  font-size: 13px;
  line-height: 1.6;
  color: #475569;
  margin: 0;
  width: 100%;
  flex: 1 1 100%;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.pulse-section {
  margin: 0;
}
.pulse-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin: 0 0 12px;
}

.quick-wins-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 720px) {
  .quick-wins-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1100px) {
  .quick-wins-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.quick-win-card {
  background: var(--pulse-card);
  border-radius: var(--pulse-radius);
  padding: 14px 16px;
  box-shadow: var(--pulse-shadow-sm);
}
.quick-win-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.quick-win-card .pulse-ico {
  color: var(--pulse-accent);
}
.quick-win-card--menu .pulse-ico {
  color: #7c3aed;
}
.quick-win-card--weather .pulse-ico {
  color: #0284c7;
}
.quick-win-card--staff .pulse-ico {
  color: #059669;
}
.quick-win-cat {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}
.quick-win-text {
  font-size: 13px;
  line-height: 1.55;
  color: #334155;
  margin: 0;
}

.pulse-todo-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pulse-todo-item {
  background: var(--pulse-card);
  border-radius: var(--pulse-radius);
  padding: 12px 14px;
  box-shadow: var(--pulse-shadow-sm);
  border-left: 4px solid #e2e8f0;
}
.pulse-todo-item.urgency-high {
  border-left-color: #ef4444;
}
.pulse-todo-item.urgency-medium {
  border-left-color: #eab308;
}
.pulse-todo-item.urgency-low {
  border-left-color: #22c55e;
}
.pulse-todo-head {
  font-weight: 500;
  font-size: 14px;
  line-height: 1.6;
  color: var(--pulse-ink);
}
.pulse-todo-head-text {
  display: block;
  margin-bottom: 4px;
}
.pulse-todo-expand {
  margin-top: 10px;
  font-size: 13px;
}
.pulse-todo-foot {
  margin-top: 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
}
.pulse-todo-foot .pulse-todo-expand {
  flex: 1;
  min-width: 0;
  margin-top: 0;
}
.pulse-todo-expand summary {
  cursor: pointer;
  color: var(--pulse-accent);
  font-weight: 600;
  list-style: none;
}

.pulse-todo-summary-text {
  flex: 1;
  min-width: 0;
}
.pulse-todo-expand summary::-webkit-details-marker {
  display: none;
}
.pulse-todo-body {
  margin-top: 10px;
}
.pulse-todo-detail-text {
  padding: 4px 0 0;
}
.pulse-todo-body .rec-text {
  font-weight: 400;
  font-size: 14px;
  line-height: 1.55;
}
.pulse-todo-body .rec-why,
.pulse-todo-body .rec-effect {
  font-size: 13px;
}

.pulse-more-recs {
  background: #f1f5f9;
  border-radius: 10px;
  padding: 4px 12px;
}
.pulse-more-recs summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: #475569;
  padding: 8px 4px;
  list-style: none;
}
.pulse-more-recs summary::-webkit-details-marker {
  display: none;
}
.pulse-footnote {
  font-size: 12px;
  color: #94a3b8;
  margin: 4px 0 0;
}

.daily-planner {
  background: var(--pulse-card);
  border-radius: var(--pulse-radius);
  padding: 16px 18px 18px;
  box-shadow: var(--pulse-shadow-sm);
}
.daily-planner-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.daily-planner-tab {
  min-width: 44px;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.daily-planner-tab:hover {
  background: #e2e8f0;
}
.daily-planner-tab.is-active {
  background: var(--pulse-accent);
  color: #fff;
}
.daily-planner-panel {
  display: none;
}
.daily-planner-panel.is-active {
  display: block;
}
.day-card {
  background: #f8fafc;
  border-radius: 10px;
  padding: 4px 4px 2px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.day-card-block {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 14px;
  line-height: 1.55;
}
.day-card-block:last-child {
  border-bottom: none;
}
.day-card-block--focus {
  padding-bottom: 14px;
}
.day-card-k {
  color: #64748b;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.3;
}
.day-card-v {
  color: #1e293b;
  font-weight: 500;
}
.day-card-v--num {
  font-size: 20px;
  font-weight: 700;
  color: var(--pulse-ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.day-card-focus {
  font-weight: 400;
  color: #334155;
  line-height: 1.65;
}
.day-card-muted {
  color: #94a3b8;
  font-size: 13px;
  font-style: italic;
}
.day-focus-list {
  margin: 0;
  padding-left: 1.15rem;
}
.day-focus-list li {
  margin-bottom: 8px;
  padding-left: 2px;
}
.day-focus-list li:last-child {
  margin-bottom: 0;
}
.day-focus-prose {
  font-size: 14px;
  line-height: 1.65;
  color: #334155;
}

.pulse-deep-dive {
  background: var(--pulse-card);
  border-radius: var(--pulse-radius);
  padding: 12px 16px;
  box-shadow: var(--pulse-shadow-sm);
}
.pulse-deep-dive summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  color: var(--pulse-accent);
  list-style: none;
}
.pulse-deep-dive summary::-webkit-details-marker {
  display: none;
}
.pulse-deep-inner {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.pulse-deep-block .pulse-deep-h {
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--pulse-ink);
}
.pulse-deep-ul {
  margin: 0;
  padding-left: 20px;
  color: #475569;
  font-size: 14px;
  line-height: 1.6;
}

.pulse-waiter-abc-module .pulse-waiter-abc-card {
  background: var(--pulse-card);
  border-radius: var(--pulse-radius);
  padding: 14px 16px 16px;
  box-shadow: var(--pulse-shadow-sm);
}
.pulse-waiter-abc-summary {
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.55;
  color: #475569;
}
.pulse-waiter-abc-module .pulse-waiter-abc-summary:last-child {
  margin-bottom: 0;
}
.pulse-waiter-abc-summary p {
  margin: 0;
}
.pulse-waiter-abc-lists {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.pulse-waiter-abc-group-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin: 0 0 6px;
}
.pulse-waiter-abc-ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pulse-waiter-abc-li {
  font-size: 13px;
  line-height: 1.5;
  color: #334155;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 8px;
}

.pulse-redesign .data-limitations-muted {
  background: #eef2f6;
  border: none;
  box-shadow: none;
}

.pulse-redesign .btn-primary {
  background: var(--pulse-accent);
}
.pulse-redesign .btn-primary:hover {
  background: var(--pulse-accent-soft);
}

/* Пульс: кнопки обратной связи и диалог */
.pulse-fb-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  padding: 0;
  margin: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  color: var(--pulse-accent);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.pulse-fb-btn:hover {
  background: #f8fafc;
  border-color: var(--pulse-accent-soft);
  box-shadow: 0 1px 4px rgba(99, 102, 241, 0.15);
}
.pulse-fb-ic {
  font-size: 14px;
  line-height: 1;
}
.pulse-fb-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  border-radius: 999px;
  background: transparent;
  color: transparent;
  pointer-events: none;
}
.pulse-fb-badge--on {
  background: var(--pulse-accent);
  color: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
}
.pulse-hero-fb {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  vertical-align: middle;
}
.pulse-section-title--row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.pulse-section-title--row .pulse-section-title {
  margin: 0;
}
.priority-card-head.pulse-fb-head {
  gap: 8px;
}
.recommendation-card .rec-priority-badge,
.recommendation-card .pulse-fb-btn {
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
}
.pulse-deep-h--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.advice-card-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.dish-detail-mod-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.summary-page-title-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.pulse-fb-dialog {
  max-width: min(28rem, calc(100vw - 1.5rem));
  width: 100%;
  padding: 0;
  border: none;
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
.pulse-fb-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}
.pulse-fb-dlg-card {
  background: #fff;
  border-radius: 16px;
  box-shadow:
    0 24px 48px rgba(15, 23, 42, 0.14),
    0 0 0 1px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}
.pulse-fb-dlg-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 1.1rem 1.15rem 0.75rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
}
.pulse-fb-dlg-head-text {
  min-width: 0;
}
.pulse-fb-dlg-kicker {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 4px;
}
.pulse-fb-dlg-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: #0f172a;
}
.pulse-fb-dlg-x {
  flex-shrink: 0;
  color: #64748b;
  font-size: 1rem;
  line-height: 1;
}
.pulse-fb-dlg-body {
  padding: 1rem 1.15rem 0.25rem;
}
.pulse-fb-dlg-list-label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}
.pulse-fb-dlg-list {
  max-height: 11rem;
  overflow-y: auto;
  margin-bottom: 1rem;
  padding: 2px;
  border-radius: 12px;
  background: #f1f5f9;
  scrollbar-width: thin;
}
.pulse-fb-dlg-empty {
  margin: 0;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.45;
  color: #64748b;
  text-align: center;
}
.pulse-fb-li {
  margin: 0 6px 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.pulse-fb-li:last-child {
  margin-bottom: 6px;
}
.pulse-fb-li-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.pulse-fb-li-who {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}
.pulse-fb-li-stars {
  font-size: 11px;
  letter-spacing: 1px;
  color: #f59e0b;
  flex-shrink: 0;
}
.pulse-fb-li-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: #475569;
  white-space: pre-wrap;
  word-break: break-word;
}
.pulse-fb-dlg-quote-wrap {
  margin-bottom: 1rem;
}
.pulse-fb-dlg-quote-box {
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.pulse-fb-dlg-quote {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 13px;
  line-height: 1.5;
  color: #334155;
  resize: none;
  font-family: inherit;
}
.pulse-fb-dlg-field {
  margin-bottom: 1rem;
}
.pulse-fb-dlg-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 8px;
}
.pulse-fb-rating-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pulse-fb-r-chip {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s,
    color 0.15s,
    transform 0.12s;
}
.pulse-fb-r-chip:hover {
  border-color: var(--pulse-accent-soft, #a5b4fc);
  color: var(--pulse-accent, #6366f1);
  background: #f8fafc;
}
.pulse-fb-r-chip--on {
  border-color: var(--pulse-accent, #6366f1);
  background: var(--pulse-accent, #6366f1);
  color: #fff;
  transform: scale(1.04);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}
.pulse-fb-dlg-rating-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.pulse-fb-dlg-comment {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  font-size: 14px;
  line-height: 1.45;
  font-family: inherit;
  color: #0f172a;
  background: #fff;
  resize: vertical;
  min-height: 5rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.pulse-fb-dlg-comment::placeholder {
  color: #94a3b8;
}
.pulse-fb-dlg-comment:focus {
  outline: none;
  border-color: var(--pulse-accent, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.pulse-fb-dlg-status {
  min-height: 1.25rem;
  margin: 0 0 4px;
  font-size: 13px;
  line-height: 1.4;
}
.pulse-fb-dlg-status--ok {
  color: #059669;
  font-weight: 500;
}
.pulse-fb-dlg-status--error {
  color: #dc2626;
  font-weight: 500;
}
.pulse-fb-dlg-foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 1.15rem 1.1rem;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  background: #fafbfc;
}
.pulse-fb-quote-fab {
  box-sizing: border-box;
  width: 30px;
  height: 30px;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: var(--pulse-accent, #6366f1);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease;
}
.pulse-fb-quote-fab:hover {
  transform: scale(1.06);
  box-shadow: 0 3px 12px rgba(99, 102, 241, 0.42);
}
.pulse-fb-quote-fab:active {
  transform: scale(0.98);
}

@media (max-width: 640px) {
  .loading,
  .empty-state {
    padding: 4px;
  }

  .pulse-todo-item {
    padding: 10px 4px;
  }

  .pulse-todo-head {
    font-size: 15px;
    line-height: 1.72;
    margin-bottom: 2px;
  }

  .pulse-todo-head-text {
    display: block;
    width: 100%;
    padding-right: 0;
    margin-bottom: 6px;
  }

  .pulse-todo-foot {
    gap: 10px;
    align-items: center;
    flex-direction: row;
  }

  .pulse-todo-foot .pulse-todo-expand {
    flex: 1;
    min-width: 0;
  }

  .pulse-todo-expand {
    margin-top: 6px;
  }

  .pulse-todo-expand summary {
    padding: 0;
  }

  .pulse-todo-body {
    margin-top: 6px;
  }

  .pulse-todo-foot .pulse-fb-btn {
    flex-shrink: 0;
    margin-top: 0;
    margin-left: 0;
  }

  .pulse-todo-body .rec-text {
    font-size: 13px;
    line-height: 1.5;
  }

  .pulse-todo-body .rec-context {
    margin-top: 4px;
  }

  .pulse-todo-body .rec-context-summary {
    font-size: 11px;
  }

  .pulse-todo-body .rec-why,
  .pulse-todo-body .rec-effect {
    font-size: 12px;
  }

  .pulse-todo-foot .pulse-fb-btn {
    width: 1.8rem;
    height: 1.8rem;
  }
}

/* —— Плавающий чат (oracul_public) —— */
.public-chat-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10050;
  font-family: inherit;
}

.public-chat-fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pulse-accent, var(--primary));
  color: #fff;
  box-shadow:
    0 10px 28px rgba(55, 48, 163, 0.35),
    0 2px 8px rgba(15, 23, 42, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.public-chat-fab:hover {
  transform: scale(1.05);
  box-shadow:
    0 12px 32px rgba(55, 48, 163, 0.42),
    0 2px 10px rgba(15, 23, 42, 0.14);
}
.public-chat-fab:focus-visible {
  outline: 3px solid rgba(99, 102, 241, 0.45);
  outline-offset: 2px;
}
.public-chat-fab-icon {
  width: 26px;
  height: 26px;
}

.public-chat-panel {
  position: absolute;
  right: 0;
  bottom: calc(56px + 14px);
  width: min(100vw - 32px, 420px);
  max-width: calc(100vw - 32px);
  /* Явная высота: иначе при height:auto flex-ребёнок .public-chat-messages с flex:1 схлопывается */
  height: min(72vh, 540px);
  min-height: 360px;
  max-height: min(85vh, 580px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  box-shadow:
    0 20px 50px rgba(15, 23, 42, 0.18),
    0 0 0 1px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.98);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}
.public-chat-panel.public-chat-panel--open,
.public-chat-panel:not([hidden]).public-chat-panel--open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.public-chat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #e8e8ee;
  background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
  flex-shrink: 0;
  min-width: 0;
}
.public-chat-head-text {
  min-width: 0;
  flex: 1;
}
.public-chat-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}
.public-chat-subtitle {
  margin: 4px 0 0;
  font-size: 11px;
  color: #64748b;
  font-family: ui-monospace, monospace;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.public-chat-head-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.public-chat-icon-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.public-chat-icon-btn:hover {
  background: #f1f5f9;
  color: #334155;
}

.public-chat-messages {
  flex: 1 1 auto;
  min-height: 12rem;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.public-chat-system {
  text-align: center;
  font-size: 13px;
  color: #64748b;
  padding: 16px 8px;
  line-height: 1.45;
}

.public-chat-msg {
  display: flex;
  min-width: 0;
  max-width: 100%;
}
.public-chat-msg--user {
  justify-content: flex-end;
}
.public-chat-msg--assistant {
  justify-content: flex-start;
}
.public-chat-bubble {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: 14px;
  padding: 8px 11px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.public-chat-msg--user .public-chat-bubble {
  max-width: 90%;
  margin-left: auto;
  background: var(--pulse-accent, var(--primary));
  color: #fff;
  border-bottom-right-radius: 4px;
}
.public-chat-msg--assistant .public-chat-bubble {
  max-width: 100%;
  background: #fff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
}
.public-chat-bubble-meta {
  font-size: 10px;
  opacity: 0.75;
  margin-bottom: 2px;
}
.public-chat-bubble-text {
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.public-chat-bubble-time {
  font-size: 10px;
  opacity: 0.65;
  margin-top: 4px;
  text-align: right;
}

.public-chat-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid #e8e8ee;
  background: #fff;
  flex-shrink: 0;
  min-width: 0;
}
.public-chat-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 44px;
  max-height: 120px;
}
.public-chat-input:focus {
  outline: none;
  border-color: var(--pulse-accent-soft, #a5b4fc);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.public-chat-send {
  align-self: flex-end;
  width: auto;
  min-width: 120px;
  padding: 8px 16px;
  font-size: 14px;
}

@media (max-width: 480px) {
  .public-chat-widget {
    right: 12px;
    bottom: 12px;
  }
  .public-chat-panel {
    width: min(100vw - 24px, 100%);
    height: min(70vh, 520px);
    min-height: 280px;
    max-height: min(88vh, 600px);
  }
  .public-chat-messages {
    min-height: 10rem;
  }
}
