:root,
[data-theme="light"] {
  --brand: oklch(0.62 0.14 152);
  --brand-strong: oklch(0.52 0.14 152);
  --brand-soft: oklch(0.95 0.04 152);
  --brand-on: #fff;
  --accent: oklch(0.72 0.16 40);
  --accent-strong: oklch(0.62 0.16 40);
  --accent-soft: oklch(0.96 0.03 40);
  --danger: #dc4d4d;
  --danger-soft: #fcebeb;
  --warning: #e5a02d;
  --warning-soft: #fbf1dd;
  --info: #3b82f6;
  --info-soft: #e6eefe;
  --bg: #fafaf7;
  --bg-elev: #f2f1ec;
  --card: #fff;
  --card-2: #f7f6f2;
  --border: #e8e6e0;
  --border-strong: #d4d2cc;
  --divider: #eeede8;
  --fg: #0f1716;
  --fg-2: #2a3231;
  --fg-muted: #6b736f;
  --fg-faint: #9ca39e;
  --shadow-1: 0 1px 2px rgba(15, 23, 22, 0.04), 0 0 0 1px rgba(15, 23, 22, 0.04);
  --shadow-2: 0 4px 16px rgba(15, 23, 22, 0.06), 0 0 0 1px rgba(15, 23, 22, 0.04);
  --shadow-3: 0 12px 32px rgba(15, 23, 22, 0.08), 0 0 0 1px rgba(15, 23, 22, 0.04);
  --shadow-pop: 0 20px 40px rgba(15, 23, 22, 0.15);
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 999px;
  --primary-50: var(--brand-soft);
  --primary-100: var(--brand-soft);
  --primary-500: var(--brand);
  --primary-600: var(--brand-strong);
  --primary-700: var(--brand-strong);
  --primary-800: var(--brand-strong);
  --accent-50: var(--accent-soft);
  --accent-100: var(--accent-soft);
  --accent-500: var(--accent);
  --accent-600: var(--accent-strong);
  --warn-50: var(--warning-soft);
  --warn-500: var(--warning);
  --danger-50: var(--danger-soft);
  --danger-500: var(--danger);
  --info-50: var(--info-soft);
  --info-500: var(--info);
  --surface-app: var(--bg);
  --surface-card: var(--card);
  --surface-raised: var(--bg-elev);
  --surface-tint: var(--brand-soft);
  --line: var(--border);
  --line-strong: var(--border-strong);
  --text: var(--fg);
  --text-soft: var(--fg-2);
  --muted: var(--fg-muted);
  --faint: var(--fg-faint);
  --shadow: var(--shadow-3);
  --shadow-soft: var(--shadow-2);
  --shadow-brand: 0 18px 40px color-mix(in oklch, var(--brand) 20%, transparent);
  --radius: var(--r-md);
  --radius-sm: var(--r-sm);
  --radius-xs: var(--r-xs);
}

[data-theme="dark"] {
  --brand: oklch(0.72 0.14 152);
  --brand-strong: oklch(0.82 0.13 152);
  --brand-soft: oklch(0.28 0.06 152);
  --accent: oklch(0.78 0.14 40);
  --accent-strong: oklch(0.86 0.13 40);
  --accent-soft: oklch(0.32 0.06 40);
  --danger: #f26b6b;
  --danger-soft: #3a1c1c;
  --warning: #f0b554;
  --warning-soft: #3a2d14;
  --info: #6ba0f8;
  --info-soft: #1b2740;
  --bg: #0e1413;
  --bg-elev: #161d1c;
  --card: #1a2120;
  --card-2: #232a29;
  --border: #2a302e;
  --border-strong: #3a413e;
  --divider: #232a29;
  --fg: #f4f2eb;
  --fg-2: #d8d6d0;
  --fg-muted: #9ca39e;
  --fg-faint: #6b736f;
  --shadow-1: 0 1px 2px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.04);
  --shadow-2: 0 4px 16px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
  --shadow-3: 0 12px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(222, 243, 232, 0.58) 0%, rgba(250, 250, 247, 0.96) 260px),
    var(--surface-app);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

.app-root {
  min-height: 100vh;
}

.boot-screen,
.loading-screen,
.empty-state {
  min-height: 280px;
  display: grid;
  place-items: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 700;
}

.boot-screen {
  min-height: 100vh;
}

.boot-screen img {
  width: 170px;
}

.auth-page {
  --role-solid: var(--brand);
  --role-strong: var(--brand-strong);
  --role-soft: var(--brand-soft);
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(0, 1.35fr);
  background: var(--surface-app);
}

.auth-panel {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 44px clamp(22px, 4vw, 64px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 251, 247, 0.92)),
    var(--surface-card);
  border-right: 1px solid var(--line);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
}

.auth-brand img {
  width: 158px;
  height: auto;
}

.auth-card {
  width: min(100%, 440px);
}

.auth-visual {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  padding: 54px;
  display: flex;
  align-items: flex-end;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(7, 93, 66, 0.97), rgba(15, 23, 22, 0.80)),
    url("/brand-mark.svg") right 12% top 15% / min(42vw, 440px) no-repeat,
    var(--primary-800);
}

.auth-visual-content {
  max-width: 620px;
}

.auth-visual h1 {
  margin: 0 0 14px;
  font-size: clamp(42px, 7vw, 82px);
  line-height: 0.98;
}

.auth-visual p {
  margin: 0;
  max-width: 560px;
  color: rgba(255, 255, 255, 0.8);
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.5;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 18px 0 18px;
}

.tab-btn,
.chip-btn,
.icon-btn,
.btn {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: var(--surface-card);
  color: var(--text);
  font-weight: 800;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.tab-btn:hover,
.chip-btn:hover,
.icon-btn:hover,
.btn:hover {
  transform: translateY(-1px);
}

.tab-btn.active,
.chip-btn.active {
  border-color: var(--primary-500);
  background: var(--primary-100);
  color: var(--primary-800);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 16px;
  white-space: nowrap;
}

.btn.primary {
  border-color: var(--primary-500);
  background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
  color: #fff;
  box-shadow: var(--shadow-brand);
}

.btn.accent {
  border-color: var(--accent-500);
  background: var(--accent-500);
  color: #fff;
}

.btn.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text);
}

.btn.soft {
  border-color: var(--primary-100);
  background: var(--primary-50);
  color: var(--primary-800);
}

.btn.danger {
  border-color: var(--danger-500);
  background: var(--danger-500);
  color: #fff;
}

.btn.warn {
  border-color: var(--warn-500);
  background: var(--warn-50);
  color: #81540c;
}

.btn.full {
  width: 100%;
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  color: var(--text-soft);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 251, 247, 0.96)),
    var(--surface-card);
  border-right: 1px solid var(--line);
}

.side-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 8px 10px;
}

.side-brand img {
  width: 142px;
}

.role-pill,
.status-pill,
.tag,
.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid transparent;
}

.role-pill {
  background: var(--primary-50);
  color: var(--primary-800);
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 13px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.nav-link:hover,
.nav-link.active {
  background: linear-gradient(135deg, var(--primary-50), #ffffff);
  color: var(--primary-800);
  box-shadow: 0 8px 20px rgba(26, 167, 122, 0.10);
}

.nav-icon {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 32px;
  border-radius: 10px;
  background: rgba(26, 167, 122, 0.09);
  color: inherit;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
}

.nav-link.active .nav-icon,
.nav-link:hover .nav-icon {
  background: var(--primary-500);
  color: #fff;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 14px clamp(16px, 3vw, 34px);
  background: rgba(250, 250, 247, 0.84);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.top-title {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.top-title h1,
.section-title h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.1;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.content {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: 22px clamp(14px, 3vw, 34px) 38px;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid.five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.75fr);
  gap: 16px;
  align-items: start;
}

.card,
.panel,
.metric-card,
.list-row {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.card,
.panel,
.metric-card {
  position: relative;
}

.metric-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  border-top: 3px solid rgba(26, 167, 122, 0.28);
}

.card,
.panel {
  padding: 18px;
}

.metric-card {
  min-height: 104px;
  padding: 16px;
}

.metric-card .label,
.field label,
.mini-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  font-size: 30px;
  line-height: 1;
}

.metric-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.hero-band {
  display: grid;
  gap: 18px;
  padding: clamp(20px, 3vw, 30px);
  color: #fff;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(8, 115, 79, 0.97), rgba(15, 23, 22, 0.84)),
    url("/brand-mark.svg") right 24px center / 172px no-repeat,
    var(--primary-800);
  box-shadow: var(--shadow);
}

.hero-band h2 {
  margin: 0;
  max-width: 560px;
  font-size: clamp(24px, 3.2vw, 38px);
  line-height: 1.05;
}

.hero-band p {
  margin: 0;
  max-width: 620px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.55;
}

.hero-actions,
.actions,
.inline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 22px 0 12px;
}

.section-title p {
  margin: 6px 0 0;
  color: var(--muted);
}

.list {
  display: grid;
  gap: 10px;
}

.list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 14px;
}

.list-row.active-row {
  border-radius: var(--radius-sm);
  background: var(--primary-50);
  box-shadow: inset 0 0 0 1px var(--primary-100);
}

.row-title {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
}

.row-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.avatar-line {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 12px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--primary-100);
  color: var(--primary-800);
  font-weight: 900;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.status-pill.ok {
  background: var(--primary-50);
  color: var(--primary-800);
  border-color: var(--primary-100);
}

.status-pill.warn {
  background: var(--warn-50);
  color: #8a5b11;
  border-color: #efd99b;
}

.status-pill.danger {
  background: var(--danger-50);
  color: #9f1f2b;
  border-color: #f4c7c7;
}

.status-pill.info {
  background: var(--info-50);
  color: #1d4ed8;
  border-color: #bfd3ff;
}

.tag {
  background: var(--surface-raised);
  color: var(--text-soft);
  border-color: var(--line);
}

.tag.green {
  background: var(--primary-50);
  color: var(--primary-800);
}

.tag.orange {
  background: var(--accent-50);
  color: var(--accent-600);
}

.tag.blue {
  background: var(--info-50);
  color: #1d4ed8;
}

.form {
  display: grid;
  gap: 12px;
}

.form.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  min-width: 0;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  padding: 10px 12px;
  color: var(--text);
  background: var(--surface-card);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(26, 167, 122, 0.12);
}

.check-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  color: var(--text-soft);
  font-weight: 800;
}

.check-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-600);
}

.wide {
  grid-column: 1 / -1;
}

.search-location-row {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: var(--surface-raised);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 800;
}

.search-location-row span {
  min-width: 0;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-card);
}

table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  background: #fbfbf8;
}

tr:last-child td {
  border-bottom: 0;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 16px;
  align-items: start;
}

.message-list {
  height: min(56vh, 560px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-app);
}

.message {
  max-width: min(72%, 540px);
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface-card);
  border: 1px solid var(--line);
}

.message.own {
  margin-left: auto;
  color: #fff;
  background: var(--primary-600);
  border-color: var(--primary-600);
}

.message strong {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
}

.message p {
  margin: 0;
  line-height: 1.45;
}

.message time {
  display: block;
  margin-top: 6px;
  opacity: 0.72;
  font-size: 11px;
}

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

.category-tile {
  min-height: 124px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 251, 247, 0.96)),
    var(--surface-card);
  box-shadow: var(--shadow-soft);
  text-align: left;
  overflow: hidden;
}

.category-tile:hover {
  border-color: rgba(26, 167, 122, 0.40);
  box-shadow: var(--shadow-brand);
}

.category-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--primary-100);
  color: var(--primary-800);
  font-size: 18px;
  font-weight: 900;
}

.category-icon img {
  width: 27px;
  height: 27px;
  object-fit: contain;
}

.category-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.category-icon.fallback {
  background: linear-gradient(135deg, var(--primary-100), #ffffff);
  border: 1px solid var(--primary-100);
}

.category-tile strong {
  font-size: 15px;
  margin-top: 12px;
}

.category-tile span {
  color: var(--muted);
  font-size: 12px;
}

.notice {
  padding: 12px 14px;
  border: 1px solid var(--primary-100);
  border-radius: var(--radius);
  background: var(--primary-50);
  color: var(--primary-800);
  font-size: 13px;
  font-weight: 800;
}

.notice.warn {
  border-color: #efd99b;
  background: var(--warn-50);
  color: #81540c;
}

.auth-required {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.auth-required h2 {
  margin: 0 0 6px;
  font-size: 24px;
}

.auth-required p:last-child {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.map-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-card);
  box-shadow: var(--shadow-soft);
}

.map-head {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.map-head strong {
  font-size: 14px;
}

.map-head span {
  color: var(--muted);
  font-size: 12px;
}

.map-canvas {
  width: 100%;
  height: 340px;
  background: var(--surface-raised);
}

.map-canvas.compact {
  height: 260px;
}

.map-canvas.tall {
  height: 440px;
}

.map-roster {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, var(--surface-tint));
}

.map-profile-chip {
  min-width: 190px;
  max-width: 260px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  box-shadow: var(--shadow-soft);
  text-align: left;
}

.map-profile-chip:hover {
  border-color: rgba(26, 167, 122, 0.42);
  box-shadow: var(--shadow-brand);
}

.map-profile-pin,
.map-profile-marker span,
.map-popup-index {
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary-600);
  color: #fff;
  font-weight: 900;
}

.map-profile-pin {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  font-size: 13px;
}

.map-profile-chip span:last-child {
  min-width: 0;
}

.map-profile-chip strong,
.map-profile-chip small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-profile-chip strong {
  color: var(--text);
  font-size: 13px;
}

.map-profile-chip small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.map-profile-marker {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(15, 23, 22, 0.24);
}

.map-profile-marker span {
  width: 34px;
  height: 34px;
  border: 4px solid #fff;
  font-size: 13px;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  color: var(--primary-800);
  background: var(--primary-50);
  border: 1px solid var(--primary-100);
  font-size: 12px;
  font-weight: 900;
}

.live-badge i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-500);
  box-shadow: 0 0 0 6px rgba(26, 167, 122, 0.13);
}

.live-badge.warn {
  color: #81540c;
  background: var(--warn-50);
  border-color: #efd99b;
}

.live-badge.warn i {
  background: var(--warn-500);
  box-shadow: 0 0 0 6px rgba(229, 160, 45, 0.13);
}

.tracking-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border-top: 1px solid var(--line);
  background: var(--line);
}

.tracking-metrics div {
  display: grid;
  gap: 4px;
  padding: 12px;
  background: var(--surface-card);
}

.tracking-metrics span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.tracking-metrics strong {
  color: var(--text);
  font-size: 16px;
}

.live-marker {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(15, 23, 22, 0.22);
}

.live-marker span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: var(--primary-600);
}

.live-marker.customer span {
  background: #4f46e5;
}

.map-empty {
  height: 260px;
  display: grid;
  place-items: center;
  padding: 18px;
  color: var(--muted);
  text-align: center;
  background: var(--surface-raised);
}

.leaflet-container {
  font: inherit;
}

.map-marker-popup strong {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.map-popup-index {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  font-size: 11px;
}

.map-marker-popup span {
  color: var(--muted);
  font-size: 12px;
}

.map-popup-profile {
  display: inline-flex;
  margin-top: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--primary-800);
  background: var(--primary-50);
  font-weight: 900;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  max-width: min(420px, calc(100vw - 32px));
  min-height: 48px;
  display: none;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--text);
  box-shadow: var(--shadow);
  font-weight: 800;
}

.toast.show {
  display: flex;
}

.toast.error {
  background: #a61f2c;
}

.toast.success {
  background: var(--primary-700);
}

.mobile-nav {
  display: none;
}

@media (max-width: 980px) {
  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    min-height: auto;
    border-right: 0;
    padding-top: 30px;
  }

  .auth-visual {
    min-height: 320px;
    padding: 26px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .mobile-nav {
    position: sticky;
    top: 72px;
    z-index: 14;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 14px;
    background: rgba(250, 250, 247, 0.96);
    border-bottom: 1px solid var(--line);
  }

  .mobile-nav .nav-link {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 12px;
  }

  .mobile-nav .nav-icon {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }

  .mobile-nav .nav-icon svg {
    width: 16px;
    height: 16px;
  }

  .dashboard-grid,
  .split,
  .grid.two,
  .grid.three,
  .grid.four,
  .grid.five,
  .form.two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    min-height: auto;
  }

  .top-actions,
  .hero-actions,
  .actions,
  .inline-actions {
    width: 100%;
  }

  .top-actions .btn,
  .hero-actions .btn,
  .actions .btn {
    flex: 1 1 150px;
  }

  .content {
    padding-inline: 12px;
  }

  .auth-required,
  .tracking-metrics {
    grid-template-columns: 1fr;
  }

  .auth-required {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-band {
    background:
      linear-gradient(135deg, rgba(8, 115, 79, 0.96), rgba(15, 23, 22, 0.86)),
      var(--primary-800);
  }

  .list-row {
    grid-template-columns: 1fr;
  }

  .message {
    max-width: 92%;
  }
}

/* Redesign layer from UsTap.zip web design */
.app-shell {
  --role-solid: var(--brand);
  --role-strong: var(--brand-strong);
  --role-soft: var(--brand-soft);
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font, Inter, -apple-system, BlinkMacSystemFont, system-ui, sans-serif);
  -webkit-font-smoothing: antialiased;
}

.app-shell.master {
  --role-solid: var(--accent);
  --role-strong: var(--accent-strong);
  --role-soft: var(--accent-soft);
}

.app-shell.admin {
  --role-solid: var(--fg);
  --role-strong: var(--fg);
  --role-soft: var(--bg-elev);
}

.sidebar {
  width: 248px;
  gap: 0;
  padding: 0;
  background: var(--card);
  border-right: 1px solid var(--border);
  box-shadow: none;
}

.side-brand {
  justify-content: flex-start;
  gap: 11px;
  min-height: 66px;
  padding: 18px 18px 14px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(150deg, var(--brand), var(--brand-strong));
  box-shadow: 0 2px 8px color-mix(in oklch, var(--brand) 40%, transparent);
}

.brand-mark svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.side-brand strong {
  display: block;
  font-size: 17px;
  line-height: 1;
  letter-spacing: -0.03em;
}

.side-brand span:not(.brand-mark) {
  display: block;
  margin-top: 3px;
  color: var(--role-strong);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-list {
  flex: 1;
  overflow-y: auto;
  gap: 2px;
  padding: 6px 12px;
}

.nav-link {
  position: relative;
  min-height: 38px;
  gap: 11px;
  margin-bottom: 2px;
  padding: 0 11px;
  border-radius: var(--r-sm);
  color: var(--fg-2);
  font-size: 14px;
  font-weight: 600;
}

.nav-link::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  width: 3px;
  height: 0;
  border-radius: 3px;
  background: var(--role-solid);
  transform: translateY(-50%);
  transition: height 150ms ease;
}

.nav-link:hover,
.nav-link.active {
  background: var(--role-soft);
  color: var(--role-strong);
  box-shadow: none;
}

.nav-link.active::before {
  height: 20px;
}

.nav-icon {
  width: auto;
  height: auto;
  flex: 0 0 auto;
  border-radius: 0;
  background: transparent;
  color: var(--fg-muted);
}

.nav-link.active .nav-icon,
.nav-link:hover .nav-icon {
  background: transparent;
  color: var(--role-strong);
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--divider);
}

.guest-card,
.user-card {
  border-radius: var(--r-md);
  background: var(--role-soft);
}

.guest-card {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.guest-card strong {
  color: var(--role-strong);
  font-size: 13px;
}

.guest-card span {
  color: var(--fg-2);
  font-size: 11.5px;
  line-height: 1.45;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  cursor: pointer;
}

.user-card strong,
.user-card span {
  display: block;
}

.user-card strong {
  max-width: 125px;
  overflow: hidden;
  color: var(--fg);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-card span {
  color: var(--fg-muted);
  font-size: 11px;
}

.user-card-icon {
  margin-left: auto;
  color: var(--fg-faint);
}

.user-card-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.main {
  min-height: 100vh;
  background: var(--bg);
}

.topbar {
  min-height: 62px;
  padding: 0 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  backdrop-filter: none;
}

.eyebrow {
  margin: 2px 0 0;
  color: var(--fg-muted);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.top-title {
  display: flex;
  flex-direction: column-reverse;
  gap: 1px;
}

.top-title h1 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.top-actions {
  gap: 8px;
}

.top-avatar {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  background: var(--bg-elev);
  color: var(--fg-2);
  font-size: 13px;
  font-weight: 700;
}

.top-avatar .avatar {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.theme-toggle {
  font-size: 17px;
}

.content {
  width: 100%;
  max-width: none;
  padding: 24px 28px;
}

.content.full-bleed {
  padding: 0;
}

.btn,
.tab-btn,
.chip-btn,
.icon-btn {
  border-color: var(--border);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--fg);
  font-weight: 700;
  box-shadow: none;
}

.btn {
  min-height: 38px;
  padding: 0 14px;
}

.btn:hover,
.tab-btn:hover,
.chip-btn:hover,
.icon-btn:hover {
  transform: none;
  border-color: var(--border-strong);
}

.btn.primary {
  border-color: var(--role-solid);
  background: var(--role-solid);
  color: #fff;
  box-shadow: none;
}

.btn.soft,
.tab-btn.active,
.chip-btn.active {
  border-color: transparent;
  background: var(--role-soft);
  color: var(--role-strong);
}

.btn.ghost {
  color: var(--fg-2);
}

.card,
.panel,
.metric-card,
.list-row,
.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: none;
}

.metric-card::after {
  display: none;
}

.metric-card strong {
  color: var(--fg);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.metric-card .label,
.field label,
.mini-label {
  color: var(--fg-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.field input,
.field textarea,
.field select {
  border-color: var(--border);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--fg);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--fg-faint);
}

.hero-band {
  min-height: 220px;
  padding: 34px 36px;
  border-radius: var(--r-lg);
  background:
    radial-gradient(circle at 82% 8%, rgba(255,255,255,0.12), transparent 32%),
    linear-gradient(125deg, var(--brand), var(--brand-strong) 62%, var(--brand-strong));
  box-shadow: none;
}

.hero-band h2 {
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hero-search {
  width: min(100%, 560px);
  display: flex;
  gap: 10px;
}

.hero-search input {
  flex: 1;
  min-width: 0;
  min-height: 50px;
  border: 0;
  border-radius: var(--r-md);
  padding: 0 16px;
  background: #fff;
  color: #0f1716;
  font-size: 15px;
  outline: none;
}

.hero-search .btn {
  min-height: 50px;
  border-color: #0f1716;
  background: #0f1716;
  color: #fafaf7;
}

.category-tile {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: none;
}

.category-icon {
  background: color-mix(in oklch, var(--brand) 14%, var(--card));
}

.search-shell {
  height: calc(100vh - 62px);
  display: grid;
  grid-template-columns: 248px minmax(340px, 392px) minmax(360px, 1fr);
  overflow: hidden;
  background: var(--bg);
}

.search-filters {
  overflow-y: auto;
  padding: 18px;
  border-right: 1px solid var(--border);
  background: var(--card);
}

.search-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.search-filter-head strong,
.search-results-head strong {
  font-size: 14.5px;
  font-weight: 800;
}

.search-filter-head button {
  color: var(--role-strong);
  font-size: 12px;
  font-weight: 700;
}

.search-filters .field {
  margin-bottom: 14px;
}

.search-filters .check-field {
  min-height: 34px;
}

.search-location-row {
  min-height: auto;
  display: grid;
  gap: 9px;
  margin: 2px 0 14px;
  padding: 10px;
  border-color: var(--border);
  background: var(--bg-elev);
  font-size: 12px;
}

.search-location-row .btn {
  width: 100%;
  min-height: 36px;
}

.search-results {
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--bg);
}

.search-results-head {
  min-height: 65px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--divider);
  background: var(--card);
}

.search-results-head span {
  display: block;
  margin-top: 2px;
  color: var(--fg-muted);
  font-size: 11.5px;
}

.search-result-list {
  flex: 1;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
}

.master-result {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--card);
}

.master-result.featured {
  border-color: var(--role-solid);
  box-shadow: 0 0 0 3px var(--role-soft);
}

.result-avatar {
  position: relative;
}

.result-avatar .avatar {
  width: 54px;
  height: 54px;
}

.result-rank {
  position: absolute;
  top: -4px;
  left: -4px;
  z-index: 1;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--role-solid);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.result-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.result-title strong {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--fg-faint);
}

.dot.online {
  background: var(--brand);
}

.result-sub {
  display: block;
  margin-top: 2px;
  color: var(--fg-muted);
  font-size: 12px;
}

.result-meta {
  display: flex;
  gap: 10px;
  margin-top: 7px;
  color: var(--fg-muted);
  font-size: 12px;
}

.result-meta span:first-child {
  color: var(--fg);
  font-weight: 800;
}

.result-actions {
  display: grid;
  gap: 7px;
}

.result-actions .btn {
  min-height: 32px;
  padding: 0 11px;
  font-size: 12px;
}

.search-map-pane {
  min-width: 0;
  position: relative;
  overflow: hidden;
}

.search-map-pane .map-card {
  height: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.search-map-pane .map-canvas.search {
  height: calc(100vh - 62px - 49px);
}

.map-card {
  border-color: var(--border);
  background: var(--card);
  box-shadow: none;
}

.map-head {
  min-height: 49px;
  border-color: var(--divider);
}

.map-profile-chip {
  background: var(--card);
  border-color: var(--border);
  box-shadow: var(--shadow-1);
}

[data-theme="dark"] .leaflet-tile {
  filter: brightness(0.72) saturate(0.75) contrast(1.08);
}

.auth-page[data-theme="dark"] {
  background: var(--bg);
}

.auth-page[data-theme="dark"] .auth-panel,
.auth-page[data-theme="dark"] .auth-card {
  background: var(--card);
}

.auth-page[data-theme="dark"] .auth-visual {
  background:
    linear-gradient(135deg, color-mix(in oklch, var(--brand-strong) 72%, #000), rgba(0, 0, 0, 0.78)),
    url("/brand-mark.svg") right 12% top 15% / min(42vw, 440px) no-repeat,
    var(--bg);
}

.auth-brand {
  justify-content: space-between;
}

@media (max-width: 1180px) {
  .search-shell {
    grid-template-columns: 248px minmax(360px, 1fr);
  }

  .search-map-pane {
    display: none;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .topbar {
    min-height: 62px;
  }

  .mobile-nav {
    top: 62px;
    background: var(--card);
    border-color: var(--border);
  }

  .search-shell {
    height: auto;
    min-height: calc(100vh - 116px);
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .search-filters,
  .search-results {
    border-right: 0;
  }

  .search-result-list {
    overflow: visible;
  }
}

@media (max-width: 620px) {
  .topbar {
    flex-direction: row;
    align-items: center;
    min-height: 62px;
    padding: 0 14px;
  }

  .top-actions {
    width: auto;
  }

  .top-avatar span {
    display: none;
  }

  .content {
    padding: 14px 12px 28px;
  }

  .content.full-bleed {
    padding: 0;
  }

  .hero-band {
    padding: 24px 20px;
  }

  .master-result {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .result-actions {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
  }
}

/* UsTap web screen parity layer */
.ut-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ut-stack.lg {
  gap: 20px;
}

.ut-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ut-row.between {
  justify-content: space-between;
}

.ut-grow {
  flex: 1;
  min-width: 0;
}

.ut-muted {
  color: var(--fg-muted);
}

.ut-faint {
  color: var(--fg-faint);
}

.ut-label {
  color: var(--fg-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ut-panel {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: none;
}

.ut-panel.lg {
  border-radius: var(--r-lg);
}

.ut-panel.soft {
  background: var(--bg-elev);
}

.ut-panel-head {
  min-height: 49px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--divider);
}

.ut-panel-title {
  margin: 0;
  color: var(--fg);
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.ut-panel-sub {
  margin: 2px 0 0;
  color: var(--fg-muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.ut-panel-body {
  padding: 16px;
}

.ut-panel-body.no-pad {
  padding: 0;
}

.ut-divide > * + * {
  border-top: 1px solid var(--divider);
}

.ut-grid {
  display: grid;
  gap: 14px;
}

.ut-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ut-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ut-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ut-grid.eight {
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.ut-layout-rail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}

.ut-order-map-top {
  grid-column: 1 / -1;
}

.ut-order-map-top .map-canvas {
  height: 300px;
}

.ut-layout-left {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.ut-layout-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
  gap: 18px;
  align-items: start;
}

.ut-sticky {
  position: sticky;
  top: 0;
}

.ut-stat-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--card);
}

.ut-stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ut-stat-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: color-mix(in oklch, var(--role-solid) 14%, var(--card));
  color: var(--role-strong);
}

.ut-stat-icon svg,
.ut-badge svg,
.ut-chip svg,
.ut-thread-head svg,
.ut-thread-context svg,
.ut-dashed svg,
.ut-note svg,
.ut-mini-stat svg,
.ut-trust svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.ut-stat-icon svg {
  width: 19px;
  height: 19px;
}

.ut-stat-value {
  margin-top: 12px;
  color: var(--fg);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
}

.ut-stat-label {
  margin-top: 4px;
  color: var(--fg-muted);
  font-size: 12.5px;
}

.ut-stat-sub {
  margin-top: 6px;
  color: var(--fg-faint);
  font-size: 11.5px;
}

.ut-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
}

.ut-delta.down {
  color: var(--danger);
}

.ut-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: max-content;
  min-height: 24px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  background: var(--bg-elev);
  color: var(--fg-muted);
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.ut-badge.sm {
  min-height: 20px;
  padding: 0 7px;
  font-size: 10.5px;
}

.ut-badge.ok,
.ut-badge.green {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.ut-badge.warn,
.ut-badge.orange {
  background: var(--warning-soft);
  color: var(--warning);
}

.ut-badge.danger,
.ut-badge.red {
  background: var(--danger-soft);
  color: var(--danger);
}

.ut-badge.info,
.ut-badge.blue {
  background: var(--info-soft);
  color: var(--info);
}

.ut-badge.accent {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.ut-price {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  color: var(--fg);
  white-space: nowrap;
}

.ut-price strong {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.ut-price small {
  color: var(--fg-muted);
  font-size: 11px;
  font-weight: 800;
}

.ut-seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: var(--r-sm);
  background: var(--bg-elev);
}

.ut-seg button,
.ut-seg a {
  height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border-radius: 7px;
  color: var(--fg-muted);
  font-size: 13px;
  font-weight: 800;
}

.ut-seg .active {
  background: var(--card);
  color: var(--fg);
  box-shadow: var(--shadow-1);
}

.ut-seg small {
  color: var(--role-strong);
  font-size: 11px;
  font-weight: 900;
}

.ut-toggle {
  width: 42px;
  height: 25px;
  display: flex;
  align-items: center;
  padding: 2px;
  border-radius: 999px;
  background: var(--border-strong);
}

.ut-toggle.on {
  justify-content: flex-end;
  background: var(--role-solid);
}

.ut-toggle::before {
  content: "";
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.ut-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ut-chip {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--card);
  color: var(--fg-2);
  font-size: 12.5px;
  font-weight: 800;
}

.ut-chip.active {
  border-color: color-mix(in oklch, var(--role-solid) 28%, transparent);
  background: var(--role-soft);
  color: var(--role-strong);
}

.ut-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ut-field label {
  color: var(--fg-2);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0;
}

.ut-field input,
.ut-field textarea,
.ut-field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--fg);
  padding: 0 12px;
  outline: none;
}

.ut-field textarea {
  min-height: 94px;
  padding-top: 11px;
  resize: vertical;
}

.ut-field input:focus,
.ut-field textarea:focus,
.ut-field select:focus {
  border-color: var(--role-solid);
  box-shadow: 0 0 0 3px var(--role-soft);
}

.ut-field .hint {
  color: var(--fg-muted);
  font-size: 11.5px;
}

.ut-radio-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--card);
  cursor: pointer;
}

.ut-radio-card input {
  width: 18px;
  height: 18px;
  accent-color: var(--role-solid);
}

.ut-radio-card:has(input:checked) {
  border-color: var(--role-solid);
  background: var(--role-soft);
  box-shadow: 0 0 0 3px var(--role-soft);
}

.ut-cover {
  height: 120px;
  background:
    linear-gradient(135deg, color-mix(in oklch, var(--role-solid) 16%, var(--card)), var(--bg-elev)),
    var(--bg-elev);
}

.ut-img-placeholder {
  display: grid;
  place-items: center;
  min-height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(135deg, color-mix(in oklch, var(--role-solid) 10%, var(--card)), var(--bg-elev));
  color: var(--fg-faint);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ut-profile-head {
  padding: 0 22px 20px;
}

.ut-profile-main {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-top: -34px;
}

.ut-profile-main .avatar {
  width: 88px;
  height: 88px;
  border: 4px solid var(--card);
  font-size: 26px;
}

.ut-profile-name {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--fg);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.ut-profile-sub {
  margin-top: 2px;
  color: var(--fg-muted);
  font-size: 13.5px;
}

.ut-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.ut-trust span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 12.5px;
  font-weight: 800;
}

.ut-profile-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--divider);
}

.ut-mini-stat strong {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--fg);
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.ut-mini-stat span {
  display: block;
  margin-top: 2px;
  color: var(--fg-muted);
  font-size: 11.5px;
}

.ut-service-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
}

.profile-service-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--divider);
  overflow-x: auto;
}

.profile-service-tabs button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--fg-muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.profile-service-tabs button.active {
  border-color: color-mix(in oklch, var(--role-solid) 28%, transparent);
  background: var(--role-soft);
  color: var(--role-strong);
}

.profile-service-tabs small {
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--bg-elev);
  color: inherit;
  font-size: 10.5px;
}

.profile-service-group {
  display: none;
}

.profile-service-group.active {
  display: block;
}

.profile-service-heading {
  padding: 12px 16px;
  border-bottom: 1px solid var(--divider);
  color: var(--fg-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ut-service-row h4,
.ut-review h4,
.ut-order-card h4 {
  margin: 0;
  color: var(--fg);
  font-size: 14px;
  font-weight: 800;
}

.ut-service-row p,
.ut-review p,
.ut-order-card p {
  margin: 3px 0 0;
  color: var(--fg-muted);
  font-size: 12px;
  line-height: 1.45;
}

.ut-portfolio {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.ut-portfolio .ut-img-placeholder {
  aspect-ratio: 1;
  border-radius: var(--r-sm);
}

.ut-review {
  padding: 14px 16px;
}

.ut-rail-card {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--card);
  padding: 18px;
}

.ut-rail-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 4px;
}

.ut-rail-price strong {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.ut-rail-price span {
  color: var(--fg-muted);
  font-size: 13px;
  font-weight: 800;
}

.ut-note {
  border: 1px solid color-mix(in oklch, var(--role-solid) 22%, transparent);
  border-radius: var(--r-md);
  background: var(--role-soft);
  color: var(--fg-2);
  padding: 14px;
  font-size: 12.5px;
  line-height: 1.5;
}

.ut-note.accent {
  border-color: color-mix(in oklch, var(--accent) 22%, transparent);
  background: var(--accent-soft);
}

.ut-stepper {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}

.ut-step {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg-faint);
  font-size: 13.5px;
  font-weight: 800;
}

.ut-step i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg-elev);
  color: var(--fg-faint);
  font-style: normal;
  font-size: 13px;
  font-weight: 900;
}

.ut-step.done,
.ut-step.active {
  color: var(--fg);
}

.ut-step.done i {
  background: var(--role-solid);
  color: #fff;
}

.ut-step.active i {
  border: 1.5px solid var(--role-solid);
  background: var(--role-soft);
  color: var(--role-strong);
}

.ut-step-line {
  width: 40px;
  height: 1.5px;
  background: var(--border);
}

.ut-step-line.done {
  background: var(--role-solid);
}

.ut-section-step {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--card);
}

.ut-section-step h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 16px;
  color: var(--fg);
  font-size: 15.5px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.ut-section-step h3 span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--fg);
  color: var(--bg);
  font-size: 12px;
  font-weight: 900;
}

.ut-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ut-summary-row + .ut-summary-row {
  margin-top: 13px;
}

.ut-summary-row span:first-child {
  color: var(--fg-muted);
  font-size: 13px;
}

.ut-summary-row span:last-child {
  color: var(--fg);
  font-size: 13.5px;
  font-weight: 800;
  text-align: right;
}

.ut-address-card,
.ut-order-card,
.ut-job-card {
  padding: 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--card);
}

.ut-address-card.active,
.ut-order-card.active,
.ut-job-card.active {
  border-color: var(--role-solid);
  box-shadow: 0 0 0 3px var(--role-soft);
}

.job-board-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 352px;
  gap: 16px;
  align-items: start;
}

.job-list-panel {
  min-width: 0;
}

.job-list-head {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.job-list-head h2 {
  margin: 0;
  color: var(--fg);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.job-list-head p {
  margin: 3px 0 0;
  color: var(--fg-muted);
  font-size: 12px;
}

.job-list-head > strong {
  min-width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--role-soft);
  color: var(--role-strong);
  font-size: 13px;
}

.job-list-grid,
.job-side-scroll {
  display: grid;
  gap: 10px;
}

.job-side-scroll {
  padding: 12px;
  overflow-y: auto;
}

.job-list-card {
  width: 100%;
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--fg);
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.job-list-card:hover,
.job-list-card.active {
  border-color: var(--role-solid);
  background: color-mix(in oklch, var(--role-solid) 4%, var(--card));
}

.job-list-card.active {
  box-shadow: 0 0 0 3px var(--role-soft);
}

.job-list-top,
.job-list-bottom,
.job-meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.job-list-top,
.job-list-bottom {
  justify-content: space-between;
}

.job-list-top > span:last-child {
  color: var(--fg-faint);
  font-family: JetBrains Mono, ui-monospace, monospace;
  font-size: 10.5px;
}

.job-list-card h3 {
  margin: 0;
  color: var(--fg);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.25;
}

.job-list-card p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--fg-2);
  font-size: 12.5px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.job-meta-line {
  flex-wrap: wrap;
}

.job-meta-line span {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: var(--bg-elev);
  color: var(--fg-muted);
  font-size: 11px;
  font-weight: 700;
}

.job-meta-line svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.job-list-bottom {
  padding-top: 3px;
}

.job-list-bottom strong {
  color: var(--role-strong);
  font-size: 13.5px;
}

.job-list-bottom small {
  color: var(--fg-muted);
  font-size: 11.5px;
  font-weight: 800;
}

.job-create-panel .ut-panel-head {
  align-items: flex-start;
  flex-direction: column;
  gap: 2px;
}

.job-budget-options {
  display: grid;
  gap: 8px;
}

.job-budget-option {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 9px;
  align-items: flex-start;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
}

.job-budget-option:has(input:checked) {
  border-color: var(--role-solid);
  background: var(--role-soft);
}

.job-budget-option input {
  margin-top: 2px;
  accent-color: var(--role-solid);
}

.job-budget-option strong,
.job-category-option strong {
  display: block;
  color: var(--fg);
  font-size: 12.5px;
  font-weight: 900;
  line-height: 1.25;
}

.job-budget-option small,
.job-category-option small {
  display: block;
  margin-top: 2px;
  color: var(--fg-muted);
  font-size: 10.5px;
  line-height: 1.35;
}

.job-budget-max {
  margin-top: 8px;
}

.job-category-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 312px;
  overflow-y: auto;
  padding-right: 2px;
}

.job-category-option {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 62px;
  padding: 8px 26px 8px 8px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card);
  cursor: pointer;
}

.job-category-option:has(input:checked) {
  border-color: var(--role-solid);
  background: var(--role-soft);
}

.job-category-option input {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 14px;
  height: 14px;
  accent-color: var(--role-solid);
}

.job-category-option .category-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 9px;
}

.job-category-option .category-icon svg,
.job-category-option .category-icon img {
  width: 17px;
  height: 17px;
}

.job-detail-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.job-detail-kicker > span:last-child {
  color: var(--fg-muted);
  font-family: JetBrains Mono, ui-monospace, monospace;
  font-size: 12px;
}

.job-detail-title {
  margin: 0;
  color: var(--fg);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.job-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.job-detail-head h2 {
  margin: 10px 0 0;
  color: var(--fg);
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.job-budget-summary {
  min-width: 150px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--role-soft);
  text-align: right;
}

.job-budget-summary strong {
  display: block;
  color: var(--role-strong);
  font-size: 14px;
}

.job-budget-summary span {
  display: block;
  margin-top: 2px;
  color: var(--fg-muted);
  font-size: 10.5px;
  font-weight: 700;
}

.ut-dashed {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-md);
  background: transparent;
  color: var(--fg-2);
  font-size: 13.5px;
  font-weight: 800;
}

.ut-chat-shell,
.ut-orders-shell,
.ut-jobs-shell {
  height: calc(100vh - 54px);
  display: flex;
  overflow: hidden;
  background: var(--bg);
}

.ut-conversations,
.ut-side-list {
  width: 320px;
  flex: 0 0 320px;
  border-right: 1px solid var(--border);
  background: var(--card);
  display: flex;
  flex-direction: column;
}

.ut-side-list.wide {
  width: 400px;
  flex-basis: 400px;
}

.ut-searchbox {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-elev);
  color: var(--fg-faint);
  font-size: 13px;
}

.ut-searchbox svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  fill: currentColor;
}

.ut-conversation,
.ut-list-item {
  width: 100%;
  display: flex;
  gap: 11px;
  padding: 12px 14px;
  border: 0;
  border-left: 3px solid transparent;
  background: transparent;
  color: inherit;
  text-align: left;
}

.ut-conversation {
  align-items: center;
  min-height: 66px;
  border-bottom: 1px solid var(--divider);
}

.ut-conversation:hover {
  background: var(--bg-elev);
}

.ut-conversation.active,
.ut-list-item.active {
  border-left-color: var(--role-solid);
  background: var(--role-soft);
}

.ut-conversation strong,
.ut-list-item strong {
  display: block;
  overflow: hidden;
  color: var(--fg);
  font-size: 13.5px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ut-conversation small,
.ut-list-item small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--fg-muted);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ut-conversation .ut-row.between {
  gap: 10px;
}

.ut-conversation .ut-row.between small {
  flex: 0 0 auto;
  margin-top: 0;
  font-size: 10.5px;
}

.ut-thread {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.ut-thread-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.ut-thread-context {
  margin: 12px 14px 0;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--card);
  display: flex;
  align-items: center;
  gap: 11px;
}

.ut-message-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 22px;
}

.ut-bubble {
  max-width: 62%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 16px 16px 16px 4px;
  background: var(--card);
  color: var(--fg);
  font-size: 13.5px;
  line-height: 1.45;
}

.ut-bubble.own {
  align-self: flex-end;
  border-color: var(--role-solid);
  border-radius: 16px 16px 4px 16px;
  background: var(--role-solid);
  color: #fff;
}

.ut-bubble.image {
  padding: 4px;
  overflow: hidden;
}

.ut-chat-image {
  display: block;
  overflow: hidden;
  border-radius: 14px;
}

.ut-chat-image img {
  display: block;
  width: min(280px, 58vw);
  max-width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: cover;
}

.ut-bubble.image time {
  padding: 0 8px 5px;
}

.ut-bubble strong {
  display: none;
}

.ut-bubble p {
  margin: 0;
}

.ut-bubble time {
  display: block;
  margin-top: 4px;
  opacity: 0.7;
  font-size: 10.5px;
  text-align: right;
}

.ut-chat-compose {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--border);
  background: var(--card);
}

.ut-chat-compose textarea {
  min-height: 44px;
  height: 44px;
  resize: none;
  border-radius: var(--r-pill);
  background: var(--bg-elev);
}

.ut-map-clip {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.ut-map-clip .map-card {
  border: 0;
  border-radius: 0;
}

.ut-map-clip .map-head {
  display: none;
}

.ut-map-clip .map-roster {
  display: none;
}

.ut-timeline {
  position: relative;
}

.ut-timeline-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 13px;
  padding-bottom: 16px;
}

.ut-timeline-row:last-child {
  padding-bottom: 0;
}

.ut-timeline-dot {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  background: var(--card);
  color: #fff;
  position: relative;
}

.ut-timeline-row.done .ut-timeline-dot,
.ut-timeline-row.active .ut-timeline-dot {
  border-color: var(--role-solid);
  background: var(--role-solid);
}

.ut-timeline-dot::after {
  content: "";
  position: absolute;
  top: 18px;
  left: 50%;
  width: 2px;
  height: 28px;
  background: var(--border);
  transform: translateX(-50%);
}

.ut-timeline-row:last-child .ut-timeline-dot::after {
  display: none;
}

.ut-timeline-row.done .ut-timeline-dot::after {
  background: var(--role-solid);
}

.ut-status-hero {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--role-solid), var(--role-strong));
  color: #fff;
}

.ut-status-hero strong {
  display: block;
  margin-top: 4px;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.ut-admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.ut-table {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--card);
}

.ut-table-head,
.ut-table-row {
  display: grid;
  gap: 12px;
  align-items: center;
  padding: 11px 16px;
}

.ut-table-head {
  border-bottom: 1px solid var(--divider);
  background: var(--card-2);
  color: var(--fg-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ut-table-row {
  min-height: 56px;
  color: var(--fg-2);
  font-size: 13.5px;
}

.ut-table-row + .ut-table-row {
  border-top: 1px solid var(--divider);
}

.ut-table-row strong {
  color: var(--fg);
}

.ut-doc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ut-doc-grid .ut-img-placeholder {
  aspect-ratio: 1;
  border-radius: var(--r-sm);
}

.ut-add-tile {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-sm);
  color: var(--fg-muted);
  font-size: 11.5px;
  font-weight: 800;
  text-align: center;
}

@media (max-width: 1220px) {
  .ut-grid.eight {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .job-board-shell,
  .ut-layout-rail,
  .ut-layout-dashboard {
    grid-template-columns: 1fr;
  }

  .ut-sticky {
    position: static;
  }
}

@media (max-width: 980px) {
  .ut-grid.four,
  .ut-grid.three,
  .ut-grid.two,
  .ut-layout-left {
    grid-template-columns: 1fr;
  }

  .ut-chat-shell,
  .ut-orders-shell,
  .ut-jobs-shell {
    height: auto;
    min-height: calc(100vh - 62px);
    flex-direction: column;
    overflow: visible;
  }

  .ut-conversations,
  .ut-side-list,
  .ut-side-list.wide {
    width: 100%;
    flex-basis: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .ut-conversations .ut-scroll,
  .ut-side-list .ut-scroll {
    max-height: 360px;
    overflow-y: auto;
  }

  .ut-message-list {
    min-height: 360px;
  }
}

@media (max-width: 620px) {
  .ut-grid.eight {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .job-category-picker {
    grid-template-columns: 1fr;
  }

  .job-detail-head {
    flex-direction: column;
  }

  .job-budget-summary {
    width: 100%;
    text-align: left;
  }

  .ut-profile-main {
    align-items: flex-start;
    flex-direction: column;
  }

  .ut-profile-main .avatar {
    width: 72px;
    height: 72px;
  }

  .ut-profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ut-stepper {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .ut-step-line {
    display: none;
  }

  .ut-service-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .ut-admin-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .ut-table {
    overflow-x: auto;
  }

  .ut-table-head,
  .ut-table-row {
    min-width: 760px;
  }

  .ut-bubble {
    max-width: 88%;
  }
}

/* Compact web parity layer */
.app-shell {
  grid-template-columns: 196px minmax(0, 1fr);
}

.sidebar {
  width: 196px;
}

.side-brand {
  min-height: 56px;
  padding: 12px 14px 10px;
  gap: 9px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  border-radius: 8px;
}

.brand-mark svg {
  width: 16px;
  height: 16px;
}

.side-brand strong {
  font-size: 14px;
  letter-spacing: 0;
}

.side-brand span:not(.brand-mark) {
  margin-top: 1px;
  font-size: 9px;
}

.nav-list {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  padding: 8px 8px 10px;
  overflow: visible;
}

.nav-link {
  min-height: 32px;
  gap: 9px;
  margin-bottom: 0;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
}

.nav-link::before {
  left: -8px;
  width: 2px;
}

.nav-link.active::before {
  height: 16px;
}

.nav-icon svg {
  width: 15px;
  height: 15px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 8px;
}

.guest-card {
  gap: 6px;
  padding: 10px;
  border-radius: 8px;
}

.guest-card strong,
.user-card strong {
  font-size: 11.5px;
}

.guest-card span,
.user-card span {
  font-size: 10px;
}

.user-card {
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--bg-elev);
}

.user-card .avatar {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 10px;
}

.user-card strong {
  max-width: 98px;
}

.sidebar-footer .btn {
  min-height: 30px;
  font-size: 11.5px;
}

.topbar {
  min-height: 54px;
  padding: 0 18px;
}

.top-title h1 {
  font-size: 15px;
}

.eyebrow {
  font-size: 10.5px;
}

.top-avatar {
  min-height: 32px;
  gap: 6px;
  padding: 0 8px;
  font-size: 12px;
}

.top-avatar .avatar {
  width: 24px;
  height: 24px;
  border-radius: 8px;
}

.content {
  padding: 18px 22px 28px;
}

.btn,
.tab-btn,
.chip-btn {
  min-height: 32px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 12px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  min-height: 32px;
  border-radius: 8px;
}

.theme-toggle {
  font-size: 0;
  color: var(--fg);
}

.theme-glyph {
  width: 16px;
  height: 16px;
  display: block;
  border-radius: 50%;
  background: currentColor;
  box-shadow: inset -6px 0 0 var(--card);
  position: relative;
}

.theme-glyph::before,
.theme-glyph::after {
  content: "";
  position: absolute;
  display: none;
}

.app-shell[data-theme="dark"] .theme-glyph,
.auth-page[data-theme="dark"] .theme-glyph {
  width: 9px;
  height: 9px;
  margin: 3px;
  background: currentColor;
  box-shadow:
    0 -7px 0 -4px currentColor,
    0 7px 0 -4px currentColor,
    7px 0 0 -4px currentColor,
    -7px 0 0 -4px currentColor,
    5px 5px 0 -4px currentColor,
    -5px 5px 0 -4px currentColor,
    5px -5px 0 -4px currentColor,
    -5px -5px 0 -4px currentColor;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: currentColor;
}

.icon-btn.primary {
  border-color: var(--role-solid);
  background: var(--role-solid);
  color: #fff;
}

.hero-band {
  min-height: 176px;
  gap: 12px;
  padding: 26px 28px;
  border-radius: 14px;
}

.hero-band h2 {
  max-width: 560px;
  font-size: clamp(24px, 2.1vw, 30px);
  line-height: 1.08;
}

.hero-band p {
  font-size: 13px;
  line-height: 1.35;
}

.hero-search {
  width: min(100%, 470px);
  gap: 8px;
}

.hero-search input,
.hero-search .btn {
  min-height: 42px;
}

.hero-search input {
  border-radius: 9px;
  padding: 0 13px;
  font-size: 13px;
}

.section-title {
  margin: 18px 0 10px;
}

.section-title h2 {
  font-size: 22px;
}

.section-title p {
  margin-top: 4px;
  font-size: 12px;
}

.ut-grid {
  gap: 10px;
}

.grid {
  gap: 10px;
}

.category-tile {
  min-height: 86px;
  padding: 11px 10px;
  border-radius: 8px;
  gap: 7px;
}

.category-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.category-icon svg,
.category-icon img {
  width: 17px;
  height: 17px;
}

.category-tile strong {
  font-size: 11.5px;
}

.category-tile span {
  font-size: 10px;
}

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

.category-tile {
  --cat-color: var(--role-solid);
  position: relative;
  min-height: 94px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card);
  box-shadow: none;
  text-align: center;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.category-tile:hover {
  border-color: color-mix(in oklch, var(--cat-color) 34%, var(--border));
  background: color-mix(in oklch, var(--cat-color) 4%, var(--card));
}

.category-tile:focus-visible {
  outline: 3px solid color-mix(in oklch, var(--cat-color) 18%, transparent);
  outline-offset: 2px;
}

.category-tile:nth-child(8n + 1) { --cat-color: #3b82f6; }
.category-tile:nth-child(8n + 2) { --cat-color: #e5a02d; }
.category-tile:nth-child(8n + 3) { --cat-color: #1aa77a; }
.category-tile:nth-child(8n + 4) { --cat-color: #f08160; }
.category-tile:nth-child(8n + 5) { --cat-color: #a855f7; }
.category-tile:nth-child(8n + 6) { --cat-color: #06b6d4; }
.category-tile:nth-child(8n + 7) { --cat-color: #334155; }
.category-tile:nth-child(8n + 8) { --cat-color: #15803d; }

.category-icon,
.category-icon.fallback {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 0;
  border-radius: 10px;
  background: color-mix(in oklch, var(--cat-color) 14%, var(--card));
  color: var(--cat-color);
  font-size: 13px;
  font-weight: 900;
}

.category-icon svg,
.category-icon img {
  width: 19px;
  height: 19px;
}

.category-icon img {
  object-fit: contain;
}

.category-tile strong {
  max-width: 100%;
  margin: 0;
  color: var(--fg);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.category-tile span:not(.category-icon) {
  margin: -2px 0 0;
  color: var(--fg-faint);
  font-size: 10.5px;
  font-weight: 600;
}

.category-tile input[type="checkbox"] {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 16px;
  height: 16px;
  accent-color: var(--cat-color);
}

.category-tile:has(input[type="checkbox"]:checked) {
  border-color: color-mix(in oklch, var(--cat-color) 42%, var(--border));
  background: color-mix(in oklch, var(--cat-color) 8%, var(--card));
}

.ut-grid.eight .category-tile {
  min-height: 90px;
}

.card,
.panel,
.metric-card,
.list-row,
.table-wrap,
.ut-panel,
.ut-stat-card {
  border-radius: 10px;
}

.card,
.panel {
  padding: 14px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 11px;
}

.avatar-line {
  gap: 10px;
}

.row-title {
  font-size: 13px;
}

.row-sub {
  margin-top: 2px;
  font-size: 11.5px;
}

.tag,
.role-pill,
.status-pill,
.count-pill {
  min-height: 22px;
  padding: 0 8px;
  font-size: 10.5px;
}

.search-shell {
  height: calc(100vh - 54px);
  grid-template-columns: 218px minmax(300px, 354px) minmax(360px, 1fr);
}

.search-filters {
  padding: 14px;
}

.search-filter-head {
  margin-bottom: 12px;
}

.search-filter-head strong,
.search-results-head strong {
  font-size: 13px;
}

.search-filter-head button,
.search-results-head span {
  font-size: 10.5px;
}

.search-filters .field {
  margin-bottom: 11px;
}

.field label,
.mini-label,
.metric-card .label {
  margin-bottom: 5px;
  font-size: 10px;
  letter-spacing: 0.07em;
}

.field input,
.field textarea,
.field select,
.ut-field input,
.ut-field textarea,
.ut-field select {
  min-height: 36px;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
}

.search-location-row {
  gap: 7px;
  margin-bottom: 11px;
  padding: 9px;
  border-radius: 8px;
  font-size: 11px;
}

.search-location-row .btn {
  min-height: 30px;
}

.check-field,
.search-filters .check-field {
  min-height: 28px;
  gap: 8px;
  font-size: 12px;
}

.check-field input {
  width: 15px;
  height: 15px;
}

.search-results-head {
  min-height: 52px;
  padding: 10px 14px;
}

.search-result-list {
  gap: 8px;
  padding: 10px;
}

.master-result {
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
}

.result-avatar .avatar {
  width: 44px;
  height: 44px;
}

.result-rank {
  width: 18px;
  height: 18px;
  font-size: 10px;
}

.result-title strong {
  font-size: 12.5px;
}

.result-sub,
.result-meta {
  font-size: 11px;
}

.result-meta {
  gap: 7px;
  margin-top: 5px;
}

.result-actions {
  gap: 6px;
}

.result-actions .btn {
  min-height: 28px;
  padding: 0 9px;
  font-size: 11px;
}

.map-head {
  min-height: 42px;
  padding: 8px 12px;
}

.map-head strong {
  font-size: 12.5px;
}

.map-head span {
  font-size: 10.5px;
}

.search-map-pane .map-canvas.search {
  height: calc(100vh - 54px - 42px);
}

.map-roster {
  padding: 8px;
  gap: 6px;
}

.map-profile-chip {
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 8px;
}

.map-profile-pin,
.map-profile-marker span,
.map-popup-index {
  width: 19px;
  height: 19px;
  font-size: 10px;
}

.ut-panel-head {
  min-height: 42px;
  padding: 11px 14px;
}

.ut-panel-title {
  font-size: 13px;
}

.ut-panel-body {
  padding: 14px;
}

.ut-service-row {
  padding: 11px 14px;
}

.profile-service-tabs {
  padding: 10px 14px;
}

.profile-service-tabs button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
}

.ut-layout-rail {
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
}

.ut-layout-left {
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 16px;
}

.ut-layout-dashboard {
  gap: 14px;
}

.app-shell[data-theme="dark"] {
  color-scheme: dark;
}

body:has(.app-shell[data-theme="dark"]),
body:has(.auth-page[data-theme="dark"]) {
  background: #0e1413;
}

.app-shell[data-theme="dark"] .topbar,
.app-shell[data-theme="dark"] .sidebar,
.app-shell[data-theme="dark"] .search-filters,
.app-shell[data-theme="dark"] .search-results-head,
.app-shell[data-theme="dark"] .map-card,
.app-shell[data-theme="dark"] .card,
.app-shell[data-theme="dark"] .panel,
.app-shell[data-theme="dark"] .ut-panel,
.app-shell[data-theme="dark"] .ut-rail-card {
  background: var(--card);
  border-color: var(--border);
}

.app-shell[data-theme="dark"] .main,
.app-shell[data-theme="dark"] .content,
.app-shell[data-theme="dark"] .search-shell,
.app-shell[data-theme="dark"] .search-results {
  background: var(--bg);
}

.app-shell[data-theme="dark"] .hero-search input {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
}

.app-shell[data-theme="dark"] .hero-search .btn {
  border-color: var(--fg);
  background: var(--fg);
  color: var(--bg);
}

.app-shell[data-theme="dark"] .category-icon,
.app-shell[data-theme="dark"] .ut-stat-icon,
.app-shell[data-theme="dark"] .ut-img-placeholder {
  background: color-mix(in oklch, var(--role-solid) 14%, var(--bg-elev));
}

.app-shell[data-theme="dark"] .theme-glyph::after {
  background: transparent;
}

.app-shell[data-theme="dark"] .category-icon,
.app-shell[data-theme="dark"] .category-icon.fallback {
  background: color-mix(in oklch, var(--cat-color) 18%, var(--card));
  color: color-mix(in oklch, var(--cat-color) 78%, #ffffff);
}

.app-shell[data-theme="dark"] .category-tile:hover,
.app-shell[data-theme="dark"] .category-tile:has(input[type="checkbox"]:checked) {
  background: color-mix(in oklch, var(--cat-color) 10%, var(--card));
}

/* Messenger-style chat */
.ut-chat-shell {
  background: var(--card);
}

.ut-conversations {
  width: 340px;
  flex-basis: 340px;
  background: var(--card);
}

.ut-conversations > div:first-child {
  padding: 12px 12px 8px !important;
  border-bottom: 0 !important;
}

.ut-conversations .ut-scroll {
  padding: 4px 8px 12px;
}

.ut-searchbox {
  height: 36px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--bg-elev);
  color: var(--fg-muted);
}

.ut-searchbox svg {
  width: 15px;
  height: 15px;
  max-width: 15px;
  max-height: 15px;
}

.ut-conversation,
.ut-conversation.active {
  min-height: 62px;
  margin: 2px 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
}

.ut-conversation:hover {
  background: var(--bg-elev);
}

.ut-conversation.active {
  background: var(--role-soft);
}

.ut-conversation .avatar,
.ut-thread-head .avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.ut-conversation strong {
  font-size: 13px;
}

.ut-conversation small {
  font-size: 11.5px;
}

.ut-thread {
  background: var(--bg);
}

.ut-thread-head {
  min-height: 56px;
  padding: 0 16px;
  background: var(--card);
}

.ut-thread-head .ut-row {
  gap: 7px;
}

.ut-thread-head .icon-btn {
  border-radius: 50%;
  border-color: transparent;
  background: var(--bg-elev);
  color: var(--role-strong);
}

.ut-thread-context {
  margin: 10px 16px 0;
  border-radius: 12px;
}

.ut-thread .message-list {
  height: auto;
  max-height: none;
  border: 0;
  border-radius: 0;
  background: var(--bg);
}

.ut-bubble {
  max-width: min(64%, 620px);
  border: 0;
  border-radius: 18px 18px 18px 6px;
  background: var(--bg-elev);
}

.ut-bubble.own {
  border: 0;
  border-radius: 18px 18px 6px 18px;
  background: #0084ff;
  color: #fff;
}

.ut-chat-compose {
  padding: 10px 14px;
  gap: 8px;
}

.ut-chat-compose .icon-btn {
  border-radius: 50%;
}

.ut-chat-compose textarea {
  min-height: 38px;
  height: 38px;
  padding-top: 9px;
  border: 0;
  background: var(--bg-elev);
}

.ut-chat-compose .icon-btn.send {
  width: 38px;
  height: 38px;
  min-height: 38px;
  border-radius: var(--r-pill);
  background: #0084ff;
  border-color: #0084ff;
  color: #fff;
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
}

/* Home marketplace master cards */
.home-master-card {
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  box-shadow: none;
}

.home-master-cover {
  position: relative;
  height: 108px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 34%, color-mix(in oklch, var(--brand) 16%, transparent), transparent 38%),
    linear-gradient(180deg, color-mix(in oklch, var(--brand) 7%, var(--card)), var(--card-2));
}

.home-master-avatar {
  position: relative;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 3px solid var(--card);
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-strong);
  box-shadow: 0 12px 26px rgba(15, 23, 22, 0.14);
}

.home-master-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
  z-index: 1;
}

.home-master-avatar svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
  z-index: 0;
}

.home-master-avatar.fallback {
  background:
    linear-gradient(135deg, color-mix(in oklch, var(--brand) 16%, var(--card)), var(--brand-soft));
}

.home-master-status {
  position: absolute;
  top: 9px;
  left: 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(15, 23, 22, 0.62);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.home-master-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fg-faint);
}

.home-master-status.online::before {
  background: #34d399;
}

.home-master-fav {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in oklch, var(--fg) 8%, transparent);
  border-radius: 8px;
  background: color-mix(in oklch, var(--card) 92%, transparent);
  color: var(--fg-2);
}

.home-master-fav svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.home-master-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 11px;
}

.home-master-title {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.home-master-title strong {
  min-width: 0;
  overflow: hidden;
  color: var(--fg);
  font-size: 12.5px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-master-title span {
  width: 14px;
  height: 14px;
  color: var(--brand-strong);
}

.home-master-title svg,
.home-master-meta svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.home-master-body p {
  margin: 3px 0 0;
  color: var(--fg-muted);
  font-size: 11px;
  line-height: 1.35;
}

.home-master-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
  color: var(--fg-muted);
  font-size: 10.8px;
}

.home-master-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.home-master-meta span:first-child {
  color: var(--fg);
  font-weight: 900;
}

.home-master-meta small {
  color: var(--fg-muted);
  font-weight: 600;
}

.home-master-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 11px;
}

.home-master-price {
  min-width: 0;
  color: var(--fg);
  white-space: nowrap;
}

.home-master-price strong {
  font-size: 13px;
  font-weight: 900;
}

.home-master-price span {
  margin-left: 2px;
  color: var(--fg-muted);
  font-size: 10.5px;
  font-weight: 700;
}

.home-master-bottom .btn {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
}

.app-shell[data-theme="dark"] .home-master-card {
  background: var(--card);
  border-color: var(--border);
}

.app-shell[data-theme="dark"] .home-master-cover {
  background:
    radial-gradient(circle at 50% 34%, color-mix(in oklch, var(--brand) 20%, transparent), transparent 38%),
    linear-gradient(180deg, color-mix(in oklch, var(--brand) 10%, var(--card)), var(--bg-elev));
}

.app-shell[data-theme="dark"] .home-master-avatar {
  border-color: var(--card);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
}

.app-shell[data-theme="dark"] .home-master-fav {
  background: color-mix(in oklch, var(--card) 88%, transparent);
  color: var(--fg-2);
}

/* Dark readability and profile map markers */
.app-shell[data-theme="dark"],
.auth-page[data-theme="dark"] {
  --surface-app: var(--bg);
  --surface-card: var(--card);
  --surface-raised: var(--bg-elev);
  --surface-tint: var(--brand-soft);
  --line: var(--border);
  --line-strong: var(--border-strong);
  --text: var(--fg);
  --text-soft: var(--fg-2);
  --muted: var(--fg-muted);
  --faint: var(--fg-faint);
  color: var(--fg);
}

.app-shell[data-theme="dark"] .top-title h1,
.app-shell[data-theme="dark"] .section-title h2,
.app-shell[data-theme="dark"] .row-title,
.app-shell[data-theme="dark"] .result-title strong,
.app-shell[data-theme="dark"] .category-tile strong,
.app-shell[data-theme="dark"] .ut-panel-title,
.app-shell[data-theme="dark"] .ut-service-row h4,
.app-shell[data-theme="dark"] .ut-review h4,
.app-shell[data-theme="dark"] .ut-order-card h4 {
  color: var(--fg);
}

.app-shell[data-theme="dark"] .row-sub,
.app-shell[data-theme="dark"] .section-title p,
.app-shell[data-theme="dark"] .result-sub,
.app-shell[data-theme="dark"] .result-meta,
.app-shell[data-theme="dark"] .category-tile span:not(.category-icon),
.app-shell[data-theme="dark"] .ut-muted {
  color: var(--fg-muted);
}

.app-shell[data-theme="dark"] .card,
.app-shell[data-theme="dark"] .master-result,
.app-shell[data-theme="dark"] .category-tile,
.app-shell[data-theme="dark"] .ut-panel,
.app-shell[data-theme="dark"] .ut-stat-card,
.app-shell[data-theme="dark"] .ut-section-step {
  background: var(--card);
  border-color: var(--border);
  color: var(--fg);
}

.app-shell[data-theme="dark"] .tag,
.app-shell[data-theme="dark"] .ut-badge,
.app-shell[data-theme="dark"] .status-pill {
  color: var(--fg-2);
}

.app-shell[data-theme="dark"] .tag.green,
.app-shell[data-theme="dark"] .ut-badge.green,
.app-shell[data-theme="dark"] .ut-badge.ok {
  color: var(--brand-strong);
}

[data-theme="dark"] .leaflet-tile {
  filter: brightness(0.86) saturate(0.78) contrast(0.96);
}

.map-profile-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  overflow: visible;
  border: 3px solid var(--card);
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-strong);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
  font-size: 12px;
  font-weight: 900;
}

.map-profile-avatar img,
.map-profile-avatar > span {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.map-profile-avatar img {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
}

.map-profile-avatar i {
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--card);
  border-radius: 50%;
  background: var(--brand);
}

.map-profile-marker {
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  overflow: visible !important;
}

.leaflet-container .map-profile-marker,
.leaflet-marker-icon.map-profile-marker {
  width: 44px !important;
  height: 44px !important;
}

.leaflet-container .map-profile-marker img,
.leaflet-container .map-profile-avatar img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: cover !important;
}

.map-profile-marker .map-profile-avatar {
  width: 44px;
  height: 44px;
  border-width: 4px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.34);
}

.map-profile-marker .map-profile-avatar > span {
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 13px;
}

.map-profile-marker .map-profile-avatar.marker-only img {
  display: none !important;
}

.map-profile-chip {
  min-width: 210px;
  background: var(--card);
}

.map-profile-chip .map-profile-avatar {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  border-width: 2px;
  box-shadow: none;
}

.map-profile-chip .map-profile-avatar > span {
  font-size: 10.5px;
}

.map-marker-popup.profile {
  width: 238px;
  max-width: 238px;
}

.map-popup-profile-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.map-popup-profile-head > div {
  min-width: 0;
}

.map-popup-avatar {
  position: relative;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  flex: 0 0 54px;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: 14px;
  background: #def3e8;
  color: #0b8b5e;
  box-shadow: none;
  font-size: 14px;
  font-weight: 900;
}

.map-marker-popup .map-popup-avatar {
  color: #0b8b5e;
  font-size: 14px;
  font-weight: 900;
}

.map-popup-avatar img,
.map-popup-avatar > span {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  display: grid;
  place-items: center;
  border-radius: inherit;
  object-fit: cover !important;
}

.map-popup-avatar > span {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.map-popup-avatar i {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 9px;
  height: 9px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #1aa77a;
}

.map-popup-profile-head strong,
.map-marker-popup > strong {
  display: block;
  margin: 0;
  color: #0f1716;
  font-size: 13.5px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-popup-profile-head > div span,
.map-marker-popup > span {
  display: block;
  margin-top: 2px;
  color: #5d6763;
  font-size: 11.5px;
  line-height: 1.35;
}

.map-popup-profile-head > div span {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.map-popup-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.map-marker-popup .map-popup-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin: 0;
  padding: 0 8px;
  border: 1px solid #dce7e2;
  border-radius: 999px;
  color: #0f1716;
  background: #f5f8f6;
  font-size: 11px;
  font-weight: 900;
}

.map-popup-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.map-popup-actions a {
  color: #0b8b5e;
  font-size: 12px;
  font-weight: 800;
}

.map-popup-actions .map-popup-profile {
  margin-top: 0;
  color: #0b8b5e;
  background: #def3e8;
}

@media (max-width: 1180px) {
  .search-shell {
    grid-template-columns: 218px minmax(320px, 1fr);
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .topbar {
    min-height: 54px;
  }

  .mobile-nav {
    top: 54px;
  }

  .search-shell {
    min-height: calc(100vh - 108px);
  }
}

/* ── Category tile — match design spec ─────────────────────────── */
.app-shell .category-tile {
  border-radius: var(--r-md);
  padding: 16px 12px;
  gap: 9px;
  min-height: unset;
}

.app-shell .category-icon,
.app-shell .category-icon.fallback {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: var(--r-sm);
  background: color-mix(in oklch, var(--cat-color) 14%, var(--card));
  color: var(--cat-color);
  font-size: 15px;
}

.app-shell .category-icon svg,
.app-shell .category-icon img {
  width: 22px;
  height: 22px;
}

.app-shell .category-tile strong {
  font-size: 12.5px;
  font-weight: 600;
  margin: 0;
}

.app-shell .category-tile span:not(.category-icon) {
  font-size: 11px;
  color: var(--fg-faint);
}

/* Dark mode: brighter icon colors for visibility */
.app-shell[data-theme="dark"] .category-icon,
.app-shell[data-theme="dark"] .category-icon.fallback {
  background: color-mix(in oklch, var(--cat-color) 18%, var(--card));
  color: color-mix(in oklch, var(--cat-color) 72%, #fff);
}

/* Dark theme polish: keep the UI dark, but lift panels away from the page. */
.app-shell[data-theme="dark"],
.auth-page[data-theme="dark"] {
  --bg: #101918;
  --bg-elev: #182321;
  --card: #1d2927;
  --card-2: #24312f;
  --border: #33413e;
  --border-strong: #4b5b57;
  --divider: #2d3a37;
  --fg: #f8fbf8;
  --fg-2: #e4ebe6;
  --fg-muted: #b8c5be;
  --fg-faint: #91a099;
  --brand-soft: #173d2b;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(255, 255, 255, 0.04);
  --shadow-2: 0 8px 22px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

body:has(.app-shell[data-theme="dark"]),
body:has(.auth-page[data-theme="dark"]) {
  background:
    radial-gradient(circle at 28% -8%, rgba(58, 155, 103, 0.18), transparent 30%),
    #101918;
}

.app-shell[data-theme="dark"] .main,
.app-shell[data-theme="dark"] .content,
.app-shell[data-theme="dark"] .search-shell,
.app-shell[data-theme="dark"] .search-results {
  background: #101918;
}

.app-shell[data-theme="dark"] .topbar,
.app-shell[data-theme="dark"] .sidebar {
  background: #18211f;
  border-color: #2b3935;
}

.app-shell[data-theme="dark"] .nav-link {
  color: #d7e2dc;
}

.app-shell[data-theme="dark"] .nav-link.active {
  background: #0b4a25;
  color: #ffffff;
}

.app-shell[data-theme="dark"] .sidebar-footer {
  background: linear-gradient(180deg, rgba(20, 30, 28, 0), #151f1d 22%);
}

.app-shell[data-theme="dark"] .hero-band {
  background:
    radial-gradient(circle at 86% 5%, rgba(255, 255, 255, 0.24), transparent 28%),
    linear-gradient(125deg, #48bf74 0%, #6fcf8d 58%, #97e4ac 100%);
  color: #ffffff;
}

.app-shell[data-theme="dark"] .hero-band h2 {
  max-width: 620px;
  color: #ffffff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.22);
}

.app-shell[data-theme="dark"] .hero-band p,
.app-shell[data-theme="dark"] .hero-band .eyebrow {
  color: rgba(255, 255, 255, 0.92);
}

.app-shell[data-theme="dark"] .hero-search input {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #17201f;
  color: #f8fbf8;
}

.app-shell[data-theme="dark"] .hero-search input::placeholder {
  color: #99aaa2;
}

.app-shell[data-theme="dark"] .hero-search .btn {
  border-color: #ffffff;
  background: #ffffff;
  color: #0d1715;
}

.app-shell[data-theme="dark"] .category-tile,
.app-shell[data-theme="dark"] .home-master-card,
.app-shell[data-theme="dark"] .ut-panel,
.app-shell[data-theme="dark"] .ut-section-step,
.app-shell[data-theme="dark"] .card,
.app-shell[data-theme="dark"] .panel {
  background: #1b2624;
  border-color: #33413e;
  box-shadow: var(--shadow-1);
}

.app-shell[data-theme="dark"] .category-tile {
  color: #f8fbf8;
}

.app-shell[data-theme="dark"] .category-tile strong {
  color: #ffffff;
  font-weight: 800;
}

.app-shell[data-theme="dark"] .category-tile span:not(.category-icon) {
  color: #a9bbb2;
}

.app-shell[data-theme="dark"] .category-icon,
.app-shell[data-theme="dark"] .category-icon.fallback {
  background: color-mix(in oklch, var(--cat-color) 24%, #22302d);
  color: color-mix(in oklch, var(--cat-color) 86%, #ffffff);
}

.app-shell[data-theme="dark"] .category-tile:hover {
  background: color-mix(in oklch, var(--cat-color) 12%, #1b2624);
  border-color: color-mix(in oklch, var(--cat-color) 38%, #33413e);
}

.app-shell[data-theme="dark"] .home-master-cover {
  background:
    radial-gradient(circle at 50% 34%, rgba(90, 220, 132, 0.24), transparent 40%),
    linear-gradient(180deg, #21342c, #182421);
  border-bottom: 1px solid #2d3a37;
}

.app-shell[data-theme="dark"] .home-master-body {
  background: #1b2624;
}

.app-shell[data-theme="dark"] .home-master-title strong,
.app-shell[data-theme="dark"] .home-master-price,
.app-shell[data-theme="dark"] .home-master-meta span:first-child {
  color: #ffffff;
}

.app-shell[data-theme="dark"] .home-master-body p,
.app-shell[data-theme="dark"] .home-master-meta,
.app-shell[data-theme="dark"] .home-master-price span,
.app-shell[data-theme="dark"] .section-title p {
  color: #b8c5be;
}

.app-shell[data-theme="dark"] .home-master-status {
  background: rgba(8, 14, 13, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.app-shell[data-theme="dark"] .home-master-fav {
  background: rgba(31, 42, 39, 0.92);
  border-color: #4b5b57;
  color: #f8fbf8;
}

.app-shell[data-theme="dark"] .ut-section-step {
  background: #1b2624;
}
