/* Estrada — controle de viagens para caminhoneiros autônomos */
* { box-sizing: border-box; }

:root {
    --ios-bg: #f2f2f7;
    --ios-elevated: rgba(255, 255, 255, 0.82);
    --ios-card: #ffffff;
    --ios-text: #1a1a2e;
    --ios-secondary: rgba(60, 60, 67, 0.6);
    --ios-tertiary: rgba(60, 60, 67, 0.3);
    --ios-separator: rgba(60, 60, 67, 0.18);
    --ios-accent: #e5a823;
    --ios-accent-press: #c8921d;
    --ios-brand-navy: #0b1f3f;
    --ios-blue: #007aff;
    --ios-green: #34c759;
    --ios-orange: #ff9500;
    --ios-red: #ff3b30;
    --ios-radius-lg: 22px;
    --ios-radius-md: 14px;
    --ios-radius-sm: 12px;
    --ios-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    --ios-tabbar-h: 52px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
    --surface-glass: rgba(255, 255, 255, 0.9);
    --navbar-bg: rgba(242, 242, 247, 0.82);
    --tabbar-bg: rgba(250, 250, 250, 0.88);
    --input-bg: #f2f2f7;
    --input-bg-focus: #e8e8ed;
    --table-head-bg: rgba(242, 242, 247, 0.9);
}

[data-theme="dark"] {
    color-scheme: dark;
    --ios-bg: #0d0d14;
    --ios-card: #1c1c24;
    --ios-text: #f2f2f7;
    --ios-secondary: rgba(235, 235, 245, 0.6);
    --ios-separator: rgba(84, 84, 88, 0.65);
    --ios-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    --surface-glass: rgba(28, 28, 36, 0.92);
    --navbar-bg: rgba(28, 28, 36, 0.86);
    --tabbar-bg: rgba(28, 28, 36, 0.92);
    --input-bg: #2c2c34;
    --input-bg-focus: #3a3a44;
    --table-head-bg: #2c2c34;
}

[data-theme="light"] {
    color-scheme: light;
}

html {
    -webkit-text-size-adjust: 100%;
}

body.ios-shell {
    margin: 0;
    min-height: 100dvh;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "SF Pro Text",
        "SF Pro Display",
        "Inter",
        system-ui,
        sans-serif;
    color: var(--ios-text);
    background: var(--ios-bg);
    letter-spacing: -0.022em;
    position: relative;
}

body.ios-shell.has-wallpaper::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    background: center / cover no-repeat var(--wallpaper-url);
    opacity: var(--wallpaper-opacity, 0.12);
    pointer-events: none;
}

body.has-wallpaper .ios-app {
    position: relative;
    z-index: 1;
}

body.has-wallpaper .card,
body.has-wallpaper form,
body.has-wallpaper .list-card,
body.has-wallpaper .ios-alert,
body.has-wallpaper .ios-toast,
body.has-wallpaper .cta-viagem-panel,
body.has-wallpaper .stat-row,
body.has-wallpaper .quick-action,
body.has-wallpaper table {
    background: var(--surface-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--ios-text);
}

body.has-wallpaper .ios-navbar {
    background: var(--navbar-bg);
}

.ios-app {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.ios-navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: calc(10px + var(--safe-top)) 16px 8px;
    background: var(--navbar-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 0.5px solid var(--ios-separator);
}

.ios-navbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 32px;
}

.ios-back {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    max-width: 38%;
    font-size: 17px;
    font-weight: 400;
    color: var(--ios-accent);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.ios-back:active { opacity: 0.55; }

.ios-back-chev {
    font-size: 22px;
    font-weight: 500;
    line-height: 1;
    margin-top: -1px;
}

.ios-navbar-brand {
    font-size: 17px;
    font-weight: 700;
    color: var(--ios-text);
    letter-spacing: -0.03em;
}

.ios-navbar-brand--logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 58%;
}

.brand-logo {
    height: 28px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    display: block;
}

.ios-navbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

a.theme-toggle.header-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--ios-text);
}

.header-help__icon {
    display: block;
    flex-shrink: 0;
}

.theme-toggle {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 50%;
    font-size: 17px;
    line-height: 1;
    background: rgba(118, 118, 128, 0.14);
    color: var(--ios-text);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-shadow: none;
}

.theme-toggle:active {
    opacity: 0.65;
    transform: scale(0.94);
    background: rgba(118, 118, 128, 0.22);
}

[data-theme="dark"] .theme-toggle {
    background: rgba(235, 235, 245, 0.12);
}

.brand-hero {
    display: flex;
    justify-content: center;
    margin: 0 0 12px;
}

.brand-hero img {
    max-width: min(200px, 70%);
    height: auto;
    object-fit: contain;
    opacity: 0.85;
}

.cta-viagem-wrap {
    margin: 0 0 20px;
}

.cta-viagem {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 18px 20px;
    border: none;
    border-radius: var(--ios-radius-lg);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 16px rgba(11, 31, 63, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cta-viagem:active {
    transform: scale(0.98);
}

.cta-viagem--primary {
    background: linear-gradient(135deg, var(--ios-brand-navy) 0%, #1a3d6e 100%);
    color: #fff;
}

.cta-viagem--active {
    background: linear-gradient(135deg, var(--ios-accent) 0%, #d4951a 100%);
    color: var(--ios-brand-navy);
}

.cta-viagem-panel {
    margin-top: 12px;
    padding: 16px;
    border-radius: var(--ios-radius-md);
    background: var(--ios-card);
    box-shadow: var(--ios-shadow);
}

.cta-viagem-panel[hidden] {
    display: none;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin: 12px 0;
}

.photo-thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--ios-radius-sm);
    overflow: hidden;
    background: var(--ios-bg);
    box-shadow: var(--ios-shadow);
}

.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-thumb__label {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 4px 6px;
    font-size: 10px;
    color: #fff;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
}

.brand-preview {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 12px 0;
}

.brand-preview__box {
    flex: 1;
    min-width: 140px;
    padding: 12px;
    border-radius: var(--ios-radius-sm);
    background: var(--ios-bg);
    text-align: center;
}

.brand-preview__box img {
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
}

.brand-preview__box--wall {
    min-height: 100px;
    background-size: cover;
    background-position: center;
    border: 1px solid var(--ios-separator);
}

.appearance-opacity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.appearance-opacity input[type="range"] {
    flex: 1;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
    font-size: 15px;
}

.checkbox-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--ios-accent);
}

.ios-navbar-spacer { width: 42%; }

.ios-kicker {
    margin: 4px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--ios-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ios-large-title {
    margin: 2px 0 0;
    font-size: 34px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.01em;
}

.container.ios-main {
    flex: 1;
    width: 100%;
    max-width: min(960px, 100%);
    margin: 0 auto;
    padding: 12px 16px calc(24px + var(--ios-tabbar-h) + var(--safe-bottom));
}

h2 {
    margin: 20px 2px 10px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h3.section-sub {
    margin: 16px 2px 8px;
    font-size: 17px;
    font-weight: 600;
    color: var(--ios-secondary);
}

.cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

@media (min-width: 520px) {
    .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.card {
    background: var(--ios-card);
    border-radius: var(--ios-radius-md);
    padding: 14px 14px 12px;
    box-shadow: var(--ios-shadow);
    border: 0.5px solid var(--ios-separator);
    color: var(--ios-text);
}

.card h3 {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ios-secondary);
}

.card--highlight {
    border-left: 4px solid var(--ios-accent);
    grid-column: 1 / -1;
}

.big {
    font-size: 28px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
}

.big-sm {
    font-size: 20px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

form {
    background: var(--ios-card);
    border-radius: var(--ios-radius-lg);
    padding: 14px 14px 6px;
    margin-bottom: 14px;
    border: 0.5px solid var(--ios-separator);
    box-shadow: var(--ios-shadow);
}

label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
    margin-left: 2px;
    color: var(--ios-secondary);
    font-weight: 500;
}

input, select, textarea {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 12px;
    border: none;
    border-radius: var(--ios-radius-sm);
    font-size: 17px;
    background: var(--input-bg);
    color: var(--ios-text);
    -webkit-appearance: none;
    appearance: none;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.3);
    background: var(--input-bg-focus);
}

textarea {
    min-height: 80px;
    resize: vertical;
}

button {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 8px;
    border: none;
    border-radius: var(--ios-radius-sm);
    font-size: 17px;
    font-weight: 600;
    color: #fff;
    background: var(--ios-accent);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    min-height: 48px;
}

button:active {
    background: var(--ios-accent-press);
    transform: scale(0.985);
}

button.btn-secondary {
    background: rgba(118, 118, 128, 0.16);
    color: var(--ios-text);
}

.ios-toast {
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: var(--ios-radius-md);
    font-size: 15px;
    font-weight: 500;
    color: #0f5132;
    background: #d1e7dd;
    border: 0.5px solid #badbcc;
}

.ios-alert {
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: var(--ios-radius-md);
    font-size: 15px;
    background: rgba(230, 126, 34, 0.12);
    border: 0.5px solid rgba(230, 126, 34, 0.35);
}

.ios-alert a {
    color: var(--ios-accent);
    font-weight: 600;
    margin-left: 6px;
    text-decoration: none;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--ios-card);
    border-radius: var(--ios-radius-lg);
    overflow: hidden;
    border: 0.5px solid var(--ios-separator);
    box-shadow: var(--ios-shadow);
}

th, td {
    text-align: left;
    padding: 12px 14px;
    font-size: 15px;
    border-bottom: 0.5px solid var(--ios-separator);
}

th {
    font-size: 13px;
    font-weight: 600;
    color: var(--ios-secondary);
    background: var(--table-head-bg);
}

tr:last-child td, tr:last-child th { border-bottom: none; }

.grid-2, .grid-3 {
    display: grid;
    gap: 0 10px;
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 640px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.muted {
    color: var(--ios-secondary);
    font-size: 15px;
    line-height: 1.35;
    margin: 4px 2px 14px;
}

.ios-owner-intro {
    margin: 0 0 14px;
    font-size: 16px;
    line-height: 1.4;
}

.status-planejada { color: var(--ios-secondary); font-weight: 600; }
.status-em_andamento { color: var(--ios-blue); font-weight: 600; }
.status-concluida { color: var(--ios-green); font-weight: 600; }
.status-pendente { color: var(--ios-orange); font-weight: 600; }
.status-pago { color: var(--ios-green); font-weight: 600; }

a.ios-link {
    color: var(--ios-accent);
    font-weight: 600;
    text-decoration: none;
}

a.ios-link:active { opacity: 0.55; }

/* Lista mobile — cards empilhados */
.list-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.list-card {
    display: block;
    background: var(--ios-card);
    border-radius: var(--ios-radius-md);
    padding: 14px 16px;
    border: 0.5px solid var(--ios-separator);
    box-shadow: var(--ios-shadow);
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}

.list-card:active { opacity: 0.85; transform: scale(0.995); }

.list-card__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}

.list-card__title {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.25;
}

.list-card__meta {
    font-size: 14px;
    color: var(--ios-secondary);
    line-height: 1.35;
}

.list-card__value {
    font-size: 16px;
    font-weight: 700;
    color: var(--ios-accent);
    white-space: nowrap;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 999px;
    background: rgba(118, 118, 128, 0.12);
    color: var(--ios-secondary);
}

.badge--active {
    background: rgba(0, 122, 255, 0.15);
    color: var(--ios-blue);
}

.badge--done {
    background: rgba(52, 199, 89, 0.15);
    color: var(--ios-green);
}

.ios-alert--danger {
    background: rgba(255, 59, 48, 0.12);
    border-color: rgba(255, 59, 48, 0.35);
    color: var(--ios-text);
}

.ios-alert--danger strong {
    color: #ff3b30;
}

.badge--warn {
    background: rgba(255, 149, 0, 0.15);
    color: var(--ios-orange);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--ios-card);
    border-radius: var(--ios-radius-sm);
    border: 0.5px solid var(--ios-separator);
    margin-bottom: 8px;
    font-size: 15px;
}

.stat-row strong {
    font-variant-numeric: tabular-nums;
}

.ios-details {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: var(--ios-radius-sm);
    background: rgba(118, 118, 128, 0.08);
}

.ios-details summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    color: var(--ios-accent);
}

.ios-segments {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
}

.ios-segments::-webkit-scrollbar { display: none; }

.ios-segment {
    flex: 0 0 auto;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 999px;
    background: rgba(118, 118, 128, 0.12);
    color: var(--ios-secondary);
    text-decoration: none;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.ios-segment.is-active {
    background: var(--ios-accent);
    color: #fff;
}

.ios-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    justify-content: flex-start;
    align-items: stretch;
    min-height: var(--ios-tabbar-h);
    padding: 6px 4px calc(6px + var(--safe-bottom));
    background: var(--tabbar-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 0.5px solid var(--ios-separator);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.ios-tabbar::-webkit-scrollbar { display: none; }

.settings-nav { margin-bottom: 8px; }

.ios-tab {
    flex: 1 0 auto;
    min-width: 58px;
    max-width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 4px 2px;
    font-size: 10px;
    font-weight: 500;
    color: var(--ios-secondary);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.ios-tab-icon { font-size: 22px; line-height: 1; }
.ios-tab.is-active { color: var(--ios-accent); }
.ios-tab:active { opacity: 0.55; }

@media (min-width: 900px) {
    .ios-tabbar {
        max-width: min(960px, 100%);
        left: 50%;
        transform: translateX(-50%);
        border-radius: 18px 18px 0 0;
    }
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 20px;
}

.quick-action {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 10px 8px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    border-radius: var(--ios-radius-md);
    background: var(--ios-card);
    border: 0.5px solid var(--ios-separator);
    box-shadow: var(--ios-shadow);
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

button.quick-action {
    width: 100%;
    margin: 0;
    color: var(--ios-text);
    background: var(--ios-card);
}

.quick-action:active { opacity: 0.85; transform: scale(0.98); }

.offline-banner {
    position: sticky;
    top: 0;
    z-index: 200;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    color: #fff;
    background: var(--ios-orange);
}

.install-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 190;
    padding: 10px 12px;
    background: linear-gradient(135deg, #0b1f3f, #163a6b);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.install-banner[hidden] { display: none !important; }

.install-banner__text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
    line-height: 1.25;
}

.install-banner__text strong { font-size: 15px; }

.install-banner__btn {
    flex: 0 0 auto;
    width: auto;
    min-height: 36px;
    padding: 8px 14px;
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #0b1f3f;
    background: #e5a823;
    border: none;
    border-radius: 999px;
}

.install-banner__dismiss {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    font-size: 22px;
    line-height: 1;
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
}

body.is-standalone .ios-back[href="../index.php"] {
    display: none;
}

@media (display-mode: standalone) {
    body.ios-shell { overscroll-behavior-y: contain; }
}

body.is-offline .offline-banner { display: block !important; }

.quick-fab {
    position: fixed;
    right: 16px;
    bottom: calc(var(--ios-tabbar-h) + var(--safe-bottom) + 12px);
    z-index: 90;
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    color: #fff;
    background: var(--ios-accent);
    box-shadow: 0 4px 14px rgba(230, 126, 34, 0.45);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.quick-fab:active { transform: scale(0.94); }

.quick-sheet[hidden] { display: none !important; }

.quick-sheet {
    position: fixed;
    inset: 0;
    z-index: 150;
}

.quick-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}

.quick-sheet__panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 85dvh;
    overflow-y: auto;
    padding: 20px 16px calc(20px + var(--safe-bottom));
    background: var(--ios-bg);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
}

.quick-sheet__panel h2 {
    margin: 0 0 12px;
    font-size: 20px;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.quick-grid button,
.quick-grid .quick-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    font-size: 15px;
    background: rgba(118, 118, 128, 0.12);
    color: var(--ios-text);
    border-radius: var(--ios-radius-md);
    text-decoration: none;
    text-align: center;
    padding: 8px;
    border: none;
    font-family: inherit;
    cursor: pointer;
}

.quick-grid .quick-link:active,
.quick-grid button:active {
    opacity: 0.85;
    transform: scale(0.98);
}

.quick-form label { margin-top: 8px; }

body.sheet-open { overflow: hidden; }

.intro-steps {
    margin: 0;
    padding-left: 1.25rem;
    line-height: 1.55;
    color: var(--ios-text-secondary);
}

.intro-steps li + li { margin-top: 10px; }

.intro-steps strong { color: var(--ios-text); }

/* Pneus — lista compacta */
.pneu-list {
    margin-bottom: 12px;
    border-radius: var(--ios-radius-md);
    overflow: hidden;
    border: 0.5px solid var(--ios-separator);
    background: var(--ios-card);
}

.pneu-list__group {
    margin: 0;
    padding: 8px 14px 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ios-secondary);
    background: rgba(118, 118, 128, 0.06);
}

.pneu-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px 10px 14px;
    border-top: 0.5px solid var(--ios-separator);
    min-height: 44px;
}

.pneu-row--muted .pneu-row__pos {
    font-weight: 500;
    font-size: 14px;
}

.pneu-row__main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pneu-row__pos {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pneu-row__meta {
    font-size: 13px;
    color: var(--ios-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pneu-row__action {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--ios-secondary);
    background: rgba(118, 118, 128, 0.12);
    cursor: pointer;
    box-shadow: none;
}

.pneu-row__action:active {
    opacity: 0.6;
    transform: scale(0.94);
}

.pneu-list--hist {
    margin-top: 8px;
    border: none;
    background: transparent;
}

.pneu-list--hist .pneu-row {
    border-radius: var(--ios-radius-sm);
    margin-bottom: 6px;
    border: 0.5px solid var(--ios-separator);
    background: var(--ios-card);
}

.pneu-sheet[hidden] { display: none !important; }

.pneu-sheet {
    position: fixed;
    inset: 0;
    z-index: 160;
}

.pneu-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}

.pneu-sheet__panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 78dvh;
    overflow-y: auto;
    padding: 16px 16px calc(16px + var(--safe-bottom));
    background: var(--ios-bg);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.18);
}

.pneu-sheet__panel h2 {
    margin: 0 0 4px;
    font-size: 20px;
}

.pneu-sheet__sub {
    margin: 0 0 14px;
    font-size: 14px;
}

.pneu-sheet__back {
    display: inline-block;
    margin: 0 0 8px;
    padding: 0;
    border: none;
    background: none;
    color: var(--ios-accent);
    font-size: 15px;
    font-weight: 600;
    min-height: auto;
    width: auto;
    box-shadow: none;
}

.pneu-sheet__menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.pneu-menu-btn {
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    margin: 0;
    border: none;
    border-radius: var(--ios-radius-sm);
    font-size: 16px;
    font-weight: 600;
    text-align: left;
    color: var(--ios-text);
    background: var(--ios-card);
    border: 0.5px solid var(--ios-separator);
    box-shadow: none;
    cursor: pointer;
}

.pneu-menu-btn:active {
    opacity: 0.75;
}

.pneu-sheet__form {
    margin-bottom: 10px;
}

.pneu-sheet__cancel {
    margin-top: 4px;
}

code {
    font-size: 13px;
    background: rgba(118, 118, 128, 0.12);
    padding: 2px 6px;
    border-radius: 6px;
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.row-actions form,
.row-actions a {
    flex: 1 1 calc(33% - 8px);
    min-width: 80px;
}

.row-actions button,
.row-actions .btn-secondary {
    width: 100%;
    margin: 0;
    padding: 10px 8px;
    font-size: 14px;
}

button.btn-danger,
.btn-danger {
    width: 100%;
    margin: 0;
    padding: 10px 16px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: var(--ios-red);
    border: none;
    border-radius: var(--ios-radius-sm);
    cursor: pointer;
}

button.btn-danger:active {
    opacity: 0.85;
}

[data-theme="dark"] .ios-toast {
    background: rgba(52, 199, 89, 0.2);
    border-color: rgba(52, 199, 89, 0.45);
    color: #b8f5c0;
}

[data-theme="dark"] .ios-alert {
    color: var(--ios-text);
}

[data-theme="dark"] .card .big,
[data-theme="dark"] .card .big-sm,
[data-theme="dark"] .list-card__title {
    color: var(--ios-text);
}
