:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --text: #061946;
  --muted: #687594;
  --line: #e8edf7;
  --blue: #1677ff;
  --blue-dark: #0d57d9;
  --blue-soft: #eef5ff;
  --green: #25a935;
  --green-soft: #edf9ef;
  --violet: #7b4df1;
  --violet-soft: #f1ecff;
  --gray-soft: #f2f5fa;
  --shadow: 0 5px 15px rgba(5, 23, 62, .055);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
.app-icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
button .app-icon, .button .app-icon { width: 17px; height: 17px; }
.icon-home { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11.5 12 4l9 7.5'/%3E%3Cpath d='M5 10.5V20h14v-9.5'/%3E%3Cpath d='M9 20v-6h6v6'/%3E%3C/svg%3E"); }
.icon-orders { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 4h8l1 3h3v13H4V7h3l1-3Z'/%3E%3Cpath d='M8 11h8M8 15h6'/%3E%3C/svg%3E"); }
.icon-route { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='6' cy='6' r='2.5'/%3E%3Ccircle cx='18' cy='18' r='2.5'/%3E%3Cpath d='M8.5 6H14a4 4 0 0 1 0 8H10a4 4 0 0 0 0 8h5.5'/%3E%3C/svg%3E"); }
.icon-chat { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 18.5A8 8 0 1 1 8.5 21L4 22l1-3.5Z'/%3E%3Cpath d='M8 11h.01M12 11h.01M16 11h.01'/%3E%3C/svg%3E"); }
.icon-profile { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21a8 8 0 0 1 16 0'/%3E%3C/svg%3E"); }
.icon-measure { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 15 11-11 5 5L9 20l-5-5Z'/%3E%3Cpath d='m8 11 2 2M11 8l2 2M14 5l2 2'/%3E%3C/svg%3E"); }
.icon-delivery { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h11v10H3z'/%3E%3Cpath d='M14 10h4l3 3v3h-7z'/%3E%3Ccircle cx='7' cy='18' r='2'/%3E%3Ccircle cx='18' cy='18' r='2'/%3E%3C/svg%3E"); }
.icon-mount { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m14 7 3-3 3 3-3 3'/%3E%3Cpath d='M4 20 15 9'/%3E%3Cpath d='m5 5 4 4'/%3E%3Cpath d='m3 7 4-4 4 4'/%3E%3C/svg%3E"); }
.icon-phone { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h3a2 2 0 0 1 2 1.7c.1 1 .4 1.9.7 2.8a2 2 0 0 1-.5 2.1L8.1 9.9a16 16 0 0 0 6 6l1.3-1.2a2 2 0 0 1 2.1-.5c.9.3 1.8.6 2.8.7A2 2 0 0 1 22 16.9Z'/%3E%3C/svg%3E"); }
.icon-doc { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 3h7l4 4v14H7z'/%3E%3Cpath d='M14 3v5h5'/%3E%3Cpath d='M10 13h5M10 17h5'/%3E%3C/svg%3E"); }
.icon-bell { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8a6 6 0 0 0-12 0c0 7-3 7-3 9h18c0-2-3-2-3-9'/%3E%3Cpath d='M10 21h4'/%3E%3C/svg%3E"); }
.icon-send { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m22 2-7 20-4-9-9-4 20-7Z'/%3E%3Cpath d='M22 2 11 13'/%3E%3C/svg%3E"); }
.icon-check { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m20 6-11 11-5-5'/%3E%3C/svg%3E"); }
button, input, select, textarea {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--text);
}
input, select, textarea { width: 100%; padding: 10px 11px; font-size: 13px; }
textarea { min-height: 72px; resize: vertical; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 800; }
button, .button {
  min-height: 34px;
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 11px;
  border: 1px solid #cfe0ff;
  background: #fff;
  color: var(--blue);
  font-size: 13px;
  font-weight: 850;
}
button.primary, .button.primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.app-shell {
  width: min(430px, 100%);
  margin: 0 auto;
  padding: 14px 14px calc(74px + env(safe-area-inset-bottom));
  min-height: 100vh;
  background: #fff;
}
.topbar {
  min-height: 52px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.back-link {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: var(--blue);
  font-size: 28px;
  line-height: 1;
}
.back-link.ghost { display: none; }
.topbar h1 {
  margin: 0;
  color: var(--text);
  font-size: 25px;
  line-height: 1.03;
  letter-spacing: 0;
}
.back-link:not(.ghost) + div h1 {
  font-size: 21px;
  line-height: 1.08;
  overflow-wrap: anywhere;
}
.back-link:not(.ghost) + div .eyebrow { font-size: 13px; }
.eyebrow {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.top-actions { display: flex; align-items: center; gap: 7px; }
.bell {
  position: relative;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--text);
  border-radius: 50%;
  background: #fff;
  border: 1px solid #edf1f8;
  box-shadow: 0 5px 14px rgba(5, 23, 62, .06);
}
.bell i {
  position: absolute;
  right: -1px;
  top: -3px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  border: 2px solid #fff;
}
.bell i::before { content: "3"; color: #fff; font-size: 10px; font-style: normal; font-weight: 900; }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #d9eaff, #fff);
  color: var(--blue);
  font-weight: 950;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px #dbe5f6, 0 6px 16px rgba(5, 23, 62, .10);
}
.avatar.big { width: 54px; height: 54px; font-size: 21px; }
.section { display: grid; gap: 9px; margin: 12px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section h2, .form-card h2, .card-title {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.15;
}
.section-head a { color: var(--blue); font-size: 13px; font-weight: 850; }
.card, .hero-card, .form-card, .control-card, .map-card, .quick-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.card, .hero-card, .form-card, .quick-card { padding: 12px; }
.hero-card { margin-bottom: 10px; }
.hero-card h2, .card h3 {
  margin: 3px 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.18;
}
.card p, .hero-card p {
  margin: 3px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.meta span, .status-pill {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
}
.status-ok { background: var(--green-soft) !important; color: var(--green) !important; }
.status-muted { background: var(--gray-soft) !important; color: var(--muted) !important; }

.control-card {
  min-height: 104px;
  padding: 13px;
  display: grid;
  grid-template-columns: 1fr 74px;
  gap: 10px;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 86%, rgba(22, 119, 255, .16), transparent 34%),
    linear-gradient(180deg, #fff, #f8fbff);
}
.control-card h2 { margin: 0 0 5px; font-size: 16px; line-height: 1.16; }
.control-card p { margin: 0; color: var(--muted); font-size: 13px; }
.progress-ring {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  background: conic-gradient(var(--blue) 0 75%, #e6efff 75% 100%);
  position: relative;
}
.progress-ring::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px #edf2fb;
}
.progress-ring b, .progress-ring span { position: relative; z-index: 1; }
.progress-ring b { font-size: 18px; }
.progress-ring span { font-size: 9px; color: var(--muted); font-weight: 800; }
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 7px 0 12px;
}
.stat-pill {
  min-height: 56px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 9px;
  border-radius: 13px;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: 0 4px 12px rgba(5, 23, 62, .05);
}
.stat-pill b { font-size: 18px; line-height: 1; }
.stat-pill span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.stat-pill::before { display: none; }

.search-box { margin-bottom: 9px; }
.search-box input {
  min-height: 38px;
  background: #f8fbff;
  border-color: #e4ebf6;
  border-radius: 13px;
  font-size: 13px;
}
.stage-tabs, .date-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 8px;
  margin-bottom: 2px;
}
.date-tabs {
  grid-template-columns: repeat(3, 1fr);
  grid-auto-flow: unset;
  grid-auto-columns: unset;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.stage-tabs a, .date-tabs span {
  min-width: 66px;
  text-align: center;
  padding: 7px 10px;
  border-radius: 11px;
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 850;
}
.date-tabs span { border-color: transparent; }
.stage-tabs a.active, .date-tabs .active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.order-card {
  position: relative;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 9px;
  padding: 10px 10px 10px 14px;
  overflow: hidden;
}
.order-card::before, .route-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--blue);
  border-radius: 16px 0 0 16px;
}
.order-icon, .soft-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 950;
  font-size: 18px;
}
.order-body { min-width: 0; }
.order-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}
.order-time {
  color: var(--blue);
  font-size: 12px;
  line-height: 1;
  font-weight: 850;
  white-space: nowrap;
}
.order-card h3 { margin: 3px 0 2px; font-size: 15px; line-height: 1.15; }
.order-card p { margin: 2px 0; font-size: 12px; line-height: 1.25; }
.order-card p:not(.subline) {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.subline, small { color: var(--muted); font-size: 11px; }
.stage-delivery::before { background: var(--green); }
.stage-delivery .order-icon, .stage-delivery .soft-icon { background: var(--green-soft); color: var(--green); }
.stage-mount::before { background: var(--violet); }
.stage-mount .order-icon, .stage-mount .soft-icon { background: var(--violet-soft); color: var(--violet); }
.stage-done::before { background: #94a0b4; }
.stage-done .order-icon, .stage-done .soft-icon { background: var(--gray-soft); color: #73809a; }
.stage-measure::before { background: var(--blue); }
.card-actions, .bottom-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 7px;
}
.order-card .card-actions .button {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
}
.money { color: var(--text) !important; font-size: 20px !important; font-weight: 950; }
.phone-line { color: var(--blue) !important; font-weight: 850; }

.order-hero {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  position: relative;
  overflow: hidden;
}
.order-hero .hero-main { min-width: 0; }
.order-hero .card-actions { grid-column: 1 / -1; }
.info-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.info-cell { display: grid; gap: 2px; color: var(--muted); font-size: 10px; }
.info-cell b { color: var(--text); font-size: 12px; line-height: 1.18; }
.task-list { display: grid; gap: 6px; }
.task-list p { color: var(--muted); font-size: 13px; }
.task-list span {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 8px;
  background: var(--blue);
  vertical-align: middle;
}
.split-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  font-size: 13px;
}
.split-card span, .split-card b { padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.split-card b { color: var(--text); }
.form-card { display: grid; gap: 9px; margin-bottom: 10px; }
.subtle-form {
  background: #f9fbff;
  box-shadow: none;
  padding: 10px;
}
.service-section {
  margin-top: 16px;
}
.service-section h2 {
  color: var(--muted);
  font-size: 14px;
}
.timeline { display: grid; gap: 0; }
.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 8px;
  align-items: start;
  min-height: 40px;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 23px;
  bottom: -4px;
  width: 2px;
  background: #d5deec;
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  border: 2px solid #cfd8e7;
  color: #fff;
  font-weight: 900;
  z-index: 1;
}
.timeline-item.done .timeline-dot { background: var(--green); border-color: var(--green); }
.timeline-item.current .timeline-dot { border-color: var(--blue); box-shadow: inset 0 0 0 4px #fff; background: var(--blue); }
.timeline-item b { color: var(--text); font-size: 13px; }
.timeline-item small { display: block; margin-top: 2px; font-size: 11px; }

.measure-head {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
}
.measure-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.measure-grid label:nth-child(3), .measure-grid label:nth-child(4), .measure-grid label:nth-child(5) { grid-column: auto; }
.photo-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.photo-strip div {
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  border: 1px solid #dfe7f3;
  background: #f4f8ff;
  color: var(--blue);
  font-size: 24px;
}
.photo-strip div::before { content: "+"; }
.photo-strip-filled {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.photo-strip-filled article,
.photo-strip-filled a {
  display: grid;
  gap: 6px;
}
.photo-strip-filled img {
  width: 100%;
  aspect-ratio: 1.2;
  object-fit: cover;
  border-radius: 13px;
  border: 1px solid #dfe7f3;
  background: #f4f8ff;
}
.photo-strip-filled form { display: grid; }
.photo-strip-filled button {
  min-height: 30px;
  padding: 5px 8px;
}
.segment {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  background: #f2f6fd;
  padding: 4px;
  border-radius: 16px;
}
.segment span {
  min-height: 32px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}
.segment .active { background: #fff; color: var(--blue); box-shadow: 0 5px 14px rgba(5, 23, 62, .06); }

.map-card {
  min-height: 128px;
  position: relative;
  padding: 13px;
  overflow: hidden;
  background: linear-gradient(180deg, #fff, #f8fbff);
}
.map-card b, .map-card span, .map-stats { position: relative; z-index: 1; display: block; }
.map-card b { font-size: 17px; }
.map-card span { margin-top: 3px; color: var(--muted); font-size: 13px; }
.map-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  max-width: 218px;
  margin-top: 10px;
}
.map-stats div { padding: 8px; border-radius: 11px; background: #fff; border: 1px solid var(--line); }
.map-stats small { display: block; }
.map-line {
  position: absolute;
  inset: 18px 12px 12px 48%;
  opacity: .95;
  background:
    radial-gradient(circle at 10% 60%, var(--blue) 0 6px, transparent 7px),
    radial-gradient(circle at 52% 35%, var(--blue) 0 6px, transparent 7px),
    radial-gradient(circle at 82% 58%, var(--green) 0 8px, transparent 9px),
    linear-gradient(130deg, transparent 23%, rgba(22,119,255,.80) 24% 27%, transparent 28%),
    linear-gradient(24deg, transparent 42%, rgba(22,119,255,.80) 43% 46%, transparent 47%),
    repeating-linear-gradient(0deg, #eef4ff 0 15px, transparent 15px 30px),
    repeating-linear-gradient(90deg, #eef4ff 0 15px, transparent 15px 30px);
  border-radius: 17px;
}
.route-list { position: relative; display: grid; gap: 8px; margin-left: 26px; }
.route-list::before {
  content: "";
  position: absolute;
  left: -15px;
  top: 18px;
  bottom: 18px;
  width: 2px;
  background: #d7e2f5;
}
.route-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  padding: 10px;
}
.route-card::before { display: none; }
.route-num {
  position: absolute;
  left: -39px;
  top: 10px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 950;
  box-shadow: 0 0 0 5px #fff;
  font-size: 12px;
}
.route-card h3 { margin: 2px 0 1px; font-size: 15px; }
.route-card p { margin: 1px 0; line-height: 1.24; }
.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  margin-top: 4px;
}
.route-card .inline-form select,
.route-card .inline-form button {
  min-height: 32px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.chat-focus {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 9px;
  align-items: center;
}
.chat-list {
  gap: 4px;
  padding-bottom: calc(120px + env(safe-area-inset-bottom));
}
.chat-bubble {
  width: fit-content;
  max-width: min(78%, 300px);
  padding: 7px 9px;
  margin: 3px 0;
  border-radius: 15px 15px 15px 5px;
  background: #fff;
  border: 1px solid #e5edf9;
  box-shadow: 0 2px 8px rgba(5, 23, 62, .04);
}
.chat-bubble.mine {
  margin-left: auto;
  background: #eaf4ff;
  color: var(--text);
  border-color: #d6e7ff;
  border-radius: 15px 15px 5px 15px;
}
.chat-bubble.mine p, .chat-bubble.mine small { color: var(--muted); }
.chat-bubble p { margin: 2px 0 3px; font-size: 13px; line-height: 1.32; color: var(--text); }
.chat-bubble small { font-size: 10px; }
.chat-bubble .meta { gap: 5px; margin-bottom: 3px; }
.chat-bubble .meta span {
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
}
.chat-form {
  position: fixed;
  left: 50%;
  bottom: calc(53px + env(safe-area-inset-bottom));
  width: min(402px, calc(100% - 24px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 1fr 38px;
  gap: 6px;
  padding: 7px;
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  border-radius: 15px;
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 22px rgba(5, 23, 62, .08);
}
.chat-form select { grid-column: 1 / -1; }
.chat-form button { min-height: 36px; border-radius: 12px; padding: 0; }

.profile-head {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 10px 0 14px;
}
.quick-card {
  min-height: 64px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 10px 8px;
}
.quick-card b {
  display: block;
  color: var(--text);
  font-size: 12px;
  line-height: 1.15;
  overflow-wrap: normal;
}
.quick-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}
.compact { padding: 10px; }
.metric { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.empty-state {
  padding: 18px;
  border-radius: 16px;
  background: #fff;
  border: 1px dashed var(--line);
  color: var(--muted);
}
.link-card { display: block; }

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  width: min(430px, 100%);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 4px 7px max(4px, env(safe-area-inset-bottom));
  background: rgba(255,255,255,.98);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(18px);
  z-index: 10;
}
.bottom-nav a {
  min-height: 38px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  color: #707c95;
  font-size: 9px;
  font-weight: 800;
  border-radius: 13px;
}
.bottom-nav a > .app-icon {
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
}
.bottom-nav a.active {
  color: var(--blue);
  background: var(--blue-soft);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
  background: #fff;
}
.login-card {
  width: min(390px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.login-card h1 { margin: 0; font-size: 30px; color: var(--text); }
.error { margin: 0; color: #b42318; font-weight: 850; }
.test-users {
  display: grid;
  gap: 3px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 380px) {
  .app-shell { padding-left: 12px; padding-right: 12px; }
  .topbar h1 { font-size: 23px; }
  .back-link:not(.ghost) + div h1 { font-size: 20px; }
  .control-card { grid-template-columns: 1fr 68px; }
  .stat-row, .quick-grid { gap: 8px; }
  .order-card { grid-template-columns: 34px 1fr; padding-right: 9px; }
  .order-icon, .soft-icon { width: 32px; height: 32px; }
  .bottom-actions { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: repeat(3, 1fr); }
}
