/* RoadPro Customer Portal 3.0 — design layer over Portal V2 (2026-10-15)
   Colours come from the existing theme tokens (admin/assets/css/theme.css) so dark / light / auto keep
   working. This file only adds the 3.0 components and tones down the V2 chrome it replaces. */
:root{
  --v3-r:14px; --v3-r-sm:10px; --v3-gap:12px;
  --v3-fs-xs:.72rem; --v3-fs-sm:.82rem; --v3-fs:.92rem; --v3-fs-lg:1.08rem; --v3-fs-xl:1.42rem;
  --v3-line:var(--border-color); --v3-card:var(--bg-secondary); --v3-card-2:var(--bg-tertiary);
  --v3-navh:62px;
}
body.v3{letter-spacing:-.005em}
body.v3 .online-pill,body.v3 .top-side #lang,body.v3 .top-side #theme{display:none!important}
body.v3 .top-bar{padding:10px 16px;padding-top:calc(10px + env(safe-area-inset-top,0px));background:color-mix(in srgb,var(--bg-primary) 88%,transparent);backdrop-filter:saturate(1.4) blur(14px);-webkit-backdrop-filter:saturate(1.4) blur(14px)}
body.v3 .logo{font-size:.98rem;letter-spacing:-.2px}
body.v3 .bell{width:40px;height:40px;border-radius:12px;font-size:0;color:var(--text-primary)}
body.v3 .bell .i{width:20px;height:20px}
body.v3 .wrap{padding:14px 16px calc(var(--v3-navh) + env(safe-area-inset-bottom,0px) + 24px)}
.i{width:20px;height:20px;flex:none;display:inline-block;vertical-align:middle}
.i.sm{width:16px;height:16px}.i.lg{width:24px;height:24px}

/* ── Bottom navigation: 4 destinations ───────────────────────────── */
body.v3 .nav{display:grid!important;grid-template-columns:repeat(4,1fr);height:auto;padding:6px 6px calc(6px + env(safe-area-inset-bottom,0px));gap:2px;background:color-mix(in srgb,var(--bg-secondary) 92%,transparent);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);border-top:1px solid var(--v3-line)}
body.v3 .nav[style*="none"]{display:none!important}
body.v3 .nav .nav-item{flex-direction:column;gap:3px;min-height:50px;border-radius:12px;color:var(--text-muted);font-size:.68rem;font-weight:600;padding:6px 2px;position:relative;white-space:nowrap}
body.v3 .nav .nav-item .i{width:22px;height:22px}
body.v3 .nav .nav-item.active{color:var(--accent-color);background:var(--accent-softer)}
body.v3 .nav .nav-item .nb{position:absolute;top:4px;left:calc(50% + 8px);min-width:17px;height:17px;padding:0 5px;border-radius:9px;background:var(--danger-color);color:#fff;font-size:.6rem;font-weight:800;display:none;align-items:center;justify-content:center}
body.v3 .nav .nav-item .nb.show{display:flex}
body.v3.v3-thread .nav{display:none!important}

/* ── Typography / layout primitives ──────────────────────────────── */
.v3-h1{font-size:var(--v3-fs-xl);font-weight:800;letter-spacing:-.02em;line-height:1.15;margin:4px 0 2px}
.v3-sub{font-size:var(--v3-fs-sm);color:var(--text-secondary);margin-bottom:14px}
.v3-label{display:flex;align-items:center;justify-content:space-between;font-size:var(--v3-fs-xs);font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--text-muted);margin:22px 2px 8px}
.v3-label a,.v3-label button{font-size:var(--v3-fs-sm);letter-spacing:0;text-transform:none;font-weight:600;color:var(--accent-color);background:none;border:0;cursor:pointer;padding:6px 0}
.v3-card{background:var(--v3-card);border:1px solid var(--v3-line);border-radius:var(--v3-r);overflow:hidden}
.v3-card.pad{padding:16px}
.v3-muted{color:var(--text-secondary)}.v3-faint{color:var(--text-muted)}
.v3-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:2px 0 6px}
.v3-head .v3-h1{margin:0}

/* ── Buttons ─────────────────────────────────────────────────────── */
.v3-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:0 16px;border-radius:12px;border:1px solid transparent;font-weight:700;font-size:var(--v3-fs-sm);cursor:pointer;background:var(--accent-color);color:var(--on-accent);white-space:nowrap}
.v3-btn:active{transform:scale(.985)}
.v3-btn.ghost{background:transparent;border-color:var(--border-strong);color:var(--text-primary)}
.v3-btn.soft{background:var(--accent-soft);color:var(--accent-color)}
.v3-btn.block{display:flex;width:100%}
.v3-btn.sm{min-height:36px;padding:0 12px;border-radius:10px;font-size:.78rem}
.v3-btn[disabled]{opacity:.55;pointer-events:none}
.v3-back{display:inline-flex;align-items:center;gap:4px;background:none;border:0;color:var(--accent-color);font-weight:600;font-size:var(--v3-fs-sm);padding:8px 4px 8px 0;margin:0 0 4px;cursor:pointer;min-height:40px}

/* ── Hero (status headline) ──────────────────────────────────────── */
.v3-greet{font-size:var(--v3-fs-sm);color:var(--text-secondary);margin:2px 2px 10px}
.v3-hero{position:relative;padding:18px;border-radius:18px;background:linear-gradient(160deg,color-mix(in srgb,var(--accent-color) 16%,var(--bg-secondary)) 0%,var(--bg-secondary) 62%);border:1px solid var(--v3-line);cursor:pointer}
.v3-hero .k{display:flex;align-items:center;gap:8px;font-size:var(--v3-fs-xs);font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--accent-color)}
.v3-hero .t{font-size:var(--v3-fs-lg);font-weight:800;letter-spacing:-.01em;line-height:1.3;margin:8px 0 4px}
.v3-hero .s{font-size:var(--v3-fs-sm);color:var(--text-secondary)}
.v3-hero.calm{background:var(--bg-secondary);cursor:default}
.v3-hero.warn .k{color:var(--warning-color)}
.v3-hero .go{position:absolute;right:16px;top:18px;color:var(--text-muted)}
.v3-hero .cta{margin-top:14px}

/* ── Rows (compact list items) ───────────────────────────────────── */
.v3-list{display:flex;flex-direction:column}
.v3-row{display:flex;align-items:center;gap:12px;padding:13px 14px;border-bottom:1px solid var(--v3-line);cursor:pointer;min-height:60px;background:none;border-left:0;border-right:0;border-top:0;width:100%;text-align:left;color:inherit;font:inherit}
.v3-row:last-child{border-bottom:0}
.v3-row:active{background:var(--accent-softer)}
.v3-row .ic{width:38px;height:38px;border-radius:11px;background:var(--v3-card-2);display:flex;align-items:center;justify-content:center;color:var(--text-secondary);flex:none}
.v3-row .ic.acc{background:var(--accent-soft);color:var(--accent-color)}
.v3-row .ic.warn{background:var(--warning-soft);color:var(--warning-color)}
.v3-row .ic.ok{background:var(--success-soft);color:var(--success-color)}
.v3-row .bd{flex:1;min-width:0}
.v3-row .tt{font-weight:700;font-size:var(--v3-fs);line-height:1.3;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.v3-row .st{font-size:var(--v3-fs-sm);color:var(--text-secondary);margin-top:2px;line-height:1.35}
.v3-row .rt{display:flex;flex-direction:column;align-items:flex-end;gap:4px;flex:none;text-align:right}
.v3-row .amt{font-weight:800;font-size:var(--v3-fs)}
.v3-row .chev{color:var(--text-muted);flex:none}
.v3-row.unread .tt::before{content:'';display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--accent-color);margin-right:7px;vertical-align:middle;position:relative;top:-1px}
.v3-row.static{cursor:default}.v3-row.static:active{background:none}

/* ── Status pills ────────────────────────────────────────────────── */
.v3-pill{display:inline-flex;align-items:center;gap:6px;font-size:.7rem;font-weight:700;padding:4px 9px;border-radius:999px;white-space:nowrap;background:var(--v3-card-2);color:var(--text-secondary)}
.v3-pill::before{content:'';width:6px;height:6px;border-radius:50%;background:currentColor}
.v3-pill.action{background:var(--warning-soft);color:var(--warning-color)}
.v3-pill.in_progress{background:var(--accent-soft);color:var(--accent-color)}
.v3-pill.completed{background:var(--success-soft);color:var(--success-color)}
.v3-pill.cancelled{color:var(--text-muted)}
.v3-count{min-width:20px;height:20px;padding:0 6px;border-radius:10px;background:var(--danger-color);color:#fff;font-size:.66rem;font-weight:800;display:inline-flex;align-items:center;justify-content:center}

/* ── Segmented tabs ──────────────────────────────────────────────── */
.v3-seg{display:flex;gap:4px;padding:4px;border-radius:12px;background:var(--v3-card-2);margin:4px 0 14px;overflow-x:auto;scrollbar-width:none}
.v3-seg::-webkit-scrollbar{display:none}
.v3-seg button{flex:1 0 auto;min-height:36px;padding:0 12px;border:0;border-radius:9px;background:none;color:var(--text-secondary);font-weight:700;font-size:.78rem;cursor:pointer;white-space:nowrap}
.v3-seg button.on{background:var(--bg-secondary);color:var(--text-primary);box-shadow:0 1px 3px var(--shadow-color)}

/* ── Quick actions ───────────────────────────────────────────────── */
.v3-quick{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.v3-quick button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;min-height:78px;border-radius:14px;border:1px solid var(--v3-line);background:var(--v3-card);color:var(--text-primary);font-weight:600;font-size:.74rem;cursor:pointer;padding:8px 4px;text-align:center}
.v3-quick button .i{color:var(--accent-color)}
.v3-quick button.sos .i{color:var(--danger-color)}

/* ── Empty / loading / error ─────────────────────────────────────── */
.v3-empty{padding:26px 18px;text-align:center}
.v3-empty .i{width:28px;height:28px;color:var(--text-muted);margin-bottom:8px}
.v3-empty .t{font-weight:700;font-size:var(--v3-fs)}
.v3-empty .s{font-size:var(--v3-fs-sm);color:var(--text-secondary);margin-top:4px}
.v3-ok{display:flex;align-items:center;gap:10px;padding:14px;font-weight:600;font-size:var(--v3-fs-sm);color:var(--text-secondary)}
.v3-ok .i{color:var(--success-color)}
.v3-sk{height:58px;margin:0 14px;border-bottom:1px solid var(--v3-line);position:relative;overflow:hidden}
.v3-sk::after{content:'';position:absolute;inset:16px 30% 16px 0;border-radius:8px;background:linear-gradient(90deg,var(--v3-card-2),var(--surface-muted),var(--v3-card-2));background-size:200% 100%;animation:v3sh 1.2s infinite}
@keyframes v3sh{to{background-position:-200% 0}}
.v3-err{padding:18px;text-align:center;font-size:var(--v3-fs-sm);color:var(--text-secondary)}

/* ── Service detail ──────────────────────────────────────────────── */
.v3-sum{padding:18px;border-radius:18px;background:var(--bg-secondary);border:1px solid var(--v3-line)}
.v3-sum .t{font-size:var(--v3-fs-xl);font-weight:800;letter-spacing:-.02em;line-height:1.2;margin:10px 0 6px}
.v3-sum .m{font-size:var(--v3-fs-sm);color:var(--text-secondary);display:flex;flex-wrap:wrap;gap:4px 14px}
.v3-sum .m span{display:inline-flex;align-items:center;gap:6px}
.v3-next{display:flex;gap:12px;align-items:flex-start;padding:14px 16px;margin-top:12px;border-radius:14px;background:var(--accent-softer);border:1px solid var(--v3-line);font-size:var(--v3-fs-sm);line-height:1.45}
.v3-next .i{color:var(--accent-color);margin-top:1px}
.v3-next.warn{background:var(--warning-soft)}.v3-next.warn .i{color:var(--warning-color)}
.v3-next b{display:block;font-size:var(--v3-fs-xs);letter-spacing:.06em;text-transform:uppercase;color:var(--text-muted);margin-bottom:2px}
.v3-journey{padding:6px 16px 6px}
.v3-step{display:flex;gap:12px;position:relative;padding:9px 0}
.v3-step .dot{width:22px;height:22px;border-radius:50%;flex:none;display:flex;align-items:center;justify-content:center;border:2px solid var(--border-strong);background:var(--bg-secondary);color:var(--on-accent);position:relative;z-index:1}
.v3-step.done .dot{background:var(--accent-color);border-color:var(--accent-color)}
.v3-step.done .dot .i{width:13px;height:13px}
.v3-step.now .dot{border-color:var(--accent-color);box-shadow:0 0 0 4px var(--accent-soft)}
.v3-step.now .dot::after{content:'';width:8px;height:8px;border-radius:50%;background:var(--accent-color)}
.v3-step:not(:last-child)::before{content:'';position:absolute;left:10px;top:31px;bottom:-9px;width:2px;background:var(--border-strong)}
.v3-step.done:not(:last-child)::before{background:var(--accent-color)}
.v3-step .l{font-weight:700;font-size:var(--v3-fs-sm);line-height:22px}
.v3-step .d{font-size:var(--v3-fs-xs);color:var(--text-muted)}
.v3-step.todo .l{color:var(--text-muted);font-weight:600}
.v3-fold{margin-top:12px;border:1px solid var(--v3-line);border-radius:var(--v3-r);background:var(--bg-secondary);overflow:hidden}
.v3-fold>summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 16px;font-weight:700;font-size:var(--v3-fs-sm);cursor:pointer;min-height:50px}
.v3-fold>summary::-webkit-details-marker{display:none}
.v3-fold>summary .i{color:var(--text-muted);transition:transform .2s}
.v3-fold[open]>summary .i{transform:rotate(90deg)}
.v3-fold>.in{padding:0 16px 16px}
body.v3 .v3-detail .section-card{border-radius:var(--v3-r);margin-top:12px;box-shadow:none}
body.v3 .v3-detail .section-title{font-size:var(--v3-fs-xs);letter-spacing:.08em}

/* ── Conversation ────────────────────────────────────────────────── */
.v3-thread-head{position:sticky;top:calc(58px + env(safe-area-inset-top,0px));z-index:5;background:var(--bg-primary);padding:4px 0 8px;margin:0 -2px}
.v3-thread-head .tt{font-weight:800;font-size:var(--v3-fs-lg);line-height:1.25}
.v3-thread-head .st{font-size:var(--v3-fs-sm);color:var(--text-secondary)}
.v3-msgs{display:flex;flex-direction:column;gap:6px;padding:6px 0 calc(92px + env(safe-area-inset-bottom,0px))}
.v3-day{align-self:center;font-size:.68rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-muted);margin:10px 0 4px}
.v3-b{max-width:82%;padding:9px 13px;border-radius:18px;font-size:var(--v3-fs);line-height:1.42;white-space:pre-wrap;word-break:break-word}
.v3-b.them{align-self:flex-start;background:var(--bg-tertiary);border-bottom-left-radius:6px}
.v3-b.me{align-self:flex-end;background:var(--accent-color);color:var(--on-accent);border-bottom-right-radius:6px}
.v3-b .w{display:block;font-size:.7rem;font-weight:700;color:var(--accent-color);margin-bottom:2px}
.v3-b .tm{display:block;font-size:.66rem;opacity:.7;margin-top:3px;text-align:right}
.v3-b.fail{background:var(--danger-soft);color:var(--danger-color);cursor:pointer}
.v3-sys{align-self:center;max-width:90%;font-size:.74rem;color:var(--text-muted);text-align:center;padding:2px 8px}
.v3-unread-line{align-self:stretch;display:flex;align-items:center;gap:8px;font-size:.66rem;font-weight:800;color:var(--accent-color);letter-spacing:.06em;text-transform:uppercase;margin:6px 0}
.v3-unread-line::before,.v3-unread-line::after{content:'';flex:1;height:1px;background:var(--accent-soft)}
.v3-composer{position:fixed;left:0;right:0;bottom:0;z-index:60;padding:8px 12px calc(8px + env(safe-area-inset-bottom,0px));background:color-mix(in srgb,var(--bg-secondary) 94%,transparent);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);border-top:1px solid var(--v3-line)}
.v3-composer .in{max-width:var(--maxw);margin:0 auto;display:flex;gap:8px;align-items:flex-end}
.v3-composer textarea{flex:1;resize:none;max-height:120px;min-height:44px;padding:11px 14px;border-radius:22px;border:1px solid var(--border-strong);background:var(--bg-tertiary);color:var(--text-primary);font:inherit;font-size:16px;line-height:1.35}
.v3-composer button{width:44px;height:44px;border-radius:50%;border:0;background:var(--accent-color);color:var(--on-accent);display:flex;align-items:center;justify-content:center;cursor:pointer;flex:none}
.v3-composer button[disabled]{opacity:.5}

/* ── Account ─────────────────────────────────────────────────────── */
.v3-me{display:flex;align-items:center;gap:14px;padding:16px}
.v3-me .av{width:52px;height:52px;border-radius:50%;background:var(--accent-soft);color:var(--accent-color);display:flex;align-items:center;justify-content:center;font-weight:800;font-size:1.1rem;flex:none}
.v3-me .n{font-weight:800;font-size:var(--v3-fs-lg)}
.v3-me .e{font-size:var(--v3-fs-sm);color:var(--text-secondary);word-break:break-all}
.v3-set{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border-bottom:1px solid var(--v3-line);min-height:56px}
.v3-set:last-child{border-bottom:0}
.v3-set label{font-weight:600;font-size:var(--v3-fs);display:flex;align-items:center;gap:12px}
.v3-set select{background:var(--bg-tertiary);border:1px solid var(--border-strong);color:var(--text-primary);border-radius:10px;padding:8px 10px;font-size:.85rem;min-height:38px;max-width:52%}
.v3-foot{text-align:center;font-size:.72rem;color:var(--text-muted);padding:22px 0 6px}

/* ── Desktop: side navigation ────────────────────────────────────── */
@media (min-width:960px){
  body.v3 .nav{position:fixed;top:0;bottom:0;left:0;right:auto;width:220px;display:flex!important;flex-direction:column;justify-content:flex-start;padding:84px 12px 20px;gap:4px;border-top:0;border-right:1px solid var(--v3-line);height:100vh}
  body.v3 .nav{height:auto!important;min-height:0;transform:none}
  body.v3 .nav .nav-item{flex:none;height:auto;flex-direction:row;justify-content:flex-start;gap:12px;font-size:.9rem;padding:12px 14px;min-height:46px}
  body.v3 .nav .nav-item .nb{position:static;margin-left:auto}
  body.v3 .top-bar{padding-left:236px}
  body.v3 .wrap{margin-left:220px;max-width:none;padding:24px 40px 60px}
  body.v3 .wrap>#view{max-width:760px;margin:0 auto}
  body.v3.v3-thread .nav{display:flex!important}
  .v3-composer{left:220px}
  .v3-quick button{min-height:90px}
}
@media (prefers-reduced-motion:reduce){.v3-sk::after{animation:none}}
.v3-meta{display:flex;align-items:center;gap:8px;margin-top:7px;font-size:.7rem;flex-wrap:wrap}
/* The satisfaction survey (enterprise layer) is kept, but it no longer sits above the customer's
   service status: on the 3.0 Home it is shown after the main content, compact. */
body.v3 #view.v3-homeview{display:flex;flex-direction:column}
body.v3 #view.v3-homeview>*{order:1}
body.v3 #view.v3-homeview>.nps-sheet{order:9;margin-top:18px;padding:14px 16px;border-radius:var(--v3-r)}
body.v3 .nps-sheet .nps-scores{display:grid;grid-template-columns:repeat(11,1fr);gap:4px;margin-top:10px}
body.v3 .nps-sheet .nps-btn{min-height:36px;border-radius:8px;border:1px solid var(--border-strong);background:var(--bg-tertiary);color:var(--text-primary);font-weight:700;font-size:.78rem;padding:0}
body.v3 .nps-sheet textarea{border-radius:10px;border:1px solid var(--border-strong);background:var(--bg-tertiary);color:var(--text-primary);padding:10px;font:inherit;font-size:16px}

/* ── iOS 26 home-screen app: bottom bar lifted off the bottom edge (2026-10-16) ──
   In an installed web app (viewport-fit=cover + translucent status bar) iOS 26 sizes the viewport short by the
   status-bar height whenever the page is shorter than the screen (WebKit bug 301108): the fixed bottom bar then
   sits that much above the bottom edge with a strip of page background under it. Giving the page a minimum
   height of the full screen in standalone mode removes the short viewport. The min() cap keeps an opaque
   status bar (inset 0) from making the page scroll by the status-bar height (WebKit bug 316008). */
/* 2026-10-24 — "What we found and did": the technician's customer-facing notes, open under the journey. */
.v3-story{padding:4px 16px}
.v3-story-item{padding:12px 0;border-bottom:1px solid var(--v3-line)}
.v3-story-item:last-child{border-bottom:0}
.v3-story-item .k{font-size:var(--v3-fs-xs,.78rem);font-weight:700;letter-spacing:.02em;text-transform:uppercase;color:var(--text-muted);margin-bottom:4px}
.v3-story-item .k .d{font-weight:500;text-transform:none;letter-spacing:0}
.v3-story-item .b{font-size:var(--v3-fs-sm);line-height:1.5;color:var(--text-primary);white-space:normal;overflow-wrap:anywhere}
.v3-story-item .b .d,.v3-sr-list .d{color:var(--text-muted);font-weight:500}
.v3-sr-sec{padding:12px 0;border-bottom:1px solid var(--v3-line)}
.v3-sr-sec:last-child{border-bottom:0}
.v3-sr-sec .v3-story-item{padding:6px 0;border-bottom:0}
.v3-sr-h{font-size:var(--v3-fs-xs,.78rem);font-weight:700;letter-spacing:.02em;text-transform:uppercase;color:var(--text-muted);margin-bottom:2px}
.v3-sr-list{margin:6px 0 0;padding-left:18px;font-size:var(--v3-fs-sm);line-height:1.6;color:var(--text-primary)}
.v3-sr-list li{overflow-wrap:anywhere}
@media (display-mode: standalone) {
  html { min-height: min(100lvh, calc(100% + env(safe-area-inset-top, 0px))); overscroll-behavior-y: none; }   /* installed app only: no rubber-band of the whole page; the browser keeps pull-to-refresh */
}
