:root {
  --navy: #00297a;
  --navy-deep: #0a1b4a;
  --royal: #051aae;
  --ink: #1c2333;
  --slate: #5a6478;
  --mist: #f4f7fc;
  --mist-2: #e8eef8;
  --line: #dbe4f0;
  --white: #fff;
  --green: #1d9e55;
  --green-bg: #e6f6ec;
  --amber: #b07d10;
  --amber-bg: #fdf3dd;
  --red: #c53030;
  --red-bg: #fdecec;
  --blue: #1d4fd7;
  --blue-bg: #e3ecfd;
  --radius: 14px;
  --shadow-sm: 0 1px 3px rgba(10,27,74,.08);
  --shadow-md: 0 8px 28px rgba(10,27,74,.16);
  --font-head: "Montserrat", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
}

:root[data-tech-theme="dark"] {
  --navy: #b9c9ff;
  --navy-deep: #071025;
  --royal: #7890ff;
  --ink: #eef3ff;
  --slate: #a8b4ca;
  --mist: #080f1e;
  --mist-2: #152038;
  --line: #293954;
  --white: #101a2d;
  --green: #6cdda0;
  --green-bg: #123625;
  --amber: #f1c36d;
  --amber-bg: #382b16;
  --red: #ff9595;
  --red-bg: #3d1d25;
  --blue: #96b2ff;
  --blue-bg: #172b52;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
  --shadow-md: 0 12px 34px rgba(0,0,0,.42);
}

:root[data-tech-theme="hello-kitty"] {
  --navy: #c2185b;
  --navy-deep: #c2185b;
  --royal: #f0367a;
  --ink: #3a2233;
  --slate: #966176;
  --mist: #fff0f5;
  --mist-2: #ffe0ec;
  --line: #ffc2d9;
  --white: #fff;
  --green: #2f9e6e;
  --green-bg: #e3f7ee;
  --amber: #b8740e;
  --amber-bg: #fdf0d8;
  --red: #d1264f;
  --red-bg: #ffe1e9;
  --blue: #4569d6;
  --blue-bg: #e6ecfd;
  --shadow-sm: 0 1px 3px rgba(224,0,77,.1);
  --shadow-md: 0 10px 30px rgba(224,0,77,.18);
}

:root[data-tech-theme="kuromi"] {
  --navy: #f1a7cf;
  --navy-deep: #17101f;
  --royal: #b35bd2;
  --ink: #f5edf8;
  --slate: #bba7c5;
  --mist: #100b16;
  --mist-2: #251a30;
  --line: #4b3559;
  --white: #1d1525;
  --green: #58d69b;
  --green-bg: #143629;
  --amber: #efb65a;
  --amber-bg: #3b2b13;
  --red: #ff7597;
  --red-bg: #421926;
  --blue: #a7b7ff;
  --blue-bg: #202943;
  --shadow-sm: 0 1px 4px rgba(0,0,0,.38);
  --shadow-md: 0 12px 34px rgba(0,0,0,.55);
}

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

body {
  font-family: var(--font-body);
  background: var(--mist);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
body.theme-picker-open { overflow: hidden; }

:root[data-tech-reduce-motion="true"] *,
:root[data-tech-reduce-motion="true"] *::before,
:root[data-tech-reduce-motion="true"] *::after {
  scroll-behavior: auto !important;
  animation-duration: .01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .01ms !important;
}

h1, h2, h3 { font-family: var(--font-head); color: var(--navy); }
button { font: inherit; cursor: pointer; }
a { color: var(--royal); text-decoration: none; }
input, textarea, select { font: inherit; }

.boot-screen {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
  background: var(--navy-deep);
}
.boot-screen img { width: 112px; height: auto; }
.boot-spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.2); border-top-color: #fff;
  animation: spin .7s linear infinite;
}

.theme-toggle { touch-action: manipulation; }
.theme-icon { width: 20px; height: 20px; }
.theme-icon-sun { display: none; }
[data-tech-theme="dark"] .theme-icon-moon { display: none; }
[data-tech-theme="dark"] .theme-icon-sun { display: none; }
.theme-toggle-brand {
  position: absolute; z-index: 4; top: 28px; right: 28px;
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.25); border-radius: 13px;
  background: rgba(255,255,255,.1); color: #fff;
}
.theme-toggle-brand:active { background: rgba(255,255,255,.2); }
.tech-theme-picker {
  position: fixed; inset: 0; z-index: 500; display: flex; align-items: flex-end; justify-content: center;
  padding: 16px 16px max(16px, env(safe-area-inset-bottom)); background: rgba(5,10,24,.55);
  opacity: 0; transition: opacity .18s ease;
}
.tech-theme-picker[hidden] { display: none; }
.tech-theme-picker.open { opacity: 1; }
.tech-theme-sheet {
  width: min(500px, 100%); padding: 18px; border: 1px solid var(--line); border-radius: 22px;
  background: var(--white); box-shadow: var(--shadow-md); transform: translateY(18px);
  transition: transform .18s ease;
}
.tech-theme-picker.open .tech-theme-sheet { transform: translateY(0); }
.tech-theme-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.tech-theme-sheet-head span { display: block; color: var(--royal); font-size: .65rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.tech-theme-sheet-head h2 { margin-top: 2px; font-size: 1.1rem; }
.tech-theme-sheet-head > button {
  width: 38px; height: 38px; border: 0; border-radius: 10px; background: var(--mist-2); color: var(--navy);
  font-size: 1.45rem; line-height: 1;
}
.tech-theme-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.tech-theme-options > button {
  display: grid; grid-template-columns: 42px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px;
  align-items: center; min-height: 64px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 13px;
  background: var(--mist); color: var(--ink); text-align: left;
}
.tech-theme-options > button:last-child { grid-column: 1 / -1; }
.tech-theme-options > button.active { border-color: var(--royal); box-shadow: inset 0 0 0 1px var(--royal); background: var(--mist-2); }
.tech-theme-options strong { align-self: end; color: var(--navy); font-size: .82rem; }
.tech-theme-options small { align-self: start; color: var(--slate); font-size: .65rem; }
.tech-theme-swatch {
  grid-row: 1 / 3; width: 42px; height: 42px; display: flex; align-items: center; justify-content: center;
  overflow: hidden; border: 1px solid var(--line); border-radius: 12px;
}
.theme-swatch-auto { background: linear-gradient(135deg, #fff 0 49%, #071025 51%); }
.theme-swatch-light { background: linear-gradient(135deg, #fff 0 55%, #e3ecfd 56%); }
.theme-swatch-dark { background: linear-gradient(135deg, #071025 0 55%, #7890ff 56%); }
.theme-swatch-kitty { background: #ff8fbd; }
.theme-swatch-kuromi { background: #281932; }
.tech-theme-swatch img { width: 34px; height: 34px; object-fit: contain; }
.theme-swatch-kuromi img { transform: translate(0.3px, 9px) scale(2.7); filter: brightness(0) invert(1); }

.login-screen {
  min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #e8eef9 0%, #f7f9fd 52%, #dce6f7 100%);
  padding: 24px; position: relative; overflow: hidden;
}
.login-shell {
  width: min(900px, 100%); min-height: 560px; display: grid;
  grid-template-columns: minmax(300px, .9fr) minmax(360px, 1.1fr);
  background: var(--white); border-radius: 28px; overflow: hidden;
  box-shadow: 0 28px 70px rgba(10,27,74,.2), 0 3px 10px rgba(10,27,74,.08);
}
.login-brand {
  position: relative; isolation: isolate; overflow: hidden; padding: 42px 40px;
  display: flex; flex-direction: column;
  background: linear-gradient(155deg, #071947 0%, #002b7d 58%, #0745c7 100%);
  color: rgba(255,255,255,.78);
}
.login-brand-logo { width: 170px; height: auto; position: relative; z-index: 2; }
.login-brand-mark {
  position: absolute; z-index: -1; width: 420px; max-width: none; right: -180px; top: 50px;
  opacity: .07; transform: rotate(-12deg); pointer-events: none;
}
.login-brand-copy { position: relative; z-index: 2; margin-top: auto; padding-bottom: 38px; }
.login-brand-copy > span, .login-kicker {
  display: block; text-transform: uppercase; letter-spacing: .13em; font-size: .69rem; font-weight: 800;
}
.login-brand-copy > span { color: #aebeff; margin-bottom: 13px; }
.login-brand-copy h1 { color: #fff; font-size: clamp(1.8rem, 3vw, 2.45rem); line-height: 1.06; margin-bottom: 16px; }
.login-brand-mobile-title { display: none; }
.login-brand-copy p { max-width: 290px; font-size: .9rem; line-height: 1.6; }
.login-waves { position: absolute; z-index: 1; bottom: -1px; left: 0; right: 0; opacity: .18; pointer-events: none; }
.login-waves svg { display: block; width: 100%; height: 125px; }
.login-waves path { fill: #b7c4ff; }
.login-card {
  background: var(--white); padding: 54px 52px; display: flex; align-items: center;
}
.login-card-inner { width: 100%; max-width: 370px; margin: 0 auto; }
.login-kicker { color: var(--blue); margin-bottom: 9px; }
.login-card h1 { text-align: left; font-size: 1.65rem; margin-bottom: 7px; }
.login-card .sub { text-align: left; color: var(--slate); font-size: .88rem; margin-bottom: 30px; }
.login-card label.fl { display: block; font-weight: 600; font-size: .8rem; color: var(--navy); margin: 0 0 5px; }
.login-card input[type=email], .login-card input[type=password] {
  width: 100%; min-height: 48px; padding: 11px 14px; font: inherit; font-size: .92rem;
  border: 1.5px solid #cbd7e8; border-radius: 11px; background: #f8fafd; color: var(--ink);
  transition: border-color .12s, box-shadow .12s, background .12s;
}
.login-card input:focus { outline: none; background: #fff; border-color: var(--royal); box-shadow: 0 0 0 4px rgba(5,26,174,.1); }
.login-card .btn-primary { min-height: 48px; background: linear-gradient(105deg, var(--royal), #174fd5); }
.login-card .link-btn { color: var(--blue); }
.pwa-install-login { display: block; margin: 9px auto 0; }
.pwa-install-login[hidden], .pwa-install-button[hidden], .pwa-update-banner[hidden], .pwa-install-help[hidden] { display: none; }

[data-tech-theme="dark"] .login-screen { background: linear-gradient(145deg, #050a15 0%, #0a1222 52%, #0d1930 100%); }
[data-tech-theme="dark"] .login-shell { border: 1px solid #1f2f4b; }
[data-tech-theme="dark"] .login-card input[type=email],
[data-tech-theme="dark"] .login-card input[type=password] {
  border-color: var(--line); background: #0b1426; color: var(--ink);
}
[data-tech-theme="dark"] .login-card input:focus { background: #0d192d; box-shadow: 0 0 0 4px rgba(120,144,255,.15); }
[data-tech-theme="hello-kitty"] .login-screen { background: linear-gradient(145deg, #ffd6e5 0%, #fff4f8 52%, #ffc2d9 100%); }
[data-tech-theme="hello-kitty"] .login-brand { background: linear-gradient(155deg, #c2185b 0%, #ed3c83 58%, #ff74b5 100%); }
[data-tech-theme="hello-kitty"] .login-brand::after,
[data-tech-theme="kuromi"] .login-brand::after {
  content: ''; position: absolute; z-index: 0; width: 360px; height: 360px; right: -120px; bottom: -80px;
  background: center / contain no-repeat; opacity: .13; filter: blur(.5px); pointer-events: none;
}
[data-tech-theme="hello-kitty"] .login-brand::after { background-image: url('/shared/hello-kitty.svg'); }
[data-tech-theme="kuromi"] .login-brand::after { background-image: url('/shared/kuromi.svg'); }
[data-tech-theme="hello-kitty"] .login-card .btn-primary { background: linear-gradient(105deg, #f0367a, #c2185b); }
[data-tech-theme="kuromi"] .login-screen { background: linear-gradient(145deg, #100b16 0%, #2a1b34 50%, #6a3f79 100%); }
[data-tech-theme="kuromi"] .login-brand { background: linear-gradient(155deg, #17101f 0%, #33203e 62%, #6e3d82 100%); }
[data-tech-theme="kuromi"] .login-shell { border: 1px solid #4b3559; }
[data-tech-theme="kuromi"] .login-card input[type=email],
[data-tech-theme="kuromi"] .login-card input[type=password] { border-color: var(--line); background: #160f1e; color: var(--ink); }
[data-tech-theme="kuromi"] .login-card input:focus { background: #1a1223; box-shadow: 0 0 0 4px rgba(179,91,210,.18); }
[data-tech-theme="kuromi"] .login-card .btn-primary { background: linear-gradient(105deg, #b35bd2, #7f3e9a); }

@media (max-width: 720px) {
  .login-screen { align-items: stretch; padding: 0; background: var(--white); overflow-y: auto; }
  .login-shell { min-height: 100vh; min-height: 100dvh; grid-template-columns: 1fr; grid-template-rows: 250px 1fr; border-radius: 0; box-shadow: none; }
  .login-brand { padding: max(25px, env(safe-area-inset-top)) 25px 38px; }
  .theme-toggle-brand { top: max(20px, env(safe-area-inset-top)); right: 20px; }
  .login-brand-logo { width: 142px; }
  .login-brand-mark { width: 300px; right: -105px; top: 0; }
  .login-brand-copy { padding: 0; margin-top: 27px; }
  .login-brand-copy > span { margin-bottom: 7px; }
  .login-brand-title { display: none; }
  .login-brand-mobile-title { display: block; font-size: 1.55rem; margin: 0; white-space: nowrap; }
  .login-brand-copy p { display: none; }
  .login-waves svg { height: 75px; }
  .login-card { position: relative; z-index: 3; align-items: flex-start; margin-top: -22px; padding: 38px 25px max(30px, env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; }
  .login-card-inner { max-width: 430px; }
  .login-card h1 { font-size: 1.45rem; }
}

@media (prefers-reduced-motion: reduce) {
  .tech-theme-picker, .tech-theme-sheet { transition: none; }
}

.app { display: none; position: relative; isolation: isolate; min-height: 100vh; min-height: 100dvh; flex-direction: column; }
.app.active { display: flex; }
.tech-theme-art { display: none; position: fixed; z-index: 0; top: 88px; right: -75px; pointer-events: none; }
.tech-theme-art img { display: none; width: 290px; max-width: none; opacity: .055; filter: blur(1.2px); transform: rotate(12deg); }
[data-tech-theme="hello-kitty"] .tech-theme-art,
[data-tech-theme="hello-kitty"] .tech-theme-art .tech-theme-kitty,
[data-tech-theme="kuromi"] .tech-theme-art,
[data-tech-theme="kuromi"] .tech-theme-art .tech-theme-kuromi { display: block; }
[data-tech-theme="kuromi"] .tech-theme-art img { width: 330px; opacity: .09; filter: brightness(0) invert(1) blur(1.2px); }

.topbar {
  background: var(--navy-deep); color: #fff; padding: 16px 18px;
  padding-top: max(16px, env(safe-area-inset-top));
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-family: var(--font-head); font-weight: 800; font-size: 1.1rem; }
.icon-btn {
  background: rgba(255,255,255,.12); border: 0; color: #fff; border-radius: 10px;
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
}
.icon-btn svg { width: 19px; height: 19px; }

.view { position: relative; z-index: 1; flex: 1; padding: 16px 16px calc(90px + env(safe-area-inset-bottom)); max-width: 640px; width: 100%; margin: 0 auto; }

.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  background: var(--white); border-top: 1px solid var(--line);
  display: flex; padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 10px rgba(10,27,74,.06);
}
.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 0 8px; color: var(--slate); font-size: .72rem; font-weight: 600;
}
.bottom-nav-item svg { width: 22px; height: 22px; }
.bottom-nav-item.active { color: var(--royal); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 18px; border-radius: 11px; border: 0; font-weight: 700; font-size: .92rem;
  transition: transform .1s ease, opacity .1s ease;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--royal); color: #fff; }
.btn-ghost { background: var(--mist-2); color: var(--navy); }
.btn-danger { background: var(--red-bg); color: var(--red); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
  .btn:active:not(:disabled) { transform: none; }
}

.icon-btn.spinning svg { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-state { display: flex; align-items: center; justify-content: center; padding: 80px 20px; }
.spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid var(--mist-2); border-top-color: var(--royal);
  animation: spin .7s linear infinite;
}

.form-err { color: var(--red); background: var(--red-bg); border-radius: 8px; padding: 10px 14px; font-size: .86rem; margin-top: 14px; display: none; }
.form-err.show { display: block; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--slate); }
.empty-state h4 { color: var(--navy); margin-bottom: 6px; font-size: 1.02rem; }

.chip {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
  background: var(--mist-2); color: var(--slate);
}
.chip.scheduled { background: var(--mist-2); color: var(--royal); }
.chip.en_route { background: var(--blue-bg); color: var(--blue); }
.chip.in_progress { background: var(--amber-bg); color: var(--amber); }
.chip.completed { background: var(--green-bg); color: var(--green); }
.chip.cancelled { background: var(--red-bg); color: var(--red); }
.chip.draft { background: var(--mist-2); color: var(--slate); }
.chip.sent { background: var(--blue-bg); color: var(--blue); }
.chip.paid { background: var(--green-bg); color: var(--green); }
.chip.overdue { background: var(--red-bg); color: var(--red); }
.chip.void { background: var(--mist-2); color: var(--slate); }

.td-main { font-weight: 600; color: var(--ink); }
.td-sub { font-size: .8rem; color: var(--slate); }

.date-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px;
}
.date-nav button {
  background: var(--white); border: 1px solid var(--line); border-radius: 10px;
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; color: var(--navy);
}
.date-nav .date-label { text-align: center; }
.date-nav .date-label strong { display: block; font-family: var(--font-head); font-size: 1rem; color: var(--navy); }
.date-nav .date-label span { font-size: .78rem; color: var(--slate); }

.jobs-list { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.job-row { display: block; padding: 14px 16px; border-top: 1px solid var(--mist-2); color: inherit; position: relative; }
.job-row:first-child { border-top: 0; }
.job-row:active { background: var(--mist); }
.job-row-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.job-row-time { display: flex; align-items: center; gap: 6px; color: var(--navy); }
.job-row-time svg { width: 17px; height: 17px; color: var(--green); flex: none; }
.job-row-time-copy { display: flex; flex-direction: column; line-height: 1.2; }
.job-row-time-copy strong { font-family: var(--font-head); font-weight: 800; font-size: 1.02rem; }
.job-row-time-copy small { color: var(--slate); font-size: .72rem; font-weight: 500; margin-top: 3px; }
.job-row-customer { font-weight: 700; font-size: 1rem; margin-bottom: 2px; }
.job-row-status { color: var(--slate); font-size: .84rem; margin-bottom: 2px; }
.job-row-address { color: var(--slate); font-size: .84rem; }

.my-day-hero {
  position: relative; isolation: isolate; overflow: hidden; margin-bottom: 12px; padding: 22px 20px 18px;
  border-radius: 18px; color: rgba(255,255,255,.8);
  background: linear-gradient(135deg, #071947 0%, #05379d 64%, #1557de 100%);
  box-shadow: var(--shadow-md);
}
[data-tech-theme="hello-kitty"] .my-day-hero { background: linear-gradient(135deg, #c2185b 0%, #ed3c83 62%, #ff74b5 100%); }
[data-tech-theme="kuromi"] .my-day-hero { background: linear-gradient(135deg, #17101f 0%, #4a2857 62%, #8b48a2 100%); }
.my-day-hero > img {
  position: absolute; z-index: -1; width: 155px; right: 14px; top: 50%;
  opacity: .1; transform: translateY(-50%) rotate(-10deg); pointer-events: none;
}
.my-day-hero > span { display: block; margin-bottom: 5px; font-size: .72rem; font-weight: 700; letter-spacing: .03em; }
.my-day-hero h1 { color: #fff; font-size: 1.5rem; line-height: 1.15; margin-bottom: 4px; }
.my-day-hero p { font-size: .86rem; }
.my-day-hero small { display: block; margin-top: 5px; font-size: .68rem; font-weight: 600; text-align: right; }
.my-day-progress { height: 6px; margin-top: 17px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.2); }
.my-day-progress > div { height: 100%; border-radius: inherit; background: #fff; transition: width .3s ease; }

.my-day-counts {
  display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 22px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--white); box-shadow: var(--shadow-sm);
}
.my-day-counts > div { min-width: 0; padding: 12px 4px 11px; text-align: center; border-left: 1px solid var(--line); }
.my-day-counts > div:first-child { border-left: 0; }
.my-day-counts strong { display: block; color: var(--navy); font-family: var(--font-head); font-size: 1.08rem; line-height: 1.1; }
.my-day-counts span { display: block; margin-top: 4px; color: var(--slate); font-size: .64rem; font-weight: 700; }

.my-day-section { margin-bottom: 22px; }
.my-day-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 10px; padding: 0 2px; }
.my-day-section-head > div { min-width: 0; }
.my-day-section-head h2 { overflow-wrap: anywhere; font-size: 1.02rem; line-height: 1.25; }
.my-day-eyebrow {
  display: block; margin-bottom: 2px; color: var(--slate); font-size: .64rem; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
}

.next-job-card {
  overflow: hidden; padding: 17px; border: 1px solid var(--line); border-radius: 16px;
  background: linear-gradient(145deg, var(--white), var(--mist)); box-shadow: var(--shadow-sm);
}
.next-job-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.next-job-card-head > div { min-width: 0; }
.next-job-card-head h2 { overflow-wrap: anywhere; font-size: 1.05rem; line-height: 1.25; }
.next-job-card-head .chip { flex: none; }
.next-job-time { color: var(--navy); font-family: var(--font-head); font-size: 1.25rem; font-weight: 800; }
.next-job-address { margin-top: 3px; color: var(--slate); font-size: .82rem; }
.missing-info-copy { color: var(--amber); font-weight: 600; }
.next-job-actions { display: flex; align-items: center; gap: 9px; margin-top: 16px; }
.next-job-actions .btn { flex: 1; min-height: 46px; }
.my-day-icon-action {
  display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; flex: none;
  border: 1px solid var(--line); border-radius: 11px; background: var(--white); color: var(--navy);
}
.my-day-icon-action svg { width: 19px; height: 19px; }
.my-day-icon-action:active { background: var(--mist-2); }

.route-clear-card {
  display: flex; align-items: center; gap: 14px; margin-bottom: 22px; padding: 18px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--white); box-shadow: var(--shadow-sm);
}
.route-clear-icon {
  display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; flex: none;
  border-radius: 50%; background: var(--green-bg); color: var(--green);
}
.route-clear-icon svg { width: 21px; height: 21px; }
.route-clear-card h2 { font-size: 1rem; }
.route-clear-card p { color: var(--slate); font-size: .8rem; }

.notice-count { flex: none; color: var(--royal); font-size: .7rem; font-weight: 700; }
.my-day-notice-list, .my-day-route-list { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--white); box-shadow: var(--shadow-sm); }
.my-day-notice { position: relative; padding: 14px 16px; border-top: 1px solid var(--line); }
.my-day-notice:first-child { border-top: 0; }
.my-day-notice.is-unread { background: linear-gradient(90deg, var(--blue-bg), var(--white) 46%); }
.my-day-notice-title-row { display: flex; align-items: center; gap: 7px; }
.my-day-notice h3 { color: var(--ink); font-family: var(--font-body); font-size: .88rem; }
.my-day-notice .notice-rich-text { margin-top: 5px; color: var(--slate); font-size: .78rem; line-height: 1.5; overflow-wrap: anywhere; }
.my-day-notice .notice-rich-text p + p, .my-day-notice .notice-rich-text ul + p, .my-day-notice .notice-rich-text p + ul { margin-top: 7px; }
.my-day-notice .notice-rich-text ul { margin: 5px 0 0 18px; }
.my-day-notice .notice-rich-text li + li { margin-top: 2px; }
.my-day-notice .notice-rich-text a { color: var(--royal); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.my-day-notice .notice-rich-text code { padding: 1px 4px; border-radius: 4px; background: var(--mist-2); color: var(--ink); font-size: .74rem; }
.notice-pin { padding: 2px 6px; border-radius: 999px; background: var(--mist-2); color: var(--royal); font-size: .58rem; font-weight: 800; text-transform: uppercase; }
.my-day-notice-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; color: var(--slate); font-size: .63rem; }
.my-day-notice-actions { display: flex; align-items: center; gap: 10px; }
.my-day-notice-meta button { flex: none; border: 0; background: none; color: var(--royal); font-size: .68rem; font-weight: 700; }
.my-day-notice-meta button[data-dismiss-tech-notice] { color: var(--slate); }

.my-day-text-action { flex: none; padding: 4px 0; border: 0; background: none; color: var(--royal); font-size: .72rem; font-weight: 700; }
.my-day-route-row {
  display: grid; grid-template-columns: 76px minmax(0, 1fr) 18px; align-items: center; gap: 10px;
  width: 100%; padding: 13px 14px; border: 0; border-top: 1px solid var(--line);
  background: var(--white); color: var(--ink); text-align: left;
}
.my-day-route-row:first-child { border-top: 0; }
.my-day-route-row.is-next { background: var(--mist); }
.my-day-route-row:active { background: var(--mist-2); }
.my-day-route-row > svg { width: 18px; height: 18px; color: var(--slate); }
.route-time { color: var(--navy); font-size: .73rem; font-weight: 800; }
.route-customer { min-width: 0; }
.route-customer strong, .route-customer small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route-customer strong { font-size: .84rem; }
.route-customer small { margin-top: 1px; color: var(--slate); font-size: .67rem; text-transform: capitalize; }

@media (prefers-reduced-motion: reduce) {
  .my-day-progress > div { transition: none; }
}

.detail-card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 20px; margin-bottom: 14px;
}
.detail-card h2 { font-size: 1.15rem; margin-bottom: 2px; }
.detail-card .customer-line { color: var(--slate); font-size: .92rem; margin-bottom: 14px; }

.detail-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.detail-card-head-main { min-width: 0; }
.detail-card-head-main h2 { overflow-wrap: break-word; }
.job-header-sched { flex: none; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; text-align: right; padding-top: 11px; }
.job-header-sched strong { font-family: var(--font-head); font-weight: 800; font-size: .96rem; color: var(--navy); white-space: nowrap; }
.job-header-sched small { color: var(--slate); font-size: .72rem; font-weight: 500; margin-top: 3px; white-space: nowrap; }

.quick-actions { display: flex; gap: 10px; margin-bottom: 4px; }
.quick-action {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 8px; border-radius: 12px; background: var(--mist); color: var(--navy);
}
.quick-action svg { width: 21px; height: 21px; }
.quick-action:active { background: var(--mist-2); }
.quick-action-label { font-size: .78rem; font-weight: 700; }
.quick-action-sub { display: flex; align-items: center; gap: 3px; font-size: .72rem; font-weight: 600; color: var(--slate); min-height: 15px; }
.quick-action-sub svg { width: 13px; height: 13px; flex: none; }
.detail-row { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--mist-2); }
.detail-row:first-of-type { border-top: 0; }
.detail-row svg { width: 19px; height: 19px; flex: none; margin-top: 1px; color: var(--slate); }
.detail-row .label { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--slate); margin-bottom: 2px; }
.detail-row .value { font-size: .95rem; }
.detail-row .value a { font-weight: 600; }

.item-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--mist-2); font-size: .9rem; }
.item-row:first-of-type { border-top: 0; }
.item-row .qty { color: var(--slate); }

.card-head-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.link-btn { background: none; border: 0; color: var(--royal); font-weight: 700; font-size: .85rem; padding: 4px; }

.edit-item-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.edit-item-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.edit-item-top strong { font-size: .92rem; }
.edit-item-remove { background: var(--red-bg); color: var(--red); border: 0; border-radius: 8px; width: 28px; height: 28px; font-size: 1.1rem; line-height: 1; flex: none; }
.edit-item-note { margin: 8px 0; }
.edit-item-nums { display: flex; gap: 10px; }
.edit-item-nums > div { flex: 1; }

.picker-item { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 12px 4px; border-top: 1px solid var(--mist-2); text-align: left; background: none; border-left: 0; border-right: 0; border-bottom: 0; }
.picker-item:first-of-type { border-top: 0; }
.picker-item span:last-child { color: var(--slate); font-size: .85rem; }

.edit-items-subtotal { display: flex; justify-content: space-between; font-weight: 700; padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--line); }

.action-row { display: flex; gap: 10px; margin: 6px 0 14px; align-items: flex-start; }
.action-row > .btn { flex: 1; }
.action-row > .job-complete-block { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.status-banner {
  display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px 18px; border-radius: 14px;
  background: var(--white); box-shadow: var(--shadow-sm);
}
.status-banner-icon {
  display: flex; align-items: center; justify-content: center; flex: none;
  width: 34px; height: 34px; border-radius: 50%;
}
.status-banner-icon svg { width: 18px; height: 18px; }
.status-banner-copy { display: flex; flex-direction: column; align-items: center; line-height: 1.3; }
.status-banner-label { font-family: var(--font-head); font-weight: 800; font-size: 1rem; }
.status-banner-sub { font-size: .74rem; font-weight: 500; color: var(--slate); margin-top: 2px; }
.status-banner-completed .status-banner-icon { background: var(--green-bg); color: var(--green); }
.status-banner-completed .status-banner-label { color: var(--green); }
.status-banner-cancelled .status-banner-icon { background: var(--red-bg); color: var(--red); }
.status-banner-cancelled .status-banner-label { color: var(--red); }

.job-invoice-menu { background: var(--white); border-radius: 14px; box-shadow: var(--shadow-sm); overflow: hidden; }
.job-invoice-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 18px; background: none; border: 0; font-weight: 700; font-size: .9rem; color: var(--navy);
}
.job-invoice-toggle:active { background: var(--mist); }
.job-invoice-chevron { width: 18px; height: 18px; flex: none; transition: transform .22s ease; color: var(--slate); }
.job-invoice-toggle.open .job-invoice-chevron { transform: rotate(180deg); }
.job-invoice-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .26s ease; }
.job-invoice-panel.open { grid-template-rows: 1fr; }
.job-invoice-panel-inner { overflow: hidden; min-height: 0; }
.job-invoice-link {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  padding: 12px 18px; border: 0; border-top: 1px solid var(--mist-2);
  background: none; font-weight: 600; font-size: .88rem; color: var(--navy);
}
.job-invoice-link:active { background: var(--mist); }
@media (prefers-reduced-motion: reduce) {
  .job-invoice-panel, .job-invoice-chevron { transition: none; }
}

.payment-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 4px; border-top: 1px solid var(--mist-2);
}
.payment-row:first-child { border-top: 0; }
.payment-row.deleted { opacity: .55; }
.payment-row-main { display: flex; align-items: baseline; gap: 8px; font-weight: 700; }
.payment-row-method { color: var(--navy); font-size: .9rem; }
.payment-row-amount { font-family: var(--font-head); color: var(--navy); }
.payment-row-meta { flex-basis: 100%; color: var(--slate); font-size: .78rem; }
.payment-row.deleted .payment-row-meta { text-decoration: line-through; }
.payment-delete-btn {
  background: var(--red-bg); color: var(--red); border: 0; border-radius: 8px;
  padding: 6px 12px; font-size: .78rem; font-weight: 700; flex: none;
}
.payment-delete-btn:disabled { opacity: .5; }

/* ported from crm.css's invoice document view so a tech sees the real thing, not a stripped-down summary */
.inv-doc.invoice-document {
  --navy: #00297a; --navy-deep: #0a1b4a; --royal: #051aae; --royal-soft: #3a56d4; --periwinkle: #8fa5f5;
  --ink: #1c2333; --slate: #5a6478; --mist: #f4f7fc; --mist-2: #e8eef8; --line: #dbe4f0; --white: #fff;
  --green: #1d9e55; --green-bg: #e6f6ec; --amber: #b07d10; --amber-bg: #fdf3dd;
  --red: #c53030; --red-bg: #fdecec; --purple: #6b46c1; --purple-bg: #f1eafc;
  --blue: #1d4fd7; --blue-bg: #e3ecfd; --teal: #0e6880; --teal-bg: #e0f2f7;
  color-scheme: light; color: var(--ink); background: var(--white);
}
.inv-doc-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding-bottom: 20px; margin-bottom: 24px; border-bottom: 2px solid var(--line);
}
.inv-doc-logo { height: 56px; }
.inv-doc-brand { display: inline-flex; align-items: center; gap: 10px; }
.inv-doc-company-details {
  color: var(--slate); font-size: .6rem; line-height: 1.5;
}
.inv-doc-legal-name {
  color: var(--navy); font-size: .67rem; font-weight: 700;
  letter-spacing: .02em;
}
.inv-doc-head-right { text-align: right; }
.inv-doc-title {
  font-family: var(--font-head); font-size: 1.15rem; font-weight: 800;
  color: var(--navy); letter-spacing: .06em;
}
.inv-doc-number { color: var(--slate); font-size: .84rem; margin: 3px 0 10px; }
.inv-doc-meta {
  display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 24px;
}
.inv-doc-meta h5 {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--slate); margin-bottom: 8px;
}
.inv-doc-meta p { margin: 2px 0; font-size: .88rem; color: var(--ink); }
.inv-doc-meta p .td-sub { font-size: .8rem; }
.inv-doc-meta .td-main { font-weight: 700; color: var(--navy); }
.inv-doc-table { width: 100%; border-collapse: collapse; margin-bottom: 4px; }
.inv-payment-acceptance { margin: 16px 0 10px; }
.inv-payment-acceptance h5 {
  margin: 0 0 5px; color: var(--slate); font-size: .7rem;
  letter-spacing: .05em; text-transform: uppercase;
}
.inv-payment-acceptance p { margin: 0; color: var(--slate); font-size: .72rem; line-height: 1.45; }
.inv-doc-table th {
  text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .03em;
  color: var(--slate); padding: 8px 6px; border-bottom: 1.5px solid var(--line);
}
.inv-doc-table td { padding: 9px 6px; border-bottom: 1px solid var(--mist-2); font-size: .84rem; }
.inv-doc-table th:not(:first-child), .inv-doc-table td:not(:first-child) { text-align: right; }
.inv-doc-table th:first-child, .inv-doc-table td:first-child { padding-left: 0; }
.inv-doc-notes {
  margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line);
}
.inv-doc-notes h5 {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--slate); margin-bottom: 6px;
}
.inv-doc-notes p { font-size: .86rem; color: var(--ink); white-space: pre-wrap; }
.inv-aftercare {
  margin: 20px auto 0; padding: 16px 18px 18px; text-align: center;
  background: linear-gradient(135deg, #f7faff 0%, #edf4ff 100%);
  border: 1px solid #ccdafa; border-radius: 11px;
}
.inv-aftercare-label {
  margin-bottom: 7px; color: #00297a; font-size: .66rem; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase;
}
.inv-doc-notes .inv-default-note { margin: 0 auto; line-height: 1.6; color: #334b72; }
.inv-customer-notes { margin: 0; padding: 0 0 10px; }
.inv-summary {
  margin-top: 16px; margin-left: auto; max-width: 280px;
  background: var(--mist); border: 1px solid var(--line); border-radius: 9px; padding: 12px 16px;
}
.inv-summary > div { display: flex; justify-content: space-between; padding: 4px 0; font-size: .86rem; color: var(--slate); }
.inv-summary .total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; font-size: .98rem; color: var(--navy); }
.inv-summary .total strong { color: var(--royal); font-family: var(--font-head); }

.actions-menu-wrap { position: relative; flex: none; }
.actions-menu-trigger {
  width: 46px; height: 46px; border-radius: 11px; background: var(--mist-2); border: 0; color: var(--navy);
  display: flex; align-items: center; justify-content: center;
}
.actions-menu-trigger svg { width: 20px; height: 20px; }
/* Opening upward dodges the bottom nav, except on the first rows where it'd clip offscreen. */
.actions-menu {
  position: absolute; bottom: calc(100% + 8px); right: 0; min-width: 190px;
  background: var(--white); border-radius: 12px; box-shadow: var(--shadow-md);
  padding: 6px; display: none; z-index: 30;
}
.actions-menu.drop-down { bottom: auto; top: calc(100% + 8px); }
.actions-menu.open { display: block; }
.actions-menu-item {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  padding: 11px 12px; border-radius: 8px; font-size: .9rem; font-weight: 600; color: var(--ink);
}
.actions-menu-item:active { background: var(--mist-2); }
.actions-menu-item.danger { color: var(--red); }

.job-fab {
  position: fixed; left: 50%; transform: translate(-50%, 12px);
  bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 21;
  width: 58px; height: 58px; border-radius: 50%; background: var(--royal); color: #fff; border: 0;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .2s ease, transform .24s ease, visibility 0s linear .24s;
}
.job-fab.is-visible { opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, 0); transition-delay: 0s; }
.job-fab svg { width: 24px; height: 24px; }
.job-fab:active { background: var(--navy); }

.sheet-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: 0;
  padding: 15px 4px; border-top: 1px solid var(--mist-2); font-size: .95rem; font-weight: 600; color: var(--ink);
}
.sheet-item:first-child { border-top: 0; }
.sheet-item:active { background: var(--mist); }
.sheet-item.danger { color: var(--red); }
.sheet-item svg { width: 20px; height: 20px; flex: none; color: var(--slate); }
.sheet-item.danger svg { color: var(--red); }
.sheet-item-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sheet-item-sub { font-size: .74rem; font-weight: 500; color: var(--slate); white-space: normal; }
.sheet-item.disabled { color: var(--slate); }
.sheet-item.disabled svg { color: var(--line); }

.job-tabs { display: flex; gap: 6px; background: var(--mist-2); border-radius: 11px; padding: 4px; margin-bottom: 14px; }
.job-tab { flex: 1; background: none; border: 0; padding: 9px 0; border-radius: 8px; font-weight: 700; font-size: .88rem; color: var(--slate); }
.job-tab.active { background: var(--white); color: var(--royal); box-shadow: var(--shadow-sm); }

#job-tab-content { padding-bottom: 24px; }

.priced-item-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 10px 0; border-top: 1px solid var(--mist-2); }
.priced-item-row:first-of-type { border-top: 0; }
.priced-item-desc { font-size: .92rem; font-weight: 600; }
.priced-item-meta { font-size: .8rem; color: var(--slate); margin-top: 1px; }
.priced-item-total { font-weight: 700; font-size: .92rem; white-space: nowrap; }
.priced-item-total.negative { color: var(--red); }

.items-summary { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); font-size: .92rem; }
.items-summary > div { display: flex; justify-content: space-between; padding: 3px 0; }
.items-summary .discount-row { color: var(--red); }
.items-summary .total-row { font-weight: 800; font-size: 1.02rem; color: var(--navy); padding-top: 6px; margin-top: 4px; border-top: 1px solid var(--line); }
.items-summary .paid-row { color: var(--green); padding-top: 7px; }
.items-summary .balance-row { font-weight: 800; color: var(--navy); }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(10,27,74,.5); z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: var(--white); border-radius: 18px 18px 0 0; box-shadow: var(--shadow-md);
  width: 100%; max-width: 480px; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}
.actions-sheet { animation: actions-sheet-backdrop-in .2s ease-out; }
.actions-sheet .modal { animation: actions-sheet-up .24s cubic-bezier(.22, 1, .36, 1); }
@keyframes actions-sheet-backdrop-in { from { background: rgba(10,27,74,0); } }
@keyframes actions-sheet-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .actions-sheet, .actions-sheet .modal { animation: none; }
  .job-fab { transition: none; }
}
.modal-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { font-size: 1.02rem; }
.modal-close { background: none; border: 0; font-size: 1.5rem; color: var(--slate); line-height: 1; padding: 4px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-body label.fl { display: block; font-weight: 600; font-size: .8rem; color: var(--navy); margin: 12px 0 5px; }
.modal-body label.fl:first-child { margin-top: 0; }
.modal-body input, .modal-body textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: .95rem;
  background: var(--mist); color: var(--ink);
}
.modal-body textarea { resize: vertical; min-height: 70px; }
.modal-check { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; margin-top: 14px; }
.modal-check input { width: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; }
.modal-foot .btn { flex: 1; }

.payment-status-note { border-radius: 10px; padding: 11px 14px; font-size: .86rem; font-weight: 600; margin-bottom: 14px; }
.payment-status-note-good { background: var(--green-bg); color: var(--green); }
.payment-status-note-neutral { background: var(--mist-2); color: var(--navy); }
.payment-status-note-warn { background: var(--amber-bg); color: var(--amber); }

.payment-amount-row {
  display: flex; align-items: center; gap: 4px; background: var(--mist); border-radius: 12px;
  padding: 10px 16px; margin-bottom: 4px;
}
.payment-amount-currency { font-family: var(--font-head); font-weight: 800; font-size: 1.4rem; color: var(--navy); }
.payment-amount-input {
  border: 0 !important; background: none !important; padding: 0 !important; width: 100% !important;
  font-family: var(--font-head); font-weight: 800; font-size: 1.4rem; color: var(--navy);
}
.payment-amount-input:focus { outline: none; }
.payment-card-number-wrap { position: relative; }
.payment-card-number-wrap input { padding-right: 66px !important; }
.payment-card-brand {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--slate);
}
.payment-row-split { display: flex; gap: 10px; }
.payment-row-split > div { flex: 1; }
.payment-disclaimer { color: var(--slate); font-size: .78rem; margin-top: 14px; text-align: center; }

#toast-wrap { position: fixed; bottom: calc(90px + env(safe-area-inset-bottom)); left: 16px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--navy-deep); color: #fff; padding: 13px 16px; border-radius: 11px; font-size: .9rem;
  box-shadow: var(--shadow-md); animation: toast-in .18s ease;
}
.toast.err { background: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.pwa-update-banner, .pwa-install-help {
  position: fixed; z-index: 240; left: 16px; right: 16px; bottom: calc(82px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 9px; width: min(460px, calc(100% - 32px)); margin: 0 auto;
  padding: 13px; border: 1px solid rgba(255,255,255,.16); border-radius: 13px;
  background: var(--navy-deep); color: #fff; box-shadow: var(--shadow-md);
}
.pwa-update-banner > div, .pwa-install-help > div { min-width: 0; flex: 1; }
.pwa-update-banner strong, .pwa-install-help strong { display: block; font-size: .8rem; }
.pwa-update-banner span, .pwa-install-help span { display: block; margin-top: 2px; color: rgba(255,255,255,.72); font-size: .68rem; line-height: 1.35; }
.pwa-update-banner button, .pwa-install-help button {
  min-height: 36px; padding: 7px 10px; flex: none; border: 1px solid rgba(255,255,255,.2); border-radius: 8px;
  background: rgba(255,255,255,.1); color: #fff; font-size: .7rem; font-weight: 700;
}
.pwa-update-banner button.primary { border-color: transparent; background: #fff; color: #071947; }

/* Keep this outside #view; transforming that would make the fixed FAB wander off. */
.swipe-back-hint {
  position: fixed; top: 50%; left: 14px; z-index: 25;
  width: 40px; height: 40px; border-radius: 50%; background: var(--navy-deep); color: #fff;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(-50%) scale(.7); pointer-events: none;
}
.swipe-back-hint svg { width: 20px; height: 20px; }
.swipe-back-hint.releasing { transition: opacity .18s ease, transform .18s ease; }
@media (prefers-reduced-motion: reduce) {
  .swipe-back-hint { display: none; }
}

.performance-head { margin: 2px 2px 17px; }
.performance-head p { color: var(--slate); font-size: .82rem; }
.performance-period-toggle {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: 14px; padding: 4px;
  border-radius: 12px; background: var(--mist-2);
}
.performance-period-toggle button {
  min-height: 40px; padding: 8px 12px; border: 0; border-radius: 9px;
  background: transparent; color: var(--slate); font-size: .8rem; font-weight: 700;
}
.performance-period-toggle button.active { background: var(--white); color: var(--royal); box-shadow: var(--shadow-sm); }
.performance-custom-range {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: -4px 0 14px; padding: 13px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--white); box-shadow: var(--shadow-sm);
}
.performance-custom-range[hidden] { display: none; }
.performance-custom-range label { min-width: 0; color: var(--slate); font-size: .67rem; font-weight: 700; }
.performance-custom-range label span { display: block; margin-bottom: 5px; }
.performance-custom-range input {
  width: 100%; min-width: 0; min-height: 43px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--mist); color: var(--ink); font-size: .78rem;
}
[data-tech-theme="dark"] .performance-custom-range input { color-scheme: dark; }
.performance-custom-range .btn { grid-column: 1 / -1; min-height: 43px; padding: 9px 14px; }
.performance-content { transition: opacity .14s ease; }
.performance-content.is-loading { opacity: .55; }
.performance-loading { display: flex; justify-content: center; padding: 70px 20px; }
.performance-summary {
  position: relative; overflow: hidden; margin-bottom: 12px; padding: 20px;
  border-radius: 17px; color: rgba(255,255,255,.78);
  background: linear-gradient(135deg, #071947 0%, #073aa7 65%, #2361e4 100%); box-shadow: var(--shadow-md);
}
[data-tech-theme="hello-kitty"] .performance-summary { background: linear-gradient(135deg, #c2185b 0%, #ed3c83 65%, #ff74b5 100%); }
[data-tech-theme="kuromi"] .performance-summary { background: linear-gradient(135deg, #17101f 0%, #4a2857 65%, #8b48a2 100%); }
.performance-summary::after {
  content: ''; position: absolute; width: 160px; height: 160px; right: -65px; top: -70px;
  border: 28px solid rgba(255,255,255,.06); border-radius: 50%; pointer-events: none;
}
.performance-kicker { display: block; font-size: .67rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.performance-summary > strong { display: block; margin: 5px 0 0; color: #fff; font-family: var(--font-head); font-size: 2rem; line-height: 1.1; }
.performance-summary > small { display: block; margin-top: 4px; font-size: .68rem; font-weight: 600; }
.performance-summary > p { margin-top: 18px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.18); font-size: .72rem; }
.performance-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.performance-metrics article {
  min-height: 105px; padding: 15px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--white); box-shadow: var(--shadow-sm);
}
.performance-metrics span { display: block; color: var(--slate); font-size: .72rem; font-weight: 700; }
.performance-metrics strong { display: block; margin-top: 13px; color: var(--navy); font-family: var(--font-head); font-size: 1.35rem; line-height: 1.1; overflow-wrap: anywhere; }
.performance-note {
  display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; padding: 13px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--mist); color: var(--slate);
}
.performance-note svg { width: 17px; height: 17px; flex: none; margin-top: 1px; color: var(--royal); }
.performance-note p { font-size: .7rem; line-height: 1.45; }

@media (prefers-reduced-motion: reduce) {
  .performance-content { transition: none; }
}

.tech-settings-page {
  min-height: calc(100dvh - 176px); display: flex; flex-direction: column; gap: 18px;
}
.tech-settings-main { display: grid; gap: 14px; }
.tech-settings-card {
  overflow: hidden; border: 1px solid var(--line); border-radius: 16px;
  background: var(--white); box-shadow: var(--shadow-sm);
}
.tech-settings-card-head { padding: 16px 16px 13px; border-bottom: 1px solid var(--line); }
.tech-settings-card-head > span {
  display: block; margin-bottom: 2px; color: var(--royal); font-size: .63rem; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase;
}
.tech-settings-card-head h2 { font-size: 1rem; }
.settings-theme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 13px; }
.settings-theme-option {
  display: grid; grid-template-columns: 42px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px;
  align-items: center; min-height: 64px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 13px;
  background: var(--mist); color: var(--ink); text-align: left;
}
.settings-theme-option:last-child { grid-column: 1 / -1; }
.settings-theme-option.active { border-color: var(--royal); background: var(--mist-2); box-shadow: inset 0 0 0 1px var(--royal); }
.settings-theme-option strong { align-self: end; color: var(--navy); font-size: .79rem; }
.settings-theme-option small { align-self: start; color: var(--slate); font-size: .62rem; }
.settings-control-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  min-height: 72px; padding: 13px 16px; border-top: 1px solid var(--line);
}
.tech-settings-card-head + .settings-control-row { border-top: 0; }
.settings-control-copy { min-width: 0; }
.settings-control-copy strong { display: block; color: var(--ink); font-size: .82rem; }
.settings-control-copy small { display: block; margin-top: 2px; color: var(--slate); font-size: .66rem; line-height: 1.35; }
.settings-select-row select {
  width: 122px; min-height: 40px; flex: none; padding: 8px 28px 8px 10px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--mist); color: var(--ink); font-size: .78rem; font-weight: 700;
}
.settings-switch { position: relative; width: 46px; height: 26px; flex: none; }
.settings-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.settings-switch > span {
  position: absolute; inset: 0; border-radius: 999px; background: var(--mist-2); box-shadow: inset 0 0 0 1px var(--line);
  transition: background .15s ease, box-shadow .15s ease;
}
.settings-switch > span::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--white); box-shadow: 0 1px 4px rgba(0,0,0,.24); transition: transform .15s ease;
}
.settings-switch input:checked + span { background: var(--royal); box-shadow: none; }
.settings-switch input:checked + span::after { transform: translateX(20px); }
.settings-switch input:focus-visible + span { outline: 3px solid var(--blue-bg); outline-offset: 2px; }
.tech-settings-footer { display: grid; gap: 12px; margin-top: auto; }
.tech-app-info dl { padding: 7px 16px; }
.tech-app-info dl > div { display: flex; justify-content: space-between; gap: 18px; padding: 8px 0; }
.tech-app-info dt { color: var(--slate); font-size: .72rem; }
.tech-app-info dd { max-width: 68%; color: var(--ink); font-size: .72rem; font-weight: 700; overflow-wrap: anywhere; text-align: right; }
.tech-app-info dd.online { color: var(--green); }
.tech-app-info dd.offline { color: var(--red); }
.settings-install-button { width: calc(100% - 26px); margin: 3px 13px 13px; }
.settings-install-button[hidden] { display: none; }
.tech-settings-sign-out { min-height: 48px; }

@media (max-width: 390px) {
  .settings-theme-grid { grid-template-columns: 1fr; }
  .settings-theme-option:last-child { grid-column: auto; }
}

.plan-tech { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 12px; overflow: hidden; }
.plan-tech-head { padding: 12px 16px; background: var(--mist); font-weight: 700; display: flex; justify-content: space-between; }
.plan-job-row { padding: 10px 16px; border-top: 1px solid var(--mist-2); font-size: .88rem; display: flex; justify-content: space-between; gap: 10px; }
.plan-job-row:first-of-type { border-top: 0; }

@media (min-width: 640px) {
  .view { padding: 24px 20px calc(90px + env(safe-area-inset-bottom)); }
}
