:root {
            color-scheme: light;
            font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
            background: #fff1be;
            color: #1f1a14;
            --line: #1f1a14;
            --line-soft: #e7d8a8;
            --muted: #6d614e;
            --panel: #fff9e8;
            --green: #17936c;
            --blue: #263941;
            --gold: #ffcf3f;
            --gold-soft: #fff3c8;
            --ink: #1f1a14;
            --raised: 0 6px 0 #1f1a14, 0 18px 28px rgba(31, 26, 20, 0.12);
            --pressed: 0 2px 0 #1f1a14, 0 10px 18px rgba(31, 26, 20, 0.12);
        }

        [v-cloak] {
            display: none;
        }

        * {
            box-sizing: border-box;
        }

        body {
            margin: 0;
            padding: 28px 16px 120px;
            background:
                radial-gradient(circle at 12% 12%, rgba(255, 255, 255, 0.36) 0 9%, transparent 9% 100%),
                radial-gradient(circle at 88% 18%, rgba(255, 207, 63, 0.45) 0 10%, transparent 10% 100%),
                #fff1be;
        }

        main {
            max-width: 1080px;
            margin: 0 auto;
        }

        header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            margin-bottom: 22px;
            padding: 18px 22px;
            position: relative;
            overflow: hidden;
            background: #1f1a14;
            border: 2px solid #1f1a14;
            border-radius: 8px;
            box-shadow: var(--raised);
        }

        header::before {
            background: linear-gradient(90deg, #f8b83e, #d99518, #13966f);
            content: "";
            height: 5px;
            inset: 0 0 auto;
            position: absolute;
        }

        header > div:first-child {
            min-width: 0;
        }

        h1 {
            color: #fff6d9;
            margin: 0;
            font-size: 28px;
            line-height: 1.15;
            letter-spacing: 0;
            white-space: nowrap;
        }

        .muted {
            color: #ffde68;
            margin: 6px 0 0;
            font-size: 14px;
            font-weight: 700;
        }

        .button {
            border: 2px solid #1f1a14;
            background: #fff9e8;
            color: var(--ink);
            border-radius: 8px;
            padding: 10px 14px;
            text-decoration: none;
            font-size: 14px;
            font-weight: 700;
            white-space: nowrap;
            box-shadow: 0 4px 0 #1f1a14;
            cursor: pointer;
            transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
        }

        .button.primary {
            border-color: #1f1a14;
            background: #ffcf3f;
            color: #1f1a14;
            box-shadow: 0 4px 0 #1f1a14;
        }

        .button:hover:not(:disabled) {
            background: #ffefaa;
            transform: translateY(-1px);
        }

        .button.primary:hover:not(:disabled) {
            background: #ffd85f;
        }

        .button:active:not(:disabled) {
            box-shadow: 0 1px 0 #1f1a14;
            transform: translateY(3px);
        }

        .button.primary:active:not(:disabled) {
            box-shadow: 0 1px 0 #1f1a14;
        }

        .button:disabled {
            cursor: wait;
            opacity: 0.7;
        }

        .reference-action {
            align-items: center;
            background: #fff9e8;
            border: 2px solid #1f1a14;
            border-radius: 999px;
            box-shadow: 0 2px 0 #1f1a14;
            color: #1f1a14;
            cursor: pointer;
            display: inline-flex;
            font-size: 13px;
            font-weight: 900;
            height: 28px;
            justify-content: center;
            line-height: 1;
            width: 28px;
        }

        .reference-action.active {
            background: #ffcf3f;
            box-shadow: inset 0 -2px 0 rgba(31, 26, 20, 0.18);
            cursor: default;
        }

        .actions {
            display: flex;
            align-items: center;
            gap: 10px;
            flex: 0 0 auto;
            flex-wrap: nowrap;
            justify-content: flex-end;
        }

        .status {
            color: var(--muted);
            font-size: 13px;
            min-height: 18px;
            text-align: right;
            width: 100%;
        }

        .summary {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 14px;
            margin-bottom: 18px;
        }

        .summary-section {
            background: transparent;
        }

        .view-section {
            animation: view-in 160ms ease-out;
        }

        .panel,
        .metric {
            background: var(--panel);
            border: 2px solid var(--line);
            border-radius: 8px;
            box-shadow: var(--raised);
        }

        .metric {
            background: #fff9e8;
            border-color: #1f1a14;
            padding: 18px 16px 15px;
            min-height: 116px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            overflow: hidden;
            position: relative;
        }

        .metric-label {
            color: #725f22;
            font-size: 13px;
            font-weight: 800;
            margin-bottom: 10px;
        }

        .metric-value {
            color: #1f1a14;
            font-size: 24px;
            font-weight: 900;
            line-height: 1.2;
            overflow-wrap: anywhere;
        }

        .metric-note {
            color: var(--muted);
            font-size: 12px;
            font-weight: 700;
            margin-top: 8px;
        }

        .grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 18px;
            margin-bottom: 18px;
        }

        .panel {
            padding: 18px;
            min-width: 0;
            overflow: hidden;
            position: relative;
        }

        .chart-panel {
            background: #f4fff7;
            border-color: #1f1a14;
            box-shadow: var(--raised);
        }

        .log-panel {
            background: #fff9e8;
            border-color: #1f1a14;
            box-shadow: var(--raised);
        }

        .savings-panel {
            background: #fff9e8;
            border-color: #1f1a14;
            box-shadow: var(--raised);
        }

        .panel-head {
            display: flex;
            align-items: start;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 14px;
        }

        .panel h2 {
            margin: 0;
            font-size: 20px;
            font-weight: 900;
        }

        .panel-meta {
            color: var(--muted);
            font-size: 12px;
            margin-top: 4px;
        }

        .pill {
            align-items: center;
            background: #ffefaa;
            border: 2px solid #1f1a14;
            border-radius: 999px;
            color: #1f1a14;
            display: inline-flex;
            font-size: 12px;
            font-weight: 900;
            height: 26px;
            padding: 0 10px;
            white-space: nowrap;
        }

        .chart-wrap {
            position: relative;
            width: 100%;
            height: 360px;
            border: 2px solid #1f1a14;
            border-radius: 8px;
            background:
                linear-gradient(180deg, rgba(255, 255, 255, 0.86) 0%, #fff 100%),
                repeating-linear-gradient(90deg, rgba(31, 26, 20, 0.05) 0 1px, transparent 1px 48px);
            overflow: hidden;
        }

        canvas {
            display: block;
            width: 100%;
            height: 100%;
        }

        .table-wrap {
            overflow-x: auto;
            border: 2px solid #1f1a14;
            border-radius: 8px;
            box-shadow: inset 0 1px 0 #fff;
        }

        .log-toolbar {
            align-items: center;
            display: flex;
            gap: 10px;
            justify-content: space-between;
            margin: 2px -2px 14px;
            padding: 0 2px;
        }

        .section-actions {
            align-items: center;
            display: flex;
            gap: 10px;
            justify-content: flex-end;
            min-width: 0;
        }

        .section-status {
            background: #ffefaa;
            border: 2px solid #1f1a14;
            border-radius: 8px;
            color: #1f1a14;
            font-size: 13px;
            font-weight: 800;
            margin: -4px 0 14px;
            padding: 10px 12px;
        }

        .pagination {
            align-items: center;
            display: flex;
            gap: 8px;
            justify-content: flex-end;
            margin-top: 14px;
        }

        .page-link {
            border: 2px solid #1f1a14;
            border-radius: 8px;
            color: var(--ink);
            min-width: 38px;
            padding: 9px 11px;
            text-align: center;
            text-decoration: none;
            background: #fff9e8;
            font-weight: 900;
            box-shadow: 0 3px 0 #1f1a14;
        }

        .page-link:not(.disabled):hover {
            background: #ffefaa;
        }

        .page-link.disabled {
            color: #9a8d72;
            pointer-events: none;
            box-shadow: none;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            min-width: 640px;
            background: #fff;
        }

        th,
        td {
            padding: 10px 12px;
            border-bottom: 1px solid var(--line-soft);
            text-align: left;
            font-size: 13px;
            white-space: nowrap;
        }

        th {
            color: #1f1a14;
            font-weight: 900;
            background: #ffefaa;
            position: sticky;
            top: 0;
        }

        td.number,
        th.number {
            text-align: right;
            font-variant-numeric: tabular-nums;
        }

        tbody tr:hover {
            background: #fff3c8;
        }

        tbody tr:nth-child(even) {
            background: #fffdf1;
        }

        tbody tr:nth-child(even):hover {
            background: #fff3c8;
        }

        tr:last-child td {
            border-bottom: 0;
        }

        .badge {
            display: inline-flex;
            align-items: center;
            height: 24px;
            padding: 0 9px;
            border-radius: 999px;
            font-size: 12px;
            border: 2px solid #1f1a14;
            background: #fff9e8;
            font-weight: 900;
        }

        .badge.sent {
            border-color: #1f1a14;
            background: #dff6df;
            color: #175821;
        }

        .badge.skipped {
            border-color: #1f1a14;
            background: #fff1be;
            color: #6b5300;
        }

        .error {
            border: 1px solid #efb4aa;
            background: #fff4f2;
            color: #8f2013;
            border-radius: 8px;
            padding: 14px 16px;
        }

        .auth-body {
            display: grid;
            min-height: 100vh;
            padding: 24px 16px;
            place-items: center;
        }

        .auth-shell {
            max-width: 420px;
            width: 100%;
        }

        .auth-panel {
            background: #1f1a14;
            border: 2px solid #1f1a14;
            border-radius: 8px;
            box-shadow: var(--raised);
            overflow: hidden;
            padding: 24px;
            position: relative;
        }

        .auth-panel::before {
            background: linear-gradient(90deg, #f8b83e, #d99518, #13966f);
            content: "";
            height: 5px;
            inset: 0 0 auto;
            position: absolute;
        }

        .auth-panel h1 {
            color: #fff6d9;
            font-size: 26px;
            white-space: normal;
        }

        .auth-eyebrow {
            color: #ffde68;
            font-size: 13px;
            font-weight: 900;
            margin: 0 0 6px;
        }

        .auth-form {
            display: grid;
            gap: 12px;
            margin-top: 22px;
        }

        .auth-label {
            color: #ffde68;
            font-size: 13px;
            font-weight: 900;
        }

        .auth-input {
            background: #fff9e8;
            border: 2px solid #1f1a14;
            border-radius: 8px;
            color: #1f1a14;
            font-size: 17px;
            font-weight: 900;
            padding: 12px 14px;
            width: 100%;
        }

        .auth-error {
            background: #fff4f2;
            border: 2px solid #efb4aa;
            border-radius: 8px;
            color: #8f2013;
            font-size: 13px;
            font-weight: 900;
            padding: 10px 12px;
        }

        .auth-remember {
            align-items: center;
            color: #fff6d9;
            cursor: pointer;
            display: inline-flex;
            font-size: 13px;
            font-weight: 900;
            gap: 8px;
        }

        .auth-remember input {
            accent-color: #ffcf3f;
            height: 16px;
            width: 16px;
        }

        .auth-submit {
            width: 100%;
        }

        .loading-state {
            background: #fff9e8;
            border: 2px solid #1f1a14;
            border-radius: 8px;
            box-shadow: var(--raised);
            color: #1f1a14;
            font-size: 15px;
            font-weight: 900;
            padding: 18px;
            text-align: center;
        }

        .empty {
            display: grid;
            place-items: center;
            height: 100%;
            color: var(--muted);
            font-size: 14px;
            text-align: center;
            padding: 24px;
        }

        .table-empty {
            color: var(--muted);
            font-weight: 800;
            padding: 28px 12px;
            text-align: center;
        }

        .savings-section {
            width: 100%;
        }

        .savings-total-card {
            background: #ffefaa;
            border: 2px solid #1f1a14;
            border-radius: 8px;
            margin-bottom: 14px;
            overflow: hidden;
        }

        .savings-total {
            align-items: center;
            display: flex;
            justify-content: space-between;
            gap: 16px;
            padding: 16px;
        }

        .simulation-box {
            align-items: center;
            background: #fff9e8;
            border-top: 2px solid #1f1a14;
            display: grid;
            gap: 10px;
            grid-template-columns: auto 1fr minmax(160px, 240px);
            padding: 12px;
        }

        .simulation-label {
            color: #1f1a14;
            font-size: 13px;
            font-weight: 900;
        }

        .simulation-input {
            background: #fff9e8;
            border: 2px solid #1f1a14;
            border-radius: 8px;
            color: #1f1a14;
            font-size: 15px;
            font-weight: 900;
            min-width: 0;
            padding: 10px 12px;
            width: 100%;
        }

        .savings-total-value {
            color: #1f1a14;
            font-size: 28px;
            font-weight: 900;
            line-height: 1.1;
            overflow-wrap: anywhere;
        }

        .savings-grams {
            background: #fff9e8;
            border: 2px solid #1f1a14;
            border-radius: 999px;
            font-size: 13px;
            font-weight: 900;
            padding: 7px 11px;
            white-space: nowrap;
        }

        .savings-list {
            display: grid;
            gap: 10px;
        }

        .savings-row {
            align-items: center;
            background: #fffdf1;
            border: 2px solid #1f1a14;
            border-radius: 8px;
            display: flex;
            gap: 14px;
            justify-content: space-between;
            padding: 12px 14px;
        }

        .savings-name,
        .savings-value {
            color: #1f1a14;
            font-weight: 900;
        }

        .savings-value {
            text-align: right;
            white-space: nowrap;
        }

        .savings-empty {
            min-height: 160px;
        }

        .bottom-nav {
            align-items: center;
            background: #1f1a14;
            border: 2px solid #1f1a14;
            border-radius: 8px;
            bottom: 18px;
            box-shadow: 0 6px 0 rgba(31, 26, 20, 0.32), 0 18px 48px rgba(31, 26, 20, 0.24);
            display: grid;
            gap: 4px;
            grid-template-columns: repeat(5, minmax(0, 1fr));
            left: 50%;
            max-width: min(640px, calc(100vw - 32px));
            padding: 6px;
            position: fixed;
            transform: translateX(-50%);
            width: 100%;
            z-index: 20;
        }

        .bottom-nav-item {
            align-items: center;
            background: transparent;
            border: 0;
            border-radius: 6px;
            color: #fff6d9;
            cursor: pointer;
            display: inline-flex;
            font-size: 13px;
            font-weight: 800;
            gap: 7px;
            height: 42px;
            justify-content: center;
            min-width: 0;
            padding: 0 10px;
            white-space: nowrap;
        }

        .bottom-nav-item.active {
            background: #ffcf3f;
            color: #1f1a14;
            box-shadow: inset 0 -3px 0 rgba(31, 26, 20, 0.16);
        }

        .bottom-nav-icon {
            align-items: center;
            background: rgba(255, 255, 255, 0.12);
            border: 1px solid rgba(255, 255, 255, 0.18);
            border-radius: 999px;
            display: inline-flex;
            font-size: 11px;
            font-weight: 700;
            height: 22px;
            justify-content: center;
            line-height: 1;
            width: 22px;
        }

        .bottom-nav-icon svg {
            fill: none;
            height: 15px;
            stroke: currentColor;
            stroke-linecap: round;
            stroke-linejoin: round;
            stroke-width: 2;
            width: 15px;
        }

        .bottom-nav-item.active .bottom-nav-icon {
            background: rgba(255, 255, 255, 0.34);
            border-color: rgba(32, 32, 42, 0.16);
        }

        @keyframes view-in {
            from {
                opacity: 0;
                transform: translateY(4px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @media (max-width: 900px) {
            header {
                align-items: center;
                flex-direction: row;
            }

            .actions {
                justify-content: flex-end;
            }

            .log-toolbar,
            .pagination {
                align-items: flex-start;
                flex-direction: column;
            }

            .section-actions {
                justify-content: flex-start;
            }

            .status {
                text-align: left;
            }

            .summary,
            .grid {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 560px) {
            body {
                padding-bottom: 108px;
            }

            header {
                align-items: center;
                flex-direction: row;
                gap: 10px;
                padding: 14px 12px;
            }

            h1 {
                font-size: 20px;
                white-space: nowrap;
            }

            .muted {
                font-size: 11px;
                margin-top: 3px;
                white-space: nowrap;
            }

            .actions {
                justify-content: flex-end;
            }

            .button {
                font-size: 12px;
                padding: 7px 9px;
            }

            .bottom-nav {
                bottom: 12px;
                max-width: calc(100vw - 24px);
            }

            .bottom-nav-item {
                flex-direction: column;
                font-size: 10px;
                gap: 3px;
                height: 52px;
                padding: 0 3px;
            }

            .savings-total,
            .savings-row,
            .simulation-box {
                align-items: flex-start;
                flex-direction: column;
            }

            .simulation-box {
                display: flex;
                gap: 8px;
            }

            .savings-value {
                text-align: left;
                white-space: normal;
            }
        }
