:root {
    color-scheme: dark;
    --xp-green: #00ff00;
    --xp-green-dark: #00cc00;
    --xp-bg: #020607;
    --xp-surface: #07100c;
    --xp-surface-2: #0b1510;
    --xp-border: rgba(255, 255, 255, 0.12);
    --xp-text: #f5f8f5;
    --xp-muted: #98a39c;
    --xp-warning: #f5b942;
    --xp-danger: #ff6b6b;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
    margin: 0;
    background: var(--xp-bg);
    color: var(--xp-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, textarea { font: inherit; }

.app-shell {
    width: min(100%, 430px);
    min-height: 100vh;
    margin: 0 auto;
    padding:
        calc(14px + env(safe-area-inset-top, 0px))
        calc(10px + env(safe-area-inset-right, 0px))
        calc(28px + env(safe-area-inset-bottom, 0px))
        calc(10px + env(safe-area-inset-left, 0px));
}

button, a, [role="button"] { touch-action: manipulation; }

.app-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto;
    column-gap: 12px;
    row-gap: 0;
    align-items: start;
    margin-bottom: 12px;
    padding: 0 2px 10px;
    border-bottom: 1px solid var(--xp-border);
}

.app-header > div { display: contents; }

.app-kicker {
    grid-column: 1;
    grid-row: 1;
    display: block;
    margin-bottom: 3px;
    color: var(--xp-green);
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.16em;
}

h1, h2, p { margin-top: 0; }

h1 {
    grid-column: 1;
    grid-row: 2;
    margin-bottom: 2px;
    font-size: clamp(1.85rem, 8vw, 2.2rem);
    line-height: 1;
    letter-spacing: -0.035em;
}

.app-header p {
    grid-column: 1 / -1;
    grid-row: 3;
    width: 100%;
    margin: 7px 0 0;
    color: var(--xp-muted);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.25;
}

.version-badge {
    grid-column: 2;
    grid-row: 1 / 3;
    display: grid;
    flex: 0 0 auto;
    min-width: 78px;
    padding: 7px 9px;
    place-items: center;
    border: 1px solid rgba(0, 255, 0, 0.35);
    border-radius: 8px;
    background: rgba(0, 255, 0, 0.08);
    color: var(--xp-green);
    line-height: 1.05;
    text-align: center;
}

.version-badge strong {
    font-size: 0.8rem;
    font-weight: 900;
}

.version-badge small {
    margin-top: 2px;
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.07em;
}

.driver-card {
    padding: 13px;
    border: 1px solid var(--xp-border);
    border-radius: 8px;
    background: var(--xp-surface);
    box-shadow: none;
}

.card-heading {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.step-number {
    display: grid;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 6px;
    background: var(--xp-green);
    color: #001804;
}

.step-number svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

h2 {
    margin-bottom: 3px;
    font-size: 1rem;
}

.card-heading p {
    margin-bottom: 0;
    color: var(--xp-muted);
    font-size: 0.8rem;
    line-height: 1.35;
}

label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.8rem;
    font-weight: 800;
}

textarea {
    width: 100%;
    min-height: 145px;
    resize: vertical;
    padding: 11px 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 7px;
    outline: none;
    background: #030a06;
    color: var(--xp-text);
    line-height: 1.45;
}

textarea:focus {
    border-color: rgba(0, 255, 0, 0.7);
    box-shadow: 0 0 0 2px rgba(0, 255, 0, 0.12);
}

textarea::placeholder {
    color: #68736c;
    opacity: 1;
}

.primary-action {
    width: 100%;
    min-height: 49px;
    margin-top: 11px;
    border: 0;
    border-radius: 6px;
    background: var(--xp-green);
    color: #001804;
    font-weight: 900;
    font-size: 0.98rem;
    cursor: pointer;
    box-shadow: none;
}

.primary-action:hover { background: #1aff1a; }
.primary-action:active { transform: translateY(1px); }

.feedback {
    margin-top: 10px;
    padding: 10px 11px;
    border-radius: 7px;
    font-size: 0.82rem;
    line-height: 1.35;
}

.feedback-error {
    border: 1px solid rgba(255, 107, 107, 0.4);
    background: rgba(255, 107, 107, 0.08);
    color: #ffc1c1;
}

.results-section { margin-top: 13px; }

.results-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin: 0 2px 7px;
}

.results-heading h2 { margin-bottom: 0; }

.results-heading span {
    color: var(--xp-muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-align: right;
}

.customer-result {
    display: flex;
    gap: 8px;
    padding: 9px 10px;
    border: 1px solid var(--xp-border);
    border-radius: 7px;
    background: var(--xp-surface);
    box-shadow: none;
}

.customer-result + .customer-result { margin-top: 5px; }

.result-status {
    display: grid;
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 5px;
    font-size: 0.78rem;
    font-weight: 900;
}

.customer-ok .result-status {
    background: rgba(0, 255, 0, 0.13);
    color: var(--xp-green);
}

.customer-warning .result-status {
    background: rgba(245, 185, 66, 0.14);
    color: var(--xp-warning);
}

.customer-error .result-status {
    background: rgba(255, 107, 107, 0.12);
    color: var(--xp-danger);
}

.result-content {
    min-width: 0;
    flex: 1;
}

.result-topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.result-title {
    display: grid;
    min-width: 0;
    gap: 1px;
    margin-bottom: 2px;
}

.result-title strong {
    color: var(--xp-green);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.025em;
}

.result-title span {
    font-size: 0.86rem;
    font-weight: 650;
    line-height: 1.18;
}

.route-badge {
    flex: 0 0 auto;
    padding: 3px 6px;
    border-radius: 5px;
    background: rgba(0, 255, 0, 0.09);
    color: var(--xp-green);
    font-size: 0.65rem;
    font-weight: 900;
    white-space: nowrap;
}

.result-content p {
    margin-bottom: 0;
    color: #8f9a93;
    font-size: 0.7rem;
    line-height: 1.2;
}

.address-line { white-space: normal; }

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
}

.result-meta span {
    padding: 3px 6px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.06);
    color: #cbd3cd;
    font-size: 0.65rem;
    font-weight: 750;
}

.route-summary { margin: 0 2px 7px; }

.route-summary span:first-child {
    padding-left: 0;
    background: transparent;
    color: var(--xp-muted);
}

.route-summary span:last-child {
    background: rgba(0, 255, 0, 0.1);
    color: var(--xp-green);
}

.stop-meta { margin-top: 3px; }

.stop-meta span {
    padding: 0;
    background: transparent;
    color: #98a39c;
    font-weight: 650;
}

.address-control {
    padding-top: 2px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

@media (min-width: 700px) {
    .app-shell { padding-top: 24px; }
}
