/* =========================================================
   PULSELINE — Responsive Rules
   Breakpoints: >=1280 desktop (default in style.css),
   1279–860 tablet, <=859 mobile, <=420 small mobile
   ========================================================= */

/* ---------- Tablet ---------- */
@media (max-width: 1279px){
  main{ padding: 16px 18px 70px; }
  .dashboard-grid{
    grid-template-columns: 1fr;
    grid-template-areas:
      "gauge"
      "result"
      "chart"
      "info";
  }
  .gauge-wrap{ max-width:300px; }
  .settings-row{ grid-template-columns: 1fr; gap:10px; }
}

/* ---------- Mobile ---------- */
@media (max-width: 859px){
  .topbar{
    flex-wrap:wrap; gap:10px; margin:10px; padding:10px 14px; border-radius: var(--r-lg);
  }
  .topbar-nav{ order:3; width:100%; justify-content:center; }
  .nav-btn{ flex:1; text-align:center; padding:8px 10px; font-size:.82rem; }

  .hero-copy{ margin: 18px 0 22px; }
  .hero-copy h1{ font-size: clamp(1.5rem, 6vw, 2rem); }
  .hero-sub{ font-size:.92rem; }

  .panel{ padding:18px; }
  .result-cards{ grid-template-columns: 1fr 1fr; gap:10px; }
  .gauge-stats{ flex-direction:column; }
  .btn-start{ width:104px; height:104px; }

  .export-actions{ width:100%; }
  .export-actions .btn-ghost{ flex:1; min-width:calc(50% - 8px); }

  .history-table{ font-size:.76rem; }
  .history-table th, .history-table td{ padding:8px 10px; }
}

/* ---------- Small mobile ---------- */
@media (max-width: 420px){
  .brand-name{ font-size:1rem; }
  .result-cards{ grid-template-columns: 1fr; }
  .gauge-wrap{ max-width:250px; }
  .gauge-value{ font-size:2.1rem; }
  .unit-toggle{ flex-wrap:wrap; }
  .unit-btn{ flex:1 1 45%; }
}

/* ---------- Landscape phones ---------- */
@media (max-width: 900px) and (orientation:landscape){
  .gauge-wrap{ max-width:220px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{
    animation-duration:.001ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.001ms !important;
    scroll-behavior:auto !important;
  }
}

/* ---------- Print (used for PDF export view) ---------- */
@media print{
  .topbar, .site-footer, .bg-layer, .gauge-panel, .chart-panel, .info-panel,
  .export-actions, #view-dashboard, #view-settings{ display:none !important; }
  body{ background:#fff; color:#000; }
  .panel{ box-shadow:none; border:1px solid #ccc; }
}
