# -*- coding: utf-8 -*-
/* Vaznino mobile density — single source for compact phone/tablet UI.
   Breakpoints: 900px (stack), 768px (tablet), 640px (phone), 480px (360px Samsung).
   Load AFTER vaznino.css and app-overrides.css. Cache-bust ?v= on link tags. */

/* ─── Global: prevent horizontal overflow on small screens ─── */
@media (max-width: 900px) {
  html,
  body {
    overflow-x: clip;
    max-width: 100%;
  }

  img,
  video,
  svg,
  canvas {
    max-width: 100%;
  }
}

/* ─── Tablet (768px) ─── */
@media (max-width: 768px) {
  .hero-grid,
  .split {
    grid-template-columns: 1fr !important;
  }

  .profile-stats {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .profile-hero-inner {
    display: block !important;
  }

  .profile-hero-actions {
    margin-top: 14px !important;
  }
}

/* ─── Phone base (640px) — root scale for Samsung “zoomed in” feel ─── */
@media (max-width: 640px) {
  html {
    font-size: 13px !important;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body {
    font-size: 13px;
    line-height: 1.5;
  }

  .app-notice,
  .notice {
    font-size: 11px !important;
    padding: 6px 10px !important;
    line-height: 1.45;
  }

  .page,
  .container {
    padding: 0.7rem 0.85rem 1.25rem !important;
  }

  .container {
    width: min(100% - 20px, 1160px) !important;
  }

  /* Marketing header */
  .nav {
    height: 54px !important;
    gap: 12px !important;
  }

  .brand {
    font-size: 17px !important;
  }

  .brand-logo-img {
    width: 34px !important;
    height: 34px !important;
  }

  .mobile-toggle {
    width: 36px !important;
    height: 36px !important;
    font-size: 18px !important;
  }

  .cart-btn,
  .ghost-btn,
  .primary-btn {
    padding: 8px 12px !important;
    font-size: 12px !important;
    border-radius: 11px !important;
  }

  /* Hero & sections */
  .hero {
    padding: 28px 0 24px !important;
  }

  .hero h1 {
    font-size: 26px !important;
    line-height: 1.35 !important;
    margin-bottom: 12px !important;
  }

  .hero p {
    font-size: 14px !important;
    line-height: 1.65 !important;
    margin-bottom: 18px !important;
  }

  .eyebrow {
    font-size: 12px !important;
    padding: 5px 10px !important;
    margin-bottom: 12px !important;
  }

  .section {
    padding: 36px 0 !important;
  }

  .section-title {
    font-size: 22px !important;
    line-height: 1.35 !important;
  }

  .section-sub {
    font-size: 13px !important;
  }

  .card {
    padding: 16px !important;
    border-radius: 18px !important;
  }

  .card h3 {
    font-size: 16px !important;
  }

  .card p {
    font-size: 13px !important;
  }

  .icon-box {
    width: 42px !important;
    height: 42px !important;
    font-size: 18px !important;
    margin-bottom: 12px !important;
  }

  .grid-3,
  .product-grid,
  .kpi-row,
  .form-grid {
    grid-template-columns: 1fr !important;
  }

  .product-card {
    padding: 18px !important;
  }

  .feature-list {
    font-size: 12px !important;
  }

  /* Readiness / funnel */
  .readiness-heading {
    padding: 24px 0 16px !important;
  }

  .readiness-heading h1,
  .result-heading h1,
  .specialist-shell h1 {
    font-size: 24px !important;
  }

  .readiness-heading p {
    font-size: 12px !important;
  }

  .screen-card {
    padding: 14px 12px !important;
  }

  .screen-card-title h2 {
    font-size: 16px !important;
  }

  .screen-field {
    font-size: 12px !important;
  }

  .screen-field input,
  .screen-field select {
    height: 40px !important;
    font-size: 16px !important;
    padding: 0 10px !important;
  }

  .health-options label,
  .radio-options label {
    font-size: 12px !important;
  }

  .assessment-submit {
    min-height: 42px !important;
    font-size: 13px !important;
    padding: 0 16px !important;
  }

  .quiz-q {
    font-size: 17px !important;
  }

  .option {
    padding: 12px 14px !important;
    font-size: 13px !important;
  }

  /* Forms (shared) */
  .field label {
    font-size: 12px !important;
  }

  .field input,
  .field textarea,
  .field select {
    padding: 9px 11px !important;
    font-size: 16px !important;
    border-radius: 11px !important;
  }

  .form-card {
    padding: 18px 14px !important;
  }

  .page-hero {
    padding: 32px 0 !important;
  }

  .page-hero h1 {
    font-size: 24px !important;
  }

  input[type="text"],
  input[type="password"],
  input[type="tel"],
  input[type="email"],
  input[type="number"],
  input[type="date"],
  select,
  textarea,
  .auth-field input,
  .form-card input {
    min-height: 38px !important;
    padding: 0.42rem 0.6rem !important;
    font-size: 16px !important;
  }

  .btn-primary {
    padding: 0.55rem 0.9rem !important;
    font-size: 0.86rem !important;
    margin-top: 0.65rem !important;
    min-height: 38px !important;
  }

  .btn-secondary,
  .btn-outline {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.82rem !important;
    min-height: 36px !important;
  }

  /* Profile / dashboard-lite */
  .profile-hero {
    padding: 22px 0 18px !important;
  }

  .profile-hero h1 {
    font-size: 22px !important;
  }

  .profile-hero p {
    font-size: 12px !important;
  }

  .profile-hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px !important;
  }

  .profile-hero-actions a,
  .profile-hero-actions button {
    width: 100%;
    text-align: center;
    min-height: 38px !important;
    padding: 9px 12px !important;
    font-size: 0.84rem !important;
  }

  .profile-stat {
    padding: 10px !important;
  }

  .profile-stat strong {
    font-size: 18px !important;
  }

  .profile-stat span,
  .profile-stat small {
    font-size: 10px !important;
  }

  .profile-card {
    padding: 12px 10px !important;
    border-radius: 16px !important;
    margin-bottom: 14px !important;
  }

  .profile-card-head {
    display: block;
  }

  .profile-card-head h2 {
    font-size: 17px !important;
  }

  .profile-card-head p {
    font-size: 11px !important;
  }

  .weight-entry-form {
    grid-template-columns: 1fr !important;
    margin-top: 12px !important;
    gap: 6px !important;
  }

  .weight-entry-form label {
    font-size: 10px !important;
  }

  .weight-entry-form input,
  .weight-entry-form .primary-btn {
    height: 38px !important;
    min-height: 38px !important;
    font-size: 16px !important;
  }

  .weight-entry-form .primary-btn {
    grid-column: 1 / -1;
    font-size: 0.84rem !important;
  }

  .profile-chart-wrap svg {
    min-width: 0 !important;
  }

  .weight-log-row {
    flex-wrap: wrap;
    border-radius: 12px;
    padding: 7px 10px;
    width: 100%;
    font-size: 0.75rem;
  }

  .weight-log-list {
    flex-direction: column;
    gap: 6px;
  }

  .lite-weight-actions {
    width: 100%;
    justify-content: flex-end;
  }

  /* Paid dashboard SPA */
  .dashboard-mobile-toggle {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
    border-radius: 10px;
  }

  .logo-img {
    height: 34px !important;
  }

  .logo-text b {
    font-size: 0.92rem !important;
  }

  .logo small {
    font-size: 0.58rem !important;
  }

  .dashboard-bottom-tabs {
    padding: 4px 10px calc(6px + var(--safe-bottom));
    gap: 6px;
  }

  .dashboard-bottom-tabs button {
    min-height: 38px;
    font-size: 0.72rem;
    padding: 7px 4px;
  }

  .home-greeting {
    margin-bottom: 0.65rem !important;
  }

  .home-greeting h1 {
    font-size: 1.08rem !important;
  }

  .home-greeting p {
    font-size: 0.76rem !important;
  }

  .home-card {
    padding: 0.75rem 0.85rem !important;
    border-radius: 14px !important;
    margin-bottom: 0.6rem !important;
  }

  .home-card h2 {
    font-size: 0.86rem !important;
    margin-bottom: 0.45rem !important;
  }

  .home-stats-row {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem !important;
    margin: 0.55rem 0 !important;
  }

  .home-stat {
    min-width: 0;
    padding: 0.38rem 0.3rem !important;
  }

  .home-stat b {
    font-size: 0.92rem !important;
  }

  .home-stat span {
    font-size: 0.62rem !important;
  }

  .progress-insights {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
    margin-bottom: 0.55rem !important;
  }

  .progress-insight {
    padding: 7px 8px !important;
    border-radius: 10px !important;
  }

  .progress-insight b {
    font-size: 0.82rem !important;
  }

  .progress-insight span {
    font-size: 0.6rem !important;
  }

  .chart-toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    margin-inline: -2px;
    padding-inline: 2px;
    gap: 6px;
  }

  .chart-toolbar .chart-toggle {
    flex-shrink: 0;
    padding: 4px 9px !important;
    font-size: 0.68rem !important;
    min-height: unset !important;
  }

  .chart-wrap.tall {
    height: 205px !important;
  }

  .secondary-charts {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .secondary-chart-wrap {
    height: 155px !important;
  }

  .secondary-chart-card {
    padding: 10px !important;
  }

  .secondary-chart-card h3 {
    font-size: 0.8rem !important;
    margin-bottom: 6px !important;
  }

  .quick-weight-form {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
    margin-top: 0.6rem !important;
    padding-top: 0.6rem !important;
  }

  .quick-weight-form label {
    font-size: 0.68rem !important;
  }

  .quick-weight-form input {
    height: 38px !important;
  }

  .quick-weight-form .btn-primary,
  .quick-weight-form button {
    width: 100%;
    min-height: 38px !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.84rem !important;
  }

  .home-cta-row {
    flex-direction: column;
    gap: 0.45rem !important;
  }

  .home-cta-row button {
    width: 100%;
    min-height: 38px !important;
    font-size: 0.84rem !important;
  }

  .hero-title {
    margin-bottom: 0.85rem !important;
  }

  .hero-title h1 {
    font-size: 1.15rem !important;
  }

  .hero-title p {
    font-size: 0.78rem !important;
  }

  body.dashboard-app .site-header {
    padding: 0.45rem 0.75rem !important;
    min-height: 48px !important;
    height: auto !important;
  }

  body.dashboard-app .container {
    padding: 0.55rem 0.75rem 1rem !important;
  }

  body.dashboard-app .card {
    padding: 0.75rem !important;
  }

  body.dashboard-app .hero-title h1 {
    font-size: 1.15rem !important;
  }

  body.dashboard-app input[type="text"],
  body.dashboard-app input[type="password"],
  body.dashboard-app input[type="tel"],
  body.dashboard-app input[type="email"],
  body.dashboard-app input[type="number"],
  body.dashboard-app input[type="date"],
  body.dashboard-app select,
  body.dashboard-app textarea {
    min-height: 36px !important;
    padding: 0.35rem 0.55rem !important;
    font-size: 16px !important;
  }

  body.dashboard-app .btn-primary {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.85rem !important;
    min-height: 36px !important;
    margin-top: 0.5rem !important;
  }

  body.dashboard-app .btn-secondary {
    padding: 0.45rem 0.65rem !important;
    font-size: 0.8rem !important;
    min-height: 34px !important;
  }

  body.dashboard-app .home-card {
    padding: 0.6rem 0.7rem !important;
  }

  body.dashboard-app .home-greeting h1 {
    font-size: 1rem !important;
  }

  body.dashboard-app .home-stat b {
    font-size: 0.85rem !important;
  }

  body.dashboard-app .chart-wrap.tall {
    height: 180px !important;
  }

  body.dashboard-app .notice,
  body.dashboard-app .app-notice {
    font-size: 10px !important;
    padding: 5px 8px !important;
  }

  /* Coach chat */
  .chat-bubble {
    max-width: 88% !important;
    font-size: 0.8rem !important;
    padding: 0.5rem 0.7rem !important;
  }

  .nutrition-chat-suggestions {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    gap: 6px !important;
  }

  .nutrition-chat-suggestions button {
    flex-shrink: 0;
    min-height: 34px !important;
    padding: 6px 10px !important;
    font-size: 0.72rem !important;
  }

  .coach-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .coach-tab {
    flex-shrink: 0;
    min-height: 36px !important;
    padding: 8px 10px !important;
    font-size: 0.78rem !important;
  }

  .chat-layout {
    height: calc(100vh - 190px) !important;
    min-height: 260px !important;
  }

  .coach-ask-chat.chat-layout {
    height: calc(100vh - 220px) !important;
    min-height: 280px !important;
    max-height: none !important;
  }

  /* Progress history table */
  .progress-history th,
  .progress-history td {
    padding: 0.35rem 0.28rem !important;
    font-size: 0.72rem !important;
  }

  .progress-history .row-action-btn {
    min-height: 30px !important;
    padding: 4px 8px !important;
    font-size: 0.68rem !important;
  }

  /* Weight edit modal — full-width bottom sheet on phone */
  .weight-edit-dialog {
    padding: 16px !important;
  }

  .weight-edit-dialog h3 {
    font-size: 0.95rem !important;
  }

  .weight-edit-grid input {
    height: 38px !important;
    font-size: 16px !important;
  }

  .weight-edit-actions .btn-primary,
  .weight-edit-actions .btn-secondary,
  .weight-edit-actions .row-action-btn {
    min-height: 38px !important;
  }

  .weight-edit-modal {
    align-items: flex-end;
    padding: 0;
  }

  .weight-edit-dialog {
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-height: 88vh;
  }

  .weight-edit-actions {
    flex-direction: column;
  }

  .weight-edit-actions > * {
    width: 100%;
  }

  .dose-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Readiness result page — BMI + chart + packages */
  .assessment-result-page .result-heading {
    padding: 20px 0 14px !important;
  }

  .assessment-result-page .result-heading h1 {
    font-size: 20px !important;
    line-height: 1.35;
  }

  .assessment-result-page .result-title-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .assessment-result-page .success-check {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }

  .assessment-result-page .result-heading > p {
    font-size: 12px !important;
    line-height: 1.65;
    margin-top: 8px !important;
    padding: 0 2px;
  }

  .assessment-result-page .result-dashboard,
  .assessment-result-page .result-info-stack,
  .assessment-result-page .result-packages-section {
    width: 100% !important;
    max-width: 100%;
    gap: 12px !important;
  }

  .assessment-result-page .result-panel {
    padding: 14px 12px !important;
    border-radius: 14px !important;
  }

  .assessment-result-page .panel-title {
    margin-bottom: 8px;
  }

  .assessment-result-page .panel-title h2 {
    font-size: 15px !important;
  }

  .assessment-result-page .panel-title span {
    font-size: 18px !important;
  }

  .assessment-result-page .bmi-content {
    grid-template-columns: 1fr !important;
    min-height: unset !important;
    gap: 8px !important;
    text-align: center;
  }

  .assessment-result-page .bmi-number {
    font-size: 42px !important;
  }

  .assessment-result-page .body-form-line {
    font-size: 13px !important;
    margin-top: 4px !important;
  }

  .assessment-result-page .body-figure {
    width: 92px !important;
    height: 92px !important;
    margin: 2px auto 0 !important;
  }

  .assessment-result-page .body-figure svg {
    width: 68px !important;
    height: 84px !important;
  }

  .assessment-result-page .ideal-weight-box {
    padding: 11px 10px !important;
    margin-top: 10px;
  }

  .assessment-result-page .ideal-weight-box > span {
    font-size: 11px !important;
  }

  .assessment-result-page .ideal-weight-box strong {
    font-size: 20px !important;
  }

  .assessment-result-page .ideal-helper {
    font-size: 9px !important;
    line-height: 1.5;
  }

  .assessment-result-page .chart-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    direction: ltr;
    margin: 0 -4px;
    padding: 0 4px;
  }

  .assessment-result-page .chart-wrap svg {
    min-height: 165px !important;
    max-height: 190px;
    width: 100%;
    min-width: 0 !important;
  }

  .assessment-result-page .chart-formula {
    font-size: 9px !important;
    line-height: 1.45;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding: 5px 2px;
    margin-top: 6px;
    direction: ltr;
    text-align: center;
  }

  .assessment-result-page .chart-note {
    font-size: 10px !important;
    line-height: 1.55;
  }

  .assessment-result-page .result-info-stack {
    margin-top: 12px !important;
    gap: 10px !important;
  }

  .assessment-result-page .result-info-card {
    flex-direction: row;
    align-items: flex-start;
    text-align: right;
    gap: 12px !important;
    padding: 12px 11px !important;
  }

  .assessment-result-page .info-round {
    width: 40px !important;
    height: 40px !important;
    font-size: 17px !important;
  }

  .assessment-result-page .result-info-card h3 {
    font-size: 14px !important;
  }

  .assessment-result-page .result-info-card p {
    font-size: 11px !important;
    line-height: 1.6;
  }

  .assessment-result-page .result-packages-section {
    padding: 22px 0 36px !important;
  }

  .assessment-result-page .section-copy-center h2 {
    font-size: 19px !important;
  }

  .assessment-result-page .section-copy-center p {
    font-size: 11px !important;
    margin-bottom: 14px !important;
  }

  .assessment-result-page .result-package-grid {
    gap: 12px !important;
  }

  .assessment-result-page .result-package-card {
    padding: 15px 13px !important;
    min-height: unset !important;
  }

  .assessment-result-page .result-package-card h3 {
    font-size: 15px !important;
    margin-bottom: 8px !important;
  }

  .assessment-result-page .package-intro {
    font-size: 11px !important;
  }

  .assessment-result-page .result-package-card ul {
    font-size: 11px !important;
    gap: 7px !important;
    margin-bottom: 14px !important;
  }

  .assessment-result-page .result-package-price {
    padding: 8px !important;
    margin-bottom: 8px !important;
  }

  .assessment-result-page .result-package-price strong {
    font-size: 16px !important;
  }

  .assessment-result-page .result-package-card .primary-btn {
    min-height: 38px !important;
    font-size: 12px !important;
    padding: 9px 12px !important;
  }

  .assessment-result-page .result-privacy {
    font-size: 10px !important;
    margin-top: 14px !important;
  }
}

/* ─── Extra-tight (480px — Samsung FE / 360px logical) ─── */
@media (max-width: 480px) {
  html {
    font-size: 12.5px !important;
  }

  .hero h1 {
    font-size: 23px !important;
  }

  .section-title {
    font-size: 20px !important;
  }

  .readiness-heading h1,
  .result-heading h1 {
    font-size: 21px !important;
  }

  .profile-hero h1 {
    font-size: 20px !important;
  }

  .home-stats-row,
  .progress-insights {
    grid-template-columns: repeat(2, 1fr);
  }

  .profile-stats {
    grid-template-columns: 1fr 1fr !important;
  }

  body.dashboard-app .dashboard-bottom-tabs button {
    font-size: 0.68rem !important;
    min-height: 34px !important;
  }

  .assessment-result-page .bmi-number {
    font-size: 36px !important;
  }

  .assessment-result-page .result-heading h1 {
    font-size: 18px !important;
  }

  .assessment-result-page .chart-wrap svg {
    min-height: 150px !important;
    max-height: 170px;
  }

  .assessment-result-page .section-copy-center h2 {
    font-size: 17px !important;
  }
}
