* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--tg-theme-bg-color, #fff);
  color: var(--tg-theme-text-color, #000);
  height: 100vh;
  overflow: hidden;
}
#app { display: flex; flex-direction: column; height: 100vh; }
#content { flex: 1; overflow-y: auto; padding: 12px; padding-bottom: 70px; }
#tabs {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; background: var(--tg-theme-bg-color, #fff);
  border-top: 1px solid rgba(0,0,0,0.1);
  padding: 8px 0 env(safe-area-inset-bottom, 8px);
}
#tabs button {
  flex: 1; background: none; border: none; font-size: 22px;
  padding: 6px; cursor: pointer; opacity: 0.5; transition: opacity 0.15s;
}
#tabs button.active { opacity: 1; }
.card {
  background: var(--tg-theme-secondary-bg-color, #f5f5f5);
  border-radius: 12px; padding: 14px; margin-bottom: 10px;
}
.card .label { font-size: 12px; opacity: 0.6; margin-bottom: 4px; }
.card .value { font-size: 22px; font-weight: 600; }
.card .sub { font-size: 13px; opacity: 0.7; margin-top: 4px; }
.section-header { font-size: 13px; font-weight: 600; opacity: 0.5; text-transform: uppercase; letter-spacing: 0.5px; margin: 14px 0 8px; }
.item-card { background: var(--tg-theme-secondary-bg-color, #f5f5f5); border-radius: 10px; padding: 12px; margin-bottom: 8px; }
.action-btn {
  width: 100%; padding: 14px; background: var(--tg-theme-button-color, #007aff);
  color: var(--tg-theme-button-text-color, #fff); border: none; border-radius: 12px;
  font-size: 16px; font-weight: 600; cursor: pointer; margin-top: 12px;
}
.spike-bad { color: #e53e3e; }
.spike-ok { color: #38a169; }
.days-low { color: #e53e3e; font-weight: 600; }
.empty { text-align: center; opacity: 0.4; padding: 32px 0; }
.loading { text-align: center; opacity: 0.4; padding: 32px 0; }
.macros { display: flex; gap: 12px; margin-top: 6px; font-size: 13px; opacity: 0.8; }
.time-block { margin-bottom: 14px; }
.time-label { font-size: 13px; font-weight: 600; opacity: 0.5; margin-bottom: 6px; }
.sup-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid rgba(0,0,0,0.06); }
.sup-item:last-child { border-bottom: none; }
.cgm-row { display: flex; gap: 8px; font-size: 13px; margin-top: 4px; opacity: 0.8; }
.hypothesis { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(0,0,0,0.06); gap: 8px; }
.hypothesis span { flex: 1; font-size: 14px; }
.hypothesis button { font-size: 12px; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--tg-theme-button-color, #007aff); background: none; color: var(--tg-theme-button-color, #007aff); cursor: pointer; white-space: nowrap; }
.back-btn { background: none; border: none; color: var(--tg-theme-button-color, #007aff); font-size: 15px; cursor: pointer; padding: 0 0 12px; }
.recipe-body { font-size: 14px; line-height: 1.6; white-space: pre-wrap; margin-top: 12px; }
