.quality-open { position: absolute; z-index: 8; top: 22px; right: 24px; display: flex; align-items: center; gap: 8px; padding: 11px 15px; border: 1px solid #b8d7d840; border-radius: 12px; background: #142731e8; color: #eaf6f3; font: inherit; font-size: 13px; cursor: pointer; backdrop-filter: blur(12px); }
.quality-open svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.quality-open:disabled { opacity: .45; cursor: wait; }
body[data-view="ground"] .quality-open, body[data-view="external"] .quality-open { top: auto; bottom: 26px; right: 20px; }
body[data-environment="station"] .quality-open { top: 108px; bottom: auto; right: 28px; }
.quality-dialog { color-scheme: dark; width: min(1120px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 24px); padding: 0; border: 1px solid #9cbdc648; border-radius: 20px; background: #10232c; color: #f0f5ee; box-shadow: 0 30px 100px #0008; font-family: inherit; overflow: auto; }
.quality-dialog::backdrop { background: #04121bd9; backdrop-filter: blur(8px); }
.quality-dialog * { box-sizing: border-box; }
.quality-dialog button, .quality-dialog select { font: inherit; cursor: pointer; }
.quality-dialog button:focus-visible, .quality-dialog select:focus-visible, .quality-open:focus-visible { outline: 2px solid #f5ca7a; outline-offset: -3px; }
.quality-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto 38px; align-items: start; gap: 24px; padding: 20px 24px 14px; position: sticky; top: 0; z-index: 3; background: #10232c; }
.quality-eyebrow { color: #8fbcad; font-size: 10px; letter-spacing: 2px; font-weight: 700; }
.quality-heading h2 { margin: 10px 0 7px; font-size: 27px; letter-spacing: -.7px; }
.quality-heading p { margin: 0; color: #acc1c5; font-size: 12px; line-height: 1.5; }
.quality-close { width: 38px; height: 38px; border: 1px solid #bed7dc30; border-radius: 50%; background: #ffffff05; color: #fff; font-size: 22px !important; }
.quality-presets { display: flex; align-items: center; gap: 8px; padding-top: 1px; }
.quality-presets span { margin-right: 6px; font-size: 11px; color: #acc1c5; }
.quality-presets button { white-space: nowrap; background: #ffffff05; color: #d9e8e6; border: 1px solid #b6d6cb30; border-radius: 20px; padding: 9px 12px; font-size: 11px; }
.quality-presets button:hover { background: #ffffff16; }
.quality-layout, .quality-detail { min-width: 0; }
.quality-carousel { display: grid; grid-template-columns: 36px minmax(0, 1fr) 36px; align-items: center; gap: 8px; padding: 4px 12px 8px; border-bottom: 1px solid #bed7dc1c; }
.quality-nav-button { display: grid; place-items: center; width: 36px; height: 44px; padding: 6px; border: 1px solid #b6d6cb30; border-radius: 10px; background: #ffffff05; color: #d4e3d4; }
.quality-nav-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.quality-nav-button:hover { background: #6ba58a24; border-color: #8fbb9070; }
.quality-rows { --visible-items: 4; display: flex; gap: 8px; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
.quality-rows::-webkit-scrollbar { display: none; }
.quality-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 9px; flex: 0 0 calc((100% - (var(--visible-items) - 1) * 8px) / var(--visible-items)); min-width: 0; min-height: 52px; text-align: left; padding: 10px 14px; border: 1px solid transparent; border-radius: 11px; color: #c8d9da; background: #091a231c; font-size: 12px !important; }
.quality-row[aria-pressed="true"] { background: #6ba58a24; border-color: #8fbb905c; color: #fff; }
.quality-row strong { white-space: nowrap; font-size: 9px; font-weight: 600; color: #a6beb9; }
.quality-row[aria-pressed="true"] strong { color: #dbd9a6; }
.quality-symbol { font-size: 20px; color: #bad2a2; text-align: center; }
.quality-levels { display: grid; grid-template-columns: repeat(var(--choices, 5), minmax(0, 1fr)); gap: 6px; max-width: 760px; margin: 0 auto; padding: 16px 24px 28px; }
.quality-levels button { min-height: 44px; padding: 8px 4px; border: 1px solid #b6d6cb30; border-radius: 9px; background: #ffffff05; color: #b6cccf; font-size: 11px; }
.quality-levels button[aria-pressed="true"] { background: #d9c79a; border-color: #e9d5a2; color: #1f302f; font-weight: 700; }
.quality-stage { position: relative; width: 100%; overflow: hidden; height: clamp(260px, 46dvh, 420px); border-block: 1px solid #bed7dc30; background: #132932; }
.quality-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.quality-stage canvas:active { cursor: grabbing; }
.quality-stage::after { content: ''; position: absolute; width: 1px; background: #bed7dc38; top: 0; bottom: 0; left: 50%; pointer-events: none; }
.quality-preview-labels { display: grid; grid-template-columns: 1fr 1fr; position: absolute; top: 18px; left: 0; right: 0; pointer-events: none; text-align: center; font-size: 13px; font-weight: 600; color: #c5d6d7; }
.quality-preview-labels span:last-child { color: #f4d18e; }
.quality-preview-message { position: absolute; inset: 0; display: grid; place-items: center; padding: 30px; margin: 0; text-align: center; color: #a9c0c4; font-size: 12px; }
.quality-preview-message[hidden] { display: none; }
.quality-hint { text-align: center; font-size: 12px; margin: 0; padding: 12px; color: #8fa9af; }
/* O visualizador (pedido de 15/10/2026): "Ver como fica" abre o modelo escolhido na tela inteira. */
.quality-viewer-open { position: absolute; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 7px; padding: 9px 13px; border: 1px solid #e9d5a280; border-radius: 10px; background: #10232ce6; color: #f4d18e; font-size: 12px !important; font-weight: 600; }
.quality-viewer-open svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.quality-viewer-open:hover { background: #1c3a43; }
.quality-viewer-close { position: absolute; top: 14px; right: 14px; width: 46px; height: 46px; border: 1px solid #bed7dc40; border-radius: 50%; background: #10232ce6; color: #fff; font-size: 26px !important; line-height: 1; }
.quality-viewer-close[hidden], .quality-viewer-hint { display: none; }
.quality-viewing .quality-stage { position: fixed; inset: 0; z-index: 20; height: auto; border: 0; background: #152c31; }
.quality-viewing .quality-stage::after, .quality-viewing #quality-before, .quality-viewing .quality-viewer-open { display: none; }
.quality-viewing .quality-preview-labels { grid-template-columns: 1fr; top: 26px; font-size: 15px; }
.quality-viewing .quality-preview-labels span, .quality-viewing .quality-viewer-hint { justify-self: center; padding: 7px 14px; border-radius: 20px; background: #10232cd9; }
.quality-viewing .quality-viewer-hint { display: block; position: absolute; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); bottom: 104px; margin: 0; text-align: center; font-size: 12px; color: #a9c0c4; pointer-events: none; }
.quality-viewing .quality-levels { position: fixed; z-index: 21; left: 0; right: 0; bottom: 0; max-width: none; padding: 14px max(16px, calc(50% - 380px)) 24px; background: linear-gradient(#152c3100, #10232c 30%); }
.quality-footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'image image' 'test apply' 'suggestion suggestion'; align-items: center; column-gap: 18px; row-gap: 8px; padding: 0 16px 16px; }
.quality-image-row { grid-area: image; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 8px; background: #091b2440; border-radius: 10px; }
.quality-image-row label { font-size: 12px; }
.quality-image-row small { display: block; color: #8fa9af; font-size: 10px; line-height: 1.5; margin-top: 4px; }
.quality-image-row select { color: #d7e7e4; background: #19343e; border: 1px solid #aac9cc44; border-radius: 8px; padding: 10px 12px; min-width: 135px; font-size: 13px; }
.quality-test-line { grid-area: test; display: flex; gap: 14px; align-items: center; padding: 10px 12px; background: #06182070; border-radius: 10px; }
.quality-test-line button, .quality-suggestion { flex-shrink: 0; border: 1px solid #81b6a46b; background: #24534550; color: #c9e8d2; padding: 10px 13px; border-radius: 8px; font-size: 11px !important; }
.quality-test-copy { min-width: 0; }
.quality-test-copy p { margin: 0; font-size: 11px; line-height: 1.5; color: #b5cacd; }
.quality-test-copy p[data-rating="smooth"] { color: #9eddb1; }
.quality-test-copy p[data-rating="slow"] { color: #f0b098; }
.quality-test-copy small { display: block; margin-top: 4px; font-size: 9px; color: #839fa7; line-height: 1.5; }
.quality-test-copy progress { width: 100%; height: 5px; margin-top: 7px; accent-color: #c8d99c; }
.quality-suggestion { grid-area: suggestion; justify-self: start; }
.quality-actions { grid-area: apply; }
.quality-actions small { display: none; }
.quality-apply { width: 100%; min-height: 46px; border: 1px solid #cbd39d; background: #d4dda6; color: #23332b; border-radius: 11px; padding: 12px 22px; font-weight: 700 !important; font-size: 12px !important; }
.quality-dialog button:disabled { opacity: .4; cursor: wait; }
.quality-testing .quality-layout { display: none; }
.quality-testing::backdrop { backdrop-filter: none; background: #04121b50; }
@media (max-width: 1000px) {
  .quality-heading { gap: 16px; }
  .quality-presets span { display: none; }
  .quality-row { padding-inline: 10px; gap: 6px; }
}
@media (max-width: 760px) {
  .quality-open { top: 14px; right: 12px; padding: 9px 11px; font-size: 11px; }
  body[data-view="ground"] .quality-open, body[data-view="external"] .quality-open { bottom: 14px; right: 12px; }
  body[data-environment="station"] .quality-open { top: 88px; bottom: auto; right: 16px; }
  .quality-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 16px; }
  .quality-heading { grid-template-columns: minmax(0, 1fr) 34px; gap: 12px; padding: 14px 14px 10px; }
  .quality-eyebrow { display: none; }
  .quality-heading h2 { font-size: 22px; margin: 0 0 6px; }
  .quality-heading p { font-size: 10px; }
  .quality-close { grid-column: 2; grid-row: 1; width: 34px; height: 34px; }
  .quality-presets { grid-row: 2; grid-column: 1 / -1; gap: 6px; padding: 0; }
  .quality-presets button { padding: 8px 10px; font-size: 10px; }
  .quality-carousel { grid-template-columns: 32px minmax(0, 1fr) 32px; gap: 6px; padding: 2px 8px 8px; }
  .quality-nav-button { width: 32px; padding: 5px; }
  .quality-rows { --visible-items: 2; }
  .quality-row { grid-template-columns: 18px minmax(0, 1fr); column-gap: 6px; row-gap: 3px; padding: 8px; font-size: 11px !important; min-height: 48px; }
  .quality-symbol { grid-row: 1 / 3; font-size: 17px; }
  .quality-row strong { grid-column: 2; font-size: 8px; }
  .quality-levels { padding: 12px 12px 16px; gap: 4px; }
  .quality-levels button { font-size: 10px; }
  .quality-stage { height: clamp(220px, 36dvh, 300px); }
  .quality-preview-labels { top: 14px; font-size: 10px; }
  .quality-hint { font-size: 10px; padding: 10px 8px; }
  .quality-footer { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'image' 'test' 'suggestion' 'apply'; padding: 0 10px 12px; gap: 8px; }
  .quality-image-row { padding: 8px 2px; gap: 8px; }
  .quality-image-row label { font-size: 11px; }
  .quality-image-row small { font-size: 9px; }
  .quality-image-row select { min-width: 110px; font-size: 11px; padding-inline: 8px; }
  .quality-test-line { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px; }
  .quality-suggestion { width: 100%; }
}
@media (max-height: 500px) and (min-width: 761px) {
  body[data-environment="station"] .quality-open { top: 82px; right: 25px; }
  .quality-heading { padding-block: 12px; }
  .quality-heading h2 { font-size: 23px; margin: 4px 0; }
  .quality-eyebrow, .quality-heading p { display: none; }
  .quality-levels { padding-block: 10px; }
  .quality-stage { height: 210px; }
}
