:root {
    --bg: #f6f8fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --text: #0f172a;
    --muted: #64748b;
    --blue: #2563eb;
    --blue-soft: #dbeafe;
    --green: #16a34a;
    --green-soft: #dcfce7;
    --purple: #7c3aed;
    --purple-soft: #ede9fe;
    --red: #dc2626;
    --red-soft: #fee2e2;
    --gray-soft: #f1f5f9;
    --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", Arial, sans-serif;
    font-size: 15px;
    letter-spacing: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

a,
button,
[role="button"] {
    -webkit-tap-highlight-color: transparent;
}

button,
input,
select,
textarea {
    font: inherit;
    letter-spacing: 0;
}

select {
    min-height: 42px;
}

input[type="date"] {
    min-width: 0;
    max-width: 100%;
}

input[type="date"]::-webkit-date-and-time-value {
    min-width: 0;
    text-align: left;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

.icon-button {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: #111827;
}

.icon-button:hover {
    background: var(--gray-soft);
}

.primary-button,
.ghost-button,
.outline-danger-button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: var(--radius);
    padding: 0 18px;
    font-weight: 700;
    white-space: nowrap;
}

.primary-button {
    border: 1px solid var(--blue);
    background: linear-gradient(180deg, #3b82f6, #2563eb);
    color: #fff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.24);
}

.ghost-button {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
}

.ghost-button:hover {
    border-color: var(--line-strong);
    background: var(--surface-soft);
}

.ghost-button.compact {
    min-height: 36px;
    padding: 0 12px;
    font-size: 14px;
}

.ghost-button.danger,
.outline-danger-button {
    color: var(--red);
}

.outline-danger-button {
    width: 100%;
    border: 1px solid var(--red);
    background: #fff;
}

.button-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.button-row form {
    margin: 0;
}

.topbar {
    height: 70px;
    max-width: 1680px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto 240px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 0 18px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
    backdrop-filter: blur(16px);
}

.brand-car {
    font-weight: 800;
}

.topnav {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.topnav a {
    height: 100%;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    color: #334155;
    border-bottom: 3px solid transparent;
    font-weight: 650;
}

.topnav a.is-active {
    color: #020617;
    border-bottom-color: #020617;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mobile-topbar {
    display: none;
}

.mobile-search-panel {
    display: none;
}

.quick-add-shell {
    position: relative;
}

.quick-add-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 24;
    min-width: 224px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16);
    transform-origin: top right;
    animation: quickAddIn 140ms ease;
}

.quick-add-menu[hidden],
.quick-add-backdrop[hidden] {
    display: none;
}

.quick-add-link {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #f8fafc;
    color: #334155;
    font-weight: 850;
}

.quick-add-link:hover {
    border-color: rgba(37, 99, 235, 0.32);
    background: var(--blue-soft);
    color: var(--blue);
}

[data-quick-add-toggle].is-open .icon {
    transform: rotate(45deg);
}

@keyframes quickAddIn {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.app-shell {
    max-width: 1680px;
    min-height: calc(100vh - 70px);
    margin: 0 auto 24px;
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid var(--line);
    border-radius: 0 0 18px 18px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 0 18px 22px;
    border-right: 1px solid var(--line);
    background: var(--surface);
}

.car-card {
    position: relative;
    min-height: 176px;
    margin: 0 -18px;
    overflow: hidden;
    background: var(--surface-soft);
}

.car-card img {
    width: 100%;
    height: 176px;
    object-fit: cover;
    display: block;
}

.car-card-overlay {
    position: absolute;
    left: 18px;
    bottom: 16px;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.car-card-overlay strong,
.car-card-overlay span {
    display: block;
}

.car-card-overlay span {
    margin-top: 4px;
    font-size: 18px;
    font-weight: 800;
}

.side-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.side-menu-item {
    height: 42px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: var(--radius);
    padding: 0 12px;
    color: #334155;
    font-weight: 650;
}

.side-menu-item .icon {
    width: 18px;
    height: 18px;
}

.side-menu-item.is-active {
    background: #eff6ff;
    color: var(--blue);
}

.side-summary {
    margin-top: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    background: var(--surface);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.side-summary h2 {
    margin: 0 0 14px;
    font-size: 17px;
}

.side-summary dl {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px 14px;
    margin: 0;
}

.side-summary dt,
.side-summary dd {
    margin: 0;
}

.side-summary dd {
    font-weight: 750;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    font-weight: 800;
}

.sync-text {
    color: var(--muted);
    line-height: 1.6;
}

.main-content {
    min-width: 0;
    padding: 28px 28px 36px;
    background: linear-gradient(180deg, #fff 0, #f8fafc 100%);
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.page-header > div {
    display: flex;
    align-items: baseline;
    gap: 14px;
}

.page-header h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.2;
}

.count-text {
    color: #475569;
    font-weight: 650;
}

.filter-bar {
    display: grid;
    grid-template-columns: 130px 160px 160px minmax(220px, 1fr) auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
}

.dashboard-filter {
    grid-template-columns: 150px;
    justify-content: start;
}

.compact-filter {
    grid-template-columns: 150px minmax(220px, 1fr) auto;
}

.filter-bar select,
.filter-bar input,
.form-card input,
.form-card select,
.form-card textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0 14px;
    background: var(--surface);
    color: var(--text);
}

.form-card textarea {
    padding-top: 10px;
    resize: vertical;
}

.search-field {
    position: relative;
    display: flex;
    align-items: center;
}

.search-field .icon {
    position: absolute;
    left: 12px;
    color: var(--muted);
}

.search-field input {
    padding-left: 40px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    margin-bottom: 20px;
}

.summary-card {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas: "icon label" "icon amount" "icon small";
    column-gap: 14px;
    padding: 22px;
    border-right: 1px solid var(--line);
}

.summary-card:last-child {
    border-right: 0;
}

.summary-icon {
    grid-area: icon;
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
}

.summary-icon.blue,
.summary-icon.blue-soft {
    background: #3b82f6;
}

.summary-icon.green {
    background: #22c55e;
}

.summary-icon.purple {
    background: #8b5cf6;
}

.summary-card p,
.summary-card strong,
.summary-card small {
    margin: 0;
}

.summary-card p {
    grid-area: label;
    color: #334155;
    font-weight: 650;
}

.summary-card strong {
    grid-area: amount;
    margin-top: 5px;
    font-size: 23px;
}

.summary-card small {
    grid-area: small;
    margin-top: 8px;
    color: var(--muted);
}

.timeline-list {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}

.timeline-row {
    display: grid;
    grid-template-columns: 70px 18px minmax(0, 1fr);
    min-height: 100px;
}

.timeline-date {
    padding: 20px 0 0 18px;
    color: #0f172a;
    text-align: center;
}

.timeline-date strong,
.timeline-date span {
    display: block;
}

.timeline-date span {
    margin-top: 4px;
    color: #64748b;
    font-size: 13px;
}

.timeline-dot {
    position: relative;
    display: flex;
    justify-content: center;
}

.timeline-dot::before {
    content: "";
    width: 1px;
    height: 100%;
    background: var(--line);
}

.timeline-dot::after {
    content: "";
    position: absolute;
    top: 27px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 3px solid var(--surface);
    background: #64748b;
}

.timeline-row.is-featured .timeline-dot::after {
    background: var(--blue);
}

.timeline-marker {
    --marker-color: #64748b;
    position: relative;
    display: flex;
    justify-content: center;
}

.timeline-marker::before {
    content: "";
    width: 1px;
    height: 100%;
    background: var(--line);
}

.timeline-marker::after {
    content: "";
    position: absolute;
    top: 22px;
    z-index: 1;
    width: 30px;
    height: 30px;
    border: 2px solid var(--surface);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
}

.timeline-marker > .icon,
.timeline-marker > span,
.timeline-marker > img {
    position: absolute;
    z-index: 2;
    color: #fff;
}

.timeline-marker > img {
    top: 22px;
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 50%;
}

.timeline-marker > .icon {
    top: 29px;
    width: 16px;
    height: 16px;
}

.timeline-marker > span {
    top: 30px;
    width: 28px;
    text-align: center;
    font-size: 8px;
    font-weight: 950;
    letter-spacing: 0;
    line-height: 1;
}

.timeline-marker-repair {
    --marker-color: #2563eb;
}

.timeline-marker-drive {
    --marker-color: #0ea5e9;
}

.timeline-marker-etc {
    --marker-color: #64748b;
}

.timeline-marker-accident {
    --marker-color: #ef4444;
}

.timeline-marker-fuel,
.fuel-brand-rto {
    --marker-color: #16a34a;
}

.fuel-brand-gsc {
    --marker-color: #0ea5e9;
}

.fuel-brand-hdo {
    --marker-color: #1d4ed8;
}

.fuel-brand-sol {
    --marker-color: #f97316;
}

.fuel-brand-skg {
    --marker-color: #e11d48;
}

.timeline-card {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 18px;
    padding: 18px 18px 18px 26px;
    border-bottom: 1px solid var(--line);
}

.timeline-row.is-featured .timeline-card {
    margin: 0 0 0 0;
    border: 1px solid #93c5fd;
    border-radius: var(--radius);
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.08);
}

.timeline-card h2 {
    margin: 0;
    font-size: 18px;
}

.timeline-card p {
    margin: 8px 0 0;
    color: #475569;
}

.timeline-meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px !important;
}

.timeline-card p .timeline-meta-pill {
    min-height: 25px;
    display: inline-flex;
    align-items: center;
    border: 1px solid #dbeafe;
    border-radius: 6px;
    padding: 0 9px;
    margin: 0;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 850;
    line-height: 1;
}

.timeline-card p .timeline-meta-pill:nth-child(2) {
    border-color: #e0e7ff;
    background: #eef2ff;
    color: #4338ca;
}

.timeline-memo {
    max-width: 760px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 13px;
    line-height: 1.45;
}

.timeline-card p span,
.mobile-item-card p span {
    color: var(--line-strong);
    margin: 0 8px;
}

.timeline-amount {
    text-align: right;
}

.timeline-amount strong,
.timeline-amount span {
    display: block;
}

.timeline-amount strong {
    font-size: 18px;
}

.timeline-amount span {
    margin-top: 18px;
    color: #475569;
    font-size: 13px;
}

.dashboard-timeline {
    border: 0;
    background: transparent;
    overflow: visible;
    display: grid;
    gap: 10px;
}

.dashboard-timeline .timeline-row {
    grid-template-columns: 82px 24px minmax(0, 1fr);
    min-height: 112px;
}

.dashboard-timeline .timeline-card,
.dashboard-timeline .timeline-row.is-featured .timeline-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.dashboard-timeline .timeline-row.is-featured .timeline-card {
    border-color: var(--line);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.badge-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.badge,
.badge-line em {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    border-radius: 6px;
    padding: 0 9px;
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
}

.badge-blue {
    color: #1d4ed8;
    background: var(--blue-soft);
}

.badge-green {
    color: #15803d;
    background: var(--green-soft);
}

.badge-purple {
    color: #6d28d9;
    background: var(--purple-soft);
}

.badge-gray {
    color: #475569;
    background: var(--gray-soft);
}

.badge-red {
    color: #b91c1c;
    background: var(--red-soft);
}

.blue-text {
    color: var(--blue);
}

.green-text {
    color: var(--green);
}

.empty-state {
    padding: 48px;
    text-align: center;
    color: var(--muted);
}

.detail-card,
.form-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.detail-card {
    margin-bottom: 18px;
    padding: 22px;
}

.detail-page-header {
    margin-bottom: 16px;
}

.detail-page-header h1 {
    font-size: 26px;
}

.detail-card h2,
.form-card h2 {
    margin: 0;
    color: var(--blue);
    font-size: 18px;
}

.two-column-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-top: 18px;
}

.two-column-info dl {
    margin: 0;
}

.two-column-info div {
    display: grid;
    grid-template-columns: 140px 1fr;
    border-bottom: 1px solid var(--line);
}

.two-column-info dt,
.two-column-info dd {
    margin: 0;
    padding: 12px 14px;
}

.two-column-info dt {
    background: #f8fafc;
    font-weight: 800;
}

.two-column-info dd {
    min-width: 0;
}

.detail-info-card,
.detail-items-card {
    font-size: 14px;
}

.detail-info-card,
.detail-items-card {
    padding: 20px;
}

.detail-info-card > h2,
.detail-items-card h2 {
    font-size: 17px;
}

.detail-info-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
    gap: 18px;
    margin-top: 16px;
}

.detail-info-card .two-column-info {
    gap: 18px;
    margin-top: 0;
}

.detail-info-card .two-column-info div {
    grid-template-columns: minmax(122px, 140px) minmax(0, 1fr);
}

.detail-info-card .two-column-info dt,
.detail-info-card .two-column-info dd {
    padding: 10px 12px;
    font-size: 13.5px;
    line-height: 1.55;
}

.detail-info-card .two-column-info dt {
    font-weight: 760;
}

.detail-amount-summary {
    border: 1px solid #a78bfa;
    border-radius: var(--radius);
    padding: 16px;
    background: linear-gradient(180deg, #fff 0, #fdfcff 100%);
    box-shadow: 0 8px 18px rgba(124, 58, 237, 0.08);
}

.detail-amount-summary h2 {
    margin: 0 0 12px;
    color: var(--purple);
    font-size: 16px;
}

.detail-amount-summary dl {
    margin: 0;
    padding: 8px 12px;
    border: 1px solid #ddd6fe;
    border-radius: var(--radius);
    background: #fff;
}

.detail-amount-summary dl div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}

.detail-amount-summary dl div:last-child {
    border-bottom: 0;
}

.detail-amount-summary dt,
.detail-amount-summary dd {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
}

.detail-amount-summary dt {
    font-weight: 760;
}

.detail-amount-summary dd {
    text-align: right;
    white-space: nowrap;
    font-weight: 850;
}

.detail-amount-summary p {
    margin: 12px 0 0;
    color: #475569;
    font-size: 12.5px;
    line-height: 1.6;
}

.detail-amount-summary p span {
    display: block;
    margin-top: 2px;
    text-align: right;
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.table-scroll {
    overflow-x: auto;
}

.item-table {
    width: 100%;
    min-width: 1040px;
    border-collapse: collapse;
    font-size: 14px;
}

.item-table th,
.item-table td {
    border: 1px solid var(--line);
    padding: 12px;
    text-align: center;
    vertical-align: middle;
}

.item-table th {
    background: #f8fafc;
    font-weight: 850;
}

.detail-items-card .section-title-row {
    margin-bottom: 12px;
}

.detail-items-card .item-table {
    min-width: 980px;
    font-size: 13px;
}

.detail-items-card .item-table th,
.detail-items-card .item-table td {
    padding: 10px 9px;
    line-height: 1.45;
}

.detail-items-card .metric-table {
    min-width: 760px;
}

.icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
}

.icon-link:hover {
    background: var(--gray-soft);
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        linear-gradient(120deg, rgba(37, 99, 235, 0.08), transparent 42%),
        linear-gradient(300deg, rgba(22, 163, 74, 0.08), transparent 45%),
        #f8fafc;
}

.login-shell {
    width: min(920px, calc(100vw - 32px));
}

.login-panel {
    display: grid;
    grid-template-columns: 1fr 380px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow);
}

.login-copy {
    min-height: 440px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 44px;
    background:
        linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.78)),
        url("../img/car-placeholder.svg") center / cover no-repeat;
    color: #fff;
}

.login-copy .eyebrow {
    margin: 0 0 10px;
    font-weight: 850;
}

.login-copy h1 {
    margin: 0;
    font-size: 42px;
}

.login-copy p:last-child {
    margin: 12px 0 0;
    color: #e2e8f0;
}

.login-form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    padding: 40px;
}

.login-form label,
.form-card label {
    display: grid;
    gap: 8px;
}

.login-form span,
.form-card label span {
    color: #334155;
    font-weight: 800;
    font-size: 13px;
}

.login-form input {
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0 14px;
}

.form-error {
    margin: 0;
    color: var(--red);
    font-weight: 700;
}

.repair-form {
    display: grid;
    gap: 18px;
}

.form-card {
    padding: 22px;
}

.form-card h2 {
    margin-bottom: 18px;
}

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

.span-2 {
    grid-column: span 2;
}

.totals-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 22px;
    align-items: start;
}

.totals-grid dl {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.totals-grid div {
    padding: 14px;
    border-right: 1px solid var(--line);
    background: #f8fafc;
}

.totals-grid div:last-child {
    border-right: 0;
}

.totals-grid dt,
.totals-grid dd {
    margin: 0;
}

.totals-grid dt {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.totals-grid dd {
    margin-top: 7px;
    font-size: 18px;
    font-weight: 850;
}

.inline-total-preview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin: 16px 0 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.inline-total-preview div {
    padding: 14px;
    background: #f8fafc;
    border-right: 1px solid var(--line);
}

.inline-total-preview div:last-child {
    border-right: 0;
}

.inline-total-preview dt,
.inline-total-preview dd {
    margin: 0;
}

.inline-total-preview dt {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.inline-total-preview dd {
    margin-top: 6px;
    font-size: 18px;
    font-weight: 850;
}

.item-category-list,
.item-editor-list {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.item-category-group {
    display: grid;
    gap: 12px;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.item-category-header {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.item-category-header label {
    min-width: 0;
}

.item-category-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.ghost-button.danger {
    color: var(--red);
}

.item-editor-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) 42px;
    gap: 10px;
    align-items: end;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
}

.item-editor-row label {
    min-width: 0;
}

.item-editor-row .wide {
    grid-column: span 2;
    min-width: 0;
}

.item-editor-row label:nth-of-type(2) {
    grid-column: 3;
}

.item-editor-row label:nth-of-type(3) {
    grid-column: 4;
}

.item-editor-row label:nth-of-type(4) {
    grid-column: 1;
}

.item-editor-row label:nth-of-type(5) {
    grid-column: 2;
}

.item-editor-row label:nth-of-type(6) {
    grid-column: 3;
}

.item-editor-row label:nth-of-type(7) {
    grid-column: 4;
}

.item-editor-row label:nth-of-type(8) {
    grid-column: 1 / span 4;
}

.remove-item-button {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--red);
    grid-column: 5;
    grid-row: 3;
    justify-self: end;
}

input.is-readonly {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

.sticky-form-actions {
    position: sticky;
    bottom: 18px;
    z-index: 4;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}

.mobile-only,
.bottom-nav {
    display: none;
}

.drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(15, 23, 42, 0.58);
}

.drawer-backdrop[hidden] {
    display: none;
}

.app-drawer {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 41;
    width: min(360px, 86vw);
    height: 100vh;
    background: #fff;
    box-shadow: 18px 0 44px rgba(15, 23, 42, 0.18);
    transform: translateX(-105%);
    transition: transform 160ms ease;
}

.app-drawer.is-open {
    transform: translateX(0);
}

.drawer-account {
    display: grid;
    gap: 14px;
    padding: 32px 24px 26px;
    background: #f8fafc;
}

.drawer-account-head {
    display: grid;
    gap: 6px;
    text-align: center;
}

.drawer-account strong {
    text-align: center;
    font-size: 24px;
}

.drawer-account-head span {
    color: #475569;
    font-size: 13px;
    font-weight: 850;
}

.drawer-account select {
    min-height: 50px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    padding: 0 14px;
    background: #fff;
}

.logout-pill {
    justify-self: center;
    min-width: 132px;
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 18px;
    font-weight: 850;
}

.drawer-title {
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    background: #2f2f2f;
    color: #fff;
}

.drawer-title h2 {
    margin: 0;
    font-size: 28px;
}

.drawer-title .icon-button {
    color: #fff;
}

.drawer-record-menu {
    display: none;
}

.drawer-record-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: var(--radius);
    padding: 0 12px;
    color: #334155;
    font-weight: 800;
}

.drawer-record-link.is-active {
    background: var(--blue-soft);
    color: var(--blue);
}

.drawer-menu {
    display: grid;
    padding: 24px 0;
}

.drawer-menu a {
    min-height: 66px;
    display: flex;
    align-items: center;
    padding: 0 28px;
    color: #374151;
    font-size: 18px;
}

.drawer-menu a:hover {
    background: #f8fafc;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.dashboard-card,
.settings-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.dashboard-card {
    position: relative;
    padding: 20px;
    min-width: 0;
    padding-left: 70px;
}

.dashboard-card p,
.dashboard-card strong,
.dashboard-card small {
    margin: 0;
}

.dashboard-card p {
    color: var(--muted);
    font-weight: 800;
}

.dashboard-card strong {
    display: block;
    margin-top: 8px;
    font-size: 24px;
}

.dashboard-card small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
}

.dashboard-card-icon {
    position: absolute;
    top: 50%;
    left: 20px;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    transform: translateY(-50%);
}

.dashboard-card-icon .icon {
    width: 20px;
    height: 20px;
}

.dashboard-icon-total,
.dashboard-icon-fuel {
    background: #2563eb;
}

.dashboard-icon-repair {
    background: #3b82f6;
}

.dashboard-icon-etc {
    background: #64748b;
}

.vehicle-summary-card {
    margin-bottom: 18px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.vehicle-summary-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.vehicle-summary-head h2,
.vehicle-summary-head p {
    margin: 0;
}

.vehicle-summary-head h2 {
    font-size: 17px;
    color: var(--blue);
}

.vehicle-summary-head p {
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.vehicle-summary-head > span {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 10px;
    background: var(--surface-soft);
    color: #334155;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.vehicle-summary-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr 1fr;
    gap: 12px;
}

.vehicle-metric {
    min-width: 0;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 13px;
    align-items: center;
    min-height: 102px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #fff, #fbfdff);
}

.vehicle-metric p,
.vehicle-metric strong,
.vehicle-metric small,
.vehicle-metric dl {
    margin: 0;
}

.vehicle-metric p {
    color: #475569;
    font-size: 13px;
    font-weight: 850;
}

.vehicle-metric strong {
    display: block;
    margin-top: 6px;
    font-size: 22px;
    line-height: 1.2;
}

.vehicle-metric small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.vehicle-metric-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: #fff;
}

.vehicle-metric-icon .icon {
    width: 20px;
    height: 20px;
}

.metric-blue {
    color: #2563eb;
    background: #eff6ff;
}

.metric-orange {
    color: #ea580c;
    background: #fff7ed;
}

.metric-green {
    color: #059669;
    background: #ecfdf5;
}

.mileage-metric dl {
    display: grid;
    gap: 6px;
    margin-top: 8px;
}

.mileage-metric dl div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.mileage-metric dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.mileage-metric dd {
    margin: 0;
    font-size: 18px;
    font-weight: 900;
    white-space: nowrap;
}

.record-add-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.record-add-card {
    min-height: 190px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.record-add-card:hover {
    border-color: #93c5fd;
}

.record-add-card > span {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
}

.record-add-card strong {
    font-size: 22px;
}

.record-add-card small {
    color: var(--muted);
    line-height: 1.55;
}

.text-link {
    color: var(--blue);
    font-weight: 800;
}

.form-card small {
    color: var(--muted);
    font-weight: 700;
}

.station-picker-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.segmented-field {
    display: grid;
    gap: 8px;
}

.segmented-field > span {
    color: #334155;
    font-weight: 800;
    font-size: 13px;
}

.segmented-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.segmented-options label {
    display: block;
}

.segmented-options input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmented-options span {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0 16px;
    background: #fff;
    color: #334155;
    font-weight: 850;
}

.segmented-options input:checked + span {
    border-color: #93c5fd;
    background: var(--blue-soft);
    color: var(--blue);
}

.station-search-bar {
    display: grid;
    grid-template-columns: auto minmax(260px, 1fr) auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
}

.station-search-bar input {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0 14px 0 40px;
    background: #fff;
}

.fuel-select-inline {
    flex-wrap: nowrap;
}

.station-list {
    display: grid;
    gap: 10px;
}

.station-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    background: #fff;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.04);
}

.station-card:hover {
    border-color: #93c5fd;
}

.station-card strong,
.station-card span {
    display: block;
}

.station-card strong {
    font-size: 17px;
}

.station-card span {
    margin-top: 6px;
    color: var(--muted);
    line-height: 1.45;
}

.station-card dl {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px 14px;
    margin: 0;
}

.station-card dl div {
    display: grid;
    gap: 3px;
    text-align: right;
}

.station-card dt,
.station-card dd {
    margin: 0;
}

.station-card dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.station-card dd {
    font-weight: 850;
}

.station-error {
    margin-bottom: 14px;
}

.place-search-bar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
}

.place-search-bar input {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0 14px 0 40px;
    background: #fff;
}

.place-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 16px;
    align-items: start;
}

.place-result-title {
    margin: 12px 0 2px;
    color: var(--blue);
    font-size: 17px;
}

.place-card small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
}

.place-side-card,
.selected-place-preview {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.place-side-card {
    position: sticky;
    top: 88px;
    display: grid;
    gap: 12px;
}

.place-side-card h2 {
    margin: 0;
    color: var(--blue);
    font-size: 17px;
}

.place-side-card form {
    display: grid;
    gap: 10px;
}

.place-side-card label {
    display: grid;
    gap: 6px;
}

.place-side-card span {
    color: #334155;
    font-size: 13px;
    font-weight: 800;
}

.place-side-card input {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0 12px;
}

.place-side-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.selected-place-preview {
    display: grid;
    gap: 10px;
}

.selected-place-preview strong,
.selected-place-preview span {
    display: block;
}

.selected-place-preview span {
    margin-top: 4px;
    color: var(--muted);
}

.place-map-box {
    min-height: 210px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #f8fafc;
    color: var(--muted);
    overflow: hidden;
}

.record-type {
    display: inline-flex;
    min-width: 48px;
    justify-content: center;
}

.settings-stack {
    display: grid;
    gap: 18px;
}

.settings-card {
    padding: 22px;
}

.settings-card h2 {
    margin: 0 0 18px;
    color: var(--blue);
    font-size: 18px;
}

.settings-options {
    display: grid;
    gap: 12px;
}

.settings-options label {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #f8fafc;
    font-weight: 750;
}

.car-edit-list {
    display: grid;
    gap: 14px;
}

.car-summary-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.car-summary-card {
    min-width: 0;
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    background: #f8fafc;
}

.car-summary-card:hover {
    border-color: #bfdbfe;
    background: #fafdff;
}

.car-summary-card img {
    width: 112px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius);
    background: #dbeafe;
}

.car-summary-card div {
    min-width: 0;
}

.car-summary-card h3,
.car-summary-card p {
    margin: 0;
}

.car-summary-card h3 {
    overflow: hidden;
    color: var(--text);
    font-size: 17px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.car-summary-card p {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.car-summary-card > strong {
    color: var(--blue);
    font-size: 13px;
}

.default-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    margin-top: 8px;
    border-radius: 999px;
    padding: 0 9px;
    background: var(--blue-soft);
    color: var(--blue);
    font-size: 12px;
    font-weight: 850;
}

.car-edit-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    background: #f8fafc;
}

.car-edit-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.car-edit-title h3 {
    margin: 0;
}

.car-edit-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.car-edit-grid label {
    display: grid;
    gap: 6px;
}

.car-edit-grid span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.car-edit-grid input,
.car-edit-grid select {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0 12px;
    background: #fff;
}

.car-form-hero {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
}

.car-form-hero img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius);
    background: #dbeafe;
}

.car-form-hero h2,
.car-form-hero p {
    margin: 0;
}

.car-form-hero p {
    margin-top: 8px;
    color: var(--muted);
    font-weight: 800;
}

.inline-check {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0 12px;
    background: #f8fafc;
    font-weight: 800;
}

.toast-message {
    margin-bottom: 14px;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius);
    padding: 12px 14px;
    background: #f0fdf4;
    color: #166534;
    font-weight: 800;
}

.mobile-record-card,
.mobile-amount-card,
.mobile-meta article,
.item-accordion {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.05);
}

.stats-titlebar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.stats-titlebar h1 {
    margin: 0;
    font-size: 28px;
}

.stats-titlebar > span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.stats-filter {
    display: flex;
    gap: 8px;
    align-items: center;
}

.stats-filter select {
    min-width: 118px;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0 14px;
    background: #fff;
    color: var(--text);
    font-weight: 750;
}

.stats-overview {
    margin-bottom: 18px;
}

.stats-overview-title {
    margin-bottom: 12px;
}

.stats-filter-mobile {
    display: none;
}

.stats-overview-title span {
    color: var(--blue);
    font-size: 16px;
    font-weight: 900;
}

.stats-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.stats-overview article {
    min-height: 86px;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.stats-overview article.wide {
    grid-column: span 2;
}

.stats-overview article div > span {
    color: #334155;
    font-size: 13px;
    font-weight: 850;
}

.stats-overview article strong {
    display: block;
    margin-top: 6px;
    color: #020617;
    font-size: 22px;
    line-height: 1.15;
}

.stats-overview article small {
    color: #475569;
    font-size: 14px;
}

.stats-metric-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dbeafe;
    border-radius: 50%;
    background: #fff;
    color: var(--blue);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.08);
}

.stats-metric-icon .icon {
    width: 22px;
    height: 22px;
}

.stats-metric-icon.green {
    color: #10b981;
}

.stats-metric-icon.teal,
.stats-metric-icon.gauge {
    color: #14b8a6;
}

.stats-metric-icon.drop {
    color: #0ea5e9;
}

.stats-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
        "spend composition"
        "efficiency distance";
    gap: 18px;
    margin-bottom: 18px;
}

.stats-chart-card,
.stats-table-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.stats-spend-card {
    grid-area: spend;
}

.stats-composition-card {
    grid-area: composition;
}

.stats-efficiency-card {
    grid-area: efficiency;
}

.stats-distance-card {
    grid-area: distance;
}

.chart-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.chart-card-header h2 {
    margin: 0;
    font-size: 18px;
}

.chart-card-header span {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.chart-legend i {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.legend-fuel,
.bar-fuel {
    background: #60a5fa;
}

.legend-repair,
.bar-repair {
    background: #2563eb;
}

.legend-other,
.bar-other {
    background: #94a3b8;
}

.chart-tabs {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 3px;
    background: #f8fafc;
}

.chart-tabs button {
    min-width: 74px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    cursor: pointer;
}

.chart-tabs button.is-active {
    background: #fff;
    color: var(--blue);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.stacked-chart,
.simple-bar-chart {
    min-height: 280px;
    display: grid;
    grid-template-columns: repeat(12, minmax(28px, 1fr));
    gap: 10px;
    align-items: end;
}

.chart-month,
.simple-bar-month {
    position: relative;
    min-width: 0;
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 6px;
    align-items: end;
    text-align: center;
}

.stacked-track,
.simple-track {
    position: relative;
    height: 220px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    border-bottom: 2px solid #cbd5e1;
    background:
        linear-gradient(to top, rgba(148, 163, 184, 0.18) 1px, transparent 1px) 0 0 / 100% 20%;
}

.stacked-bar {
    width: 58%;
    min-height: 0;
    display: flex;
    flex-direction: column-reverse;
    overflow: hidden;
    border-radius: 6px 6px 0 0;
    background: #e2e8f0;
}

.stacked-bar span {
    display: block;
    min-height: 0;
}

.chart-month strong,
.simple-bar-month strong {
    color: #475569;
    font-size: 12px;
}

.chart-month small,
.simple-bar-month small {
    min-height: 17px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
}

.simple-track .simple-bar {
    width: 62%;
    min-height: 0;
    border-radius: 6px 6px 0 0;
    background: #22c1f1;
}

.distance-chart .simple-track .simple-bar {
    background: #3b82f6;
}

.value-label {
    position: absolute;
    left: 50%;
    bottom: calc(var(--bar-height, 0%) + 5px);
    z-index: 2;
    min-height: 18px;
    transform: translateX(-50%);
    color: #0284c7;
    font-size: 12px;
    font-weight: 850;
    line-height: 1.1;
    white-space: nowrap;
}

.distance-chart .value-label {
    font-size: 10px;
}

.fuel-liter-chart .simple-track .simple-bar {
    background: #22c55e;
}

.composition-card {
    display: flex;
    flex-direction: column;
}

.donut-layout {
    min-height: 260px;
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 24px;
    align-items: center;
}

.donut-chart {
    position: relative;
    width: 188px;
    aspect-ratio: 1;
    border-radius: 50%;
}

.donut-chart::after {
    content: "";
    position: absolute;
    inset: 38px;
    border-radius: inherit;
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--line);
}

.donut-chart > div {
    position: absolute;
    inset: 48px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.donut-chart span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.donut-chart strong {
    margin-top: 4px;
    color: var(--text);
    font-size: 16px;
    line-height: 1.2;
}

.donut-legend {
    display: grid;
    gap: 18px;
}

.donut-legend-row {
    display: grid;
    grid-template-columns: minmax(90px, 1fr) minmax(0, auto);
    gap: 14px;
    align-items: center;
}

.donut-legend-row span,
.donut-legend-row strong {
    display: inline-flex;
    align-items: center;
}

.donut-legend-row span {
    gap: 9px;
    color: #334155;
    font-weight: 850;
}

.donut-legend-row i {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.donut-legend-row strong {
    justify-content: flex-end;
    gap: 5px;
    white-space: nowrap;
}

.donut-legend-row small {
    color: var(--muted);
    font-size: 12px;
}

.composition-row {
    display: grid;
    gap: 10px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}

.composition-row:first-of-type {
    border-top: 0;
}

.composition-row > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-weight: 850;
}

.composition-row span {
    color: #334155;
}

.composition-track {
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.composition-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.stats-table-wrap {
    overflow-x: auto;
}

.stats-table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
    font-size: 14px;
}

.stats-table th,
.stats-table td {
    padding: 12px 10px;
    border-top: 1px solid var(--line);
    text-align: right;
    white-space: nowrap;
}

.stats-table th:first-child,
.stats-table td:first-child {
    text-align: left;
}

.stats-table thead th {
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 850;
}

.stats-summary-row {
    cursor: pointer;
}

.stats-summary-row:hover th,
.stats-summary-row:hover td,
.stats-summary-row.is-open th,
.stats-summary-row.is-open td {
    background: #f8fafc;
}

.stats-month-detail-row td {
    padding: 0;
    background: #fbfdff;
}

.month-detail-list {
    display: grid;
    gap: 8px;
    padding: 12px;
}

.month-detail-list a {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr) minmax(160px, auto) minmax(110px, auto);
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.month-detail-list strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.month-detail-list small {
    color: var(--muted);
    font-size: 12px;
}

.month-detail-list em {
    justify-self: end;
    font-style: normal;
    font-weight: 900;
}

@media (max-width: 1180px) {
    .topbar {
        grid-template-columns: auto 210px 1fr auto;
    }

    .topnav {
        gap: 6px;
    }

    .filter-bar {
        grid-template-columns: repeat(3, minmax(120px, 1fr));
    }

    .search-field {
        grid-column: span 2;
    }

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

    .dashboard-grid,
    .car-edit-grid,
    .record-add-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .vehicle-summary-grid .mileage-metric {
        grid-column: 1 / -1;
    }

    .stats-overview {
        grid-template-columns: 1fr;
    }

    .stats-overview-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .stats-chart-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "spend composition"
            "efficiency distance";
    }

    .donut-layout {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .detail-info-layout {
        grid-template-columns: 1fr;
    }

    .summary-card:nth-child(2) {
        border-right: 0;
    }

    .summary-card:nth-child(-n + 2) {
        border-bottom: 1px solid var(--line);
    }

    .item-editor-row {
        grid-template-columns: repeat(2, minmax(0, 1fr)) 42px;
    }

    .item-editor-row label:nth-of-type(1),
    .item-editor-row label:nth-of-type(3),
    .item-editor-row label:nth-of-type(5),
    .item-editor-row label:nth-of-type(7) {
        grid-column: 1;
    }

    .item-editor-row label:nth-of-type(2),
    .item-editor-row label:nth-of-type(4),
    .item-editor-row label:nth-of-type(6) {
        grid-column: 2;
    }

    .item-editor-row .wide {
        grid-column: 1 / span 2;
    }

    .remove-item-button {
        grid-column: 3;
        grid-row: 4;
    }
}

@media (max-width: 980px) {
    .detail-info-card .two-column-info {
        grid-template-columns: 1fr;
    }

    .detail-info-card .two-column-info div {
        grid-template-columns: minmax(122px, 140px) minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    html,
    body {
        width: 100%;
        overflow-x: hidden;
    }

    body {
        background: #f8fafc;
        font-size: 14px;
    }

    button,
    a,
    select,
    input,
    textarea,
    .bottom-nav-item,
    .quick-add-link,
    .icon-button {
        -webkit-tap-highlight-color: transparent;
    }

    select,
    .filter-bar select,
    .form-card select,
    .drawer-account select {
        min-height: 44px;
        line-height: 44px;
    }

    input[type="date"],
    .form-card input[type="date"],
    .car-edit-grid input[type="date"] {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        padding-right: 12px;
        text-align: left;
    }

    .desktop-only,
    .topbar,
    .sidebar {
        display: none !important;
    }

    .mobile-only {
        display: block;
    }

    .mobile-topbar {
        position: sticky;
        top: 0;
        left: 0;
        right: 0;
        z-index: 20;
        width: 100%;
        min-height: calc(58px + env(safe-area-inset-top));
        display: grid;
        grid-template-columns: 48px minmax(0, 1fr) 48px;
        align-items: center;
        gap: 6px;
        padding: env(safe-area-inset-top) 12px 0;
        border-bottom: 1px solid var(--line);
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(16px);
    }

    .mobile-title {
        grid-column: 1 / -1;
        min-width: 0;
        text-align: center;
        font-size: 17px;
        font-weight: 900;
    }

    .mobile-topbar > .icon-button {
        position: absolute;
        top: env(safe-area-inset-top);
        left: 12px;
    }

    .mobile-search-button {
        position: fixed !important;
        top: 8px !important;
        right: 12px !important;
        left: auto !important;
        z-index: 1000;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 0;
        border-radius: var(--radius);
        background: rgba(248, 250, 252, 0.98);
    }

    .mobile-actions .icon-button,
    .mobile-topbar > .icon-button,
    .mobile-search-button {
        width: 42px;
        height: 42px;
        color: #0f172a;
    }

    .mobile-actions .icon-button .icon,
    .mobile-search-button .icon {
        display: block;
        color: #0f172a;
        stroke: currentColor;
    }

    .mobile-search-button::before {
        content: "";
        position: absolute;
        width: 15px;
        height: 15px;
        border: 2px solid currentColor;
        border-radius: 50%;
        transform: translate(-2px, -2px);
    }

    .mobile-search-button::after {
        content: "";
        position: absolute;
        width: 8px;
        height: 2px;
        border-radius: 999px;
        background: currentColor;
        transform: translate(8px, 8px) rotate(45deg);
    }

    .mobile-search-button .icon {
        opacity: 0;
    }

    .mobile-search-panel {
        position: sticky;
        top: calc(58px + env(safe-area-inset-top));
        z-index: 19;
        display: block;
        padding: 10px 14px;
        border-bottom: 1px solid var(--line);
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(16px);
    }

    .mobile-search-panel[hidden] {
        display: none;
    }

    .mobile-search-panel form {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
    }

    .mobile-search-panel .search-field {
        min-width: 0;
    }

    .app-shell {
        display: block;
        min-height: 100vh;
        margin: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
    }

    .main-content {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
        padding: calc(env(safe-area-inset-top) + 16px) 14px 190px;
        background: transparent;
    }

    .page-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: flex-start;
        margin-bottom: 14px;
    }

    .page-header > div {
        display: block;
        min-width: 0;
    }

    .page-header h1 {
        font-size: 22px;
    }

    .page-header .count-text {
        display: block;
        margin-top: 4px;
        line-height: 1.45;
    }

    .page-header .ghost-button {
        min-height: 38px;
        padding: 0 12px;
        font-size: 13px;
    }

    .dashboard-page-header .dashboard-add-shell {
        display: none;
    }

    .add-record-button {
        width: 44px;
        min-width: 44px;
        padding: 0;
        overflow: hidden;
        color: transparent;
    }

    .add-record-button .icon {
        color: #fff;
    }

    .filter-bar {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        margin: 0 -14px 14px;
        padding: 0 14px 4px;
        scrollbar-width: none;
    }

    .filter-bar::-webkit-scrollbar {
        display: none;
    }

    .filter-bar select,
    .filter-bar input,
    .filter-bar .ghost-button {
        min-width: 118px;
        border-radius: 999px;
        background: #fff;
    }

    .search-field {
        min-width: 220px;
    }

    .stats-titlebar {
        display: none;
    }

    .stats-overview {
        min-width: 0;
        max-width: 100%;
        margin-bottom: 12px;
        padding: 8px;
        border: 1px solid #c9eee1;
        border-radius: var(--radius);
        background: linear-gradient(180deg, #eefdf7, #f7fffb);
    }

    .stats-overview-title {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 8px;
        padding: 0 2px;
    }

    .stats-overview-title .stats-filter-mobile {
        display: flex;
    }

    .stats-filter-mobile select {
        min-width: 96px;
        min-height: 40px;
        line-height: 40px;
        border-radius: 8px;
        padding: 0 10px;
        font-size: 12px;
    }

    .stats-overview-title span {
        color: #047857;
        font-size: 15px;
    }

    .stats-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0;
        border: 1px solid #d6eee5;
        border-radius: 8px;
        overflow: hidden;
        background: rgba(255, 255, 255, 0.48);
    }

    .stats-overview article {
        min-height: 72px;
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 9px;
        padding: 10px;
        border: 0;
        border-right: 1px solid #d6eee5;
        border-bottom: 1px solid #d6eee5;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .stats-overview article:nth-child(2n),
    .stats-overview article.wide {
        border-right: 0;
    }

    .stats-overview article.wide {
        grid-column: 1 / -1;
        justify-content: center;
        grid-template-columns: 36px auto;
    }

    .stats-metric-icon {
        width: 34px;
        height: 34px;
    }

    .stats-metric-icon .icon {
        width: 18px;
        height: 18px;
    }

    .stats-overview article div > span {
        font-size: 11px;
    }

    .stats-overview article strong {
        font-size: 15px;
    }

    .stats-chart-grid {
        min-width: 0;
        max-width: 100%;
        grid-template-columns: 1fr;
        grid-template-areas:
            "spend"
            "composition"
            "efficiency"
            "distance";
        gap: 12px;
        margin-bottom: 12px;
    }

    .stats-chart-card,
    .stats-table-card {
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        padding: 16px;
    }

    .chart-card-header {
        display: block;
        margin-bottom: 12px;
    }

    .chart-card-header h2 {
        font-size: 18px;
    }

    .chart-card-header span {
        font-size: 12px;
    }

    .chart-legend {
        justify-content: flex-start;
        gap: 8px;
        margin-top: 10px;
        font-size: 11px;
    }

    .chart-tabs {
        margin-top: 10px;
    }

    .donut-layout {
        min-height: 0;
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 14px;
    }

    .donut-chart {
        width: 178px;
    }

    .donut-chart::after {
        inset: 35px;
    }

    .donut-chart > div {
        inset: 44px;
    }

    .donut-chart strong {
        font-size: 15px;
    }

    .donut-legend {
        width: 100%;
        gap: 12px;
    }

    .donut-legend-row {
        grid-template-columns: minmax(78px, max-content) minmax(0, 1fr);
        gap: 8px;
    }

    .donut-legend-row span {
        gap: 7px;
        font-size: 13px;
    }

    .donut-legend-row strong {
        min-width: 0;
        justify-content: flex-end;
        white-space: normal;
        text-align: right;
        font-size: 13px;
        line-height: 1.2;
    }

    .donut-legend-row small {
        font-size: 11px;
    }

    .stacked-chart,
    .simple-bar-chart {
        width: 100%;
        min-height: 202px;
        display: flex;
        align-items: end;
        gap: 2px;
        transform: scaleX(0.88);
        transform-origin: left bottom;
    }

    .chart-month,
    .simple-bar-month {
        flex: 1 1 0;
    }

    .stacked-track,
    .simple-track {
        height: 148px;
    }

    .stacked-bar,
    .simple-track .simple-bar {
        width: 64%;
    }

    .chart-month strong,
    .simple-bar-month strong {
        font-size: 11px;
    }

    .chart-month small,
    .simple-bar-month small {
        display: none;
    }

    .value-label {
        bottom: calc(var(--bar-height, 0%) + 4px);
        min-height: 12px;
        transform: translateX(-50%) scale(0.9);
        font-size: 10px;
        line-height: 1;
    }

    .distance-chart .value-label,
    .fuel-liter-chart .value-label {
        transform: translateX(-50%) scale(0.82);
        font-size: 9px;
    }

    .stats-table-wrap {
        overflow-x: visible;
    }

    .stats-table {
        min-width: 0;
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
        font-size: 12px;
    }

    .stats-table thead {
        display: none;
    }

    .stats-table tbody {
        display: grid;
    }

    .stats-summary-row {
        display: grid;
        grid-template-columns: 44px repeat(3, minmax(0, 1fr));
        border-top: 1px solid var(--line);
    }

    .stats-summary-row:first-child {
        border-top: 0;
    }

    .stats-summary-row th,
    .stats-summary-row td {
        display: block;
        min-width: 0;
        padding: 8px 3px;
        border-top: 0;
        background: #fff;
        text-align: right;
        white-space: nowrap;
    }

    .stats-summary-row th {
        grid-row: 1 / span 2;
        align-self: center;
        text-align: left;
        font-size: 14px;
        font-weight: 900;
    }

    .stats-summary-row td {
        font-size: 12px;
        line-height: 1.2;
    }

    .stats-summary-row td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 3px;
        color: var(--muted);
        font-size: 10px;
        font-weight: 850;
    }

    .stats-summary-row td:nth-of-type(1) {
        grid-column: 2;
        grid-row: 1;
    }

    .stats-summary-row td:nth-of-type(2) {
        grid-column: 3;
        grid-row: 1;
    }

    .stats-summary-row td:nth-of-type(3) {
        grid-column: 4;
        grid-row: 1;
    }

    .stats-summary-row td:nth-of-type(4) {
        grid-column: 2;
        grid-row: 2;
    }

    .stats-summary-row td:nth-of-type(5) {
        grid-column: 3;
        grid-row: 2;
    }

    .stats-summary-row td:nth-of-type(6) {
        display: none;
    }

    .stats-summary-row td:nth-of-type(7) {
        grid-column: 4;
        grid-row: 2;
    }

    .stats-month-detail-row {
        display: block;
    }

    .stats-month-detail-row[hidden] {
        display: none !important;
    }

    .stats-month-detail-row td {
        display: block;
        width: 100%;
        padding: 0;
    }

    .month-detail-list a {
        grid-template-columns: 52px minmax(0, 1fr) auto;
        gap: 8px;
        padding: 10px;
    }

    .month-detail-list strong {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 13px;
    }

    .month-detail-list em {
        font-size: 12px;
        white-space: nowrap;
    }

    .month-detail-list small {
        display: none;
    }

    .summary-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        border: 0;
        background: transparent;
        box-shadow: none;
        margin-bottom: 14px;
    }

    .summary-card {
        min-height: 96px;
        min-width: 0;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        padding: 12px;
        column-gap: 10px;
        grid-template-columns: 38px minmax(0, 1fr);
        background: #fff;
        box-shadow: 0 6px 14px rgba(15, 23, 42, 0.05);
    }

    .summary-card p,
    .summary-card strong,
    .summary-card small {
        min-width: 0;
    }

    .summary-icon {
        width: 38px;
        height: 38px;
    }

    .summary-card strong {
        font-size: 18px;
        overflow-wrap: anywhere;
    }

    .summary-card p {
        overflow-wrap: anywhere;
        word-break: break-all;
        font-size: 13px;
    }

    .timeline-list {
        border: 0;
        background: transparent;
        display: grid;
        gap: 8px;
    }

    .timeline-row {
        grid-template-columns: 52px 12px minmax(0, 1fr);
        min-height: auto;
    }

    .timeline-date {
        padding: 16px 0 0;
        font-size: 13px;
    }

    .timeline-card,
    .timeline-row.is-featured .timeline-card {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        padding: 14px;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: #fff;
        box-shadow: 0 6px 14px rgba(15, 23, 42, 0.05);
    }

    .timeline-card > .icon {
        display: none;
    }

    .timeline-card h2 {
        font-size: 16px;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

    .timeline-card p {
        margin-top: 6px;
        font-size: 13px;
    }

    .timeline-amount span {
        display: none;
    }

    .timeline-amount {
        text-align: left;
    }

    .timeline-amount strong {
        font-size: 16px;
    }

    .mobile-detail-header {
        height: 54px;
        display: grid;
        grid-template-columns: 42px 1fr auto;
        align-items: center;
        margin: -4px 0 12px;
    }

    .mobile-detail-header h1 {
        margin: 0;
        text-align: center;
        font-size: 18px;
    }

    .mobile-top-actions {
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .text-action {
        min-width: 44px;
        color: #111827;
        font-weight: 750;
        text-align: center;
    }

    .mobile-record-card,
    .mobile-amount-card,
    .mobile-meta article {
        width: 100%;
        max-width: 390px;
        margin-left: auto;
        margin-right: auto;
        overflow: hidden;
        padding: 20px;
        margin-bottom: 10px;
    }

    .mobile-record-card > div {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: flex-start;
        gap: 0;
        min-width: 0;
    }

    .mobile-record-card h2 {
        margin: 0;
        min-width: 0;
        max-width: none;
        font-size: 22px;
        line-height: 1.28;
        overflow-wrap: anywhere;
        word-break: break-all;
    }

    .mobile-record-card > div > .badge {
        display: none;
    }

    .mobile-record-card ul {
        list-style: none;
        display: grid;
        gap: 12px;
        margin: 18px 0 0;
        padding: 0;
    }

    .mobile-record-card li {
        display: flex;
        align-items: center;
        gap: 10px;
        color: #111827;
    }

    .mobile-amount-card h2,
    .mobile-section-title h2,
    .mobile-meta h2 {
        margin: 0 0 16px;
        color: var(--blue);
        font-size: 18px;
    }

    .mobile-amount-card dl {
        display: grid;
        grid-template-columns: 1fr;
        gap: 7px;
        margin: 0;
    }

    .mobile-amount-card dt,
    .mobile-amount-card dd {
        margin: 0;
        min-width: 0;
        font-weight: 850;
        overflow-wrap: anywhere;
    }

    .mobile-amount-card dd {
        justify-self: start;
        max-width: 100%;
        margin-bottom: 7px;
        text-align: left;
        font-size: 18px;
    }

    .mobile-amount-card p {
        margin: 18px 0 0;
        color: var(--muted);
        line-height: 1.7;
    }

    .mobile-section-title {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin: 18px 0 8px;
    }

    .item-accordion {
        margin-bottom: 8px;
        overflow: hidden;
    }

    .item-accordion summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        min-height: 78px;
        padding: 16px;
        list-style: none;
        cursor: pointer;
    }

    .item-accordion summary::-webkit-details-marker {
        display: none;
    }

    .item-accordion summary b {
        white-space: nowrap;
    }

    .accordion-body {
        display: grid;
        gap: 8px;
        padding: 0 10px 10px;
    }

    .mobile-item-card {
        position: relative;
        padding: 14px;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: #fff;
    }

    .mobile-item-card > div {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 8px;
    }

    .mobile-item-card h3 {
        margin: 0;
        font-size: 15px;
    }

    .mobile-item-card p {
        margin: 8px 0 0;
        color: #475569;
        font-size: 13px;
    }

    .mobile-item-card strong {
        display: block;
        margin-top: 8px;
        text-align: right;
        font-size: 16px;
    }

    .group-total {
        display: flex;
        justify-content: space-between;
        padding: 12px 6px 4px;
        color: var(--blue);
        font-weight: 850;
    }

    .mobile-meta {
        display: grid;
        gap: 8px;
        margin-top: 8px;
    }

    .mobile-meta p {
        margin: 0;
        line-height: 1.8;
    }

    .mobile-meta dl {
        margin: 0;
        display: grid;
        gap: 10px;
    }

    .mobile-meta dl div {
        display: grid;
        grid-template-columns: 80px 1fr;
    }

    .mobile-meta dt,
    .mobile-meta dd {
        margin: 0;
    }

    .mobile-button-pair {
        display: grid;
        grid-template-columns: 1fr 2fr;
        gap: 12px;
        max-width: 390px;
        margin: 10px auto 0;
    }

    .bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 10;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        height: calc(72px + env(safe-area-inset-bottom));
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--line);
        background: rgba(255, 255, 255, 0.94);
        backdrop-filter: blur(16px);
    }

    .quick-add-backdrop {
        position: fixed;
        inset: 0;
        z-index: 9;
        background: rgba(15, 23, 42, 0.08);
    }

    .mobile-quick-add-menu {
        position: fixed;
        top: auto;
        right: 50%;
        bottom: calc(82px + env(safe-area-inset-bottom));
        z-index: 11;
        min-width: min(320px, calc(100vw - 40px));
        grid-template-columns: repeat(4, minmax(0, 1fr));
        transform: translateX(50%);
        transform-origin: bottom center;
    }

    .mobile-quick-add-menu .quick-add-link {
        min-height: 56px;
        flex-direction: column;
        gap: 5px;
        font-size: 12px;
    }

    .bottom-nav-item {
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: #64748b;
        font-size: 11px;
        font-weight: 750;
        border: 0;
        background: transparent;
        font-family: inherit;
        appearance: none;
        touch-action: manipulation;
        user-select: none;
    }

    .bottom-nav-item:active,
    .bottom-nav-item:focus,
    .bottom-nav-item:focus-visible {
        outline: 0;
        background: transparent;
        box-shadow: none;
    }

    .bottom-nav-item .icon {
        width: 22px;
        height: 22px;
    }

    .bottom-nav-item.is-active {
        color: var(--blue);
    }

    .bottom-nav-item.is-primary .icon {
        width: 56px;
        height: 56px;
        padding: 15px;
        border-radius: 50%;
        background: var(--blue);
        color: #fff;
        box-shadow: 0 8px 18px rgba(37, 99, 235, 0.32);
        transform: translateY(-14px);
        transition: transform 160ms ease;
    }

    .bottom-nav-item.is-primary.is-open .icon {
        transform: translateY(-14px) rotate(45deg);
    }

    .bottom-nav-item.is-primary span {
        display: none;
    }

    .form-grid,
    .totals-grid,
    .totals-grid dl,
    .inline-total-preview {
        grid-template-columns: 1fr;
    }

    .inline-total-preview div {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .inline-total-preview div:last-child {
        border-bottom: 0;
    }

    .span-2 {
        grid-column: auto;
    }

    .form-card {
        padding: 16px;
    }

    .item-category-group {
        padding: 12px;
    }

    .item-category-header {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .item-category-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-content: stretch;
    }

    .item-category-actions .ghost-button {
        width: 100%;
        min-width: 0;
        padding: 0 8px;
    }

    .item-editor-row {
        grid-template-columns: 1fr 42px;
        align-items: end;
    }

    .item-editor-row label,
    .item-editor-row .wide {
        grid-column: 1 / -1;
    }

    .item-editor-row label:nth-of-type(n) {
        grid-column: 1 / -1;
    }

    .remove-item-button {
        grid-column: 2;
        grid-row: auto;
    }

    .sticky-form-actions {
        position: fixed;
        left: 50%;
        right: auto;
        bottom: calc(72px + env(safe-area-inset-bottom) + 10px);
        z-index: 12;
        display: grid;
        grid-template-columns: 1fr 2fr;
        gap: 10px;
        width: calc(100% - 28px);
        max-width: 390px;
        margin-left: auto;
        margin-right: auto;
        padding: 10px;
        transform: translateX(-50%);
    }

    .sticky-form-actions .ghost-button,
    .sticky-form-actions .primary-button {
        width: 100%;
        min-width: 0;
        padding: 0 10px;
    }

    .login-panel {
        grid-template-columns: 1fr;
    }

    .dashboard-grid,
    .car-edit-grid,
    .record-add-grid {
        grid-template-columns: 1fr;
    }

    .car-summary-list {
        grid-template-columns: 1fr;
    }

    .car-summary-card {
        grid-template-columns: 92px minmax(0, 1fr) auto;
        gap: 10px;
        padding: 10px;
    }

    .car-summary-card img {
        width: 92px;
    }

    .car-summary-card h3 {
        font-size: 15px;
    }

    .car-summary-card p {
        font-size: 12px;
    }

    .car-form-hero {
        grid-template-columns: 1fr;
    }

    .car-form-hero img {
        max-width: 260px;
    }

    .station-picker-field,
    .station-search-bar,
    .place-search-bar,
    .place-layout,
    .station-card {
        grid-template-columns: 1fr;
    }

    .place-side-card {
        position: static;
    }

    .station-card dl {
        justify-content: flex-start;
    }

    .station-card dl div {
        text-align: left;
    }

    .fuel-select-inline {
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .app-drawer {
        width: min(314px, 86vw);
    }

    .drawer-record-menu {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 16px 18px 6px;
    }

    .drawer-record-link {
        min-height: 46px;
        background: #f8fafc;
    }

    .drawer-menu {
        padding-top: 10px;
    }

    .login-copy {
        min-height: 220px;
        padding: 28px;
    }

    .login-form {
        padding: 28px;
    }
}

@media (max-width: 760px) {
    .dashboard-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 14px;
    }

    .dashboard-summary-grid .dashboard-card {
        min-height: 66px;
        padding: 10px 10px 10px 52px;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        box-shadow: 0 6px 14px rgba(15, 23, 42, 0.05);
    }

    .dashboard-summary-grid .dashboard-total-card {
        grid-column: 1 / -1;
        min-height: 92px;
        padding: 14px 14px 14px 60px;
    }

    .dashboard-summary-grid .dashboard-card-icon {
        left: 12px;
        width: 34px;
        height: 34px;
    }

    .dashboard-summary-grid .dashboard-total-card .dashboard-card-icon {
        left: 14px;
        width: 38px;
        height: 38px;
    }

    .dashboard-summary-grid .dashboard-card-icon .icon {
        width: 18px;
        height: 18px;
    }

    .dashboard-summary-grid .dashboard-card p {
        font-size: 13px;
        line-height: 1.25;
    }

    .dashboard-summary-grid .dashboard-card strong {
        margin-top: 2px;
        font-size: 17px;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .dashboard-summary-grid .dashboard-total-card strong {
        font-size: 26px;
    }

    .dashboard-summary-grid .dashboard-card small {
        margin-top: 3px;
        font-size: 12px;
        line-height: 1.3;
    }

    .vehicle-summary-card {
        margin-bottom: 14px;
        padding: 14px;
    }

    .vehicle-summary-head {
        gap: 10px;
        margin-bottom: 10px;
    }

    .vehicle-summary-head h2 {
        font-size: 15px;
    }

    .vehicle-summary-head p {
        font-size: 12px;
        line-height: 1.35;
    }

    .vehicle-summary-head > span {
        min-height: 26px;
        padding: 0 8px;
        font-size: 11px;
    }

    .vehicle-summary-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .vehicle-metric {
        min-height: 74px;
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 10px;
        padding: 12px;
    }

    .vehicle-metric-icon {
        width: 34px;
        height: 34px;
    }

    .vehicle-metric-icon .icon {
        width: 17px;
        height: 17px;
    }

    .vehicle-metric p {
        font-size: 12px;
    }

    .vehicle-metric strong {
        font-size: 18px;
    }

    .vehicle-metric small {
        margin-top: 4px;
        font-size: 11px;
    }

    .mileage-metric dl {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .mileage-metric dl div {
        display: block;
    }

    .mileage-metric dd {
        margin-top: 2px;
        font-size: 17px;
    }

    .dashboard-timeline {
        gap: 10px;
    }

    .dashboard-timeline .timeline-row {
        grid-template-columns: 64px 22px minmax(0, 1fr);
        min-height: auto;
    }

    .dashboard-timeline .timeline-date {
        padding: 15px 0 0 8px;
        font-size: 13px;
    }

    .dashboard-timeline .timeline-marker::after {
        top: 17px;
        width: 26px;
        height: 26px;
    }

    .dashboard-timeline .timeline-marker > img {
        top: 17px;
        width: 26px;
        height: 26px;
    }

    .dashboard-timeline .timeline-marker > .icon {
        top: 23px;
        width: 14px;
        height: 14px;
    }

    .dashboard-timeline .timeline-marker > span {
        top: 24px;
        font-size: 7px;
    }

    .dashboard-timeline .timeline-card,
    .dashboard-timeline .timeline-row.is-featured .timeline-card {
        border: 1px solid var(--line);
        box-shadow: 0 6px 14px rgba(15, 23, 42, 0.05);
    }

    .dashboard-timeline .timeline-card {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        padding: 16px;
    }

    .dashboard-timeline .timeline-card > .icon {
        display: none;
    }

    .dashboard-timeline .timeline-card h2 {
        font-size: 17px;
        line-height: 1.35;
    }

    .timeline-meta-line {
        gap: 5px;
    }

    .timeline-card p .timeline-meta-pill {
        min-height: 24px;
        max-width: 100%;
        padding: 0 8px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .dashboard-timeline .timeline-amount {
        text-align: left;
    }

    .dashboard-timeline .timeline-amount span {
        display: none;
    }
}
