/* Chép từ jc_nutrition_connector (public/widgets/src/shared/base.css), NUT-34, bỏ .wrap, header.head, .section-title và .prefresh.
   Thêm: [hidden], a, :focus-visible, .sr-only, .skip (trước đây lấy từ /styles.css của landing, app giờ tự đứng).
   Một trang là MỘT .panel: dòng header (.phead), rồi các section ngăn bằng vạch mảnh (.psec). */
@font-face {
  font-family: "Bowlby One";
  src: url("/fonts/BowlbyOne-Regular.woff2?v=nut33b") format("woff2");
  font-weight: 400;
  font-display: optional;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/IBMPlexMono-Regular-Latin1.woff2?v=nut33b") format("woff2");
  font-weight: 400;
  font-display: optional;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/IBMPlexMono-Medium-Latin1.woff2?v=nut33b") format("woff2");
  font-weight: 500 700;
  font-display: optional;
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html,
body {
  margin: 0;
  padding: 0;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  color: var(--text);
  background: var(--bg);
  font-family: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  font-family: "Bowlby One", "Arial Black", Impact, sans-serif;
  font-weight: 400;
}
/* Link ghi bằng màu chữ, gạch chân màu accent: --accent trên --bg chỉ đạt 4.47:1 ở theme sáng. */
a {
  color: var(--text);
  text-decoration-color: var(--accent);
  text-underline-offset: 0.2em;
}
:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: absolute;
  left: 12px;
  top: -4rem;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  z-index: 10;
}
.skip:focus {
  top: 8px;
}

/* Bề mặt dùng chung: mọi card là cùng một fill, viền, bo góc, bóng. */
.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---- Vỏ gọn: MỘT card, một dòng header, các section ngăn bằng vạch mảnh ---- */
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

/* Dòng header. Điện thoại: tên và .pmeta chung hàng một, .psub xuống hàng hai. Từ 560px cả ba nằm một dòng, .psub nhận phần dư. */
.phead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
}
.phead.mid {
  align-items: center;
}
.ptitle {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
/* NUT-159 (uma P2-6): h1 nhận focus bằng code (sau Accept notice). Chỉ viền khi bàn phím, không bao giờ tô nền. */
.ptitle[tabindex]:focus {
  outline: none;
}
.ptitle[tabindex]:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}
.pmeta {
  margin-left: auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.psub {
  order: 3;
  flex: 1 1 100%;
  min-width: 0;
  font-size: var(--fs-small);
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* NUT-155: dưới 360px dòng phụ ("16 Sept to 15 Oct · 14 of 30 days logged") xuống dòng thay vì bị cắt. */
@media (max-width: 359px) {
  .psub {
    white-space: normal;
  }
}

/* Một section ngăn bằng vạch mảnh bên trong panel. */
.psec {
  padding-top: 9px;
  border-top: 1px solid var(--panel-border);
}

@media (min-width: 560px) {
  .panel {
    padding: 12px 16px;
    gap: 10px;
  }
  .psub {
    order: 0;
    flex: 1 1 auto;
  }
  .psec {
    padding-top: 10px;
  }
}

/* Trạng thái rỗng thay cho panel khi không có gì để vẽ. */
.empty {
  text-align: center;
  color: var(--text-dim);
  padding: 40px 20px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.empty p + p {
  margin-top: 4px;
}
