/*
 * Scan2openBIM — 2.1 / Lectura y uso táctil.
 * Se carga después de site.css, commerce.css y themes.css.
 * Tipografía móvil: 17 px principal, 16 px de lectura/formulario,
 * 14–15 px auxiliares y 13 px en leyendas técnicas y navegación de pasos.
 * Sin cambios en tarifas, cálculo, contenidos legales ni pasarela.
 */
@media screen and (max-width: 850px) {
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 90px; }
  body { font-size: 17px; line-height: 1.65; }
  .wrap, .nav-shell { width: calc(100% - 40px); }
  .hero-copy, .heading-aside, .calc-layout > *, .contact-grid > *, .openbim-grid > * { min-width: 0; }
  p, label, legend, dt, dd, .button, .text-button, .calc-choice { overflow-wrap: anywhere; }
  .button, .button-small, .text-button, .hero-actions > .button,
  .hero-actions > .text-button, .offer-card .text-button,
  .app-copy .text-button, .calc-nav .button, .calc-result-actions .button {
    font-size: 16px; min-height: 48px; line-height: 1.45; gap: 12px;
  }
  .button { padding: 13px 18px; }
  .text-button { padding-block: 12px; text-align: left; }
  .button .icon, .text-button .icon { width: 20px; height: 20px; }
  .design-bar { padding: 10px 12px; gap: 6px; }
  .design-bar a { min-height: 44px; padding: 9px 12px; font-size: 14px; }
  .design-bar > span { font-size: 14px; }
  .nav-shell { min-height: 72px; gap: 12px; }
  .brand-word { font-size: 20px; }
  .menu-toggle { display: flex; flex: 0 0 48px; width: 48px; height: 48px; }
  .main-nav {
    display: none; position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 12px 20px 22px; background: var(--paper);
    border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px #15312f12;
    max-height: calc(100dvh - 80px); overflow-y: auto;
  }
  .main-nav.is-open { display: flex; }
  .main-nav > a:not(.button) { min-height: 48px; font-size: 17px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .main-nav > .button { font-size: 16px; width: 100%; margin: 16px 0 0; }
  html[data-theme=blue] .main-nav { background: #0a1630; }
  .menu-toggle[aria-expanded=true] span:first-child { transform: translateY(4px) rotate(45deg); }
  .menu-toggle[aria-expanded=true] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
  .hero .eyebrow, .section-heading .eyebrow, .open-copy .eyebrow,
  .faq-grid .eyebrow, .contact-copy .eyebrow, .eyebrow {
    font-size: 13px; line-height: 1.6; letter-spacing: .75px; flex-wrap: wrap;
  }
  html[data-theme] .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 38px; }
  html[data-theme] .hero h1 { font-size: clamp(44px, 9vw, 68px); line-height: 1.09; letter-spacing: -2px; }
  .hero-description, html[data-theme] .hero-description { font-size: 17px; line-height: 1.75; max-width: 620px; }
  .hero-actions { gap: 12px 20px; }
  .hero-quote-link { font-size: 15px; line-height: 1.65; flex-wrap: wrap; }
  .hero-quote-link > span { font-size: 13px; line-height: 1.5; padding: 6px 9px; }
  .hero-scope { align-items: flex-start; gap: 12px; }
  .scope-icon { flex: 0 0 38px; }
  .hero-scope p, .hero-scope strong { font-size: 15px; line-height: 1.65; }

  /* Las leyendas de la portada tienen su propio espacio; no se comprimen sobre el lienzo. */
  html[data-theme] .hero-visual { height: auto; display: flex; flex-direction: column; transform: none; }
  html[data-theme] .hero-viewer-top {
    position: static; order: 0; padding: 20px 18px 0; gap: 6px 16px;
    flex-wrap: wrap; font-size: 13px; line-height: 1.5; letter-spacing: .25px;
  }
  html[data-theme] .hero-coordinate { position: static; order: 1; font-size: 13px; line-height: 1.5; letter-spacing: .35px; margin: 12px 18px 0; }
  .coordinate-line { margin-top: 8px; }
  html[data-theme] .hero-visual > canvas { order: 2; flex: none; width: 100%; height: 290px; }
  html[data-theme] .float-tag {
    position: static; order: 3; margin: 0 16px 16px; padding: 13px 14px;
    font-size: 16px; line-height: 1.5; align-self: stretch; max-width: none;
  }
  html[data-theme] .float-tag > div > span { font-size: 13px; line-height: 1.6; }
  html[data-theme] .hero-viewer-bottom {
    position: static; order: 4; font-size: 13px; line-height: 1.6;
    padding: 15px 18px; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: flex-start;
  }
  .hero-viewer-bottom > span:last-child { max-width: none; text-align: left; }
  html[data-theme=clay] .hero-viewer-top { padding: 48px 32px 0; justify-content: center; text-align: center; }
  html[data-theme=clay] .hero-coordinate { text-align: center; }
  html[data-theme=clay] .coordinate-line { margin-inline: auto; }
  .capability-strip { flex-direction: column; gap: 16px; align-items: flex-start; }
  .capability-strip > span { font-size: 13px; line-height: 1.5; letter-spacing: .6px; }
  .capability-strip > div { font-size: 15px; line-height: 1.8; flex-wrap: wrap; gap: 4px 12px; }

  /* Contenido: mantener cuerpos de lectura en lugar de reducir columnas. */
  .section-heading { display: block; }
  .heading-aside, .calculator-intro { max-width: 640px; margin-top: 20px; }
  .heading-aside, .heading-aside > p, .service-card > p, .app-copy > p,
  .process-grid p, .open-copy > p:not(.eyebrow), .offer-card > p,
  .faq-intro, .faq-list details > div, .contact-copy > p, .calculator-intro {
    font-size: 16px; line-height: 1.75;
  }
  .stage-label, .contact-status .stage-label { font-size: 14px; line-height: 1.5; padding: 7px 10px; }
  .card-number, .card-number span, .step-number { font-size: 14px; letter-spacing: .6px; }
  .service-card h3, .offer-card h3 { font-size: 25px; line-height: 1.3; }
  .service-card .card-link { font-size: 16px; min-height: 48px; line-height: 1.5; }
  .app-deliverables { font-size: 16px; line-height: 1.65; }
  .tag { font-size: 13px; letter-spacing: .6px; padding: 7px 10px; }
  .application-tabs { gap: 16px; }
  .application-tabs button { font-size: 15px; min-height: 48px; line-height: 1.5; padding: 14px 0; }
  .process-grid h3 { font-size: 22px; line-height: 1.35; }
  .step-output { font-size: 14px; line-height: 1.6; margin-top: 18px; }
  .process-note { font-size: 15px; line-height: 1.65; align-items: flex-start; }
  .process-note .icon { margin-top: 4px; }
  .open-points strong { font-size: 17px; line-height: 1.5; }
  .open-points span { font-size: 15px; line-height: 1.7; }
  .req-title { font-size: 14px; line-height: 1.6; flex-wrap: wrap; }
  .req-title > span, .req-kicker { font-size: 13px; line-height: 1.6; }
  .req-row { font-size: 15px; line-height: 1.6; }
  .req-highlight { font-size: 20px; }
  .req-foot, .format-chips > span, .format-note, .standards-note { font-size: 14px; line-height: 1.65; }
  .offer-card > span:not(.offer-icon):not(.offer-badge), .offer-badge { font-size: 13px; line-height: 1.55; }
  .pricing-note { font-size: 15px; line-height: 1.75; }
  .faq-list summary { font-size: 17px; line-height: 1.55; gap: 16px; padding-block: 20px; }
  .faq-list summary .icon { flex: none; }
  .contact-status p, .contact-parent { font-size: 15px; line-height: 1.75; }

  /* Demo: controles grandes y panel de información bajo la escena, no encima. */
  .demo-toolbar { flex-wrap: wrap; gap: 16px; padding: 16px; }
  .demo-project { font-size: 16px; min-width: 0; align-items: flex-start; }
  .demo-project small { font-size: 13px; line-height: 1.6; margin-top: 5px; letter-spacing: .3px; white-space: normal; }
  .view-switch { width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .view-switch button { font-size: 15px; min-height: 46px; padding: 9px 4px; }
  .demo-stage, .demo-shell:fullscreen .demo-stage {
    display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto auto;
    height: auto; overflow: hidden;
  }
  .demo-label { position: static; grid-area: 1 / 1; font-size: 14px; line-height: 1.5; max-width: none; margin: 16px 16px 12px; }
  .demo-tools { position: static; grid-area: 2 / 1; justify-self: end; flex-direction: row; margin: 0 16px 4px; }
  .demo-tools button { width: 46px; height: 46px; border-bottom: 0; border-right: 1px solid #3b5449; }
  .demo-tools button:last-child { border-right: 0; }
  .demo-tools .icon { width: 21px; height: 21px; }
  .demo-stage > canvas { grid-area: 3 / 1; width: 100%; height: 350px; }
  .compare-legend { position: static; grid-area: 3 / 1; align-self: start; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; font-size: 13px; line-height: 1.5; margin: 14px 16px 0; z-index: 2; }
  .compare-legend span { text-align: center; }
  .demo-compass { position: static; grid-area: 3 / 1; align-self: end; justify-self: end; margin: 16px; }
  .demo-compass span { font-size: 13px; }
  .demo-properties { position: static; grid-area: 4 / 1; width: auto; margin: 0 16px 16px; padding: 18px; }
  .demo-properties > p { font-size: 13px; letter-spacing: .45px; line-height: 1.6; }
  .demo-properties h4 { font-size: 19px; line-height: 1.4; }
  .demo-properties dl { font-size: 15px; line-height: 1.65; margin: 12px 0; }
  .demo-properties dl > div { gap: 18px; padding-block: 8px; }
  .demo-properties dd { text-align: right; }
  .demo-properties > span { font-size: 14px; line-height: 1.6; align-items: flex-start; }
  .demo-properties > span .icon { width: 16px; height: 16px; margin-top: 3px; }
  .demo-status { padding: 16px; font-size: 14px; line-height: 1.65; flex-direction: column; align-items: flex-start; gap: 8px; }
  .demo-status > span:last-child { text-align: left; max-width: none; }
  .demo-status > span:first-child { align-items: flex-start; }
  .demo-status .icon { margin-top: 4px; flex: none; }
  .demo-shell:fullscreen { overflow-y: auto; }
  .experience-features > div { font-size: 15px; line-height: 1.6; gap: 12px; }
  .experience-features .icon { width: 21px; height: 21px; }

  /* Formularios: letras reales a 16 px, incluso en ayuda y placeholders. */
  .need-fieldset legend, .calc-contact h4 { font-size: 17px; line-height: 1.5; }
  .need-options { flex-wrap: wrap; gap: 6px; }
  .need-options span { font-size: 15px; min-height: 48px; padding: 10px; }
  .field label, .calc-field label { font-size: 16px; font-weight: 600; line-height: 1.5; }
  .field input, .field select, .field textarea,
  .calc-field input, .calc-field select, .calc-field textarea {
    font-size: 16px; line-height: 1.5; min-height: 50px; padding: 12px;
  }
  .field input::placeholder, .field textarea::placeholder,
  .calc-field input::placeholder, .calc-field textarea::placeholder {
    font-size: 16px; opacity: 1; color: #65766a;
  }
  .field textarea, .calc-field textarea { min-height: 120px; }
  .field-help, .calc-field small { font-size: 14px; line-height: 1.65; }
  .field-help { color: #566e4d; }
  .privacy-check, .calc-contact .privacy-check, .dialog-inner .privacy-check { font-size: 15px; line-height: 1.75; gap: 12px; }
  .privacy-check input, .calc-choice input, .calc-checks input { flex: 0 0 20px; width: 20px; height: 20px; margin-top: 4px; }
  .form-note, .form-status, .draft-result p { font-size: 15px; line-height: 1.75; }
  .draft-result textarea, .calc-draft-box { font-size: 16px; line-height: 1.65; min-width: 0; }
  .form-note { color: #526747; }

  /* Calculadora: el tamaño no depende del número de columnas. */
  .calculator-section { padding-block: 64px; }
  .demo-warning { font-size: 15px; line-height: 1.65; }
  .demo-warning strong { font-size: 16px; line-height: 1.5; }
  .demo-warning p { font-size: 15px; line-height: 1.65; margin-top: 6px; }
  .calc-layout { grid-template-columns: minmax(0, 1fr); }
  .calc-stepper { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding: 14px 10px; }
  .calc-stepper li { min-width: 0; }
  .calc-stepper button { font-size: 13px; line-height: 1.4; flex-direction: column; min-height: 62px; width: 100%; gap: 7px; padding: 4px 0; }
  .calc-stepper button span { flex: none; width: 30px; height: 30px; font-size: 14px; }
  .calc-step { padding: 24px; }
  .calc-step legend { font-size: 26px; line-height: 1.3; }
  html[data-theme=clay] .calc-step legend { font-size: 28px; }
  .calc-step > p { font-size: 16px; line-height: 1.7; }
  .calc-choice { gap: 12px; padding: 18px 16px; }
  .calc-choice:has(input:checked) { padding: 17px 15px; }
  .calc-choice > span { min-width: 0; }
  .calc-choice strong { font-size: 17px; line-height: 1.45; }
  .calc-choice small { font-size: 15px; line-height: 1.7; }
  .calc-choice b { font-size: 13px; line-height: 1.5; }
  .calc-checks { font-size: 16px; gap: 10px 20px; }
  .calc-checks label { min-height: 44px; align-items: flex-start; padding-block: 8px; }
  .calc-inline-note, .calc-help { font-size: 15px; line-height: 1.75; }
  .calc-nav { padding: 18px 24px; flex-wrap: wrap; }
  .calc-progress-text { font-size: 13px; }
  .calc-errors { font-size: 15px; line-height: 1.65; padding-inline: 24px; }
  .calc-summary { position: static; padding: 24px; }
  .summary-eyebrow { font-size: 13px; line-height: 1.55; letter-spacing: .5px; }
  .calc-summary .summary-price { font-size: clamp(28px, 6.5vw, 36px); line-height: 1.35; letter-spacing: -.8px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
  .summary-price small { font-size: 16px; }
  .summary-tax, .summary-note { font-size: 15px; line-height: 1.75; }
  .estimate-row, .estimate-row.total { display: grid; grid-template-columns: minmax(0, 1fr) max-content; align-items: start; gap: 12px; font-size: 15px; line-height: 1.65; padding-block: 12px; }
  .estimate-row dt { max-width: none; }
  .estimate-row dd { font-size: 16px; font-variant-numeric: tabular-nums; text-align: right; }
  .estimate-row.total { font-weight: 600; }
  .summary-status { font-size: 15px; line-height: 1.65; align-items: flex-start; }
  .summary-status::before { margin-top: 9px; }
  .scope-tags { gap: 8px; }
  .scope-tags span { font-size: 13px; line-height: 1.5; padding: 6px 9px; }
  .summary-actions { gap: 10px; }
  .summary-actions button { font-size: 15px; line-height: 1.5; min-height: 46px; padding: 10px 12px; }
  .calc-review h3 { font-size: 22px; line-height: 1.4; }
  .review-list li { font-size: 16px; line-height: 1.7; padding-block: 8px; padding-left: 20px; }
  .calc-request-status { font-size: 16px; line-height: 1.7; }
  .calc-storage-tools { gap: 8px 20px; }
  .calc-storage-tools button { font-size: 15px; min-height: 44px; line-height: 1.5; padding-block: 8px; text-align: left; }
  .calc-storage-note { font-size: 14px; line-height: 1.7; }
  .calc-audit h3 { font-size: 18px; line-height: 1.45; }
  .calc-audit p { font-size: 16px; line-height: 1.7; }
  .calc-audit b { font-size: 14px; }
  .mobile-estimate-bar { padding: 18px; gap: 14px; flex-wrap: wrap; }
  .mobile-estimate-bar > div { min-width: 0; flex: 1 1 210px; }
  .mobile-estimate-bar span { font-size: 13px; line-height: 1.6; letter-spacing: .3px; }
  .mobile-estimate-bar strong { font-size: 26px; line-height: 1.4; letter-spacing: -.6px; overflow-wrap: anywhere; }
  .mobile-estimate-bar button { font-size: 15px; line-height: 1.5; min-height: 46px; padding: 10px 14px; }
  #estimate-form { scroll-margin-top: 90px; }

  /* Oferta validada / simulación: también se leen sin ampliar la pantalla. */
  .checkout-dialog { max-height: 90dvh; }
  .dialog-inner { padding: 24px; }
  .dialog-close { float: none; display: grid; margin-left: auto; width: 46px; height: 46px; }
  .dialog-inner h2 { font-size: 30px; line-height: 1.2; margin-top: 18px; }
  .dialog-inner p { font-size: 16px; line-height: 1.75; }
  .dialog-summary div { font-size: 16px; line-height: 1.7; flex-wrap: wrap; }
  .dialog-state { font-size: 14px; line-height: 1.65; }
  .dialog-steps span { font-size: 13px; line-height: 1.55; }
  .offer-shell h1 { font-size: 38px; line-height: 1.2; }
  .offer-page .offer-card { padding: 22px; }
  .offer-card dl > div { font-size: 16px; line-height: 1.65; }
  .offer-details, .offer-status { font-size: 16px; line-height: 1.75; }
  .offer-page .offer-card h2 { font-size: 26px; line-height: 1.3; }
  .offer-page .offer-card p { font-size: 16px; }
  .legal-main p, .legal-main li { font-size: 16px; line-height: 1.8; }
  .legal-main .legal-meta, .legal-main .draft-notice { font-size: 15px; line-height: 1.75; }
  .legal-main code { font-size: 14px; overflow-wrap: anywhere; }
  .footer-top > p { font-size: 16px; }
  .footer-top .brand-word { font-size: 20px; }
  .back-top { font-size: 15px; min-height: 44px; display: inline-flex; align-items: center; }
  .footer-bottom { align-items: flex-start; flex-direction: column; gap: 14px; }
  .footer-bottom p { font-size: 14px; line-height: 1.75; }
  .footer-bottom nav { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 15px; }
  .footer-bottom nav a { min-height: 44px; display: inline-flex; align-items: center; }
  .footer-disclaimer { font-size: 14px; line-height: 1.75; }
  .preview-local-note, .preview-local-note .wrap { font-size: 15px !important; line-height: 1.75; }
}
@media screen and (max-width: 600px) {
  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-actions > .button { width: 100%; }
  .hero-actions > .text-button { justify-content: center; }
  .service-grid, .offer-grid, .calc-choices, .calc-fields, .form-grid,
  .contact-grid, .openbim-grid, .faq-grid, .application-panel { grid-template-columns: minmax(0, 1fr); }
  .calc-field.full, .calc-checks, .field.full { grid-column: auto; }
  .experience-features { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .application-tabs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
  .application-tabs button { flex-direction: row; align-items: center; gap: 14px; font-size: 16px; text-align: left; }
  .application-tabs .icon { width: 22px; height: 22px; flex: none; }
  .process-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .process-grid article, .process-grid article:not(:first-child), .process-grid article:nth-child(3) {
    padding: 24px 0; border-left: 0; border-top: 1px solid var(--line);
  }
  .process-grid article:first-child { padding-top: 0; border-top: 0; }
  .step-number { margin-bottom: 14px; }
  .requirements-card { transform: none; }
  .req-body { padding: 20px; }
  .req-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .req-row strong { text-align: left; }
  .need-options { display: grid; grid-template-columns: 1fr; }
  .need-options span { justify-content: flex-start; padding-inline: 14px; }
  .calc-step, .calc-summary { padding: 22px 18px; }
  .calc-nav { padding: 16px; gap: 10px; }
  .calc-nav .button { padding-inline: 12px; flex: 1 1 auto; }
  .calc-progress-text { display: none; }
  .calc-result-actions { flex-direction: column; }
  .calc-result-actions .button, .summary-actions button { width: 100%; }
  .calc-storage-tools { align-items: flex-start; flex-direction: column; }
  .dialog-inner { padding: 20px; }
  .dialog-steps { flex-direction: column; gap: 10px; }
  .dialog-steps span { padding-top: 6px; }
  .offer-page .offer-card dl > div { flex-direction: column; align-items: flex-start; gap: 4px; }
}
@media screen and (max-width: 380px) {
  .wrap, .nav-shell { width: calc(100% - 32px); }
  .brand-word { font-size: 19px; }
  .design-bar a { padding-inline: 9px; font-size: 14px; }
  .calc-stepper { padding-inline: 4px; gap: 2px; }
  .calc-stepper button { font-size: 13px; letter-spacing: -.4px; }
  .calc-step, .calc-summary { padding: 20px 14px; }
  .calc-nav { padding-inline: 12px; }
  .calc-nav .button { padding-inline: 9px; font-size: 16px; }
  .estimate-row, .estimate-row.total { gap: 9px; }
  .hero-visual > canvas { height: 250px; }
  .demo-stage > canvas { height: 310px; }
  .demo-properties { padding: 14px; }
  .demo-properties dl > div { gap: 10px; }
  .demo-properties dl { font-size: 15px; }
  .view-switch { gap: 2px; }
  .view-switch button { font-size: 14px; }
  .contact-email { font-size: 20px; gap: 10px; }
}
/* Ajustes de reflujo comprobados en pantallas estrechas. */
@media screen and (max-width: 850px) {
  #preview-legal { font-size: 15px !important; line-height: 1.75; }
  html[data-theme=blue] .theme-aside { display: none; } /* Rótulo ornamental duplicado. */
  .view-switch { grid-template-columns: minmax(44px, .85fr) minmax(44px, .85fr) minmax(88px, 1.4fr) minmax(44px, .7fr); }
  .feature-visual { height: 220px; }
  .mini-label { font-size: 13px; line-height: 1.5; letter-spacing: .3px; color: #586e5b; }
  .mini-window { height: 192px; }
  .mini-window-bar { height: 32px; }
  .mini-window-bar span, .mini-window-bottom { font-size: 13px; line-height: 1.5; }
  .mini-room { height: 127px; }
  .mini-window-bottom { height: 32px; padding-inline: 10px; }
  .panorama-badge { font-size: 14px; width: 48px; height: 48px; }
  .mini-property { font-size: 15px; }
  .mini-property.secondary { font-size: 13px; width: 210px; top: 105px; }
  .art-caption { font-size: 13px; letter-spacing: .3px; line-height: 1.5; }
}
@media screen and (max-width: 600px) {
  .calc-stepper { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px 6px; padding: 14px 10px; }
  .calc-stepper li { grid-column: span 2; }
  .calc-stepper li:nth-child(4) { grid-column: 2 / span 2; }
  .calc-stepper li:nth-child(5) { grid-column: 4 / span 2; }
  .calc-stepper button { font-size: 14px; letter-spacing: 0; min-height: 65px; }
}
