:root {
    --blue-900: #064985;
    --blue-800: #0757a6;
    --blue-700: #0868c7;
    --blue-600: #1478d4;
    --blue-100: #dcedff;
    --blue-50: #f1f8ff;
    --ink: #172536;
    --muted: #64758a;
    --line: #dfe8f1;
    --surface: #ffffff;
    --background: #f4f8fc;
    --green: #16865b;
    --green-soft: #e4f7ef;
    --red: #c14c4c;
    --red-soft: #ffeded;
    --orange: #aa6a0a;
    --orange-soft: #fff2d6;
    --purple: #7043bc;
    --purple-soft: #f0eaff;
    --shadow: 0 8px 28px rgba(29, 61, 94, .065);
    --radius: 18px;
    --content: 760px;
    --nav-height: 76px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-height: 100%; background: var(--background); }

body {
    min-height: 100%;
    margin: 0;
    color: var(--ink);
    background:
        linear-gradient(180deg, #f7faff 0, var(--background) 32rem);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.35rem; height: 1.35rem; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app-header {
    position: relative;
    z-index: 15;
    color: #fff;
    background: linear-gradient(125deg, #07549a 0%, #0869c6 72%, #1478d4 100%);
    box-shadow: 0 3px 14px rgba(4, 58, 112, .16);
}

.header-inner { max-width: 1080px; margin: 0 auto; min-height: 80px; padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.28); border-radius: 14px; background: rgba(255,255,255,.13); box-shadow: inset 0 1px rgba(255,255,255,.12); }
.brand-mark .icon { width: 28px; height: 28px; stroke-width: 1.8; }
.brand strong { display: block; font-size: 1.12rem; line-height: 1.15; letter-spacing: -.025em; }
.brand small { display: block; margin-top: 3px; color: #dceeff; font-size: .72rem; line-height: 1.25; }

.notification-center { position: relative; flex: 0 0 auto; }
.notification-button { position: relative; width: 44px; height: 44px; padding: 0; display: grid; place-items: center; color: inherit; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.24); border-radius: 13px; cursor: pointer; }
.notification-button .icon { width: 1.35rem; height: 1.35rem; }
.notification-badge { position: absolute; top: -5px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; display: grid; place-items: center; color: #fff; background: #d94f4f; border: 2px solid var(--blue-700); border-radius: 999px; font-size: .61rem; font-weight: 900; line-height: 1; }
.notification-panel { position: absolute; z-index: 80; top: calc(100% + 11px); right: 0; width: min(370px, calc(100vw - 24px)); overflow: hidden; color: var(--ink); background: #fff; border: 1px solid #d9e4ee; border-radius: 18px; box-shadow: 0 20px 60px rgba(8,27,47,.25); }
.notification-panel > header { min-height: 68px; padding: 14px 15px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid #e6edf3; }
.notification-panel > header h2 { margin: 1px 0 0; font-size: 1.12rem; }
.notification-panel > header > button { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; color: var(--muted); background: #eef3f7; border: 0; border-radius: 11px; cursor: pointer; }
.notification-list { max-height: min(440px, 55vh); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.notification-item { width: 100%; padding: 13px 14px; display: grid; grid-template-columns: 9px minmax(0, 1fr); gap: 10px; color: var(--ink); background: #fff; border: 0; border-bottom: 1px solid #edf2f6; text-align: left; cursor: pointer; }
.notification-item:hover { background: #f7fbff; }
.notification-item.unread { background: var(--blue-50); }
.notification-item-dot { width: 8px; height: 8px; margin-top: 6px; background: transparent; border-radius: 50%; }
.notification-item.unread .notification-item-dot { background: var(--blue-700); box-shadow: 0 0 0 3px rgba(8,104,199,.1); }
.notification-item-copy, .notification-item-copy strong, .notification-item-copy > span, .notification-item-copy time { display: block; min-width: 0; }
.notification-item-copy strong { font-size: .82rem; line-height: 1.35; }
.notification-item-copy > span { margin-top: 2px; overflow-wrap: anywhere; color: var(--muted); font-size: .75rem; }
.notification-item-copy time { margin-top: 5px; color: #8795a4; font-size: .68rem; }
.notification-loading, .notification-empty { margin: 0; padding: 30px 18px; color: var(--muted); font-size: .78rem; text-align: center; }
.notification-panel > footer { padding: 11px 13px 13px; display: grid; gap: 9px; background: #fbfdff; border-top: 1px solid #e6edf3; }
.notification-sound-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.notification-sound-row > span { color: var(--muted); font-size: .69rem; }
.notification-sound-row button, .notification-read-all { min-height: 34px; padding: 7px 10px; color: var(--blue-800); background: var(--blue-50); border: 1px solid #c8def1; border-radius: 9px; font-size: .7rem; font-weight: 800; cursor: pointer; }
.notification-read-all { width: 100%; color: #52677c; background: #fff; border-color: #d8e3ec; }
.notification-read-all:disabled { opacity: .5; cursor: default; }
.driver-notification-center .notification-panel { position: fixed; top: calc(80px + env(safe-area-inset-top)); right: 12px; }

.app-main { min-height: calc(100vh - 80px); }
.app-main.has-bottom-nav { padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 30px); }
.page { width: min(100% - 32px, var(--content)); margin: 0 auto; padding: 24px 0 38px; }
.page.narrow { max-width: 620px; }
.narrow-heading { max-width: 620px; margin-left: auto; margin-right: auto; }

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(1.65rem, 6.8vw, 2.15rem); line-height: 1.12; letter-spacing: -.035em; }
h2 { margin-bottom: 5px; font-size: 1.2rem; line-height: 1.3; letter-spacing: -.02em; }
.page-heading { margin-bottom: 20px; }
.page-heading p { max-width: 38rem; margin-bottom: 0; color: var(--muted); font-size: .94rem; line-height: 1.5; }
.page-heading.with-back { display: flex; flex-direction: column; align-items: flex-start; }
.eyebrow, .overline { display: block; color: var(--blue-700); font-size: .76rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.eyebrow { margin-bottom: 6px; }
.overline { margin-bottom: 2px; }
.back-link { min-height: 44px; margin: -8px 0 11px -10px; padding: 9px 10px; display: inline-flex; align-items: center; gap: 6px; color: var(--blue-800); font-size: .91rem; font-weight: 750; border-radius: 12px; }
.back-link:hover { background: var(--blue-100); }
.context-pill { max-width: 100%; margin-bottom: 11px; padding: 6px 10px; display: inline-flex; align-items: center; gap: 6px; overflow: hidden; color: var(--blue-800); background: #e5f2ff; border-radius: 999px; font-size: .76rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.context-pill .icon { width: 1rem; height: 1rem; }

.card { background: var(--surface); border: 1px solid rgba(213, 224, 235, .86); border-radius: var(--radius); box-shadow: var(--shadow); }
.form-card { padding: 20px; }
.field-label { margin-bottom: 8px; display: block; color: #34475d; font-size: .93rem; font-weight: 800; }
.field-label span { color: var(--muted); font-weight: 500; }
.input-with-icon { position: relative; display: flex; align-items: center; }
.input-with-icon > .icon { position: absolute; left: 16px; color: var(--blue-700); pointer-events: none; }
input[type="text"], input[type="search"], input[type="number"], textarea {
    width: 100%;
    color: var(--ink);
    background: #fbfdff;
    border: 1.5px solid #cfdce9;
    border-radius: 14px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
input[type="text"], input[type="search"] { min-height: 56px; padding: 0 15px; }
.input-with-icon input { padding-left: 49px; }
.input-large input { min-height: 64px; font-size: 1.3rem; font-weight: 700; letter-spacing: .025em; }
textarea { min-height: 118px; padding: 14px; resize: vertical; line-height: 1.5; }
input:focus, textarea:focus { background: #fff; border-color: var(--blue-600); box-shadow: 0 0 0 4px rgba(20, 120, 212, .12); }
input::placeholder, textarea::placeholder { color: #91a0af; font-weight: 450; letter-spacing: 0; }

.btn {
    min-height: 56px;
    padding: 13px 20px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 9px;
    border: 0;
    border-radius: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { color: #fff; background: linear-gradient(135deg, #0871cf, #0757a6); box-shadow: 0 7px 17px rgba(8, 104, 199, .18); }
.btn-primary:hover { box-shadow: 0 9px 20px rgba(8, 104, 199, .24); }
.btn-secondary { color: var(--blue-800); background: #fff; border: 1px solid #bfd6eb; box-shadow: none; }
.btn-block { width: 100%; }
.form-card > .btn { margin-top: 16px; }
.form-hint { margin: 13px 0 0; color: var(--muted); font-size: .83rem; text-align: center; }
.btn:disabled, .btn.is-loading { opacity: .7; cursor: wait; transform: none; }

.flash { width: min(100% - 32px, 620px); margin: 16px auto -4px; padding: 13px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #8d3f3f; background: var(--red-soft); border: 1px solid #f1c6c6; border-radius: 14px; box-shadow: 0 5px 16px rgba(99, 50, 50, .06); font-weight: 650; }
.flash-info { color: #255b88; background: #e9f4ff; border-color: #c7dff4; }
.flash-success { color: #176549; background: var(--green-soft); border-color: #bfe4d6; }
.flash-warning { color: #7d560c; background: var(--orange-soft); border-color: #ead39f; }
.flash-close { width: 30px; height: 30px; padding: 0; color: inherit; background: transparent; border: 0; font-size: 1.4rem; cursor: pointer; }

.found-card, .delivery-card { margin-top: 18px; padding: 20px; animation: rise .28s ease both; }
.card-title-row { display: flex; align-items: center; gap: 13px; }
.card-title-row h2 { margin: 0; font-size: 1.35rem; }
.round-icon { width: 45px; height: 45px; display: inline-grid; place-items: center; flex: 0 0 auto; color: var(--blue-700); background: var(--blue-100); border-radius: 14px; }
.round-icon.green { color: var(--green); background: var(--green-soft); }
.round-icon.red { color: var(--red); background: var(--red-soft); }
.round-icon.orange { color: var(--orange); background: var(--orange-soft); }
.round-icon.purple { color: var(--purple); background: var(--purple-soft); }
.round-icon.gray { color: #607184; background: #edf1f5; }
.data-list { margin: 18px 0; }
.data-list > div { padding: 11px 0; display: grid; grid-template-columns: minmax(92px, .7fr) 1.5fr; gap: 14px; border-bottom: 1px solid #edf2f7; }
.data-list > div:last-child { border-bottom: 0; }
.data-list dt { color: var(--muted); }
.data-list dd { margin: 0; font-weight: 750; text-align: right; }
.data-list.compact { margin: 0; }
.status-line { margin: -2px 0 18px; padding: 10px 12px; display: flex; align-items: center; gap: 8px; color: var(--green); background: var(--green-soft); border-radius: 11px; font-size: .89rem; font-weight: 800; }
.status-dot, .online-pill > span { width: 9px; height: 9px; display: inline-block; background: #23a772; border-radius: 50%; box-shadow: 0 0 0 4px rgba(35,167,114,.12); }

.greeting-row { margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.greeting-row h1 { margin: 0; }
.online-pill { padding: 7px 10px; display: inline-flex; align-items: center; gap: 8px; color: var(--green); background: var(--green-soft); border-radius: 999px; font-size: .74rem; font-weight: 800; white-space: nowrap; }
.online-pill > span { width: 7px; height: 7px; box-shadow: none; }
.route-card { overflow: hidden; border-color: #cedfec; box-shadow: 0 10px 30px rgba(25, 73, 117, .08); }
.route-top { padding: 19px 20px 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; color: #fff; background: linear-gradient(130deg, #0962b6, #0876ce); }
.route-top .overline { color: #cbe6ff; }
.route-top h2 { margin: 2px 0 0; font-size: 1.88rem; font-variant-numeric: tabular-nums; }
.badge { max-width: 138px; padding: 7px 10px; border-radius: 999px; font-size: .68rem; font-weight: 800; line-height: 1.25; text-align: center; }
.badge-success { color: #eafff6; background: rgba(3, 81, 52, .34); border: 1px solid rgba(255,255,255,.18); }
.route-details { margin: 0; padding: 7px 20px 8px; }
.route-details > div { padding: 12px 0; display: flex; justify-content: space-between; gap: 18px; border-bottom: 1px solid #edf2f7; }
.route-details > div:last-child { border: 0; }
.route-details dt { color: var(--muted); font-size: .91rem; }
.route-details dd { margin: 0; max-width: 62%; overflow-wrap: anywhere; font-weight: 780; text-align: right; }
.home-actions { margin: 18px 0; display: grid; gap: 10px; }
.btn-hero { min-height: 76px; padding: 14px 17px; justify-content: flex-start; text-align: left; }
.btn-hero > .icon:first-child { width: 1.7rem; height: 1.7rem; }
.btn-hero > .icon:last-child { margin-left: auto; }
.btn-hero span { display: flex; flex-direction: column; }
.btn-hero small { margin-top: 1px; color: #d8ebff; font-size: .75rem; font-weight: 500; }
.guidance-card { padding: 15px 16px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; box-shadow: 0 5px 18px rgba(23,55,88,.05); transition: transform .15s ease, border-color .15s ease; }
.guidance-card:hover { transform: translateY(-1px); border-color: #b5d5ef; }
.guidance-card strong, .guidance-card small { display: block; }
.guidance-card small { margin-top: 2px; color: var(--muted); font-size: .8rem; }
.guidance-card > .icon { color: #8090a0; }
.connection-state { margin: 22px auto 0; display: flex; justify-content: center; align-items: center; gap: 9px; color: var(--green); }
.connection-state .icon { width: 1.2rem; }
.connection-state strong, .connection-state small { display: block; }
.connection-state strong { font-size: .82rem; }
.connection-state small { color: var(--muted); font-size: .7rem; }

.problem-grid { display: grid; gap: 10px; }
.problem-card, .scope-btn { width: 100%; min-height: 80px; padding: 13px 14px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; color: var(--ink); background: var(--surface); border: 1px solid #dbe5ee; border-radius: 17px; box-shadow: 0 3px 13px rgba(23,55,88,.04); text-align: left; cursor: pointer; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.problem-card:hover, .scope-btn:hover { transform: translateY(-1px); border-color: #a7ccec; box-shadow: var(--shadow); }
.problem-card.selected { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(20,120,212,.1); }
.problem-card strong, .problem-card small, .scope-btn strong, .scope-btn small { display: block; }
.problem-card strong { font-size: 1rem; }
.problem-card small, .scope-btn small { margin-top: 2px; color: var(--muted); font-size: .78rem; }
.problem-card > .icon, .scope-btn > .icon { color: #8292a1; }

.product-search { max-width: 620px; margin: 0 auto 17px; position: sticky; top: 9px; z-index: 5; display: flex; align-items: center; border-radius: 15px; box-shadow: 0 7px 18px rgba(34,70,105,.08); }
.product-search .icon { position: absolute; left: 16px; z-index: 1; color: var(--blue-700); }
.product-search input { min-height: 56px; padding-left: 49px; background: #fff; }
.scope-actions { max-width: 620px; margin: 0 auto; display: grid; gap: 10px; }
.scope-btn { min-height: 75px; }
.section-divider { max-width: 620px; margin: 19px auto; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .75rem; font-weight: 650; text-align: center; }
.section-divider::before, .section-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.product-list { display: grid; gap: 10px; }
.product-card { position: relative; min-height: 112px; padding: 11px; display: grid; grid-template-columns: 88px minmax(0, 1fr) 30px; align-items: center; gap: 13px; background: var(--surface); border: 1px solid #d8e3ed; border-radius: 17px; box-shadow: 0 3px 13px rgba(23,55,88,.045); cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.product-card:hover { transform: translateY(-1px); border-color: #a9ccec; }
.product-card:has(input:checked) { border-color: var(--blue-600); background: #fbfdff; box-shadow: 0 0 0 3px rgba(20,120,212,.1), var(--shadow); }
.product-card > input { position: absolute; opacity: 0; pointer-events: none; }
.product-card img { width: 88px; height: 80px; object-fit: cover; border-radius: 12px; background: #eef3f7; }
.product-info strong, .product-info small, .product-info span { display: block; }
.product-info strong { line-height: 1.3; }
.product-info small { margin-top: 3px; color: var(--muted); font-size: .78rem; }
.product-info span { margin-top: 7px; color: var(--blue-800); font-size: .78rem; font-weight: 800; }
.select-indicator { width: 25px; height: 25px; display: grid; place-items: center; color: transparent; border: 2px solid #bfccd8; border-radius: 50%; transition: all .15s ease; }
.select-indicator .icon { width: .95rem; height: .95rem; stroke-width: 3; }
.product-card:has(input:checked) .select-indicator { color: #fff; background: var(--blue-700); border-color: var(--blue-700); }
.sticky-action { position: sticky; bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 9px); z-index: 4; max-width: 620px; margin: 18px auto 0; padding: 7px; background: rgba(244,248,252,.94); border: 1px solid rgba(218,228,237,.78); border-radius: 18px; box-shadow: 0 7px 20px rgba(23,55,88,.07); backdrop-filter: blur(12px); }
.empty-search { padding: 24px; color: var(--muted); background: #fff; border: 1px dashed #bdcad6; border-radius: 16px; text-align: center; }

/* Seleção de produtos da ocorrência */
.product-selection-methods { margin-bottom: 28px; display: grid; gap: 10px; }
.product-method { min-height: 58px; }
.product-selection-methods .btn-primary { min-height: 68px; font-size: 1rem; }
.product-selection-methods .btn-primary .icon { width: 1.55rem; height: 1.55rem; }
.selected-products-section { margin-bottom: 30px; }
.section-heading-row { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-heading-row h2 { margin: 0; }
.selection-count { min-width: 36px; min-height: 32px; padding: 0 10px; display: grid; place-items: center; color: var(--blue-800); background: var(--blue-100); border-radius: 999px; font-size: .82rem; font-weight: 850; }
.selected-products-empty { padding: 22px 18px; color: var(--muted); background: #f8fbfe; border: 1px dashed #b9cede; border-radius: 16px; text-align: center; }
.selected-product-list { display: grid; gap: 11px; }
.selected-product-card { padding: 14px; display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; border-color: #d6e3ed; box-shadow: 0 3px 14px rgba(23,55,88,.045); }
.selected-product-card > img { width: 72px; height: 70px; object-fit: cover; border-radius: 12px; background: #eef3f7; }
.selected-product-copy h3 { margin: 0 0 7px; font-size: 1rem; }
.selected-product-copy dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 5px 10px; }
.selected-product-copy dl div { min-width: 0; }
.selected-product-copy dt { color: var(--muted); font-size: .67rem; }
.selected-product-copy dd { margin: 0; overflow-wrap: anywhere; font-size: .77rem; font-weight: 750; }
.selected-product-actions { grid-column: 1 / -1; padding-top: 12px; display: flex; align-items: end; justify-content: space-between; gap: 10px; border-top: 1px solid #e8eef4; }
.selected-quantity-form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.selected-quantity-form > label { color: var(--muted); font-size: .72rem; font-weight: 750; }
.selected-quantity-form > label small { display: block; }
.selected-quantity-form .quantity-control { grid-template-columns: 42px 46px 42px; }
.selected-quantity-form .quantity-control button, .selected-quantity-form .quantity-control input { min-height: 42px; }
.product-edit-button, .product-remove-button { min-height: 44px; padding: 9px 13px; border: 0; border-radius: 11px; font-size: .76rem; font-weight: 800; cursor: pointer; }
.product-edit-button { color: var(--blue-800); background: var(--blue-100); }
.product-remove-button { color: var(--red); background: var(--red-soft); }
.add-another-product, .continue-products-form { margin-top: 12px; }
.product-scope-actions { margin-top: 12px; }
.product-scope-actions form { min-width: 0; }
.duplicate-product-alert { margin-bottom: 12px; padding: 14px; display: grid; gap: 5px; color: #744b08; background: var(--orange-soft); border: 1px solid #ecd49e; border-radius: 15px; }
.duplicate-product-alert > div { margin-top: 6px; display: flex; gap: 8px; }
.duplicate-product-alert .btn { min-height: 42px; padding: 9px 12px; font-size: .76rem; }
.manual-products-section { padding-top: 26px; border-top: 1px solid #dce6ef; }
.manual-product-card { grid-template-columns: 84px minmax(0, 1fr); align-items: start; }
.manual-product-card img { width: 84px; height: 76px; }
.manual-product-card .product-info { min-width: 0; }
.single-lot-choice { margin: 10px 0 2px; padding: 9px 10px; display: flex; align-items: center; gap: 9px; color: var(--blue-800); background: var(--blue-50); border-radius: 11px; font-size: .8rem; font-weight: 800; }
.single-lot-choice input, .lot-options input { width: 22px; height: 22px; flex: 0 0 auto; accent-color: var(--blue-700); }
.lot-options { margin: 10px 0 0; padding: 0; border: 0; }
.lot-options legend { margin-bottom: 7px; color: var(--muted); font-size: .72rem; font-weight: 750; }
.lot-options label { padding: 9px 10px; display: flex; align-items: center; gap: 9px; background: #f7fafc; border: 1px solid transparent; border-radius: 11px; }
.lot-options label + label { margin-top: 6px; }
.lot-options label:has(input:checked) { color: var(--blue-800); background: var(--blue-50); border-color: #bfdcf4; }
.lot-options label span, .lot-options label small { display: block; }
.lot-options label b { font-size: .8rem; }
.lot-options label small { margin: 1px 0 0; }
.barcode-dialog { width: min(calc(100vw - 16px), 560px); max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); padding: 0; border: 0; border-radius: 22px; box-shadow: 0 24px 70px rgba(8,27,47,.3); }
.barcode-dialog::backdrop { background: rgba(8,18,31,.72); }
.barcode-dialog-content { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); padding: 18px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.barcode-dialog header { position: sticky; top: -18px; z-index: 2; margin: -18px -18px 0; padding: 18px 18px 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; background: rgba(255,255,255,.97); border-bottom: 1px solid #edf2f7; backdrop-filter: blur(12px); }
.barcode-dialog header h2 { margin: 2px 0 0; }
.barcode-dialog header > button { width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center; color: var(--muted); background: #eef3f7; border: 0; border-radius: 12px; cursor: pointer; }
.barcode-intro { margin: 15px 0 13px; color: var(--muted); font-size: .84rem; line-height: 1.5; }
.barcode-methods { display: grid; gap: 9px; }
.barcode-methods[hidden] { display: none; }
.barcode-methods > .btn { min-height: 56px; }
.barcode-photo-button { cursor: pointer; }
.barcode-photo-button input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.barcode-typed-form { padding: 14px; display: grid; gap: 8px; background: #f6f9fc; border: 1px solid #e0e8f0; border-radius: 14px; }
.barcode-typed-form > label { color: var(--ink); font-size: .78rem; font-weight: 800; }
.barcode-typed-form > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.barcode-typed-form input { min-width: 0; min-height: 46px; padding: 10px 12px; border: 1px solid #cbd7e2; border-radius: 10px; font: inherit; }
.barcode-typed-form .btn { min-height: 46px; padding-inline: 13px; }
.barcode-dialog video { width: 100%; max-height: 52dvh; margin-top: 14px; object-fit: cover; aspect-ratio: 4 / 3; background: #101820; border-radius: 15px; }
.barcode-status { min-height: 44px; margin: 14px 0; padding: 10px 12px; display: flex; align-items: center; color: var(--muted); background: #f6f9fc; border-radius: 12px; font-size: .84rem; overflow-wrap: anywhere; }
.barcode-result { margin-bottom: 12px; padding: 14px; display: grid; gap: 4px; background: var(--blue-50); border: 1px solid #c9e0f4; border-radius: 14px; }
.barcode-result > span, .barcode-result > small { color: var(--muted); }
.barcode-result fieldset { margin: 8px 0; padding: 0; border: 0; }
.barcode-result legend { margin-bottom: 5px; font-size: .76rem; font-weight: 800; }
.barcode-result fieldset label { padding: 9px 10px; display: flex; align-items: center; gap: 9px; background: rgba(255,255,255,.7); border: 1px solid transparent; border-radius: 10px; }
.barcode-result fieldset label + label { margin-top: 6px; }
.barcode-result fieldset label:has(input:checked) { border-color: #acd2f1; background: #fff; }
.barcode-result fieldset input { width: 22px; height: 22px; }
.barcode-result fieldset span, .barcode-result fieldset small { display: block; }
.barcode-actions, .barcode-duplicate-actions { display: grid; gap: 8px; }
.barcode-actions .btn, .barcode-duplicate-actions .btn { min-height: 52px; }
.barcode-diagnostics { margin-top: 14px; padding: 11px 12px; color: var(--muted); background: #f7f9fb; border-radius: 12px; font-size: .71rem; }
.barcode-diagnostics summary { min-height: 28px; display: flex; align-items: center; cursor: pointer; font-weight: 750; }
.barcode-diagnostics dl { margin: 9px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 5px 12px; }
.barcode-diagnostics dl div { display: flex; justify-content: space-between; gap: 7px; }
.barcode-diagnostics dd { margin: 0; font-weight: 800; }
.barcode-diagnostics p { margin: 8px 0 0; line-height: 1.45; }

@media (max-width: 430px) {
    .barcode-typed-form > div { grid-template-columns: 1fr; }
}

.occurrence-form { display: grid; gap: 16px; }
.all-delivery-banner { padding: 14px 16px; display: flex; align-items: center; gap: 12px; color: var(--purple); background: var(--purple-soft); border: 1px solid #dbcaf9; border-radius: 16px; }
.all-delivery-banner strong, .all-delivery-banner small { display: block; }
.all-delivery-banner small { color: #705f8c; }
.item-detail-card { padding: 17px; }
.detail-product { display: grid; grid-template-columns: 91px 1fr; align-items: center; gap: 14px; }
.detail-product img { width: 91px; height: 78px; object-fit: cover; border-radius: 13px; }
.detail-product h2 { margin-bottom: 2px; }
.detail-product p { margin: 0; color: var(--muted); font-size: .82rem; }
.inline-data { margin: 16px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.inline-data > div { padding: 11px 12px; background: #f6f9fc; border-radius: 12px; }
.inline-data dt { color: var(--muted); font-size: .75rem; }
.inline-data dd { margin: 2px 0 0; font-weight: 800; }
.quantity-row { padding-top: 15px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-top: 1px solid #edf2f7; }
.quantity-row .field-label { margin: 0; }
.quantity-row small { color: var(--muted); font-size: .74rem; }
.quantity-control { display: grid; grid-template-columns: 48px 52px 48px; overflow: hidden; border: 1px solid #b9cde0; border-radius: 14px; }
.quantity-control button { min-height: 46px; padding: 0; color: var(--blue-800); background: var(--blue-50); border: 0; font-size: 1.45rem; font-weight: 700; cursor: pointer; }
.quantity-control input { min-height: 46px; padding: 0; text-align: center; background: #fff; border: 0; border-left: 1px solid #d4e0eb; border-right: 1px solid #d4e0eb; border-radius: 0; font-weight: 850; -moz-appearance: textfield; }
.quantity-control input::-webkit-inner-spin-button { appearance: none; }
.fixed-quantity { color: var(--purple); font-size: 1.1rem; }
.upload-field { min-height: 68px; padding: 2px 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; cursor: pointer; }
.upload-field strong, .upload-field small { display: block; }
.upload-field small { margin-top: 2px; color: var(--muted); font-size: .72rem; }
.upload-action { color: var(--blue-700); font-size: .8rem; font-weight: 850; }
.upload-field.separated { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.image-preview { margin-top: 14px; position: relative; overflow: hidden; border-radius: 15px; background: #edf3f8; }
.image-preview img { width: 100%; max-height: 330px; object-fit: contain; }
.image-preview button { position: absolute; right: 10px; bottom: 10px; padding: 8px 11px; color: #fff; background: rgba(23,37,54,.82); border: 0; border-radius: 9px; font-size: .76rem; font-weight: 750; cursor: pointer; }
.textarea-label { margin-top: 20px; }
.character-count { margin-top: 5px; color: var(--muted); font-size: .75rem; text-align: right; }
.btn-submit { min-height: 61px; }
.prototype-note { margin: -2px 12px 0; color: var(--muted); font-size: .73rem; text-align: center; }
.issue-summary { padding: 15px; display: flex; align-items: center; gap: 12px; }
.issue-summary small, .issue-summary strong { display: block; }
.issue-summary small { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

.result-page { padding-top: 30px; }
.success-hero { margin-bottom: 20px; text-align: center; }
.success-mark { width: 72px; height: 72px; margin: 0 auto 15px; display: grid; place-items: center; color: var(--green); background: var(--green-soft); border: 1px solid #bce7d7; border-radius: 23px; box-shadow: 0 8px 22px rgba(22,134,91,.11); }
.success-mark .icon { width: 37px; height: 37px; stroke-width: 2.4; }
.success-hero.waiting .success-mark { color: var(--blue-700); background: var(--blue-100); border-color: #c2def8; box-shadow: 0 9px 25px rgba(8,104,199,.12); }
.success-hero h1 { margin-bottom: 6px; }
.success-hero p { color: var(--muted); }
.success-hero p strong { color: var(--ink); }
.result-summary { padding: 10px 18px; }
.guideline-result { margin-top: 15px; padding: 20px; color: #164e3c; background: linear-gradient(145deg, #effcf7, #e2f6ee); border: 1px solid #bde6d7; border-radius: var(--radius); box-shadow: 0 8px 24px rgba(22,134,91,.08); }
.guideline-heading { display: flex; align-items: center; gap: 12px; }
.guideline-heading .overline { color: var(--green); }
.guideline-heading h2 { margin: 0; }
.guideline-result > p { margin: 16px 0 9px; font-size: 1.04rem; font-weight: 620; line-height: 1.6; }
.guideline-result > small { color: #568174; }
.benefit-grid { margin: 15px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.benefit-grid > div { min-height: 92px; padding: 11px 7px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; color: var(--green); background: #fff; border: 1px solid #d7e8e1; border-radius: 14px; text-align: center; box-shadow: 0 3px 12px rgba(23,55,88,.04); }
.benefit-grid span { color: #345b4e; font-size: .7rem; font-weight: 800; line-height: 1.25; }
.waiting-card { margin: 15px 0; padding: 18px; display: flex; gap: 13px; }
.waiting-card h2 { margin-bottom: 5px; }
.waiting-card p { margin: 0; color: var(--muted); }
.result-actions { display: grid; gap: 10px; margin-top: 18px; }

.filter-tabs { margin: 0 -16px 18px; padding: 0 16px 8px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tabs a { min-height: 44px; padding: 10px 14px; display: flex; align-items: center; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 999px; font-size: .81rem; font-weight: 800; white-space: nowrap; }
.filter-tabs a.active { color: #fff; background: var(--blue-700); border-color: var(--blue-700); box-shadow: 0 5px 13px rgba(8,104,199,.17); }
.ticket-list { display: grid; gap: 12px; }
.ticket-card { padding: 17px; box-shadow: 0 3px 14px rgba(23,55,88,.045); transition: transform .15s ease, border-color .15s ease; }
.ticket-card:hover { transform: translateY(-1px); border-color: #afcfea; }
.ticket-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ticket-top > strong { color: var(--blue-800); font-size: .82rem; }
.ticket-card h2 { margin: 14px 0 4px; font-size: 1.08rem; }
.ticket-card > p { margin-bottom: 13px; color: var(--muted); font-size: .85rem; }
.ticket-bottom { padding-top: 12px; display: flex; align-items: center; gap: 8px; color: var(--muted); border-top: 1px solid #edf2f7; font-size: .73rem; }
.ticket-bottom > span { display: inline-flex; align-items: center; gap: 4px; }
.ticket-bottom > .icon { margin-left: auto; color: #8494a4; }
.ticket-bottom .icon { width: .95rem; height: .95rem; }
.status-badge { padding: 5px 8px; display: inline-block; border-radius: 999px; font-size: .67rem; font-weight: 850; line-height: 1.25; text-align: center; }
.status-badge.large { padding: 7px 11px; font-size: .76rem; }
.status-aguardando { color: #855800; background: var(--orange-soft); }
.status-em_atendimento { color: var(--blue-800); background: var(--blue-100); }
.status-encaminhado_cd { color: var(--blue); background: var(--blue-soft); }
.status-finalizado, .status-resolvido_automaticamente { color: var(--green); background: var(--green-soft); }
.empty-state { padding: 38px 22px; display: flex; flex-direction: column; align-items: center; color: var(--ink); background: #fbfdff; text-align: center; }
.empty-state h1, .empty-state h2 { margin: 14px 0 7px; }
.empty-state p { max-width: 27rem; margin-bottom: 19px; color: var(--muted); }
.section-title { margin: 23px 3px 10px; font-size: 1rem; }
.compact-product { margin-bottom: 10px; padding: 11px; display: grid; grid-template-columns: 78px 1fr; align-items: center; gap: 12px; }
.compact-product img { width: 78px; height: 67px; object-fit: cover; border-radius: 11px; }
.compact-product strong, .compact-product span, .compact-product small { display: block; }
.compact-product span, .compact-product small { color: var(--muted); font-size: .77rem; }
.compact-product small { margin-top: 4px; }
.text-card { margin-top: 13px; padding: 18px; }
.text-card p { margin: 8px 0 0; }
.attached-image { width: 100%; max-height: 480px; object-fit: contain; background: #eaf0f5; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.compact-guideline { margin-top: 18px; }

.profile-card { margin-bottom: 14px; padding: 24px 20px 10px; text-align: center; }
.avatar { width: 70px; height: 70px; margin: 0 auto 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--blue-700), var(--blue-900)); border-radius: 22px; font-size: 1.65rem; font-weight: 850; box-shadow: 0 8px 20px rgba(8,104,199,.2); }
.profile-card > p { color: var(--muted); }
.profile-card .data-list { text-align: left; }

.bottom-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 20; min-height: calc(var(--nav-height) + env(safe-area-inset-bottom)); padding: 6px max(16px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(16px, env(safe-area-inset-left)); display: grid; grid-template-columns: repeat(3, 1fr); background: rgba(255,255,255,.97); border-top: 1px solid #dce6ef; box-shadow: 0 -7px 22px rgba(23,55,88,.07); backdrop-filter: blur(16px); }
.bottom-nav a { min-height: 64px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 3px; color: #738396; border-radius: 14px; font-size: .7rem; font-weight: 750; transition: color .15s ease, background .15s ease; }
.bottom-nav a.active { color: var(--blue-800); background: #e5f2ff; }
.bottom-nav .icon { width: 1.42rem; height: 1.42rem; }

.btn.is-loading::after {
    content: "";
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes rise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

@media (min-width: 700px) {
    .header-inner { min-height: 92px; padding-left: 28px; padding-right: 28px; }
    .app-main { min-height: calc(100vh - 92px); }
    .page { padding-top: 38px; }
    .problem-grid { grid-template-columns: 1fr 1fr; }
    .problem-card:last-child { grid-column: 1 / -1; }
    .product-list { grid-template-columns: 1fr 1fr; }
    .scope-actions { grid-template-columns: 1fr 1fr; }
    .bottom-nav { left: 50%; width: min(520px, calc(100% - 32px)); bottom: 14px; transform: translateX(-50%); padding: 7px; border: 1px solid #dce6ef; border-radius: 22px; }
    .app-main.has-bottom-nav { padding-bottom: 118px; }
    .sticky-action { bottom: 104px; }
}

@media (max-width: 390px) {
    .page { width: min(100% - 24px, var(--content)); padding-top: 22px; }
    .header-inner { min-height: 78px; padding: 12px 14px; }
    .app-main { min-height: calc(100vh - 78px); }
    .brand-mark { width: 43px; height: 43px; border-radius: 13px; }
    .brand strong { font-size: 1.08rem; }
    .brand small { font-size: .69rem; }
    .brand { min-width: 0; gap: 9px; }
    .brand > span:last-child { min-width: 0; }
    .brand small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .notification-panel { width: calc(100vw - 20px); }
    .driver-notification-center .notification-panel { right: 10px; }
    .form-card, .found-card, .delivery-card { padding: 17px; }
    .product-card { grid-template-columns: 78px minmax(0, 1fr) 27px; gap: 10px; }
    .product-card img { width: 78px; height: 72px; }
    .manual-product-card { grid-template-columns: 76px minmax(0, 1fr); }
    .manual-product-card img { width: 76px; height: 70px; }
    .selected-product-card { grid-template-columns: 66px minmax(0, 1fr); gap: 10px; }
    .selected-product-card > img { width: 66px; height: 66px; }
    .selected-product-actions { align-items: stretch; }
    .selected-quantity-form { flex: 1 1 auto; }
    .product-remove-button { align-self: end; }
    .benefit-grid span { font-size: .64rem; }
    .ticket-bottom { flex-wrap: wrap; }
}

@media (max-width: 365px) {
    .route-top { padding: 17px 16px; }
    .route-details { padding-left: 16px; padding-right: 16px; }
    .route-details > div { gap: 10px; }
    .btn { padding-left: 15px; padding-right: 15px; }
    .selected-product-copy dl { grid-template-columns: 1fr; }
    .selected-product-actions { flex-direction: column; align-items: stretch; }
    .product-remove-button { align-self: stretch; }
    .benefit-grid { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Chat compartilhado entre motorista e CAT */
.mobile-ticket-page { display: grid; gap: 13px; }
.mobile-ticket-page > .page-heading { margin-bottom: 0; }
.mobile-service-state { padding: 14px 15px; display: flex; align-items: center; gap: 12px; border: 1px solid; border-radius: 16px; }
.mobile-service-state strong, .mobile-service-state small { display: block; }
.mobile-service-state small { margin-top: 2px; font-size: .78rem; }
.mobile-service-state.waiting { color: #7d560c; background: var(--orange-soft); border-color: #edd39a; }
.mobile-service-state.active { color: #176549; background: var(--green-soft); border-color: #bde4d5; }
.mobile-service-state.cd { color: #60379e; background: var(--purple-soft); border-color: #d9c8f5; }
.ticket-context { overflow: hidden; }
.ticket-context summary { min-height: 56px; padding: 14px 16px; display: flex; align-items: center; gap: 8px; color: var(--blue-800); font-weight: 800; cursor: pointer; list-style: none; }
.ticket-context summary::-webkit-details-marker { display: none; }
.ticket-context summary .icon { margin-left: auto; transition: transform .2s; }
.ticket-context[open] summary .icon { transform: rotate(90deg); }
.ticket-context > :not(summary) { margin-left: 16px; margin-right: 16px; }
.ticket-context .data-list { padding-top: 3px; border-top: 1px solid var(--line); }
.compact-product.embedded { padding: 10px 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.context-observation { padding: 14px 0 17px; border-top: 1px solid var(--line); }
.context-observation p { margin: 5px 0 0; }

.mobile-chat { overflow: hidden; display: flex; flex-direction: column; min-height: 500px; border-color: #d6e2ec; box-shadow: 0 6px 22px rgba(23,55,88,.06); }
.mobile-chat-header { min-height: 60px; padding: 12px 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff; border-bottom: 1px solid #e6edf3; }
.mobile-chat-header > div { display: flex; align-items: center; gap: 8px; }
.mobile-chat-header small { color: var(--muted); font-size: .7rem; }
.online-chat-dot { width: 9px; height: 9px; background: #25a976; border-radius: 50%; box-shadow: 0 0 0 4px rgba(37,169,118,.12); }
.chat-messages { min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #f7fafc; overscroll-behavior-y: auto; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.mobile-chat-messages { height: min(54vh, 480px); height: clamp(320px, 53dvh, 490px); min-height: 290px; padding: 15px 13px 18px; gap: 11px; background: linear-gradient(180deg, #f8fbfd, #f4f8fb); scrollbar-gutter: stable; }
.chat-loading, .chat-empty { margin: auto; color: var(--muted); font-size: .82rem; text-align: center; }
.mobile-chat .chat-loading::before { content: ""; width: 18px; height: 18px; margin: 0 auto 8px; display: block; border: 2px solid #b6c9d9; border-right-color: var(--blue-700); border-radius: 50%; animation: spin .7s linear infinite; }
.chat-message { width: 100%; display: flex; }
.message-cat { justify-content: flex-end; }
.message-motorista { justify-content: flex-start; }
.message-sistema { justify-content: center; }
.mobile-chat .message-bubble { max-width: min(84%, 440px); padding: 10px 12px; color: #26384a; background: #fff; border: 1px solid #dce6ef; border-radius: 7px 16px 16px 16px; box-shadow: 0 2px 7px rgba(23,55,88,.04); }
.mobile-chat .message-cat .message-bubble { color: #fff; background: linear-gradient(135deg, #1478d4, #075cae); border-color: #116dc3; border-radius: 16px 7px 16px 16px; }
.message-bubble header { margin-bottom: 4px; display: flex; justify-content: space-between; gap: 18px; }
.message-bubble header strong { font-size: .69rem; }
.message-bubble header time { color: #77889a; font-size: .64rem; white-space: nowrap; }
.message-cat .message-bubble header time { color: #d1e8ff; }
.message-bubble p { margin: 0; font-size: .88rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.mobile-chat .system-message { max-width: 92%; padding: 7px 11px; color: #637487; background: #e8eef4; border-radius: 10px; font-size: .68rem; font-weight: 750; line-height: 1.4; text-align: center; }
.chat-photo { width: 100%; margin: 3px 0 5px; padding: 0; overflow: hidden; background: transparent; border: 0; border-radius: 11px; cursor: zoom-in; }
.chat-photo img { width: 100%; max-height: 230px; object-fit: cover; }
.chat-audio { width: min(290px, 100%); height: 42px; margin: 3px 0; display: block; }
/* Controles compartilhados: reprodução sempre visível, sem controles nativos comprimidos. */
.compact-audio-player { width: 300px; max-width: 100%; min-width: 0; margin: 5px 0; padding: 8px; display: grid; grid-template-columns: 44px minmax(0,1fr); gap: 8px; align-items: center; color: #24435e; background: #f1f6fa; border: 1px solid #dde7ef; border-radius: 12px; }
.compact-audio-player[hidden] { display: none !important; }
.compact-audio-element { display: none !important; }
.compact-audio-player button { display: grid; place-items: center; padding: 0; color: #075cae; background: #fff; border: 1px solid #d4e2ed; border-radius: 50%; cursor: pointer; }
.compact-audio-player .audio-play { width: 44px; height: 44px; }
.compact-audio-player .icon { width: 21px; height: 21px; }
.audio-progress { min-width: 0; display: grid; gap: 4px; }
.compact-audio-player input[type="range"] { width: 100%; min-width: 0; height: 20px; min-height: 20px; padding: 0; margin: 0; border: 0; border-radius: 0; accent-color: #0869c1; cursor: pointer; }
.audio-play-time { font-size: 12px; line-height: 1.3; font-variant-numeric: tabular-nums; color: #587086; }
.audio-volume { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; border-top: 1px solid #dde7ef; padding-top: 5px; }
.audio-volume button { width: 32px; height: 32px; background: transparent; border: 0; }
.audio-volume input { max-width: 100px; }
.audio-play-error { grid-column: 1 / -1; color: #ad4040; font-size: 12px; }
.compact-audio-player button:focus-visible,.compact-audio-player input:focus-visible { outline: 2px solid #1379d0; outline-offset: 3px; }
.message-cat .compact-audio-player { background: #edf5fc; border-color: #dbe8f4; }
.audio-recorder .compact-audio-player { grid-column: 1 / -1; width: 100%; }
@media (max-width: 699px) { .compact-audio-player .audio-volume { display: none; } }
.message-cat .chat-audio { filter: saturate(.8); }
.chat-composer { padding: 10px; display: grid; grid-template-columns: 42px minmax(0,1fr) 42px 44px; align-items: end; gap: 6px; background: #fff; border-top: 1px solid var(--line); }
.mobile-chat .chat-composer { padding: 10px 11px; grid-template-columns: 44px minmax(0,1fr) 44px 46px; gap: 6px; }
.chat-composer textarea { min-height: 42px; max-height: 112px; padding: 10px 12px; background: #f3f7fa; border: 1px solid #d7e2eb; border-radius: 15px; resize: none; }
.mobile-chat .chat-composer textarea { min-height: 44px; padding: 10px 12px; line-height: 1.35; }
.composer-icon, .composer-send { width: 42px; height: 42px; padding: 0; display: grid; place-items: center; color: var(--blue-700); background: var(--blue-50); border: 0; border-radius: 13px; cursor: pointer; }
.mobile-chat .composer-icon { width: 44px; height: 44px; }
.composer-send { width: 44px; color: #fff; background: var(--blue-700); }
.mobile-chat .composer-send { width: 46px; height: 44px; box-shadow: 0 4px 11px rgba(8,104,199,.18); }
.composer-icon:focus-visible, .composer-send:focus-visible, .attachment-sheet button:focus-visible { outline: 3px solid rgba(20,120,212,.22); outline-offset: 2px; }
.composer-icon:disabled, .composer-send:disabled, .chat-composer.disabled { opacity: .5; }
.selected-file { padding: 7px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--blue-800); background: var(--blue-50); font-size: .74rem; }
.selected-file button { color: var(--red); background: transparent; border: 0; font-weight: 800; cursor: pointer; }
.attachment-sheet { padding: 9px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; background: #fff; border-top: 1px solid var(--line); }
.mobile-chat .attachment-sheet { padding: 10px 12px; }
.attachment-sheet button { min-height: 63px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--blue-800); background: var(--blue-50); border: 1px solid #cee1f2; border-radius: 13px; font-size: .74rem; font-weight: 800; cursor: pointer; }
.mobile-chat .attachment-sheet button { min-height: 68px; }
.audio-recorder { padding: 10px 12px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; background: #fff4f4; border-top: 1px solid #f1cece; }
.mobile-chat .audio-recorder { padding: 12px; background: #fff6f6; }
.recording-dot { width: 10px; height: 10px; background: #d24d4d; border-radius: 50%; animation: pulse-record 1s infinite; }
.audio-recorder strong { color: #a64242; font-size: .78rem; }
.audio-recorder time { color: #7f4a4a; font-variant-numeric: tabular-nums; font-size: .78rem; }
.audio-recorder audio { grid-column: 1 / -1; width: 100%; height: 40px; }
.audio-recorder button { min-height: 42px; padding: 8px 12px; border: 0; border-radius: 11px; font-size: .75rem; font-weight: 800; cursor: pointer; }
.audio-recorder-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.audio-cancel { color: #874646; background: #fff; }
.audio-stop { color: #fff; background: #c14c4c; }
.audio-send { color: #fff; background: var(--blue-700); }
.chat-support, .chat-closed { margin: 0; padding: 7px 12px 10px; color: var(--muted); background: #fff; font-size: .7rem; text-align: center; }
.chat-closed { padding: 14px; border-top: 1px solid var(--line); }
.media-dialog { width: min(94vw, 1000px); max-height: 92vh; padding: 0; overflow: visible; background: transparent; border: 0; }
.media-dialog::backdrop { background: rgba(8,18,31,.86); backdrop-filter: blur(5px); }
.media-dialog img { width: 100%; max-height: 88vh; object-fit: contain; border-radius: 12px; }
.media-dialog > button { position: absolute; top: -18px; right: -12px; width: 42px; height: 42px; display: grid; place-items: center; color: #fff; background: #26384a; border: 2px solid #fff; border-radius: 50%; cursor: pointer; }
@keyframes pulse-record { 50% { opacity: .35; transform: scale(.8); } }

@media (max-width: 390px) {
    .mobile-chat-header { align-items: flex-start; }
    .mobile-chat-header small { max-width: 82px; text-align: right; }
    .mobile-chat .chat-composer { grid-template-columns: 42px minmax(0, 1fr) 42px 44px; padding-left: 8px; padding-right: 8px; gap: 5px; }
    .mobile-chat .composer-icon { width: 42px; }
    .mobile-chat .composer-send { width: 44px; }
}

@media (max-width: 365px) {
    .mobile-chat .chat-composer { grid-template-columns: 40px minmax(0, 1fr) 40px 42px; gap: 4px; padding-left: 6px; padding-right: 6px; }
    .mobile-chat .composer-icon { width: 40px; }
    .mobile-chat .composer-send { width: 42px; }
    .mobile-chat .chat-composer textarea { padding-left: 10px; padding-right: 10px; font-size: .9rem; }
}
