:root {
  color-scheme: light;
  --app-height: 100vh;
  --bottom-nav-height: 92px;
  --bg: #f7eef1;
  --screen: #fbf5f6;
  --text: #2b1218;
  --muted: #7a6269;
  --line: #ead4dc;
  --primary: #8a1538;
  --primary-dark: #64102a;
  --primary-soft: #f2dce4;
  --white: #fffafb;
  --danger: #d9364f;
  --shadow: 0 24px 70px rgba(92, 12, 39, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

body {
  height: 100%;
  min-height: 100%;
  width: 100%;
  margin: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at top left, rgba(138, 21, 56, 0.2), transparent 34rem),
    linear-gradient(135deg, #f6fcff 0%, var(--bg) 100%);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  overflow: hidden;
}

html.native-app,
html.native-app body {
  width: 100%;
  height: var(--app-height, 100dvh);
  min-height: var(--app-height, 100dvh);
  overflow: hidden;
}

html.native-app body {
  place-items: stretch center;
  background: var(--screen);
}

body.dark {
  color-scheme: dark;
  --bg: #1f0811;
  --screen: #2a1019;
  --text: #fff5f7;
  --muted: #d0aeb9;
  --line: #5a2334;
  --primary: #b62451;
  --primary-dark: #ff9db8;
  --primary-soft: #451426;
  --white: #341420;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

body.booting {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  max-width: 100%;
}

button {
  cursor: pointer;
  white-space: normal;
}

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

.toast-stack {
  position: fixed;
  left: 50%;
  bottom: 86px;
  z-index: 50;
  width: min(92vw, 390px);
  display: grid;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
}

.toast.success {
  border-color: rgba(20, 143, 91, 0.28);
}

.toast.error {
  border-color: rgba(217, 54, 79, 0.38);
  color: var(--danger);
}

body.client-mode .worker-only-row {
  display: none;
}

body.client-mode #profile-view .profile-stats,
body.client-mode #profile-view .level-panel,
body.client-mode #profile-view .rules-panel,
body.client-mode #profile-view .settings-list .setting-row {
  display: none;
}

.trust-strip,
.filter-row,
.service-disclaimer {
  display: none !important;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}

.mode-switch button,
.online-toggle {
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  background: var(--screen);
  color: var(--muted);
  font-weight: 950;
}

.mode-switch button.active {
  background: var(--primary);
  color: white;
}

.worker-status-card,
.driver-order-card,
.empty-state {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}

.worker-access-panel,
.worker-identity-strip,
.worker-active-order,
.worker-detail-block,
.worker-request-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.worker-access-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.worker-access-panel span,
.worker-identity-strip span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.worker-identity-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.worker-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 17px;
  font-weight: 950;
}

.online-toggle {
  min-height: 128px;
  display: grid;
  place-items: center;
  gap: 6px;
  background: var(--muted);
  color: white;
  text-align: center;
}

.online-toggle strong {
  font-size: 34px;
  line-height: 1;
}

.online-toggle.online {
  background: var(--primary);
}

.driver-order-card {
  min-height: 320px;
  align-content: space-between;
}

.driver-order-card h2 {
  margin: 0;
  font-size: 30px;
}

.driver-order-card p {
  margin: 0;
}

.worker-order-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}

.worker-order-tabs button {
  min-height: 44px;
  padding: 7px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.worker-order-tabs button.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.worker-request-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.worker-request-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.worker-request-heading h2,
.worker-request-card p {
  margin: 3px 0 0;
}

.worker-request-heading span,
.worker-request-meta,
.worker-order-state {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.worker-request-heading > strong {
  color: var(--primary);
  font-size: 20px;
}

.worker-request-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.worker-request-meta span {
  padding: 8px;
  border-radius: 6px;
  background: var(--screen);
}

.worker-active-order {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 16px;
  margin-top: 14px;
  overflow-x: hidden;
}

.worker-order-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.worker-order-facts div {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 10px;
  border-radius: 7px;
  background: var(--screen);
}

.worker-order-facts span,
.worker-order-facts strong {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.worker-order-facts span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.worker-comment {
  margin: 0;
  padding: 12px;
  border-left: 4px solid var(--primary);
  background: var(--screen);
}

.worker-primary-actions,
.worker-safety-actions,
.worker-chat-compose {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.worker-primary-actions > :last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.worker-detail-block {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0 12px;
  overflow-x: hidden;
}

#worker-orders-view,
#worker-orders-list,
#worker-active-order > *,
.worker-active-order .panel-heading,
.worker-active-order .panel-heading > *,
.worker-primary-actions,
.worker-safety-actions,
.worker-chat-compose,
.worker-receipt-form,
#worker-receipt-summary {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.worker-active-order .panel-heading {
  flex-wrap: wrap;
}

.worker-active-order .panel-heading h2,
.worker-active-order .panel-heading strong,
.worker-comment,
#worker-receipt-summary {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 560px) {
  .worker-order-facts,
  .worker-primary-actions,
  .worker-safety-actions,
  .worker-chat-compose {
    grid-template-columns: minmax(0, 1fr);
  }

  .worker-primary-actions > :last-child:nth-child(odd) {
    grid-column: auto;
  }

  .worker-chat-compose .chat-attachment-button {
    justify-self: start;
  }
}

.worker-detail-block summary {
  min-height: 52px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 900;
}

.worker-detail-block[open] {
  padding-bottom: 12px;
}

.worker-quick-messages {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.worker-quick-messages button {
  flex: 0 0 auto;
  max-width: 230px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--screen);
  color: var(--text);
  font-weight: 800;
}

.worker-chat-compose {
  margin-top: 8px;
}

.worker-chat-compose input {
  min-width: 0;
}

.chat-message {
  display: grid;
  gap: 3px;
}

.chat-message small {
  opacity: 0.7;
  font-size: 10px;
}

.chat-message.system {
  margin-inline: auto;
  background: var(--screen);
  color: var(--muted);
  text-align: center;
}

.worker-receipt-form,
.worker-settings-grid {
  display: grid;
  gap: 10px;
}

.worker-receipt-form textarea {
  resize: vertical;
}

.worker-settings-grid label:not(.comfort-toggle) {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.worker-review {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--screen);
}

.worker-review span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.worker-review p {
  margin: 0;
}

.worker-payout-row > div:last-child {
  text-align: right;
}

.payment-history-heading {
  margin-top: 8px;
}

.payment-history-item strong {
  overflow-wrap: anywhere;
}

.driver-order-meta,
.driver-actions,
.income-grid {
  display: grid;
  gap: 10px;
}

.driver-order-meta {
  grid-template-columns: repeat(3, 1fr);
}

.driver-order-meta strong,
.income-grid article {
  padding: 12px;
  border-radius: 8px;
  background: var(--screen);
  text-align: center;
}

.driver-actions {
  grid-template-columns: 1fr 1fr;
}

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

.income-grid article {
  display: grid;
  gap: 5px;
  text-align: left;
}

.income-grid span,
.empty-state span,
.online-toggle small,
.driver-order-card > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.online-toggle small {
  color: rgba(255, 255, 255, 0.9);
}

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #fff5f7 0%, #f0d4dd 100%);
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.splash-logo {
  color: var(--primary-dark);
  font-size: 52px;
  font-weight: 950;
  letter-spacing: 0;
}

.splash-logo-image {
  width: 128px;
  height: 128px;
  border-radius: 32px;
  object-fit: contain;
  box-shadow: 0 24px 70px rgba(95, 10, 35, 0.24);
}

.auth-shell {
  width: min(100vw, 430px);
  height: min(var(--app-height, 100dvh), 860px);
  min-height: min(var(--app-height, 100dvh), 640px);
  display: grid;
  align-items: start;
  justify-items: center;
  padding: calc(22px + env(safe-area-inset-top, 0px)) 22px calc(34px + env(safe-area-inset-bottom, 0px));
  background: var(--screen);
  box-shadow: var(--shadow);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-padding-block: calc(24px + env(safe-area-inset-top, 0px)) calc(48px + env(safe-area-inset-bottom, 0px));
}

.legal-page {
  min-height: var(--app-height, 100dvh);
  place-items: start center;
  overflow-y: auto;
}

.legal-page .auth-card,
.legal-page .form-card,
.legal-section {
  min-width: 0;
  max-width: 100%;
}

.legal-page .form-card {
  display: grid;
  gap: 18px;
  overflow-wrap: anywhere;
}

.legal-section {
  display: grid;
  gap: 8px;
}

.legal-section h2,
.legal-section p {
  margin: 0;
}

.auth-card {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding-bottom: 8px;
}

.auth-logo {
  display: block;
  width: 72px;
  height: 72px;
  margin-bottom: 12px;
  border-radius: 20px;
  object-fit: contain;
  box-shadow: 0 18px 42px rgba(95, 10, 35, 0.18);
}

.startup-fallback-card {
  display: grid;
  justify-items: start;
  gap: 14px;
}

.startup-fallback-message {
  width: 100%;
  line-height: 1.45;
  text-align: left;
}

.legal-back {
  min-height: 44px;
  margin-bottom: 16px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--primary);
  color: white;
  font-weight: 900;
}

.auth-copy {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 22px 0 16px;
  padding: 5px;
  border-radius: 8px;
  background: var(--primary-soft);
}

.auth-tab {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--primary-dark);
  font-weight: 900;
}

.auth-tab.active {
  background: var(--white);
  color: var(--text);
}

.auth-form {
  display: none;
  gap: 12px;
}

.auth-form.active {
  display: grid;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.auth-form .consent-row {
  display: flex;
}

.auth-form input {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  background: var(--white);
  color: var(--text);
  outline: none;
}

.auth-form input:focus {
  border-color: var(--primary);
}

.link-action {
  width: max-content;
  min-height: 34px;
  border: 0;
  background: transparent;
  color: var(--primary-dark);
  font-weight: 900;
  padding: 0;
  text-align: left;
}

.social-login-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.code-panel {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--primary-soft);
}

.form-message {
  min-height: 20px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
}

.form-message.success {
  color: var(--primary-dark);
}

.wide-action {
  width: 100%;
}

.phone-shell {
  width: min(100vw, 430px);
  height: min(var(--app-height, 100dvh), 860px);
  min-height: min(var(--app-height, 100dvh), 640px);
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--screen);
  box-shadow: var(--shadow);
  overflow: hidden;
}

html.native-app .phone-shell {
  width: 100vw;
  height: var(--app-height, 100dvh);
  min-height: var(--app-height, 100dvh);
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.app-screen {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  padding: calc(28px + env(safe-area-inset-top, 0px)) 20px calc(20px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: auto;
  scroll-padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px) + 20px);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.top-bar > div {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 32px;
  line-height: 1.05;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

h2 {
  font-size: 21px;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(138, 21, 56, 0.28);
}

.notification-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #8f1d3f;
  color: #fff;
  font-size: 12px;
  line-height: 20px;
  text-align: center;
}

.notification-dialog-card {
  width: min(92vw, 460px);
  max-height: min(78vh, 680px);
  overflow: auto;
}

.chat-message {
  display: grid;
  gap: 4px;
}

.chat-message time {
  color: var(--muted);
  font-size: 12px;
}

.chat-message a {
  color: var(--primary);
  overflow-wrap: anywhere;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.profile-hero,
.order-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #c44167);
  color: white;
}

.profile-hero p,
.order-main p {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.84);
}

.avatar,
.worker-photo {
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.24);
  font-weight: 900;
}

.info-grid,
.route-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0;
}

.profile-stats article {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.profile-stats span,
.level-track span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.profile-stats strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.metric,
.route-card > div {
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.metric span,
.route-card span,
.details-list span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric strong,
.route-card strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.wallet-panel,
.booking-panel,
.chat-panel,
.live-map-card,
.comfort-panel,
.ai-panel,
.compare-panel,
.review-panel,
.payment-summary-panel,
.rules-panel,
.safety-panel,
.estimate-panel,
.safety-actions-panel,
.level-panel {
  display: grid;
  gap: 12px;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  min-width: 0;
}

.payout-account-panel {
  display: grid;
  gap: 12px;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.payout-account-panel .panel-heading strong {
  color: var(--primary-dark);
  text-align: right;
}

.payout-summary {
  margin-top: 0;
}

.level-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.level-track span {
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--screen);
  text-align: center;
}

.level-track span.active {
  background: linear-gradient(135deg, #b8872e, #f2d18a);
  color: #35101d;
}

.trust-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.trust-strip > div,
.safety-grid article,
.estimate-grid > div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  min-width: 0;
}

.trust-strip strong,
.safety-grid strong,
.estimate-grid strong {
  color: var(--text);
  font-size: 14px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.trust-strip span,
.safety-grid span,
.estimate-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  min-width: 0;
  overflow-wrap: anywhere;
}

.safety-grid,
.estimate-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.report-textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--screen);
  color: var(--text);
  font: inherit;
  outline: none;
}

.report-textarea:focus {
  border-color: var(--primary);
}

.ai-log {
  display: grid;
  gap: 8px;
  max-height: 190px;
  overflow-y: auto;
}

.ai-message {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
  min-width: 0;
  overflow-wrap: anywhere;
}

.ai-message.bot {
  justify-self: start;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.ai-message.user {
  justify-self: end;
  background: var(--primary);
  color: white;
}

.ai-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  min-width: 0;
}

.ai-input-row input,
.review-panel input {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--screen);
  color: var(--text);
  outline: none;
  min-width: 0;
}

.ai-input-row .primary-action {
  min-width: 92px;
  max-width: 100%;
  padding-inline: 12px;
  overflow-wrap: anywhere;
}

.service-specific-fields,
.profile-filters {
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.profile-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.profile-filters label {
  min-width: 0;
}

@media (max-width: 560px) {
  .profile-filters {
    grid-template-columns: 1fr;
  }
}

.problem-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.problem-preview img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

.panel-heading h2,
.panel-heading span {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.panel-heading span {
  flex: 0 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
}

.amount-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.amount-row button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 900;
}

.amount-row button.active {
  background: var(--primary);
  color: white;
}

.payment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pay-tile {
  min-height: 74px;
  display: grid;
  align-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--screen);
  color: var(--text);
  text-align: left;
  padding: 12px;
  min-width: 0;
}

.pay-tile strong {
  font-size: 15px;
}

.pay-tile span {
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
}

.topup-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.topup-row input,
.payment-method-row select {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--screen);
  color: var(--text);
  outline: none;
}

.payment-method-row {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.payment-method-row select {
  width: 100%;
}

.rules-panel ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.4;
  font-size: 13px;
  font-weight: 750;
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--screen);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.consent-row input {
  width: 18px;
  height: 18px;
  min-height: auto;
  margin-top: 1px;
  accent-color: var(--primary);
}

.settings-list,
.details-list {
  display: grid;
  gap: 10px;
}

.legal-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  position: relative;
  z-index: 2;
}

.auth-legal-links {
  margin-top: -4px;
}

.legal-links a {
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  line-height: 1.25;
  overflow-wrap: anywhere;
  padding: 8px;
  pointer-events: auto;
  touch-action: manipulation;
}

.compact-list {
  margin-bottom: 16px;
}

.setting-row,
.primary-row,
.danger-row,
.details-list > div {
  min-height: 58px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--text);
  text-align: left;
  min-width: 0;
  overflow-wrap: anywhere;
}

.setting-row > span,
.primary-row > span,
.danger-row > span,
.details-list strong,
.details-list span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.primary-row {
  justify-content: center;
  background: var(--primary);
  color: white;
  border-color: transparent;
  font-weight: 900;
}

.center-row {
  justify-content: center;
  font-weight: 900;
}

.danger-row {
  justify-content: center;
  color: var(--danger);
  font-weight: 800;
}

.select-row select,
.field-grid select {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  background: var(--primary-soft);
  color: var(--text);
  font-weight: 800;
  outline: none;
  min-width: 0;
}

.select-row select {
  max-width: 58%;
}

.toggle-row input {
  position: absolute;
  opacity: 0;
}

.switch {
  width: 48px;
  height: 28px;
  padding: 3px;
  border-radius: 999px;
  background: #b8cfdd;
  transition: background 0.2s ease;
}

.switch::before {
  content: "";
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  transition: transform 0.2s ease;
}

.toggle-row input:checked + .switch {
  background: var(--primary);
}

.toggle-row input:checked + .switch::before {
  transform: translateX(20px);
}

.search-panel {
  padding: 16px;
  border-radius: 8px;
  background: var(--white);
  border: 1px solid var(--line);
}

.search-panel label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.search-panel input {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--primary-soft);
  color: var(--text);
  outline: none;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 12px 0 16px;
}

.filter-row button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.filter-row button.active {
  border-color: transparent;
  background: var(--primary);
  color: white;
}

.worker-form {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding-bottom: calc(112px + env(safe-area-inset-bottom));
}

#worker-form .order-actions,
#worker-submit {
  position: relative;
  z-index: 2;
  pointer-events: auto;
  touch-action: manipulation;
}

body.worker-onboarding-active .bottom-nav {
  display: none;
  pointer-events: none;
}

body.worker-onboarding-active .app-screen {
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

body.worker-onboarding-active #worker-view .order-actions {
  z-index: 60;
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
  background: var(--screen);
}

.avatar-upload {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.avatar-upload input,
.chat-attachment-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

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

.master-avatar img,
.worker-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.chat-attachment-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.specialty-picker {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.specialty-picker legend {
  margin-bottom: 6px;
  font-weight: 900;
}

.specialty-picker > small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.specialty-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.specialty-option {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 54px;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  font-weight: 800;
  line-height: 1.25;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.specialty-option:has(input:checked) {
  border-color: color-mix(in srgb, var(--primary) 80%, black);
  background: color-mix(in srgb, var(--primary) 10%, var(--white));
  box-shadow: inset 0 0 0 1px var(--primary);
}

.specialty-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.specialty-name {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}

.specialty-check {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  color: transparent;
  font-size: 15px;
  line-height: 1;
}

.specialty-option:has(input:checked) .specialty-check {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.specialty-option:focus-within {
  outline: 3px solid color-mix(in srgb, var(--primary) 22%, transparent);
  outline-offset: 2px;
}

@media (max-width: 460px) {
  .specialty-options {
    grid-template-columns: 1fr;
  }

  .specialty-option {
    min-height: 56px;
  }
}

.form-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.form-card h2 {
  margin-bottom: 14px;
}

.form-note {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.field-grid {
  display: grid;
  gap: 12px;
}

.field-grid.one-column {
  grid-template-columns: 1fr;
}

.field-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.field-grid input,
.field-grid select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--screen);
  color: var(--text);
  outline: none;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--screen);
  min-width: 0;
}

.history-item > div {
  min-width: 0;
}

.history-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.history-item strong {
  font-size: 14px;
}

.order-map {
  width: 100%;
  height: 250px;
  min-height: 250px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--screen);
  z-index: 0;
}

.order-map .leaflet-control-attribution {
  font-size: 10px;
}

.elma-map-marker {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.24);
  font-size: 18px;
  font-weight: 950;
}

.elma-map-marker.client {
  background: #221019;
}

.map-message {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
}

.map-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.map-summary > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--screen);
}

.map-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.map-summary strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.route-button {
  min-height: 54px;
}

.comfort-toggle {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--screen);
  color: var(--text);
  font-weight: 800;
}

.comfort-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.prep-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.prep-item {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--screen);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.prep-item.done {
  border-color: transparent;
  background: var(--primary);
  color: white;
}

.trust-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.back-inline {
  width: max-content;
  min-width: 112px;
  padding: 0 18px;
  margin-bottom: 14px;
}

.section-heading {
  margin-bottom: 12px;
}

.masters-list {
  display: grid;
  gap: 12px;
}

.master-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  min-width: 0;
}

.master-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.master-select-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.master-select-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.review-snippet {
  padding: 10px 12px;
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  background: var(--screen);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.compare-grid {
  display: grid;
  gap: 8px;
}

.compare-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--screen);
}

.compare-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.master-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.master-top > div {
  min-width: 0;
}

.master-avatar {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 950;
}

.master-top p,
.master-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.rate-badge {
  color: var(--primary-dark);
  font-weight: 950;
  white-space: nowrap;
  text-align: right;
}

.service-pricing-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.service-price-list {
  display: grid;
  gap: 7px;
  max-height: 360px;
  overflow: auto;
  padding-right: 2px;
}

.service-price-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--screen);
}

.service-price-row span,
.service-price-row strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.service-price-row span {
  color: var(--text);
  font-weight: 850;
}

.service-price-row strong {
  color: var(--primary-dark);
  text-align: right;
  white-space: nowrap;
}

.price-disclaimer {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-dark) !important;
  font-weight: 800;
}

.subservice-list {
  display: grid;
  gap: 8px;
}

.subservice-list > strong {
  font-size: 13px;
  color: var(--text);
}

.subservice-list ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.subservice-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--screen);
  font-size: 12px;
}

.subservice-list span,
.subservice-list strong {
  overflow-wrap: anywhere;
}

.subservice-list li strong {
  color: var(--primary-dark);
  text-align: right;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.portfolio-tile {
  min-height: 74px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

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

.file-drop {
  min-height: 54px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--primary);
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 900;
  text-align: center;
}

.file-drop input {
  display: none;
}

.material-steps {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.material-steps li {
  padding-left: 2px;
  overflow-wrap: anywhere;
}

.receipt-amount-field {
  display: grid;
  gap: 7px;
  font-size: 12px;
  font-weight: 900;
  color: var(--muted);
}

.receipt-amount-field input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--white);
  color: var(--text);
  font-weight: 900;
}

.file-list,
.rates-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.file-pill,
.rate-row {
  min-height: 44px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--screen);
}

.file-pill span,
.rate-row span {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.rate-row small {
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 900;
}

.rate-row input {
  width: 86px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  background: var(--white);
  color: var(--text);
}

.field-grid input:focus,
.field-grid select:focus {
  border-color: var(--primary);
}

.promo-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 18px;
  padding: 16px;
  border-radius: 8px;
  background: #35101d;
  color: white;
}

.promo-band span {
  display: block;
  margin-bottom: 4px;
  color: #f1a9be;
  font-size: 13px;
  font-weight: 800;
}

.promo-band button,
.primary-action {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  background: var(--primary);
  color: white;
  font-weight: 900;
}

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

.service-card {
  min-height: 176px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--text);
  text-align: left;
}

.service-card:hover,
.service-card:focus-visible {
  border-color: var(--primary);
  outline: none;
}

.service-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 21px;
}

.service-card strong {
  font-size: 16px;
  line-height: 1.2;
}

.service-copy {
  display: grid;
  gap: 4px;
}

.service-card span:not(.service-icon),
.service-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.service-price-box {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--primary-soft);
}

.service-price-box b {
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.service-disclaimer {
  color: var(--primary-dark) !important;
  font-size: 10.5px !important;
  line-height: 1.25;
}

.service-meta-row {
  display: grid;
  gap: 4px;
}

.service-meta-row small {
  overflow-wrap: anywhere;
}

.service-card em {
  align-self: end;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 11px;
  font-style: normal;
  font-weight: 950;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

[hidden] {
  display: none !important;
}

.home-address,
.active-order-summary {
  width: 100%;
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--text);
  text-align: left;
}

.home-address span,
.active-order-summary span,
.active-order-summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.home-address strong,
.active-order-summary strong {
  font-size: 17px;
}

.active-order-summary {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.home-search {
  margin: 0 0 12px;
}

.home-search input {
  min-height: 56px;
  font-size: 17px;
}

.booking-step {
  display: grid;
  gap: 4px;
}

.booking-step span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.booking-step strong {
  font-size: 20px;
}

.order-extras {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.order-extras summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  color: var(--primary-dark);
  font-weight: 900;
  cursor: pointer;
}

.compact-heading {
  margin-top: 18px;
}

.compact-heading h2 {
  font-size: 20px;
}

.all-services-button {
  margin-top: 12px;
  margin-bottom: 8px;
  position: relative;
  z-index: 2;
  pointer-events: auto;
  touch-action: manipulation;
}

.materials-short {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

#masters-view .service-pricing-panel,
#masters-view .compare-panel,
#order-view .payment-summary-panel,
#order-view .safety-actions-panel,
#order-view .comfort-panel,
#order-view .details-list,
#order-view .progress-steps,
#order-view .order-card,
#order-view .live-map-card,
#order-view .chat-panel,
#order-view .receipt-panel,
#order-view .review-panel {
  margin-block: 12px;
}

#order-view .route-card {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#order-view .route-card > div {
  min-height: 82px;
}

#order-view .chat-panel {
  grid-template-columns: 1fr auto;
  align-items: end;
}

#order-view .chat-log {
  grid-column: 1 / -1;
}

.primary-action,
.secondary-action,
.danger-action {
  min-height: 48px;
}

.status {
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 900;
}

.details-list {
  margin-top: 12px;
}

.details-list > div {
  display: block;
}

.details-list strong {
  display: block;
  margin-top: 6px;
}

.progress-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.progress-steps span {
  min-height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.progress-steps span.active {
  background: var(--primary);
  color: white;
}

.chat-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.chat-panel input {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--screen);
  color: var(--text);
  outline: none;
}

.chat-log {
  display: grid;
  gap: 7px;
}

.chat-message {
  justify-self: end;
  max-width: 86%;
  padding: 9px 11px;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-size: 13px;
  font-weight: 700;
}

.worker-active-order .chat-message.bot {
  justify-self: start;
  background: var(--screen);
  color: var(--text);
}

.worker-active-order .chat-message.system {
  justify-self: center;
  max-width: 100%;
  background: var(--screen);
  color: var(--muted);
}

.worker-receipt-form input,
.worker-receipt-form textarea,
.worker-settings-grid input,
.worker-chat-compose input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--screen);
  color: var(--text);
  font: inherit;
}

.stars {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.stars button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 22px;
}

.stars button.active {
  background: var(--primary);
  color: white;
}

.order-actions,
.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.secondary-action,
.danger-action {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  font-weight: 900;
}

.secondary-action {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.danger-action {
  background: var(--danger);
  color: white;
}

.bottom-nav {
  flex: 0 0 auto;
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  min-height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: rgba(243, 248, 251, 0.94);
  backdrop-filter: blur(18px);
}

body.dark .bottom-nav {
  background: rgba(13, 36, 51, 0.92);
}

.nav-button {
  min-height: 64px;
  display: grid;
  place-items: center;
  gap: 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  min-width: 0;
  overflow: hidden;
  line-height: 1.15;
  text-align: center;
}

.nav-button span:last-child {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.nav-button.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.nav-icon {
  font-size: 20px;
  line-height: 1;
}

dialog {
  width: min(92vw, 360px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

dialog::backdrop {
  background: rgba(4, 23, 35, 0.48);
}

.dialog-card {
  padding: 20px;
  background: var(--screen);
  color: var(--text);
  border-radius: 8px;
}

.dialog-card p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.auth-consent-row {
  align-items: flex-start;
  display: grid;
  gap: 12px;
  grid-template-columns: 24px minmax(0, 1fr);
}

.auth-consent-row input {
  height: 22px;
  margin: 2px 0 0;
  width: 22px;
}

.auth-consent-row label {
  line-height: 1.45;
  min-width: 0;
}

.auth-consent-row a,
.legal-consent-card a,
.trust-block a {
  color: var(--primary);
  font-weight: 700;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.trust-block {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 16px;
}

.trust-block h2 {
  font-size: 1rem;
  margin: 0;
}

.trust-block p,
.trust-block ul {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  margin: 0;
}

.trust-block ul,
.legal-summary-list {
  display: grid;
  gap: 8px;
  padding-inline-start: 20px;
}

.legal-consent-dialog {
  max-height: calc(100dvh - 24px);
  max-width: min(520px, calc(100vw - 24px));
  overflow: hidden;
  width: 100%;
}

.legal-consent-card {
  max-height: calc(100dvh - 24px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

.legal-summary-list {
  color: var(--muted);
  line-height: 1.45;
  margin: 12px 0;
}

.legal-consent-actions,
.legal-blocking-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.legal-consent-actions a {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  min-height: 48px;
  padding: 10px;
  text-align: center;
}

.support-link {
  display: block;
  text-align: center;
}

@media (max-width: 420px) {
  .phone-shell,
  .auth-shell {
    width: 100vw;
    height: var(--app-height, 100dvh);
    min-height: var(--app-height, 100dvh);
    max-height: none;
  }

  .auth-shell {
    place-items: start center;
    padding-inline: 16px;
    padding-bottom: calc(42px + env(safe-area-inset-bottom, 0px));
  }

  .app-screen {
    padding-inline: 14px;
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  }

  .wallet-panel,
  .booking-panel,
  .chat-panel,
  .live-map-card,
  .comfort-panel,
  .ai-panel,
  .compare-panel,
  .review-panel,
  .payment-summary-panel,
  .rules-panel,
  .safety-panel,
  .estimate-panel,
  .safety-actions-panel,
  .level-panel {
    padding: 14px;
  }

  .panel-heading {
    align-items: flex-start;
    gap: 8px;
  }

  .panel-heading h2 {
    flex: 1 1 150px;
  }

  .panel-heading span {
    flex: 0 1 max-content;
    margin-left: 0;
  }

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

  .ai-input-row .primary-action {
    width: 100%;
  }

  .setting-row,
  .primary-row,
  .danger-row,
  .details-list > div,
  .payment-method-row {
    gap: 10px;
    padding: 12px;
  }

  .bottom-nav {
    gap: 4px;
    padding-inline: 8px;
    min-height: calc(88px + env(safe-area-inset-bottom, 0px));
  }

  .nav-button {
    min-height: 66px;
    padding-inline: 2px;
    font-size: 10px;
  }

  .nav-icon {
    font-size: 19px;
  }

  .legal-consent-actions,
  .legal-blocking-actions {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 520px) {
  .phone-shell {
    margin: 28px 0;
    border-radius: 30px;
    border: 10px solid #35101d;
  }

  .field-grid {
    grid-template-columns: 1fr 1fr;
  }

  .trust-strip {
    grid-template-columns: repeat(3, 1fr);
  }

  .safety-grid {
    grid-template-columns: 1fr;
  }

  .estimate-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 360px) {
  .app-screen {
    padding-inline: 14px;
  }

  h1 {
    font-size: 28px;
  }

  .legal-links {
    grid-template-columns: 1fr;
  }

  .select-row select {
    max-width: 100%;
  }

  .payment-grid,
  .topup-row {
    grid-template-columns: 1fr;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }
}
