/* ============================================================
   赤ずきん — Pet Health App
   Premium vet clinic aesthetic. Two themes: forest / navy.
   Built on Peace Flat tokens, extended with deep green.
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Zen+Kaku+Gothic+New:wght@400;500;700;900&family=Inter:wght@400;500;600;700&family=Cormorant+Garamond:ital,wght@0,500;0,600;1,500&display=swap");

/* ===== Theme: Forest (Variation A) ===== */
.theme-forest {
  --bg: #F4EFE3;
  --bg-deep: #ECE5D2;
  --surface: #FFFFFF;
  --surface-tint: #FBF8F0;
  --surface-soft: #F2EEDF;

  --ink: #15201A;
  --ink-2: #2E3E36;
  --muted: #6B7A72;
  --subtle: #94A39C;
  --border: #E6DECB;
  --border-strong: #D4C9AE;
  --divider: #ECE4D0;

  --primary: #1F4D3F;
  --primary-2: #2D6B57;
  --primary-3: #5BA088;
  --primary-soft: #E6EFEA;
  --primary-tint: #F1F6F2;
  --primary-deep: #143329;

  --accent: #B04545;        /* 赤ずきん accent — used sparingly */
  --accent-soft: #F5E5E5;
  --gold: #B89366;
  --gold-soft: #F2E8D7;

  --on-primary: #F4EFE3;
  --on-primary-muted: #BFD4CA;

  --success: #2F7D5B;
  --warning: #B88420;
  --info: #2A5C8A;

  --shadow-clay-1: 0 1px 2px rgba(15, 32, 26, 0.05);
  --shadow-clay-2: 0 4px 12px rgba(15, 32, 26, 0.08), 0 1px 2px rgba(15, 32, 26, 0.04);
  --shadow-clay-3: 0 10px 28px rgba(15, 32, 26, 0.10), 0 2px 4px rgba(15, 32, 26, 0.06);
  --shadow-clay-deep: 0 18px 40px rgba(15, 32, 26, 0.14);
}

/* ===== Theme: Navy (Variation B) ===== */
.theme-navy {
  --bg: #F1ECDF;
  --bg-deep: #E7DFCB;
  --surface: #FFFFFF;
  --surface-tint: #F9F6EE;
  --surface-soft: #EFEADC;

  --ink: #0F1F38;
  --ink-2: #1E365E;
  --muted: #4A5A75;
  --subtle: #6F7F95;
  --border: #E0D9C8;
  --border-strong: #C9BEA5;
  --divider: #EBE4D2;

  --primary: #1E365E;
  --primary-2: #2A4575;
  --primary-3: #5B78AA;
  --primary-soft: #E2E8F0;
  --primary-tint: #F1F4F9;
  --primary-deep: #0F1F38;

  --accent: #8C3535;         /* 赤ずきんのフード */
  --accent-soft: #F5E5E5;
  --gold: #B89366;
  --gold-soft: #F2E8D7;

  --on-primary: #FBF8F2;
  --on-primary-muted: #B7C2D2;

  --success: #2F7D5B;
  --warning: #B88420;
  --info: #2A5C8A;

  --shadow-clay-1: 0 1px 2px rgba(15, 31, 56, 0.06);
  --shadow-clay-2: 0 4px 12px rgba(15, 31, 56, 0.10), 0 1px 2px rgba(15, 31, 56, 0.05);
  --shadow-clay-3: 0 10px 28px rgba(15, 31, 56, 0.12), 0 2px 4px rgba(15, 31, 56, 0.06);
  --shadow-clay-deep: 0 18px 40px rgba(15, 31, 56, 0.16);
}

/* ============================================================
   Mobile canvas reset
   ============================================================ */
.scr {
  width: 390px;
  height: 844px;
  overflow: hidden;
  background: var(--bg);
  font-family: "Zen Kaku Gothic New", "Noto Sans JP", -apple-system, sans-serif;
  color: var(--ink);
  font-feature-settings: "palt" 1, "pkna" 1;
  -webkit-font-smoothing: antialiased;
  position: relative;
  display: flex;
  flex-direction: column;
  letter-spacing: -0.01em;
}
.scr *, .scr *::before, .scr *::after { box-sizing: border-box; }
.scr h1, .scr h2, .scr h3, .scr h4, .scr p { margin: 0; }
.scr button { font-family: inherit; cursor: pointer; border: 0; background: none; padding: 0; color: inherit; }

/* ============================================================
   Status bar (iOS-ish)
   ============================================================ */
.statusbar {
  height: 50px;
  padding: 0 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: 8px;
  font-family: "Inter", -apple-system, sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  letter-spacing: 0.01em;
  flex-shrink: 0;
}
.statusbar.on-dark { color: var(--on-primary); }
.statusbar .sb-r { display: flex; align-items: center; gap: 6px; }
.statusbar svg { display: block; }

/* ============================================================
   Scroll body
   ============================================================ */
.scrollbody {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.scrollbody::-webkit-scrollbar { display: none; }

/* ============================================================
   Bottom tabbar
   ============================================================ */
.tabbar {
  flex-shrink: 0;
  height: 86px;
  padding: 8px 12px 24px;
  background: var(--surface);
  border-top: 1px solid var(--divider);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}
.tabbar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.tabbar-item.active { color: var(--primary); }
.tabbar-item .ti-icon-wrap {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
}

/* ============================================================
   Type scale (mobile)
   ============================================================ */
.t-display { font-size: 32px; font-weight: 700; line-height: 1.15; letter-spacing: -0.025em; }
.t-h1 { font-size: 26px; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
.t-h2 { font-size: 21px; font-weight: 700; line-height: 1.25; letter-spacing: -0.015em; }
.t-h3 { font-size: 17px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
.t-h4 { font-size: 15px; font-weight: 600; line-height: 1.35; }
.t-body { font-size: 14px; line-height: 1.55; }
.t-body-sm { font-size: 13px; line-height: 1.5; }
.t-caption { font-size: 12px; line-height: 1.4; color: var(--muted); }
.t-micro { font-size: 10px; line-height: 1.3; }
.t-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: "Inter", sans-serif;
}
.t-num { font-family: "Inter", sans-serif; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.t-serif { font-family: "Cormorant Garamond", serif; font-style: italic; }

.tx-primary { color: var(--primary); }
.tx-muted { color: var(--muted); }
.tx-subtle { color: var(--subtle); }
.tx-accent { color: var(--accent); }
.tx-gold { color: var(--gold); }
.tx-on-dark { color: var(--on-primary); }

/* ============================================================
   Buttons / pills
   ============================================================ */
.btn {
  height: 52px;
  padding: 0 24px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--primary-2), var(--primary));
  color: var(--on-primary);
  box-shadow: var(--shadow-clay-2), inset 0 1px 0 rgba(255,255,255,0.12);
}
.btn-ghost {
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--border);
}
.btn-accent {
  background: linear-gradient(180deg, #C75A5A, var(--accent));
  color: #FFF8F1;
  box-shadow: var(--shadow-clay-2);
}
.btn-block { width: 100%; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--primary-soft);
  color: var(--primary);
  white-space: nowrap;
}
.pill-gold { background: var(--gold-soft); color: var(--gold); }
.pill-accent { background: var(--accent-soft); color: var(--accent); }
.pill-success { background: #E1EFE8; color: #2F7D5B; }
.pill-warning { background: #F6EDD8; color: #B88420; }
.pill-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--surface);
  border-radius: 20px;
  padding: 16px;
  box-shadow: var(--shadow-clay-2);
}
.card-flat {
  background: var(--surface);
  border-radius: 16px;
  padding: 14px;
  border: 1px solid var(--border);
}
.card-tint {
  background: var(--surface-tint);
  border-radius: 16px;
  padding: 14px;
  border: 1px solid var(--border);
}
.card-primary {
  background: linear-gradient(160deg, var(--primary-2), var(--primary));
  color: var(--on-primary);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow-clay-3);
  position: relative;
  overflow: hidden;
}

/* Section heading inside screens */
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  margin-bottom: 12px;
}
.sec-head .sec-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.005em;
}
.sec-head .sec-link {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* Top bar (in-screen) */
.topbar {
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.topbar-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.topbar-circle-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-clay-1);
  border: 1px solid var(--border);
}

/* Brand mark line */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand .brand-jp {
  font-size: 16px;
}
.brand .brand-en {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 0;
}

/* Utility */
.flex-row { display: flex; flex-direction: row; }
.flex-col { display: flex; flex-direction: column; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.px-5 { padding-left: 20px; padding-right: 20px; }

/* ============================================================
   Score ring (for DNA / health score)
   ============================================================ */
.score-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.score-ring svg { display: block; }
.score-ring .score-inner {
  position: absolute;
  text-align: center;
}

/* ============================================================
   Bar chart (weekly weight)
   ============================================================ */
.minibars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 56px;
}
.minibars .mb {
  flex: 1;
  background: linear-gradient(180deg, var(--primary-3), var(--primary-2));
  border-radius: 4px 4px 2px 2px;
  position: relative;
  opacity: 0.55;
}
.minibars .mb.active { opacity: 1; box-shadow: var(--shadow-clay-1); }

/* ============================================================
   Article tile
   ============================================================ */
.article-tile {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  padding: 12px;
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--border);
  align-items: center;
}
.article-thumb {
  width: 64px; height: 64px;
  border-radius: 12px;
  background: var(--surface-soft);
  display: flex; align-items: center; justify-content: center;
}

/* ============================================================
   Subscription radios
   ============================================================ */
.sub-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--surface);
}
.sub-opt.active { border-color: var(--primary); background: var(--primary-tint); }

/* ============================================================
   Risk row (DNA)
   ============================================================ */
.risk-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--divider);
}
.risk-row:last-child { border-bottom: 0; }
.risk-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--surface-soft);
  margin-top: 4px;
  overflow: hidden;
}
.risk-bar > div {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary-3), var(--primary));
}
.risk-bar > div.warn {
  background: linear-gradient(90deg, #E1C28A, var(--gold));
}
.risk-bar > div.bad {
  background: linear-gradient(90deg, #D67B7B, var(--accent));
}

/* ============================================================
   Hood ribbon — decorative motif (赤ずきん hood)
   ============================================================ */
.hood-ribbon {
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--accent), #5B1B1B);
  clip-path: polygon(100% 0, 0 0, 100% 100%);
  opacity: 0.95;
}

/* Image placeholder for pet photo */
.pet-photo {
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  position: relative;
  background: linear-gradient(160deg, var(--surface-tint), var(--surface-soft));
  border: 3px solid var(--surface);
  box-shadow: var(--shadow-clay-2);
}

/* List item */
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}
.list-row + .list-row { border-top: 1px solid var(--divider); }

/* Tab segmented */
.seg {
  display: inline-flex;
  background: var(--surface-soft);
  border-radius: 12px;
  padding: 4px;
  gap: 2px;
}
.seg button {
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.seg button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-clay-1);
}

/* Notif dot */
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

/* DNA strip */
.dna-strip {
  display: flex;
  gap: 3px;
  align-items: center;
  height: 14px;
}
.dna-strip span {
  flex: 1;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--primary-3), var(--primary));
  opacity: 0.7;
}
.dna-strip span:nth-child(odd) { background: linear-gradient(180deg, var(--gold), var(--gold-soft)); }
.dna-strip span:nth-child(3n) { opacity: 0.4; }

/* Image-block placeholder for article hero, etc */
.imgblock {
  background:
    linear-gradient(135deg, var(--surface-soft) 25%, transparent 25%) -8px 0,
    linear-gradient(225deg, var(--surface-soft) 25%, transparent 25%) -8px 0,
    linear-gradient(315deg, var(--surface-soft) 25%, transparent 25%),
    linear-gradient(45deg, var(--surface-soft) 25%, transparent 25%),
    var(--surface-tint);
  background-size: 16px 16px;
  position: relative;
  overflow: hidden;
}
.imgblock::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.4), transparent 60%);
}
