/* Customer portal only. Shared tokens keep modules, tenant accents and states intact. */
html.user-portal {
 --up-bg: #101114; --up-surface: #191b20; --up-inset: #131519;
 --up-line: rgba(255,255,255,.075); --up-muted: #a2a7b2;
 --up-shadow: 0 8px 28px rgba(0,0,0,.12); --up-radius: 20px;
 --up-gap: 24px; --up-header: 80px;
 --up-accent-soft: color-mix(in srgb, var(--accent-primary) 12%, transparent);
 color-scheme: dark;
}
html.user-portal[data-theme="light"] {
 --up-bg: #f5f6f8; --up-surface: #fff; --up-inset: #f0f2f5;
 --up-line: rgba(24,32,48,.09); --up-muted: #5d6675;
 --up-shadow: 0 8px 28px rgba(24,32,48,.045); color-scheme: light;
}
html.user-portal body { background: var(--up-bg); font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; -webkit-font-smoothing: antialiased; }
html.user-portal .main-content { padding: 28px clamp(16px,2.5vw,40px) 40px !important; min-width: 0; }
html.user-portal .main-content > :is(.page-container,.autofiles-shell,.price-finder,.tfc-shell,.aff-wrap,.sol-wrap,.bosch-page,.pcode-page) {
 width: 100%; max-width: 1560px !important; margin-inline: auto !important; padding: 0 !important; box-sizing: border-box;
}
html.user-portal :is(.page-header,.autofiles-hero,.dash-hero,.wizard-page-head,.upload-page-header) { margin-bottom: var(--up-gap); padding-block: 4px 12px; }
html.user-portal :is(.page-header,.autofiles-hero,.dash-hero,.wizard-page-head) h1,
html.user-portal :is(.price-title,.tfc-step-title) { font-size: clamp(25px,2.5vw,36px); font-weight: 650; letter-spacing: -.035em; line-height: 1.18; }
html.user-portal :is(.hero-sub,.price-sub,.page-header p,.autofiles-hero p) { color: var(--up-muted); line-height: 1.65; max-width: 72ch; }
html.user-portal :is(.glass-panel,.glass-card,.panel-card,.sidebar-card,.credit-card,.stat-card,.ticket-card,.create-ticket-section,.price-panel,.step-container,.available-panel,.selected-panel,.device-card,.sub-card,.order-card,.message-card,.pf-panel,.ecu-card,.tool-card,.winols-panel,.tfc-panel2,.tfc-stage,.aff-stat,.aff-prod,.bosch-card,.pcode-card) {
 background: var(--up-surface) !important; border: 1px solid var(--up-line) !important; border-radius: var(--up-radius) !important; box-shadow: var(--up-shadow) !important;
}
html.user-portal :is(.panel-card,.sidebar-card,.ticket-card,.order-card,.device-card,.sub-card,.message-card,.tool-card) { overflow-wrap: anywhere; }
html.user-portal :is(.glass-panel,.price-panel,.step-container,.pf-panel,.create-ticket-body) { padding: clamp(18px,2vw,28px); }
html.user-portal :is(.credit-grid,.stats-grid,.quick-actions,.dash-main,.device-grid,.tool-grid,.invoices-grid,.flash-tools-layout,.winols-layout,.pf-grid,.create-ticket-grid,.selector-grid,.vehicle-grid,.main-input-grid) { gap: 20px; }
html.user-portal :is(.panel-head,.glass-head,.section-title,.utc-section-head) { border-color: var(--up-line); }
/* Uniform controls; destructive and status colors retain their meanings. */
html.user-portal :is(button,.btn,.glass-btn,.wizard-btn,.cc-btn,.auto-btn,.winols-btn,.order-btn) { font-family: inherit; }
html.user-portal :is(.btn,.glass-btn,.wizard-btn,.cc-btn,.auto-btn,.winols-btn,.order-btn,.btn-submit,.btn-new-ticket,.ecu-btn,.search-btn,.copy-btn,.tfc-back,.tfc-newveh,.utc-action,.utc-tool) {
 min-height: 42px; border-radius: 12px !important; font-weight: 600; line-height: 1.35; text-decoration: none; transition: background-color .16s,border-color .16s,box-shadow .16s;
}
html.user-portal :is(.btn-primary,.glass-btn.primary,.wizard-btn-primary,.cc-btn,.auto-btn:not(#pdfBtn),.winols-btn.primary,.order-btn-primary,.btn-submit,.btn-new-ticket,.ecu-btn-primary,.search-btn,.utc-send,.btn-send,.auth-submit) {
 background: var(--accent-primary) !important; background-image: none !important; color: var(--accent-primary-text,#fff) !important; border-color: transparent !important; box-shadow: none;
}
html.user-portal :is(.btn-secondary,.glass-btn.secondary,.wizard-btn-secondary,.winols-btn.outline,.order-btn-secondary,.copy-btn,.utc-action,.tfc-back,.tfc-newveh) {
 background: var(--up-inset) !important; color: var(--text-primary) !important; border: 1px solid var(--up-line) !important;
}
html.user-portal :is(button,a,input,select,textarea,[tabindex]):focus-visible { outline: 2px solid var(--accent-primary) !important; outline-offset: 3px; }
html.user-portal :is(button,input,select,textarea):disabled { opacity: .48; cursor: not-allowed; }
html.user-portal :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]):not([type="color"]),select,textarea,.custom-dropdown-trigger) {
 background: var(--up-inset); color: var(--text-primary); border: 1px solid var(--up-line); border-radius: 12px; font: inherit; font-size: 14px; min-height: 44px; box-sizing: border-box; max-width: 100%;
}
html.user-portal :is(input,textarea)::placeholder { color: var(--up-muted); opacity: .85; }
html.user-portal :is(input[type="checkbox"],input[type="radio"],progress) { accent-color: var(--accent-primary); }
html.user-portal :is(.custom-options,.dtc-dropdown-list,.searchable-select-dropdown) { background: var(--up-surface); border: 1px solid var(--up-line); border-radius: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.18); }
html.user-portal :is(.filter-tabs,.tfc-dyno-tabs) { gap: 4px; padding: 5px; background: var(--up-inset); border-radius: 14px; flex-wrap: wrap; }
html.user-portal :is(.filter-tab.active,.tfc-dtab.active) { background: var(--up-surface); color: var(--accent-primary); border-color: transparent; border-radius: 10px; }
html.user-portal :is(.empty-state,.glass-empty,.ecu-empty) { background: var(--up-inset); color: var(--up-muted); border: 0; border-radius: 16px; padding: 32px 20px; }
/* A quiet header and navigation, with consistent tap targets. */
html.user-portal .app-header { background: var(--up-surface) !important; border-bottom: 1px solid var(--up-line); box-shadow: none !important; gap: 12px; }
html.user-portal .sidebar-container { background: var(--up-surface) !important; border-right-color: var(--up-line); }
html.user-portal .sidebar-link { box-sizing: border-box; min-height: 44px; border-radius: 10px; margin-block: 2px; padding-block: 8px; line-height: 20px; }
html.user-portal .sidebar-link.active { background: var(--up-accent-soft) !important; color: var(--accent-primary) !important; box-shadow: none !important; border-color: transparent !important; }
html.user-portal .sidebar-link.active::before { display: none; }
html.user-portal :is(.app-header-theme-toggle,.app-header-lang-toggle,.app-header-user-info,.hamburger-menu,#sidebarCollapseBtn,.up-notification-toggle) {
 min-height: 40px; min-width: 40px; border-radius: 12px !important; background: var(--up-inset) !important; border: 1px solid var(--up-line) !important; color: var(--text-primary); box-shadow: none !important;
}
html.user-portal .header-glow::before,html.user-portal .header-glow::after { display: none !important; }
html.user-portal .app-header-user { gap: 8px; }
html.user-portal .up-notification-toggle { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
html.user-portal .up-notification-toggle[aria-pressed="true"] { color: var(--accent-primary); background: var(--up-accent-soft) !important; }
html.user-portal .up-skip { position: fixed; top: -100px; left: 20px; z-index: 100001; padding: 12px 18px; border-radius: 12px; background: var(--up-surface); color: var(--text-primary); }
html.user-portal .up-skip:focus { top: 12px; }
/* Dashboard: meaningful data has priority over decorative colors. */
html.user-portal .credit-card { padding: 24px; }
html.user-portal .cc-value { font-size: clamp(28px,3vw,42px); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
html.user-portal :is(.cc-icon,.qa-icon,.stat-icon,.panel-head-icon,.sidebar-card-icon) { background: var(--up-accent-soft) !important; color: var(--accent-primary) !important; border-radius: 12px; }
html.user-portal .qa-card { background: var(--up-surface); border: 1px solid var(--up-line); border-radius: 16px; padding: 18px; box-shadow: none; }
html.user-portal .up-workbench { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin-bottom: 24px; }
html.user-portal .up-task { display: flex; flex-direction: column; gap: 8px; padding: 20px; border-radius: 18px; background: var(--up-surface); border: 1px solid var(--up-line); text-decoration: none; color: var(--text-primary); }
html.user-portal .up-task strong { font-size: 26px; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
html.user-portal .up-task span { color: var(--up-muted); font-size: 13px; line-height: 1.5; }
/* Prices: readable choices, lightweight steps, visible selected services. */
html.user-portal .price-hero { grid-template-columns: minmax(0,1fr) minmax(280px,360px); gap: 24px; }
html.user-portal .price-flow { gap: 16px; }
html.user-portal .flow-step { background: transparent; border: 0; border-radius: 0; padding: 12px 0; border-top: 1px solid var(--up-line); }
html.user-portal .select-box { background: var(--up-surface); border: 1px solid var(--up-line); border-radius: 16px; padding: 18px; }
html.user-portal .sol-group-grid { grid-template-columns: repeat(auto-fit,minmax(min(230px,100%),1fr)); gap: 12px; }
html.user-portal .solution-card { background: var(--up-surface); border: 1px solid var(--up-line); border-radius: 14px; padding: 18px; box-shadow: none; }
html.user-portal .solution-card.selected { background: var(--up-accent-soft); border-color: var(--accent-primary); }
html.user-portal .price-badge { border-radius: 8px; font-variant-numeric: tabular-nums; background: var(--up-accent-soft); color: var(--text-primary); }
html.user-portal .summary-list { display: flex; flex-wrap: wrap; gap: 6px; }
html.user-portal .summary-chip { color: var(--text-primary); background: var(--up-inset); border: 0; font-weight: 500; }
html.user-portal .summary-card { align-self: start; top: 96px; }
/* File services and configurator keep their existing processing behavior. */
html.user-portal :is(.upload-zone,.file-drop-zone) { border-radius: 20px; background: var(--up-inset); border: 1px dashed var(--up-muted); }
html.user-portal :is(.upload-zone,.file-drop-zone):hover { border-color: var(--accent-primary); background: var(--up-accent-soft); }
html.user-portal :is(.wizard-type-card,.tfc-mk,.tfc-solcard) { border-radius: 16px; background: var(--up-surface); border-color: var(--up-line); }
html.user-portal :is(.wizard-type-card.selected,.tfc-mk.selected,.tfc-solcard.selected) { border-color: var(--accent-primary); background: var(--up-accent-soft); }
html.user-portal .wizard-step-dot.active { background: var(--accent-primary); color: var(--accent-primary-text,#fff); box-shadow: 0 0 0 5px var(--up-accent-soft); }
html.user-portal :is(.wizard-progress,.wizard-buttons,.credit-total-actions) { gap: 16px; }
html.user-portal .wizard-ident-explainer { background: var(--up-inset); border: 0; border-radius: 16px; }
html.user-portal :is(.tfc-stage,.tfc-panel2) { padding: 24px; }
/* Conversations: comfortable line lengths and consistent surfaces, existing scroll ownership retained. */
html.user-portal #utc .utc-card,html.user-portal :is(.chat-card,.chat-sidebar-section) { background: var(--up-surface); border-color: var(--up-line); border-radius: 18px; box-shadow: var(--up-shadow); }
html.user-portal #utc .utc-stage { grid-template-columns: minmax(230px,300px) minmax(0,1fr); gap: 24px; }
html.user-portal #utc :is(.utc-thread,.utc-composer,.utc-chat-head) { padding: 20px; border-color: var(--up-line); }
html.user-portal #utc .utc-bubble,html.user-portal .message-body { border-radius: 16px; padding: 12px 16px; font-size: 14px; line-height: 1.65; max-width: 70ch; overflow-wrap: anywhere; }
html.user-portal #utc .utc-message { max-width: 88%; }
html.user-portal :is(.chat-messages,.utc-thread) { scrollbar-width: thin; scrollbar-color: var(--up-muted) transparent; }
html.user-portal :is(.chat-input-area,.utc-composer) { background: var(--up-surface); border-color: var(--up-line); }
/* Support workspace: scannable list, honest page-local search and a calm full-width conversation. */
html.user-portal .tickets-container .page-header { display: flex; align-items: end; justify-content: space-between; }
html.user-portal .tickets-container .page-header p { margin: 8px 0 0; }
html.user-portal .tickets-container .top-bar { align-items: center; margin-bottom: 14px; }
html.user-portal .tickets-container .filter-tabs { min-width: 0; }
html.user-portal .tickets-container .filter-tab { min-height: 40px; padding: 9px 14px; border: 0; border-radius: 10px; color: var(--up-muted); background: transparent; cursor: pointer; }
html.user-portal .tickets-container .filter-tab[aria-pressed="true"] { background: var(--up-surface); color: var(--accent-primary); box-shadow: 0 1px 8px rgba(0,0,0,.08); }
html.user-portal .up-ticket-tools { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
html.user-portal .up-ticket-search { display: flex; align-items: center; gap: 10px; width: min(440px,100%); min-height: 44px; padding: 0 14px; border: 1px solid var(--up-line); border-radius: 14px; background: var(--up-surface); color: var(--up-muted); }
html.user-portal .up-ticket-search:focus-within { border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--up-accent-soft); }
html.user-portal .up-ticket-search input { width: 100%; min-height: 40px; padding: 0; border: 0; outline: 0 !important; background: transparent; box-shadow: none; }
html.user-portal .up-ticket-results { color: var(--up-muted); font-size: 13px; white-space: nowrap; }
html.user-portal .tickets-container .ticket-list { display: grid; gap: 12px; }
html.user-portal .tickets-container .ticket-card { padding: 20px; color: var(--text-primary); text-decoration: none; box-shadow: none !important; }
html.user-portal .tickets-container .ticket-card:hover { border-color: color-mix(in srgb,var(--accent-primary) 40%,var(--up-line)) !important; background: color-mix(in srgb,var(--up-surface) 96%,var(--accent-primary)) !important; }
html.user-portal .tickets-container .ticket-card-preview { max-width: 90ch; color: var(--up-muted); line-height: 1.55; }
html.user-portal .tickets-container .ticket-card-footer { gap: 8px 12px; }
html.user-portal .up-ticket-kind { display: inline-flex; margin-right: 8px; padding: 3px 7px; border-radius: 7px; background: var(--up-accent-soft); color: var(--accent-primary); font-size: 11px; font-weight: 700; vertical-align: 2px; }
html.user-portal .up-ticket-rating { color: #d97706; letter-spacing: 1px; }
html.user-portal .tickets-container .create-ticket-header { width: 100%; border: 0; color: var(--text-primary); background: transparent; text-align: left; }
html.user-portal .tickets-container .create-ticket-header:focus-visible { outline-offset: -4px; }
html.user-portal .tickets-container .create-actions { gap: 10px; }
html.user-portal .up-ticket-skeleton { display: grid; gap: 12px; }
html.user-portal .up-ticket-skeleton i { display: block; height: 104px; border: 1px solid var(--up-line); border-radius: 18px; background: var(--up-inset); opacity: .72; }
html.user-portal .up-ticket-error { display: grid; justify-items: center; gap: 10px; }
html.user-portal .up-ticket-error :is(h3,p) { margin: 0; }
html.user-portal #utc .utc-wrap { max-width: 1560px; }
html.user-portal #utc .utc-chat { min-width: 0; }
html.user-portal #utc .utc-thread { min-height: clamp(320px,52vh,760px); }
html.user-portal #utc .utc-composer-row { align-items: end; }
html.user-portal #utc .utc-field textarea { max-height: 130px; line-height: 1.5; }
html.user-portal #utc .utc-composer-hint { display: flex; justify-content: space-between; gap: 16px; margin-top: 8px; color: var(--up-muted); font-size: 11px; line-height: 1.4; }
html.user-portal #utc .utc-composer[aria-busy="true"] { opacity: .72; }
html.user-portal #utc .utc-send:disabled { opacity: .4; cursor: default; }
/* Accessible notifications never overlap each other or steal focus. */
html.user-portal .up-toasts { position: fixed; right: max(20px,env(safe-area-inset-right)); top: max(88px,env(safe-area-inset-top)); z-index: 100000; width: min(390px,calc(100vw - 32px)); display: flex; flex-direction: column; gap: 10px; pointer-events: none; max-height: calc(100dvh - 100px); overflow-y: auto; }
html.user-portal .up-toast { display: flex; align-items: flex-start; gap: 12px; padding: 16px; border-radius: 16px; border: 1px solid var(--up-line); border-left: 3px solid var(--accent-primary); background: var(--up-surface); color: var(--text-primary); box-shadow: 0 12px 36px rgba(0,0,0,.2); pointer-events: auto; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
html.user-portal .up-toast[data-type="error"] { border-left-color: #ef4444; }
html.user-portal .up-toast[data-type="success"] { border-left-color: #22c55e; }
html.user-portal .up-toast[data-type="warning"] { border-left-color: #f59e0b; }
html.user-portal .up-toast span { flex: 1; }
html.user-portal .up-toast button { flex-shrink: 0; background: transparent; border: 0; color: var(--up-muted); width: 32px; height: 32px; margin: -4px; border-radius: 8px; cursor: pointer; }
@media(hover:hover) {
 html.user-portal :is(.qa-card,.up-task,.ticket-card,.solution-card,.tfc-mk):hover { border-color: color-mix(in srgb,var(--accent-primary) 40%,var(--up-line)); box-shadow: var(--up-shadow); transform: none; }
 html.user-portal .sidebar-link:hover { background: var(--up-inset); }
}
@media(max-width:1100px) { html.user-portal .price-hero { grid-template-columns: 1fr; } html.user-portal .summary-card { position: static; } }
@media(max-width:991px) {
 html.user-portal .main-content { padding: 20px 16px 32px !important; }
 html.user-portal .sidebar-container { max-width: min(300px,calc(100vw - 64px)); }
 html.user-portal .hamburger-menu { width: 44px; height: 44px; top: 12px; left: 12px; }
 html.user-portal .app-header { padding-left: 68px !important; }
 html.user-portal #utc .utc-stage { grid-template-columns: 1fr; gap: 16px; }
 html.user-portal :is(.credit-grid,.stats-grid,.quick-actions,.up-workbench) { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
 html.user-portal .up-workbench .up-task:last-child { grid-column: 1 / -1; }
}
@media(max-width:600px) {
 html.user-portal { --up-radius: 16px; --up-gap: 20px; }
 html.user-portal :is(.selector-grid,.vehicle-grid,.main-input-grid,.create-ticket-grid,.price-flow) { grid-template-columns: 1fr; }
 html.user-portal .price-flow { grid-template-columns: repeat(2,minmax(0,1fr)); }
 html.user-portal .credit-card { padding: 18px; }
 html.user-portal :is(input,select,textarea) { font-size: 16px; }
 html.user-portal #utc :is(.utc-thread,.utc-composer,.utc-chat-head) { padding: 12px; }
 html.user-portal #utc .utc-message { max-width: 95%; }
 html.user-portal .up-ticket-tools { align-items: stretch; flex-direction: column; }
 html.user-portal .up-ticket-search { width: 100%; }
 html.user-portal .up-ticket-results { white-space: normal; }
 html.user-portal .tickets-container .top-bar { align-items: stretch; flex-direction: column; }
 html.user-portal .tickets-container .btn-new-ticket { width: 100%; justify-content: center; }
 html.user-portal .tickets-container .filter-tabs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
 html.user-portal .tickets-container .filter-tab { white-space: normal; }
 html.user-portal #utc .utc-composer-hint span:first-child { display: none; }
 html.user-portal #utc .utc-composer-hint { justify-content: flex-end; }
 html.user-portal .app-header-user { gap: 4px; }
 html.user-portal .up-toasts { right: 16px; left: 16px; top: max(72px,env(safe-area-inset-top)); margin-inline: auto; }
}
@media(prefers-reduced-motion:reduce) { html.user-portal *,html.user-portal *::before,html.user-portal *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
@media print { html.user-portal :is(.up-toasts,.up-notification-toggle,.up-skip) { display: none !important; } }
html.user-portal .up-workbench[hidden] { display: none; }
html.user-portal .auth-card { background: var(--up-surface); border-color: var(--up-line); border-radius: 24px; box-shadow: var(--up-shadow); }
html.user-portal .auth-input { min-height: 48px; border-radius: 12px; background: var(--up-inset); }
html.user-portal .auth-submit { border-radius: 12px; min-height: 48px; }


html.user-portal .sidebar-container .section-header { margin-top:12px; margin-bottom:4px; padding-block:0; }
/* Keep expanded vehicle fields and the order summary in document flow. */
html.user-portal #normalAutomatikSticky { position:static; inset:auto; margin-top:16px; }
