/* R7b: หน้าเปิดดูรายงานที่แชร์ · ฟอนต์ระบบเท่านั้น (🚫 ฟอนต์จากภายนอก)
   สีคัดลอกจาก theme/tokens.ts (หน้าเว็บ import ไฟล์ TS ไม่ได้) — แก้ token ในแอปแล้วต้องแก้ที่นี่ด้วย
   ค่าคู่สีตัวอักษร/พื้นเหมือนในแอป จึงผ่าน contrast 4.5:1 ชุดเดียวกัน */
:root {
  --cream: #e1f2e8; /* colors.cream */
  --ink: #1e3328; /* colors.ink */
  --muted: #547161; /* colors.plumMuted */
  --green-text: #287956; /* colors.greenText */
  --line: #e7d9c7; /* colors.line */
  --white: #ffffff; /* colors.white */
  --error: #b3261e; /* colors.error */
  --health-bg: #fff4de; /* colors.uncertainBg */
  --health-border: #eec07a; /* healthNote.border */
  --health-text: #7a5a00; /* healthNote.text */
  --radius: 16px;
  --gap: 16px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans Thai', 'Leelawadee UI', Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

h1,
h2,
p,
ul {
  margin: 0;
}

h2 {
  font-size: 17px;
  line-height: 1.4;
}

ul {
  padding-left: 1.25em;
}

.brand {
  font-weight: 700;
  font-size: 20px;
  color: var(--green-text);
  letter-spacing: 0.01em;
}

.status,
.muted {
  color: var(--muted);
}

.honesty {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--green-text);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 14px;
}

.pet {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pet-name {
  font-size: 26px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.pet-meta,
.pet-period {
  color: var(--muted);
  font-size: 15px;
}

.card,
.health,
.urgent,
.notice {
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-wrap: anywhere;
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
}

.headline {
  font-size: 20px;
}

.health {
  background: var(--health-bg);
  border: 1px solid var(--health-border);
  color: var(--health-text);
}

.urgent {
  background: var(--error);
  color: var(--white);
}

.urgent-title {
  font-weight: 700;
  font-size: 18px;
}

.notice {
  background: var(--white);
  border: 1px solid var(--line);
}

.notice-main {
  font-weight: 600;
}

.notice-sub {
  color: var(--muted);
  font-size: 14px;
}

.tag {
  align-self: flex-start;
  background: var(--cream);
  color: var(--green-text);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 13px;
}

.log {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.log th,
.log td {
  text-align: left;
  vertical-align: top;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
}

.log th {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}

.nowrap {
  white-space: nowrap;
}

.mark-urgent {
  color: var(--error);
  font-weight: 600;
}

.expires {
  color: var(--muted);
  font-size: 14px;
}

.footer {
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

/* ── พิมพ์เก็บเข้าแฟ้ม: พื้นขาว ตัวดำ · การ์ดไม่ขาดกลางหน้า · แถบฉุกเฉินยังเห็นได้แม้เครื่องพิมพ์ไม่พิมพ์สีพื้น ── */
@media print {
  @page {
    margin: 16mm;
  }

  body {
    background: var(--white);
    color: #000000;
    font-size: 12pt;
  }

  .page {
    max-width: none;
    padding: 0;
    gap: 10pt;
  }

  .card,
  .health,
  .honesty,
  .notice {
    background: var(--white);
    border: 1px solid #999999;
    color: #000000;
    break-inside: avoid;
  }

  .urgent {
    background: var(--white);
    color: var(--error);
    border: 3px solid var(--error);
    break-inside: avoid;
  }

  .log tr {
    break-inside: avoid;
  }

  .log th,
  .log td {
    border-bottom: 1px solid #999999;
  }

  .brand,
  .pet-meta,
  .pet-period,
  .muted,
  .expires,
  .footer,
  .log th,
  .notice-sub,
  .tag {
    color: #000000;
  }

  .tag {
    background: none;
    border: 1px solid #999999;
  }
}
