:root {
  --brand-primary: #6b43ee;
  --brand-accent: #07dfdf;
  --text-secondary: #8e8e93;
  --stroke: #e5e5e5;
  --bg-violet: #f1edfe;
  --bg-mint: #d7fce9;
  --bg-neutral: #f4f4f4;
  --tag-success: #34c759;
  --tag-info: #007aff;
  --tag-warning: #ff9500;
  --tag-danger: #ff3b30;
  --ink: #23213f;
  --ink-soft: #6c6a86;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: rgba(255, 255, 255, 0.98);
  --shadow-lg: 0 28px 60px rgba(88, 63, 174, 0.12);
  --shadow-md: 0 16px 34px rgba(88, 63, 174, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(107, 67, 238, 0.14), transparent 20%),
    radial-gradient(circle at 92% 10%, rgba(7, 223, 223, 0.12), transparent 22%),
    linear-gradient(180deg, #fbfaff 0%, var(--bg-neutral) 100%);
  font-family: "Aptos", "Segoe UI Variable", "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.ambient {
  position: absolute;
  border-radius: 999px;
  filter: blur(18px);
  pointer-events: none;
}

.ambient-violet {
  top: -7rem;
  right: -4rem;
  width: 22rem;
  height: 22rem;
  background: rgba(107, 67, 238, 0.18);
}

.ambient-cyan {
  left: -7rem;
  top: 35%;
  width: 19rem;
  height: 19rem;
  background: rgba(7, 223, 223, 0.14);
}

.ambient-soft {
  right: 10%;
  bottom: -5rem;
  width: 18rem;
  height: 18rem;
  background: rgba(241, 237, 254, 0.9);
}

.container {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(229, 229, 229, 0.8);
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(16px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 84px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(107, 67, 238, 0.12), rgba(7, 223, 223, 0.12));
}

.brand-mark svg {
  width: 40px;
  height: 40px;
}

.brand-copy {
  display: grid;
  gap: 4px;
}

.brand-copy strong {
  font-size: 1.9rem;
  line-height: 1;
  letter-spacing: -0.04em;
  text-transform: lowercase;
}

.brand-copy small {
  color: var(--ink-soft);
}

.header-tag,
.hero-badge,
.status-pill,
.request-chip,
.tag,
.confidence-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
}

.header-tag,
.hero-badge,
.status-pill,
.request-chip {
  background: rgba(107, 67, 238, 0.08);
  color: var(--brand-primary);
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  padding: 36px 0 28px;
  align-items: center;
}

.hero h1 {
  margin: 18px 0 14px;
  font-size: clamp(2.6rem, 5vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.hero-text {
  max-width: 56ch;
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.04rem;
  line-height: 1.75;
}

.hero-panel {
  display: grid;
  gap: 16px;
}

.hero-card,
.card,
.dashboard-card,
.recommendations-card {
  border: 1px solid rgba(255, 255, 255, 0.82);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.hero-card {
  padding: 22px;
  border-radius: var(--radius-xl);
}

.hero-card-label,
.section-kicker,
.card-label,
.detail-title,
.card-note {
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-card strong {
  display: block;
  margin-top: 12px;
  font-size: 1.2rem;
  line-height: 1.35;
}

.hero-card p,
.upload-copy span,
.upload-copy small,
.cta-help,
.empty-state p,
.dashboard-card p,
.detail-block p,
.site-footer p {
  color: var(--ink-soft);
}

.hero-card p {
  margin: 10px 0 0;
  line-height: 1.65;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  color: white;
}

.tag-success {
  background: var(--tag-success);
}

.tag-info {
  background: var(--tag-info);
}

.tag-warning {
  background: var(--tag-warning);
}

.tag-danger {
  background: var(--tag-danger);
}

.analysis-layout {
  display: grid;
  gap: 24px;
  padding-bottom: 44px;
}

.workspace {
  display: grid;
  gap: 24px;
  padding-bottom: 44px;
}

.card {
  padding: 26px;
  border-radius: var(--radius-xl);
}

.section-header,
.card-top,
.detail-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.section-header h2 {
  margin: 10px 0 0;
  font-size: 1.9rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.analyze-form {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.context-grid {
  display: grid;
  gap: 16px;
}

.context-group {
  display: grid;
  gap: 10px;
}

.context-title {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 700;
}

.context-options,
.hint-chips,
.results-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.context-chip,
.hint-chip,
.example-chip,
.empty-pill,
.driver-chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(107, 67, 238, 0.08);
  color: var(--brand-primary);
  font-weight: 700;
}

.context-chip {
  cursor: pointer;
}

.context-chip.is-active {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  color: white;
}

.hint-field {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--stroke);
  border-radius: 22px;
  background: var(--surface-strong);
}

.field-heading {
  display: grid;
  gap: 8px;
}

.field-heading strong {
  font-size: 1rem;
  line-height: 1.4;
}

.hint-field textarea {
  width: 100%;
  min-height: 104px;
  padding: 14px 16px;
  border: 1px solid rgba(107, 67, 238, 0.14);
  border-radius: 18px;
  background: white;
  color: var(--ink);
  resize: vertical;
}

.hint-field textarea:focus {
  outline: 2px solid rgba(107, 67, 238, 0.16);
  border-color: rgba(107, 67, 238, 0.3);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.upload-zone {
  display: grid;
  justify-items: center;
  gap: 16px;
  min-height: 280px;
  padding: 28px;
  border: 1.5px dashed rgba(107, 67, 238, 0.28);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(241, 237, 254, 0.88)),
    radial-gradient(circle at top, rgba(7, 223, 223, 0.12), transparent 40%);
  text-align: center;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.upload-zone:hover,
.upload-zone.is-dragover {
  transform: translateY(-2px);
  border-color: rgba(107, 67, 238, 0.5);
  box-shadow: var(--shadow-md);
}

.upload-icon {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(107, 67, 238, 0.18), rgba(7, 223, 223, 0.2));
}

.upload-icon span {
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  box-shadow: 0 14px 24px rgba(107, 67, 238, 0.22);
}

.upload-copy strong {
  display: block;
  font-size: 1.12rem;
  line-height: 1.45;
}

.upload-copy span,
.upload-copy small {
  display: block;
  margin-top: 8px;
}

.preview-card {
  display: grid;
  grid-template-columns: 136px 1fr;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--stroke);
  border-radius: 22px;
  background: var(--surface-strong);
}

.preview-card img {
  width: 136px;
  height: 136px;
  object-fit: cover;
  border-radius: 18px;
}

.preview-copy strong {
  display: block;
  margin: 10px 0 4px;
  font-size: 1.05rem;
}

.preview-copy small {
  color: var(--text-secondary);
}

.preview-actions,
.cta-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.preview-actions {
  margin-top: 16px;
}

.primary-button,
.ghost-button {
  border: 0;
  cursor: pointer;
  transition: transform 150ms ease, opacity 150ms ease;
}

.primary-button {
  min-width: 164px;
  min-height: 56px;
  padding: 0 24px;
  border-radius: 16px;
  color: white;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  box-shadow: 0 18px 30px rgba(107, 67, 238, 0.24);
  font-weight: 800;
}

.primary-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.ghost-button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  background: rgba(107, 67, 238, 0.08);
  color: var(--brand-primary);
  font-weight: 700;
}

.danger-button {
  background: rgba(255, 59, 48, 0.1);
  color: var(--tag-danger);
}

.primary-button:hover:not(:disabled),
.ghost-button:hover {
  transform: translateY(-1px);
}

.cta-help {
  margin: 0;
  line-height: 1.6;
}

.empty-state,
.loading-state {
  display: grid;
  justify-items: center;
  min-height: 420px;
  text-align: center;
}

.empty-icon {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(107, 67, 238, 0.12), rgba(7, 223, 223, 0.14));
}

.empty-icon::after {
  content: "";
  position: absolute;
  inset: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
}

.empty-state h3,
.loading-state p {
  margin: 18px 0 8px;
}

.empty-state p {
  max-width: 44ch;
  line-height: 1.75;
}

.loader-line {
  width: min(520px, 100%);
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(107, 67, 238, 0.08), rgba(7, 223, 223, 0.28), rgba(107, 67, 238, 0.08));
  background-size: 200% 100%;
  animation: shimmer 1.8s linear infinite;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: min(520px, 100%);
  margin-top: 18px;
}

.skeleton-grid span {
  height: 96px;
  border-radius: 20px;
  background: rgba(229, 229, 229, 0.95);
}

.error-banner {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 59, 48, 0.12);
  color: #b0322a;
  font-weight: 700;
}

.results {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.model-meta {
  padding-top: 4px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.5;
  text-align: right;
}

.results-actions {
  justify-content: flex-start;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

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

.macro-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.nutrition-basis-note {
  margin: -4px 2px 2px;
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.6;
}

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

.dashboard-card,
.recommendations-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  box-shadow: var(--shadow-md);
}

.dashboard-card {
  min-height: 168px;
}

.dish-card {
  background:
    linear-gradient(135deg, rgba(241, 237, 254, 0.94), rgba(255, 255, 255, 0.98)),
    white;
}

.dish-card h3 {
  margin: 14px 0 10px;
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.dish-card p {
  margin: 0;
  line-height: 1.75;
}

.dish-summary {
  display: grid;
  gap: 12px;
}

.summary-stack {
  display: grid;
  gap: 12px;
}

.dish-summary p {
  margin: 0;
  line-height: 1.7;
}

.summary-stack p {
  margin: 0;
  line-height: 1.7;
}

.dish-summary strong {
  color: var(--ink);
}

.summary-stack strong {
  color: var(--ink);
}

.dish-summary .summary-note {
  color: var(--text-secondary);
}

.confidence-badge {
  background: rgba(107, 67, 238, 0.1);
  color: var(--brand-primary);
}

.ingredients-card {
  background: linear-gradient(135deg, rgba(215, 252, 233, 0.72), rgba(255, 255, 255, 0.96));
}

.card-helper {
  margin: 14px 0 0;
  max-width: 70ch;
  line-height: 1.65;
}

.calories-card {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  min-height: 136px;
  background: linear-gradient(135deg, rgba(255, 149, 0, 0.12), rgba(255, 255, 255, 0.98));
}

.metric-card {
  display: grid;
  gap: 14px;
}

.metric-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.metric-head small {
  display: block;
  margin-top: 8px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.metric-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 149, 0, 0.14);
  color: #b86c00;
  font-size: 0.84rem;
  font-weight: 700;
}

.metric-scale {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(107, 67, 238, 0.08);
}

.metric-scale-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  transition: width 400ms ease;
}

.calories-scale-fill {
  background: linear-gradient(90deg, #ff9500, #ffcc00);
}

.glycemic-scale-fill {
  background: linear-gradient(90deg, #34c759, #ff9500, #ff3b30);
}

.calories-copy {
  display: grid;
  gap: 10px;
  max-width: 28ch;
}

.glycemic-card {
  display: grid;
  gap: 16px;
  background: linear-gradient(135deg, rgba(7, 223, 223, 0.1), rgba(255, 255, 255, 0.98));
}

.glycemic-copy {
  display: grid;
  gap: 10px;
}

.metric-helper {
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.5;
}

.glycemic-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.glycemic-badge-low {
  background: rgba(52, 199, 89, 0.14);
  color: #1c8d42;
}

.glycemic-badge-medium {
  background: rgba(255, 149, 0, 0.14);
  color: #b86c00;
}

.glycemic-badge-high {
  background: rgba(255, 59, 48, 0.14);
  color: #b0322a;
}

.glycemic-card strong {
  display: block;
  font-size: clamp(2.2rem, 4vw, 3rem);
  line-height: 1;
}

.glycemic-note {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 59, 48, 0.12);
}

.glycemic-note p {
  margin: 0;
  line-height: 1.7;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sources-block {
  display: grid;
  gap: 10px;
}

.source-title {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
}

.source-link {
  display: grid;
  gap: 4px;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(107, 67, 238, 0.08);
  color: var(--brand-primary);
  text-decoration: none;
}

.source-link strong {
  color: inherit;
  font-size: 0.92rem;
}

.source-link span {
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.45;
}

.source-link:hover {
  background: rgba(107, 67, 238, 0.14);
}

.calories-card strong,
.macro-card strong {
  display: block;
  margin: 14px 0 8px;
  font-size: clamp(1.9rem, 2vw, 2.4rem);
  line-height: 1;
}

.calories-card strong {
  margin: 0;
  font-size: clamp(2.4rem, 4vw, 3.3rem);
  text-align: right;
}

.ingredients-chips,
.alternative-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.ingredient-chip,
.alternative-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font-weight: 700;
}

.ingredient-chip {
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
}

.ingredient-chip small {
  color: var(--text-secondary);
}

.alternative-chip {
  background: rgba(107, 67, 238, 0.08);
  color: var(--brand-primary);
}

.macro-card {
  min-height: 190px;
}

.mini-card {
  min-height: 180px;
  background: linear-gradient(135deg, rgba(241, 237, 254, 0.72), rgba(255, 255, 255, 0.96));
}

.mini-card strong {
  display: block;
  margin-top: 14px;
  font-size: 1.35rem;
  line-height: 1.2;
}

.mini-card p {
  margin: 12px 0 0;
  line-height: 1.65;
}

.info-card {
  min-height: 220px;
}

.suitability-list,
.risk-list,
.driver-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.status-card {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
}

.status-card p {
  margin: 10px 0 0;
  line-height: 1.6;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-badge-good {
  background: rgba(52, 199, 89, 0.14);
  color: #1c8d42;
}

.status-badge-warn,
.status-badge-medium {
  background: rgba(255, 149, 0, 0.14);
  color: #b86c00;
}

.status-badge-high {
  background: rgba(255, 59, 48, 0.14);
  color: #b0322a;
}

.status-badge-low {
  background: rgba(0, 122, 255, 0.12);
  color: #0063cf;
}

.macro-card-protein {
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.12), rgba(255, 255, 255, 0.96));
}

.macro-card-fat {
  background: linear-gradient(135deg, rgba(255, 149, 0, 0.14), rgba(255, 255, 255, 0.96));
}

.macro-card-carbs {
  background: linear-gradient(135deg, rgba(52, 199, 89, 0.14), rgba(255, 255, 255, 0.96));
}

.macro-card-protein .macro-bar {
  background: rgba(0, 122, 255, 0.14);
}

.macro-card-protein .macro-bar span {
  background: linear-gradient(90deg, #007aff, #5ac8fa);
}

.macro-card-fat .macro-bar {
  background: rgba(255, 149, 0, 0.14);
}

.macro-card-fat .macro-bar span {
  background: linear-gradient(90deg, #ff9500, #ffcc00);
}

.macro-card-carbs .macro-bar {
  background: rgba(52, 199, 89, 0.14);
}

.macro-card-carbs .macro-bar span {
  background: linear-gradient(90deg, #34c759, #30d158);
}

.macro-bar {
  margin-top: 16px;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(107, 67, 238, 0.08);
}

.macro-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
  transition: width 400ms ease;
}

.recommendations-card {
  background: linear-gradient(135deg, rgba(215, 252, 233, 0.54), rgba(255, 255, 255, 0.96));
}

.recipe-card {
  display: grid;
  gap: 18px;
  background: linear-gradient(135deg, rgba(241, 237, 254, 0.88), rgba(255, 255, 255, 0.98));
}

.recipe-header h3 {
  margin: 8px 0 0;
  font-size: clamp(1.55rem, 2.6vw, 2.2rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.recipe-link-button {
  text-decoration: none;
}

.recipe-source,
.recipe-summary,
.recipe-match-note {
  margin: 0;
  line-height: 1.7;
}

.recipe-source {
  color: var(--brand-primary);
  font-weight: 700;
}

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

.recipe-panel {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
}

.recipe-list,
.recipe-steps {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding-left: 20px;
}

.recipe-list li,
.recipe-steps li {
  line-height: 1.65;
  color: var(--ink);
}

.recommendation-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.recommendation-list li {
  position: relative;
  padding: 14px 16px 14px 42px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  line-height: 1.6;
}

.recommendation-list li::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 19px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--tag-success);
}

.detail-row {
  gap: 16px;
}

.detail-block {
  flex: 1;
  padding: 18px;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.detail-block-muted {
  background: rgba(244, 244, 244, 0.88);
}

.detail-block p {
  margin: 12px 0 0;
  line-height: 1.7;
}

.site-footer {
  border-top: 1px solid rgba(229, 229, 229, 0.85);
  background: rgba(255, 255, 255, 0.62);
}

.examples-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.compare-card {
  display: grid;
  gap: 18px;
}

.compare-header {
  align-items: center;
}

.compare-header h3 {
  margin: 8px 0 0;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.compare-header small {
  color: var(--ink-soft);
  line-height: 1.5;
}

.compare-uploader {
  display: grid;
  gap: 14px;
}

.compare-upload {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1.5px dashed rgba(107, 67, 238, 0.28);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.74);
  cursor: pointer;
}

.compare-upload strong {
  font-size: 1rem;
}

.compare-upload span {
  color: var(--ink-soft);
}

.compare-preview {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.compare-preview img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 14px;
}

.compare-preview small {
  display: block;
  margin-top: 8px;
  color: var(--ink-soft);
}

.compare-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.compare-results {
  display: grid;
  gap: 16px;
}

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

.compare-side {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
}

.compare-title {
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.compare-side strong {
  display: block;
  margin-top: 12px;
  font-size: 1.25rem;
  line-height: 1.35;
}

.compare-side p {
  margin: 12px 0 0;
  line-height: 1.6;
}

.compare-summary {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.compare-summary li {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  line-height: 1.6;
}

.history-card {
  display: grid;
  gap: 18px;
}

.history-empty {
  color: var(--ink-soft);
  line-height: 1.7;
}

.history-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.history-item {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-md);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.history-item strong {
  font-size: 1rem;
  line-height: 1.45;
}

.history-item small,
.history-time {
  color: var(--ink-soft);
}

.history-item:hover {
  transform: translateY(-1px);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 28px;
}

.footer-inner span {
  font-weight: 800;
}

.footer-inner p {
  max-width: 62ch;
  margin: 0;
  text-align: right;
  line-height: 1.65;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (max-width: 1120px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .mini-grid,
  .insight-grid,
  .macro-grid,
  .recipe-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .container {
    width: min(100% - 20px, 100%);
  }

  .header-inner,
  .footer-inner,
  .detail-row,
  .cta-row,
  .action-row,
  .status-row,
  .metric-head,
  .compare-grid {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header {
    position: static;
  }

  .hero {
    padding-top: 24px;
  }

  .hero h1 {
    font-size: 2.7rem;
  }

  .card {
    padding: 20px;
  }

  .preview-card {
    grid-template-columns: 1fr;
  }

  .preview-card img {
    width: 100%;
    height: 220px;
  }

  .compare-preview {
    grid-template-columns: 1fr;
  }

  .compare-preview img {
    width: 100%;
    height: 220px;
  }

  .calories-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .calories-card strong {
    text-align: left;
  }

  .glycemic-badge {
    white-space: normal;
  }

  .skeleton-grid,
  .macro-grid,
  .mini-grid,
  .insight-grid,
  .history-list,
  .recipe-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: white;
  }

  .ambient,
  .site-header,
  .site-footer,
  .upload-card,
  .history-card,
  .compare-card,
  .results-actions {
    display: none !important;
  }

  .container {
    width: 100%;
  }

  .card,
  .dashboard-card,
  .recommendations-card,
  .detail-block {
    box-shadow: none;
    border: 1px solid #d9d9d9;
    background: white !important;
  }
}
