* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ========================================
   LANDING PAGE
   ======================================== */
.landing-nav {
    background: #0a0a1a;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.landing-nav-inner {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.brand-logo {
    width: 32px;
    height: 32px;
    color: #f59e0b;
}

.brand-logo svg { width: 100%; height: 100%; }

.brand-name {
    font-size: 20px;
    font-weight: 500;
    color: #fff;
    letter-spacing: -0.3px;
}

.brand-name strong { font-weight: 800; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover { color: #fff; }

.nav-cta {
    background: #f59e0b !important;
    color: #000 !important;
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: 600 !important;
}

.nav-cta:hover { background: #d97706 !important; }

/* Hero */
.hero {
    background: linear-gradient(135deg, #0a0a1a 0%, #0f1b3d 50%, #0a0a1a 100%);
    padding: 100px 24px 80px;
    text-align: center;
    color: white;
}

.hero-inner {
    max-width: 720px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    background: rgba(245,158,11,0.15);
    color: #f59e0b;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 24px;
    border: 1px solid rgba(245,158,11,0.3);
}

.hero h1 {
    font-size: 52px;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -1.5px;
    margin-bottom: 20px;
}

.hero-sub {
    font-size: 18px;
    line-height: 1.6;
    color: rgba(255,255,255,0.7);
    margin-bottom: 36px;
}

.hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.btn-primary {
    background: #f59e0b;
    color: #000;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary:hover { background: #d97706; transform: translateY(-1px); }

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: white;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.2s;
}

.btn-secondary:hover { background: rgba(255,255,255,0.2); }

.btn-lg { padding: 18px 40px; font-size: 18px; }

.hero-note {
    font-size: 13px;
    color: rgba(255,255,255,0.45);
}

/* Problem/Solution */
.problem-section {
    padding: 80px 24px;
    background: #f8f9fa;
}

.problem-inner {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.problem-card, .solution-card {
    padding: 32px;
    border-radius: 16px;
}

.problem-card {
    background: #fff;
    border: 1px solid #e5e7eb;
}

.solution-card {
    background: linear-gradient(135deg, #0f1b3d, #1a2e5e);
    color: white;
}

.problem-card h3, .solution-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

.problem-card ul, .solution-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.problem-card li::before { content: "\2717 "; color: #ef4444; font-weight: 700; margin-right: 8px; }
.solution-card li::before { content: "\2713 "; color: #10b981; font-weight: 700; margin-right: 8px; }

.problem-card li, .solution-card li {
    font-size: 14px;
    line-height: 1.5;
}

/* Features */
.features-section {
    padding: 80px 24px;
    text-align: center;
    max-width: 1100px;
    margin: 0 auto;
}

.features-section h2, .compare-section h2, .pricing-section h2, .final-cta h2 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
    color: #111;
}

.section-sub {
    color: #6b7280;
    font-size: 16px;
    margin-bottom: 48px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    text-align: left;
}

.feature-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
}

.feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    margin-bottom: 14px;
}

.feature-icon svg { width: 100%; height: 100%; }

.feature-card h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.feature-card p {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
}

/* Compare Table */
.compare-section {
    padding: 80px 24px;
    background: #f8f9fa;
    text-align: center;
}

.compare-table-wrap {
    max-width: 900px;
    margin: 40px auto 0;
    overflow-x: auto;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.compare-table th, .compare-table td {
    padding: 14px 18px;
    border-bottom: 1px solid #f0f0f0;
}

.compare-table thead th {
    background: #0f1b3d;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.highlight-col {
    background: rgba(245,158,11,0.08) !important;
    color: #0f1b3d !important;
    font-weight: 600;
}

.compare-table thead .highlight-col {
    background: #f59e0b !important;
    color: #000 !important;
}

.compare-table tr:last-child td { border-bottom: none; }

/* Pricing */
.pricing-section {
    padding: 80px 24px;
    text-align: center;
}

.pricing-grid {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 700px;
    margin: 40px auto 0;
}

.pricing-card {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 36px 32px;
    flex: 1;
    min-width: 280px;
    max-width: 320px;
    text-align: left;
}

.pricing-featured {
    border-color: #f59e0b;
    box-shadow: 0 8px 30px rgba(245,158,11,0.15);
    position: relative;
}

.pricing-badge {
    display: inline-block;
    background: #f59e0b;
    color: #000;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 4px;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.pricing-card h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.pricing-amount {
    margin-bottom: 24px;
}

.pricing-amount .currency {
    font-size: 24px;
    font-weight: 700;
    vertical-align: top;
}

.pricing-amount .price {
    font-size: 48px;
    font-weight: 900;
    letter-spacing: -2px;
    line-height: 1;
}

.pricing-amount .period {
    font-size: 16px;
    color: #6b7280;
    font-weight: 500;
}

.pricing-card ul {
    list-style: none;
    margin-bottom: 24px;
}

.pricing-card li {
    font-size: 14px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    color: #374151;
}

.pricing-card li::before {
    content: "\2713";
    color: #10b981;
    font-weight: 700;
    margin-right: 10px;
}

.pricing-save {
    text-align: center;
    font-size: 13px;
    color: #059669;
    font-weight: 600;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
    line-height: 1.4;
}

/* Final CTA */
.final-cta {
    padding: 80px 24px;
    text-align: center;
    background: linear-gradient(135deg, #0a0a1a 0%, #0f1b3d 100%);
    color: white;
}

.final-cta p {
    color: rgba(255,255,255,0.7);
    font-size: 16px;
    margin-bottom: 32px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.final-cta h2 { color: #fff; margin-bottom: 16px; }

/* Landing Footer */
.landing-footer {
    background: #0a0a1a;
    color: rgba(255,255,255,0.6);
    padding: 48px 24px 24px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
}

.footer-tagline {
    font-size: 13px;
    margin-top: 8px;
    color: rgba(255,255,255,0.4);
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-links a:hover { color: #fff; }

.footer-bottom {
    max-width: 1100px;
    margin: 0 auto;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.06);
    text-align: center;
}

.footer-bottom p { font-size: 13px; color: rgba(255,255,255,0.4); }
.footer-bottom .disclaimer { font-size: 11px; margin-top: 8px; color: rgba(255,255,255,0.25); }

/* Landing responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 34px; }
    .hero-sub { font-size: 15px; }
    .problem-inner { grid-template-columns: 1fr; }
    .nav-links a:not(.nav-cta) { display: none; }
    .features-section h2, .compare-section h2, .pricing-section h2, .final-cta h2 { font-size: 26px; }
    .pricing-grid { flex-direction: column; align-items: center; }
    .footer-inner { flex-direction: column; gap: 20px; }
}

/* ========================================
   AUTH STYLES
   ======================================== */
.nav-login {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 600 !important;
}

.auth-field {
    margin-bottom: 14px;
}

.auth-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #374151;
}

.auth-field input,
.auth-field select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #111;
}

.auth-field input:focus,
.auth-field select:focus {
    outline: none;
    border-color: #1a56db;
    box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}

.auth-error {
    font-size: 13px;
    color: #dc2626;
    min-height: 20px;
    margin: 8px 0;
}

.auth-switch {
    text-align: center;
    font-size: 13px;
    color: #6b7280;
    margin-top: 16px;
}

.auth-switch a {
    color: #1a56db;
    font-weight: 600;
    text-decoration: none;
}

.auth-switch a:hover { text-decoration: underline; }

/* Header auth elements */
.trial-badge {
    background: rgba(245,158,11,0.15);
    color: #f59e0b;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(245,158,11,0.3);
}

.header-settings-btn,
.logout-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.header-settings-btn:hover,
.logout-btn:hover {
    background: rgba(255,255,255,0.2);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Team settings */
.team-members-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.team-member {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
}

.team-role {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.team-role.admin { background: #fef3c7; color: #92400e; }
.team-role.technician { background: #dbeafe; color: #1e40af; }

.team-you {
    font-size: 12px;
    color: #94a3b8;
}

.team-remove-btn {
    background: none;
    border: 1px solid #fca5a5;
    color: #dc2626;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
}

.team-remove-btn:hover { background: #fef2f2; }

/* Header icon buttons */
.header-icon-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.header-icon-btn:hover { background: rgba(255,255,255,0.2); }

/* History modal */
.history-list {
    max-height: 60vh;
    overflow-y: auto;
    padding: 0 24px 24px;
}

.history-item {
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.history-item:hover {
    border-color: #1a56db;
    background: #f0f4ff;
}

.history-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.history-mode {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #1a56db;
    background: #e8effd;
    padding: 2px 8px;
    border-radius: 4px;
}

.history-time {
    font-size: 12px;
    color: #94a3b8;
}

.history-query {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    line-height: 1.4;
}

.history-vehicle {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

.clear-history-btn {
    background: none;
    border: 1px solid #fca5a5;
    color: #dc2626;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.clear-history-btn:hover { background: #fef2f2; }

.logo-link {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
}

/* ========================================
   APP STYLES
   ======================================== */
:root {
    --primary: #1a56db;
    --primary-dark: #1240a8;
    --primary-light: #e8effd;
    --accent: #f59e0b;
    --accent-dark: #d97706;
    --bg: #f0f2f5;
    --surface: #ffffff;
    --surface-hover: #f8f9fa;
    --text: #111827;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --border: #e5e7eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.06);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: white;
    padding: 0 24px;
    height: 72px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    color: var(--accent);
    flex-shrink: 0;
}

.logo-icon svg {
    width: 100%;
    height: 100%;
}

.logo-text h1 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.tagline {
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.manufacturers-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.manufacturers-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* Main */
main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 24px;
}

/* ========================================
   REG PLATE LOOKUP
   ======================================== */
.reg-lookup {
    margin-bottom: 32px;
}

.reg-plate-container {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.reg-plate {
    display: flex;
    align-items: stretch;
    background: #fdd835;
    border: 3px solid #222;
    border-radius: 8px;
    overflow: hidden;
    height: 56px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.reg-plate-blue {
    background: #003399;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    min-width: 36px;
}

.reg-plate-flag {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

#regInput {
    border: none;
    background: transparent;
    font-size: 28px;
    font-weight: 800;
    font-family: 'Inter', monospace;
    letter-spacing: 3px;
    text-transform: uppercase;
    padding: 0 16px;
    width: 240px;
    outline: none;
    color: #222;
    text-align: center;
}

#regInput::placeholder {
    color: #999;
    font-size: 18px;
    letter-spacing: 2px;
    font-weight: 600;
}

.lookup-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    height: 56px;
}

.lookup-btn:hover {
    background: var(--primary-dark);
}

.lookup-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
}

.lookup-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* Vehicle Info Card */
.vehicle-info {
    margin-top: 16px;
    background: var(--surface);
    border: 2px solid var(--success);
    border-radius: var(--radius);
    padding: 16px 20px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeIn 0.3s ease;
}

.vehicle-confirmed {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--success);
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 12px;
}

.vehicle-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px 16px;
}

.vehicle-detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.vehicle-detail-item .label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    font-weight: 600;
}

.vehicle-detail-item .value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.mot-status-valid { color: var(--success); }
.mot-status-expired { color: var(--danger); }
.mot-status-unknown { color: var(--warning); }

.clear-vehicle-btn {
    margin-top: 12px;
    background: none;
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.clear-vehicle-btn:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.lookup-error {
    margin-top: 12px;
    text-align: center;
    color: var(--danger);
    font-size: 14px;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
}

/* Demo badge */
.demo-badge {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
}

/* ========================================
   OBD-II PANEL
   ======================================== */
.obd-panel {
    background: var(--surface);
    border: 2px solid #1e293b;
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
}

.obd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
}

.obd-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.obd-title svg { color: #f59e0b; }

.obd-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
}

.obd-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.obd-status.disconnected .obd-dot { background: #94a3b8; }
.obd-status.disconnected { color: #94a3b8; }
.obd-status.connected .obd-dot { background: #10b981; animation: pulse 2s infinite; }
.obd-status.connected { color: #10b981; }
.obd-status.error .obd-dot { background: #ef4444; }
.obd-status.error { color: #ef4444; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.obd-connect-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.obd-connect-btn {
    background: #1e293b;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.obd-connect-btn:hover { background: #334155; }

.obd-hint {
    font-size: 12px;
    color: var(--text-light);
}

.obd-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.obd-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.obd-action-btn:hover { border-color: var(--primary); background: var(--primary-light); }

.obd-ai-btn {
    background: #1e293b;
    color: white;
    border-color: #1e293b;
}

.obd-ai-btn:hover { background: #334155; border-color: #334155; }

/* OBD Results */
.obd-results-inner {
    margin-top: 16px;
    padding: 16px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.obd-results-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 12px;
}

.obd-no-codes {
    color: #10b981;
    font-weight: 600;
    font-size: 15px;
    padding: 12px 0;
}

.obd-code-section {
    margin: 8px 0;
    font-size: 13px;
}

.obd-code-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin: 6px 0;
}

.obd-code {
    font-family: monospace;
    font-size: 18px;
    font-weight: 800;
    color: #dc2626;
    letter-spacing: 1px;
}

.obd-diagnose-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.obd-diagnose-btn:hover { background: var(--primary-dark); }

.obd-diagnose-all-btn {
    width: 100%;
    margin-top: 12px;
    background: #1e293b;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

.obd-diagnose-all-btn:hover { background: #334155; }

.obd-scanning {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Live Data Gauges */
.obd-live-data {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.gauge {
    background: #1e293b;
    border-radius: 10px;
    padding: 14px 10px;
    text-align: center;
    color: white;
}

.gauge-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    margin-bottom: 4px;
}

.gauge-value {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.2;
}

.gauge-unit {
    font-size: 11px;
    color: #64748b;
}

.gauge-warning {
    background: #7f1d1d;
}

.gauge-warning .gauge-value {
    color: #fca5a5;
}

/* ========================================
   PHOTO DIAGNOSIS
   ======================================== */
.photo-diagnose-bar {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
    color: white;
}

.photo-diagnose-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.photo-diagnose-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.photo-diagnose-left svg { color: #f59e0b; flex-shrink: 0; }

.photo-diagnose-left h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 2px;
}

.photo-diagnose-left p {
    font-size: 13px;
    color: #94a3b8;
}

.photo-diagnose-actions {
    display: flex;
    gap: 10px;
}

.photo-upload-btn, .photo-camera-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    border: none;
}

.photo-upload-btn {
    background: #f59e0b;
    color: #000;
}

.photo-upload-btn:hover { background: #d97706; }

.photo-camera-btn {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
}

.photo-camera-btn:hover { background: rgba(255,255,255,0.2); }

.photo-preview {
    margin-top: 16px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.photo-preview img {
    max-width: 300px;
    max-height: 200px;
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.2);
    object-fit: contain;
}

.photo-preview-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.photo-analyse-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #10b981;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.photo-analyse-btn:hover { background: #059669; }

.photo-retake-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.3);
    color: #94a3b8;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}

.photo-retake-btn:hover { color: white; border-color: white; }

.photo-results-card {
    margin-top: 16px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

.photo-results-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: #f0fdf4;
    color: #166534;
    font-weight: 700;
    font-size: 14px;
    border-bottom: 1px solid #bbf7d0;
}

.photo-results-body {
    padding: 18px;
    color: #1e293b;
    font-size: 14px;
    line-height: 1.6;
    max-height: 500px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .photo-diagnose-inner { flex-direction: column; align-items: flex-start; }
    .photo-preview { flex-direction: column; }
    .photo-preview img { max-width: 100%; }
}

/* ========================================
   MODE SELECTOR — CATEGORISED
   ======================================== */
.mode-selector {
    padding: 8px 0;
}

.category {
    margin-bottom: 28px;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.category-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.2px;
}

.category-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
}

.category-icon svg { width: 100%; height: 100%; }
.cat-diag { background: #fee2e2; color: #dc2626; }
.cat-repair { background: #d1fae5; color: #059669; }
.cat-data { background: #e0e7ff; color: #4f46e5; }
.cat-diagrams { background: #fce7f3; color: #be185d; }

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.mode-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}

.mode-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.mode-card:active {
    transform: translateY(-1px);
}

.mode-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.mode-icon svg { width: 100%; height: 100%; }

.mode-text h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.mode-text p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Mode icon colours */
.fault-code-icon { background: #fee2e2; color: #dc2626; }
.symptom-icon { background: #e0e7ff; color: #4f46e5; }
.wiring-icon { background: #fce7f3; color: #db2777; }
.fuse-icon { background: #fef3c7; color: #d97706; }
.mot-icon { background: #d1fae5; color: #059669; }
.service-icon { background: #dbeafe; color: #2563eb; }
.procedures-icon { background: #f3e8ff; color: #7c3aed; }
.ac-icon { background: #cffafe; color: #0891b2; }
.torque-icon { background: #fce7f3; color: #be185d; }
.fluids-icon { background: #dbeafe; color: #1d4ed8; }
.alignment-icon { background: #d1fae5; color: #047857; }
.tyre-icon { background: #fef3c7; color: #d97706; }
.guide-icon { background: #e0f2fe; color: #0284c7; }
.belts-icon { background: #fce7f3; color: #be185d; }
.locator-icon { background: #dcfce7; color: #16a34a; }

/* Diagram rendering in chat */
.diagram-container {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    margin: 12px 0;
    overflow: hidden;
}

.diagram-label {
    background: #f8f9fa;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e5e7eb;
}

.diagram-svg {
    padding: 16px;
    text-align: center;
    overflow-x: auto;
}

.diagram-svg svg {
    max-width: 100%;
    height: auto;
}

/* Bottom action bars */
.bottom-bars {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.general-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
}

.general-btn svg:first-child {
    width: 24px;
    height: 24px;
    color: var(--primary);
    flex-shrink: 0;
}

.general-btn span { flex: 1; text-align: left; }

.general-btn:hover {
    border-color: var(--primary);
    color: var(--text);
    background: var(--primary-light);
}

/* ========================================
   CHAT
   ======================================== */
.chat-container {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 340px);
    min-height: 400px;
    overflow: hidden;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.back-btn, .clear-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.back-btn:hover, .clear-btn:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.chat-mode-label {
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

.message {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: var(--radius);
    line-height: 1.6;
    font-size: 14px;
    animation: fadeIn 0.3s ease;
}

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

.message.assistant {
    background: var(--primary-light);
    color: var(--text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message.user {
    background: var(--primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message.system {
    background: #fefce8;
    border: 1px solid #fde68a;
    color: #92400e;
    align-self: center;
    text-align: center;
    font-size: 13px;
    max-width: 90%;
}

.message h4 {
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 15px;
}

.message ul, .message ol {
    padding-left: 20px;
    margin: 8px 0;
}

.message li {
    margin-bottom: 4px;
}

.message strong {
    font-weight: 600;
}

/* Message formatting */
.msg-heading-1 {
    font-size: 16px;
    font-weight: 700;
    margin: 12px 0 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.msg-heading-2 {
    font-size: 15px;
    font-weight: 700;
    margin: 10px 0 4px;
    color: var(--primary-dark);
}

.msg-heading-3 {
    font-size: 14px;
    font-weight: 600;
    margin: 8px 0 4px;
}

.labour-time-box {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 10px 14px;
    margin: 8px 0;
    border-radius: 0 6px 6px 0;
    font-weight: 600;
    color: #92400e;
    font-size: 14px;
}

.message li {
    margin-bottom: 4px;
    padding-left: 4px;
    list-style: none;
}

.message li::before {
    content: "\2022";
    color: var(--primary);
    font-weight: 700;
    margin-right: 8px;
}

/* Message action bar */
.msg-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.06);
}

.msg-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: white;
    border: 1px solid #d1d5db;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: #374151;
    transition: all 0.2s;
    font-family: inherit;
}

.msg-action-btn:hover { background: #f3f4f6; border-color: #9ca3af; }
.msg-action-btn.copied { background: #d1fae5; border-color: #10b981; color: #065f46; }

.msg-rating {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.msg-rate-btn {
    background: none;
    border: 1px solid transparent;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    color: #9ca3af;
    transition: all 0.2s;
}

.msg-rate-btn:hover { color: #374151; background: #f3f4f6; }
.msg-rate-btn.rated { color: #1a56db; background: #e8effd; border-color: #bfdbfe; }

.confirm-fix-bar {
    margin-top: 10px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.confirm-fix-label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    display: block;
    margin-bottom: 8px;
}

.confirm-fix-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.fix-btn {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid;
    font-family: inherit;
    transition: all 0.2s;
}

.fix-yes { background: #d1fae5; border-color: #6ee7b7; color: #065f46; }
.fix-yes:hover { background: #a7f3d0; }
.fix-no { background: #fef3c7; border-color: #fcd34d; color: #92400e; }
.fix-no:hover { background: #fde68a; }
.fix-other { background: #e0e7ff; border-color: #a5b4fc; color: #3730a3; }
.fix-other:hover { background: #c7d2fe; }

.confirm-fix-done {
    font-size: 12px;
    color: #64748b;
    font-style: italic;
}

.confirm-fix-success { color: #059669; font-style: normal; font-weight: 600; }

.suggested-followups {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.followup-btn {
    background: white;
    border: 1px solid #d1d5db;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    color: #374151;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.followup-btn:hover {
    background: #1a56db;
    color: white;
    border-color: #1a56db;
}

.chat-link {
    color: #1a56db;
    text-decoration: underline;
    word-break: break-all;
    font-weight: 500;
}

.chat-link:hover {
    color: #1240a8;
}

.message.assistant .chat-link { color: #1a56db; }
.message.user .chat-link { color: #bfdbfe; }

.typing-indicator {
    display: flex;
    gap: 6px;
    padding: 16px 20px;
    align-self: flex-start;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--text-light);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

/* Chat Input */
.chat-input-area {
    border-top: 1px solid var(--border);
    padding: 16px 20px;
    background: var(--surface);
}

.input-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

#userInput {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    resize: none;
    line-height: 1.5;
    max-height: 120px;
    transition: border-color 0.2s;
}

#userInput:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}

.send-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.send-btn:hover {
    background: var(--primary-dark);
}

.send-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
}

/* ========================================
   MANUFACTURERS MODAL
   ======================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius);
    width: 100%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--surface-hover);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--border);
    color: var(--text);
}

.modal-search {
    padding: 16px 24px;
}

.modal-search input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
}

.modal-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}

.manufacturers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    padding: 0 24px 24px;
    overflow-y: auto;
}

.mfg-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.mfg-card:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.mfg-card .mfg-flag {
    font-size: 20px;
    flex-shrink: 0;
}

/* ========================================
   FOOTER
   ======================================== */
footer {
    text-align: center;
    padding: 24px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

footer p {
    font-size: 13px;
    color: var(--text-secondary);
}

.disclaimer {
    font-size: 11px !important;
    color: var(--text-light) !important;
    margin-top: 6px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    header { padding: 0 16px; }
    .logo-text h1 { font-size: 15px; }
    .tagline { font-size: 10px; }
    .manufacturers-btn .btn-text { display: none; }
    main { padding: 20px 16px; }
    .mode-selector h2 { font-size: 24px; }
    .mode-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .mode-card { padding: 20px 16px; }
    .chat-container { height: calc(100vh - 300px); }
    .manufacturers-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    #regInput { width: 180px; font-size: 22px; }
    .reg-plate { height: 48px; }
    .lookup-btn { height: 48px; padding: 12px 18px; font-size: 14px; }
    .vehicle-details { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .mode-grid { grid-template-columns: 1fr; }
    .message { max-width: 92%; }
    .reg-plate-container { flex-direction: column; }
    .lookup-btn { width: 100%; justify-content: center; }
    #regInput { width: 200px; }
}
