/* ============================================================
   PetToolKit 宠小算 — 全局样式表
   移动端优先 (Mobile-First)，375px 基准
   ============================================================ */

/* --- CSS Variables --- */
:root {
  /* Colors */
  --bg-primary: #FAF7F2;
  --bg-card: #FFFFFF;
  --bg-footer: #F0EDE8;
  --bg-sidebar: #F5F2EE;
  --accent: #E8915C;
  --accent-hover: #D47945;
  --accent-light: #FDF0E8;
  --border: #E5E0DA;
  --border-warm: #C4A882;
  --text-primary: #3D3D3D;
  --text-secondary: #8C8C8C;
  --text-muted: #B0B0B0;

  /* Typography */
  --font-display: 'Noto Serif SC', 'Source Han Serif SC', 'STSong', 'Songti SC', 'SimSun', serif;
  --font-body: Inter, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;

  /* Spacing */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 40px;
  --space-xl: 64px;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Nav */
  --nav-height: 64px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Prevent content overflow on mobile */
img, video, canvas, svg { max-width: 100%; }
pre, code { white-space: pre-wrap; word-break: break-all; }
p, h1, h2, h3, h4, li, td, th, a { overflow-wrap: break-word; word-break: break-word; }

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text-primary);
  line-height: 1.3;
}
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.375rem; font-weight: 600; }
h3 { font-size: 1.125rem; font-weight: 500; }

p { margin-bottom: var(--space-sm); }

/* --- Navigation --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-sm);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
  min-width: 0;
}
.nav-brand:hover { color: var(--text-primary); }
.nav-logo-icon {
  height: 28px;
  width: auto;
  flex-shrink: 0;
  margin-right: 8px;
}
.nav-brand-text {
  font-family: 'Noto Serif SC', 'Georgia', 'Songti SC', serif;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #3D3D3D;
  white-space: nowrap;
}
.nav-brand-cn {
  font-weight: 400;
  font-size: 0.8125rem;
  letter-spacing: 2px;
  margin-left: 3px;
  color: #C4A882;
}

@media (min-width: 480px) {
  .nav-brand-text { font-size: 1.25rem; }
  .nav-brand-cn { font-size: 0.9375rem; }
}
.nav-links {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.nav-links a {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
  white-space: nowrap;
}

/* Mobile nav: ensure all content fits */
@media (max-width: 420px) {
  .nav { padding: 0 8px; }
  .nav-brand { font-size: 0.75rem; gap: 3px; }
  .nav-logo-icon { height: 22px; }
.nav-brand-text { font-size: 0.75rem; }
.nav-brand-cn { font-size: 0.625rem; }
  .nav-links { gap: 6px; }
  .nav-links a { font-size: 0.75rem; }
}
.nav-links a:hover,
.nav-links a.active { color: var(--accent); }

@media (min-width: 480px) {
  .nav-brand { font-size: 1.125rem; }
  .nav-brand-text { font-size: 1.25rem; }
.nav-brand-cn { font-size: 0.9375rem; }
  .nav-links { gap: var(--space-md); }
  .nav-links a { font-size: 0.875rem; }
}

/* --- Layout --- */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

/* --- Breadcrumb --- */
.breadcrumb {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  padding: var(--space-sm) 0;
}
.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin: 0 var(--space-xs); }

/* --- Hero --- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  padding: 0;
  text-align: center;
  position: relative;
  background: url('../img/hero-dog.jpg') center/cover no-repeat;
  min-height: 180px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: var(--space-xs);
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(250,247,242,0.94) 25%, rgba(250,247,242,0.2) 100%);
  z-index: 1;
}
.hero-content {
  flex: 1;
  position: relative;
  z-index: 2;
  padding: var(--space-sm);
  text-align: left;
  align-self: flex-start;
  max-width: 100%;
}
.hero h1 {
  font-size: 1.25rem;
  margin-bottom: 2px;
  line-height: 1.3;
}
.hero p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  max-width: 100%;
  margin: 0 0 var(--space-xs);
}
.hero-image { display: none; }
.hero-actions { margin-top: 4px; }
.hero-actions .btn { font-size: 0.75rem; padding: 6px 14px; min-height: 36px; }

@media (min-width: 480px) {
  .hero { min-height: 240px; }
  .hero-content { padding: var(--space-md); }
  .hero h1 { font-size: 1.5rem; }
  .hero p { font-size: 0.875rem; }
}

@media (min-width: 768px) {
  .hero {
    min-height: 420px;
    text-align: left;
  }
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 0.9375rem; margin: 0 0 var(--space-sm); }
  .hero-content { padding: var(--space-xl); max-width: 520px; }
  .hero-actions .btn { font-size: 0.875rem; padding: 10px 20px; min-height: 44px; }
}

@media (min-width: 1024px) {
  .hero { min-height: 500px; }
  .hero h1 { font-size: 2.25rem; }
  .hero-content { max-width: 560px; padding: var(--space-xl); }
}

/* --- Tool Grid --- */
.tool-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding-bottom: var(--space-lg);
}

@media (min-width: 768px) {
  .tool-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 900px) {
  .tool-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1100px) {
  .tool-grid { grid-template-columns: repeat(5, 1fr); }
}

/* --- Card --- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 12px var(--space-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  color: inherit;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.card-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}
.card-body {
  flex: 1;
  min-width: 0;
}
.card h3 {
  font-size: 0.9375rem;
  margin-bottom: 1px;
  line-height: 1.3;
}
.card p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card .btn {
  display: none; /* Mobile: hide button, whole card is tappable */
}

@media (min-width: 768px) {
  .card .btn { display: inline-flex; flex-shrink: 0; font-size: 0.8125rem; padding: 6px 14px; min-height: 36px; }
  .card {
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-md);
    gap: 0;
  }
  .card-icon { font-size: 1.5rem; margin-bottom: var(--space-xs); width: auto; }
  .card h3 { font-size: 1.0625rem; margin-bottom: 4px; }
  .card p {
    font-size: 0.8125rem;
    margin-bottom: var(--space-sm);
    flex: 1;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }
  .card .btn { font-size: 0.8125rem; padding: 6px 14px; min-height: 36px; }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  border: none;
  text-decoration: none;
  min-height: 44px;
  min-width: 44px;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-footer); }

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8125rem;
  min-height: 36px;
}

/* --- Inputs --- */
.input-group {
  margin-bottom: var(--space-sm);
}
.input-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text-primary);
}
.input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;  /* >=16px prevents iOS zoom */
  color: var(--text-primary);
  background: var(--bg-card);
  transition: border-color 0.15s ease;
  -webkit-appearance: none;
}
.input:focus {
  border-color: var(--accent);
  outline: none;
}
.input.input-error {
  border-color: #e74c3c;
  background: #fef8f7;
}
.input-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.input-error-text {
  font-size: 0.75rem;
  color: #e74c3c;
  margin-top: 2px;
}

/* Select styling */
select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238C8C8C' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* --- Result Display --- */
.result-panel {
  background: var(--bg-footer);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
  margin-top: var(--space-md);
}
.result-value {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
}
.result-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 4px;
}
.result-detail {
  font-size: 0.875rem;
  color: var(--text-primary);
  margin-top: var(--space-xs);
  text-align: left;
}

/* --- Timeline --- */
.timeline {
  list-style: none;
  padding: 0;
}
.timeline li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-xs) 0;
  font-size: 0.875rem;
}
.timeline-icon {
  font-size: 1.125rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.timeline-checked { color: #4CAF50; }
.timeline-pending { color: var(--text-muted); }
.timeline-warning { color: var(--accent); }
.timeline-active { color: var(--accent); font-weight: 600; }

/* --- Progress Bar --- */
.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: var(--space-xs) 0;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* --- Table --- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: var(--space-sm) 0;
  max-width: 100%;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th {
  font-weight: 600;
  background: var(--bg-footer);
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
}
td { color: var(--text-primary); }
tr:last-child td { border-bottom: none; }
.badge-ok { color: #4CAF50; font-weight: 600; }
.badge-pending { color: var(--accent); font-weight: 600; }
.badge-none { color: var(--text-muted); }

/* --- FAQ (details/summary) --- */
.faq-item {
  border-bottom: 1px solid var(--border);
}
.faq-item summary {
  padding: var(--space-sm) 0;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9375rem;
  min-height: 44px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-size: 1.25rem;
  color: var(--text-muted);
  transition: transform 0.2s;
}
.faq-item[open] summary::after {
  content: '−';
  color: var(--accent);
}
.faq-item .faq-answer {
  padding: 0 0 var(--space-sm);
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* --- Content Section --- */
.content-section {
  padding: var(--space-md) 0;
}
.content-section h2 {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-xs);
  border-bottom: 2px solid var(--border-warm);
}
.content-section h3 {
  font-size: 1.0625rem;
  margin: var(--space-sm) 0 var(--space-xs);
}
.content-section p {
  font-size: 1rem;
  line-height: 1.8;
}
.content-section ol,
.content-section ul {
  padding-left: 1.25rem;
  margin-bottom: var(--space-sm);
}
.content-section li {
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: var(--space-xs);
  color: var(--text-primary);
}

/* --- Article (blog post) --- */
.article {
  max-width: 100%;
}
.article-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}
.article h1 {
  font-size: 1.5rem;
  line-height: 1.4;
  margin-bottom: var(--space-xs);
}
.article .content-section {
  max-width: 100%;
}
.article .content-section h2 {
  font-size: 1.25rem;
  line-height: 1.4;
}
.article .content-section p {
  font-size: 1.0625rem;
  line-height: 1.85;
  margin-bottom: var(--space-sm);
}
.article .content-section li {
  font-size: 1.0625rem;
  line-height: 1.85;
}
.article .table-wrap {
  margin: var(--space-sm) 0;
  max-width: 100%;
}
.article .table-wrap table {
  font-size: 0.8125rem;
  width: 100%;
}
.article .table-wrap th,
.article .table-wrap td {
  padding: 8px 10px;
}
.article .btn {
  display: inline-flex;
}

@media (min-width: 768px) {
  .article h1 { font-size: 2rem; }
  .article .content-section p { font-size: 1.125rem; }
  .article .content-section li { font-size: 1.125rem; }
  .article .table-wrap { margin: var(--space-sm) 0; padding: 0; width: 100%; max-width: 100%; }
}

/* --- Related Tools --- */
.related-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
}
@media (min-width: 768px) {
  .related-tools { grid-template-columns: repeat(4, 1fr); }
}
.related-tools .card {
  padding: var(--space-sm);
  text-align: center;
}
.related-tools .card h4 {
  font-size: 0.8125rem;
  margin: 4px 0;
}

/* --- Footer --- */
.footer {
  background: var(--bg-footer);
  padding: var(--space-sm) var(--space-sm);
  text-align: center;
  margin-top: var(--space-md);
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.footer-links a {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  text-decoration: none;
}
.footer-links a:hover { color: var(--accent); }
.footer-copy {
  font-size: 0.625rem;
  color: var(--text-muted);
  margin: 0;
}

@media (min-width: 768px) {
  .footer { padding: var(--space-lg) var(--space-sm); margin-top: var(--space-xl); }
  .footer-links { gap: var(--space-md); margin-bottom: var(--space-sm); }
  .footer-links a { font-size: 0.8125rem; }
  .footer-copy { font-size: 0.75rem; }
}

/* --- Pet Sidebar (Homepage only) --- */
.pet-sidebar-wrap {
  margin-bottom: var(--space-sm);
}

.pet-sidebar-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 10px var(--space-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  width: 100%;
  text-align: left;
  min-height: 44px;
  font-family: var(--font-body);
  user-select: none;
}
.pet-sidebar-toggle-icon {
  margin-left: auto;
  transition: transform 0.25s ease;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.pet-sidebar-toggle.open .pet-sidebar-toggle-icon {
  transform: rotate(180deg);
}

.pet-list-panel {
  display: none;
  background: var(--bg-sidebar);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  border: 1px solid var(--border);
  border-top: none;
  padding: var(--space-sm);
  margin-top: -1px;
}
.pet-list-panel.open { display: block; }

.pet-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}
.pet-item:hover { background: var(--accent-light); }
.pet-item.active {
  background: var(--accent-light);
  font-weight: 600;
}
.pet-item-emoji {
  font-size: 1.25rem;
  margin-right: var(--space-xs);
  flex-shrink: 0;
}
.pet-item-info {
  flex: 1;
  min-width: 0;
}
.pet-item-name {
  font-size: 0.9375rem;
  color: var(--text-primary);
}
.pet-item-detail {
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.pet-item-menu {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.125rem;
  padding: 4px 8px;
  min-height: 44px;
  min-width: 44px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.pet-item-menu:hover { background: var(--border); }

.pet-add-btn {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  font-family: var(--font-body);
  min-height: 44px;
}
.pet-add-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

@media (min-width: 1024px) {
  .pet-sidebar-wrap { margin-bottom: 0; }
  .pet-sidebar-toggle { display: none; }
  .pet-list-panel {
    display: block !important;
    position: fixed;
    left: max(16px, calc((100vw - 960px) / 2 - 236px));
    top: calc(var(--nav-height) + var(--space-md));
    width: 220px;
    max-height: calc(100vh - var(--nav-height) - var(--space-xl));
    overflow-y: auto;
    margin-bottom: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-sidebar);
  }
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm);
}
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  max-width: 400px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.modal h2 {
  margin-bottom: var(--space-sm);
}
.modal-actions {
  display: flex;
  gap: var(--space-xs);
  justify-content: flex-end;
  margin-top: var(--space-md);
}

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  z-index: 300;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.toast.visible {
  opacity: 1;
  pointer-events: auto;
}

/* --- Ad Placeholder --- */
/* AD_PLACEHOLDER */
.ad-placeholder {
  border: 1px dashed var(--border);
  background: var(--bg-footer);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.6875rem;
  min-height: 60px;
  margin: var(--space-sm) 0;
  border-radius: var(--radius-sm);
}

@media (min-width: 768px) {
  .ad-placeholder { min-height: 100px; margin: var(--space-md) 0; font-size: 0.75rem; }
}

/* --- Alert Bar --- */
.alert-bar {
  background: #FFF3CD;
  color: #856404;
  padding: 8px var(--space-sm);
  font-size: 0.8125rem;
  text-align: center;
  position: relative;
}
.alert-bar .alert-close {
  position: absolute;
  right: var(--space-sm);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: #856404;
  min-height: 44px;
  min-width: 44px;
}

/* --- Loading State --- */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--bg-footer) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Formula Block --- */
.formula-block {
  font-size: 1.0625rem;
  font-weight: 700;
  text-align: center;
  padding: 12px 16px;
  background: var(--bg-footer);
  border-radius: 8px;
  margin: var(--space-sm) 0;
  overflow-wrap: break-word;
  word-break: break-word;
  line-height: 1.6;
}

/* --- Inline form row (consistent mobile/desktop) --- */
.input-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.input-row .input {
  flex: 1;
  min-width: 0;
}
.input-suffix {
  font-size: 0.875rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.input-slider {
  width: 100%;
  margin-top: 10px;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 3px;
  outline: none;
}
.input-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}

/* --- Vertical form blocks --- */
.calc-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.calc-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* Type buttons (vertical) */
.type-btns {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.type-btn {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  min-height: 48px;
  transition: all 0.15s ease;
}
.type-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* Age inputs (vertical) */
.age-inputs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.age-field {
  display: flex;
  align-items: center;
  gap: 8px;
}
.age-field .input {
  flex: 1;
  min-width: 0;
}
.age-unit {
  font-size: 1rem;
  color: var(--text-secondary);
  min-width: 24px;
}
.input-lg {
  font-size: 1.25rem;
  padding: 14px 16px;
  min-height: 52px;
}

/* Size buttons (vertical) */
.size-btn {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  min-height: 48px;
}
.size-btn:hover { border-color: var(--accent); }
.size-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* Calculate button */
.btn-calc {
  width: 100%;
  min-height: 52px;
  font-size: 1.125rem;
  font-weight: 600;
}

/* --- Toggle tabs (horizontal, kept for other pages) --- */
.toggle-tabs {
  display: flex;
  gap: 0;
  margin-bottom: var(--space-sm);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--border);
}
.toggle-tab {
  flex: 1;
  padding: 10px 12px;
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  font-family: var(--font-body);
  text-align: center;
  min-height: 44px;
}
.toggle-tab.active {
  background: var(--accent);
  color: #fff;
}

/* --- Utility --- */
.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-secondary); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.hidden { display: none !important; }

/* --- Disclaimer --- */
.disclaimer {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  padding: var(--space-sm) 0;
  border-top: 1px solid var(--border);
  margin-top: var(--space-md);
}

/* --- Desktop Sidebar (1024px+) --- */
@media (min-width: 1024px) {
  body.has-sidebar {
    padding-left: 0;
  }
  .page-wrap {
    display: flex;
  }
  .page-sidebar {
    width: 220px;
    flex-shrink: 0;
  }
  .page-main {
    flex: 1;
    min-width: 0;
  }
}

/* --- Print --- */
@media print {
  .nav, .footer, .ad-placeholder, .pet-list-panel, .pet-sidebar-toggle,
  .breadcrumb, .related-tools, .btn { display: none !important; }
  body { background: #fff; font-size: 12px; }
  .container { max-width: 100%; padding: 0; }
}
