:root {
  color: #202322;
  background: #f3f7f4;
  font: 14px/1.45 Arial, Helvetica, sans-serif;
  font-synthesis: none;
  --blue: #3659d5;
  --link: #263b91;
  --border: #dce4df;
  --line: #e8eeea;
  --muted: #6b716e;
  --green: #edf5ec;
  --yellow: #f6f2da;
  --pink: #f4ece9;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  overflow: hidden;
  background: #f3f7f4;
}

button, input, select, textarea { font: inherit; color: inherit; }
button, input:not([type="checkbox"]):not([type="radio"]), select, textarea { min-height: 36px; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 0; margin: 0; }

a { color: var(--link); text-decoration: underline; text-underline-offset: 1px; }

.app-shell {
  width: calc(100vw - 24px);
  height: calc(100vh - 24px);
  margin: 12px auto;
  overflow-y: auto;
  overflow-x: hidden;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(30, 45, 38, .09);
}
.app-shell.salons-layout { display: flex; flex-direction: column; overflow: hidden; }
.app-shell.salons-layout .app-header { flex: 0 0 auto; }
.app-shell.salons-layout .app-content { flex: 1 1 auto; min-height: 0; }
.app-shell.workspace-layout { display: flex; flex-direction: column; overflow: hidden; }
.app-shell.workspace-layout .app-header { flex: 0 0 auto; }
.app-shell.workspace-layout .app-content { flex: 1 1 auto; min-height: 0; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,.98);
}

.brand-row {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
}

.brand {
  color: #171918;
  font-weight: 700;
  letter-spacing: .7px;
  text-decoration: none;
}

.session { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.login-page { display: grid; min-height: 100vh; place-items: center; overflow: auto; padding: 20px; }
.login-card { width: min(400px, 100%); padding: 30px; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 12px 34px rgba(30, 45, 38, .12); }
.login-card h1 { margin: 0; }
.login-brand { margin: 0 0 8px; color: var(--blue); font-size: 17px; font-weight: 700; letter-spacing: .8px; }
.login-form { display: grid; gap: 14px; margin-top: 22px; }
.voice-open { display: inline-flex; align-items: center; gap: 6px; }

.voice-dialog {
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: #202322;
  box-shadow: 0 24px 70px rgba(25, 36, 31, .24);
}
.voice-dialog::backdrop { background: rgba(25, 33, 29, .42); backdrop-filter: blur(2px); }
.voice-dialog-shell { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: calc(100vh - 32px); }
.voice-dialog.voice-dialog-guided[open] {
  position: fixed;
  top: var(--voice-dialog-top, 50%);
  left: var(--voice-dialog-left, 50%);
  right: auto;
  bottom: auto;
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px - env(safe-area-inset-bottom));
  margin: 0;
  transform: translate(-50%, -50%);
  z-index: 1000;
}
.voice-dialog.voice-dialog-guided .voice-dialog-shell {
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px - env(safe-area-inset-bottom));
}
.voice-dialog-guided .voice-dialog-header {
  padding: 12px 16px 10px;
}
.voice-dialog-guided .voice-dialog-body {
  gap: 8px;
  padding: 12px 16px;
}
.voice-dialog-guided .voice-state {
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
}
.voice-dialog-guided .voice-state-icon { width: 36px; height: 36px; }
.voice-dialog-guided .voice-state p { min-height: 0; }
.voice-dialog-guided .voice-record-actions {
  position: relative;
  grid-template-rows: 42px;
  gap: 0;
}
.voice-dialog-guided .voice-record-actions .button { min-height: 42px; }
.voice-dialog-guided .voice-record-actions #voice-stop {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: auto;
  min-height: 32px;
  padding: 5px 10px;
}
.voice-dialog-guided .voice-dialog-actions { padding: 10px 16px 12px; }
.voice-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.voice-dialog-header h2 { margin: 0; font-size: 18px; }
.voice-eyebrow { margin: 0 0 3px; color: var(--blue); font-size: 14px; font-weight: 700; letter-spacing: .7px; }
.voice-close {
  display: grid;
  place-items: center;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
}
.voice-close:focus-visible { outline: 2px solid #91a2e7; outline-offset: 2px; }
.voice-dialog-body { min-height: 0; display: grid; gap: 10px; padding: 18px 20px; overflow-y: auto; overscroll-behavior: contain; }
.voice-state {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f7faf8;
}
.voice-state-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #e8edfd;
  font-size: 18px;
}
.voice-state strong { display: block; margin-bottom: 2px; font-size: 14px; }
.voice-state p { min-height: 2.8em; margin: 0; color: var(--muted); line-height: 1.4; }
.voice-state[data-state="listening"] .voice-state-icon { background: #f7e7e4; animation: voice-pulse 1.2s ease-in-out infinite; }
.voice-state[data-state="success"] .voice-state-icon { background: var(--green); }
.voice-state[data-state="error"] { border-color: #e7d3ce; background: #fdf8f6; }
.voice-state[data-state="error"] .voice-state-icon { background: var(--pink); }
.voice-detail { padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; }
.voice-detail h3 { margin-bottom: 4px; color: var(--muted); font-size: 14px; letter-spacing: .4px; text-transform: uppercase; }
.voice-detail p, .voice-detail div { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.voice-command-help {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.voice-command-help > h3 {
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: #202322;
  font-size: 15px;
}
.voice-command-help-head,
.voice-command-help-row {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: 16px;
}
.voice-command-help-head {
  padding: 8px 14px;
  background: #f5f7f6;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}
.voice-command-help-list {
  height: var(--voice-help-two-rows-height, 128px);
  max-height: var(--voice-help-two-rows-height, 128px);
  margin: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.voice-command-help-row { min-height: 64px; padding: 10px 14px; }
.voice-command-help-row + .voice-command-help-row { border-top: 1px solid var(--line); }
.voice-command-help-row dt,
.voice-command-help-row dd {
  min-width: 0;
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.voice-command-help-row dt { color: var(--blue-dark); font-weight: 650; }
.voice-command-help-row dd { color: var(--muted); }
.voice-record-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 44px 44px;
  align-items: center;
  gap: 8px;
}
.voice-record-actions .button { min-height: 44px; }
.voice-record-actions #voice-stop { grid-row: 2; width: 132px; justify-self: end; }
.voice-dialog-actions { flex: 0 0 auto; display: none; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 14px 20px 18px; border-top: 1px solid var(--line); background: #fff; }
.voice-dialog-actions:has(> .button:not([hidden])) { display: flex; }
.voice-record-button {
  width: min(100%, 420px);
  min-width: 0;
  justify-self: center;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  white-space: nowrap;
  transition: box-shadow .12s ease, background-color .12s ease;
}
.voice-record-button:active,
.voice-record-button.is-recording {
  background: #b94f45;
  border-color: #a8463d;
  box-shadow: 0 0 0 4px rgba(185, 79, 69, .14);
}
.voice-record-button.is-recording::before { content: "●"; margin-right: 8px; }
.voice-guided-form { border-radius: 8px; outline: 2px solid rgba(54, 89, 213, .18); outline-offset: 5px; }
.voice-guided-field { border-color: var(--blue) !important; box-shadow: 0 0 0 3px rgba(54, 89, 213, .14); }

@keyframes voice-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(185, 83, 73, .18); }
  50% { box-shadow: 0 0 0 7px rgba(185, 83, 73, 0); }
}

.primary-nav {
  min-height: 37px;
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 1px;
  overflow: visible;
  padding: 0 6px;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}

.primary-nav::-webkit-scrollbar { display: none; }
.primary-nav a {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  min-height: 37px;
  padding: 0 5px;
  border-radius: 6px;
  color: #202322;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.primary-nav a:hover, .primary-nav a:focus-visible, .primary-nav a.active { background: #f1f3f2; }

.app-content {
  min-height: calc(100% - 81px);
  padding: 12px;
  background: #f8faf8;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: 18px; line-height: 1.25; }
h2 { margin-bottom: 8px; font-size: 15px; line-height: 1.3; }
h3 { margin-bottom: 7px; font-size: 14px; line-height: 1.35; }
p { margin-bottom: 9px; }
.muted, .hint { color: var(--muted); }
.page-lead { margin-bottom: 11px; }

.stack { display: grid; gap: 12px; }
.section-card {
  padding: 11px;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.section-card.flush { padding: 0; overflow: hidden; }
.map-scroll { display: grid; gap: 12px; align-content: start; }
.map-summary { display: grid; gap: 6px; }
.map-summary p { margin: 0; }
.map-degraded {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: 7px;
  color: var(--muted);
  background: #f8faf8;
}
.map-salon-list { display: grid; }
.map-salon-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--border);
}
.map-salon-row:first-child { border-top: 0; padding-top: 0; }
.map-salon-row p { margin: 3px 0 0; }
.map-row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.map-view-tabs { margin-bottom: 8px; }
.route-status-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.route-map-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 12px; align-items: start; }
.route-map-canvas { display: block; width: 100%; min-height: 240px; max-height: 420px; border: 1px solid var(--border); border-radius: 8px; }
.route-map-background { fill: #f4f7f5; }
.route-map-line { fill: none; stroke: var(--blue); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; opacity: .65; }
.route-map-point { fill: var(--blue); stroke: white; stroke-width: 4; }
.route-map-number { fill: white; font-size: 14px; font-weight: 800; }
.route-stop-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.route-stop-card { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 11px 0; border-top: 1px solid var(--border); border-radius: 5px; }
.route-stop-card:first-child { border-top: 0; padding-top: 0; }
.route-stop-card-simple { grid-template-columns: minmax(0, 1fr); }
.route-stop-card:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.route-stop-card p { margin: 3px 0 0; }
.route-stop-address { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.route-stop-address .text-action { min-height: 28px; padding: 2px 5px; }
.route-stop-number { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: white; font-weight: 800; }
.route-stop-reason { color: var(--danger); }
.route-order-actions { display: flex; gap: 10px; margin-top: 6px; }
.route-order-actions button:disabled { color: var(--muted); cursor: not-allowed; text-decoration: none; }
.route-reorder-panel { display: grid; gap: 8px; }
.route-reorder-panel > * { margin-bottom: 0; }
.route-reorder-warning { margin-bottom: 2px; }
.urgent-route-form-card,
.urgent-route-result,
.urgent-route-card,
.urgent-route-issues { display: grid; gap: 10px; }
.urgent-route-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.urgent-route-employees { grid-template-columns: minmax(180px, 1fr) repeat(2, minmax(120px, .55fr)); }
.urgent-route-fieldset { display: grid; gap: 10px; margin: 0; padding: 12px; border: 1px solid var(--border); border-radius: 8px; }
.urgent-route-fieldset legend { padding: 0 5px; font-weight: 700; }
.field-row { display: flex; align-items: center; gap: 7px; }
.field-row input { min-width: 0; }
.urgent-route-mandatory { display: grid; gap: 8px; }
.urgent-route-mandatory summary { cursor: pointer; font-weight: 700; }
.checkbox-list { display: grid; max-height: 170px; overflow: auto; gap: 7px; padding: 4px 0; }
.urgent-route-result { margin-top: 12px; }
.urgent-route-issues { padding: 10px; border: 1px solid var(--border); border-radius: 8px; }
.urgent-route-issues h3,
.urgent-route-issues ul { margin: 0; }
.salon-create-section { margin: 12px 0; }
.app-content.salons-page {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  height: auto;
  min-height: 0;
  overflow: hidden;
}
.app-content.workspace-page {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}
.workspace-fixed { min-width: 0; padding-bottom: 10px; }
.workspace-fixed:empty { display: none; }
.workspace-scroll {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.workspace-scroll .table-wrap { overflow: visible; }
.workspace-scroll > .section-card:first-child,
.workspace-scroll > .stack:first-child { margin-top: 0; }
.workspace-scroll .table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  box-shadow: 0 1px 0 var(--line);
}
.workspace-action-panel { margin-bottom: 0; }
.section-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.section-heading-row h2 { margin-bottom: 3px; }
.obligation-list { display: grid; gap: 10px; }
.obligation-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}
.obligation-card-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.obligation-card-title strong { overflow-wrap: anywhere; }
.obligation-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 8px 14px;
  margin: 0;
}
.obligation-meta div { min-width: 0; }
.obligation-meta dt { color: var(--muted); font-size: 14px; }
.obligation-meta dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.obligation-actions {
  align-content: start;
  justify-content: flex-end;
  max-width: 520px;
}
.obligation-assignment-form {
  flex-basis: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}
.muted-badge { color: var(--muted); background: #eef1ef; }
.salons-page-heading { grid-row: 1; }
.salons-page > .record-tabs { grid-row: 2; }
.salons-page > #salon-search { grid-row: 3; }
.salons-page > .salon-create-section { grid-row: 4; }
.salons-page > #salons-result,
.salons-page > .table-wrap,
.salons-page > .empty-state,
.salons-page > .message {
  grid-row: 5;
  min-height: 0;
}
.salons-page > .table-wrap {
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
}
.salons-page > .table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  box-shadow: 0 1px 0 var(--line);
}

.empty-state {
  min-height: 63px;
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: 7px;
  color: var(--muted);
}
.empty-state strong { display: block; margin-bottom: 4px; color: #292d2b; }

.inline-form, .toolbar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
.field { display: grid; gap: 3px; min-width: 100px; }
.field > span { font-size: 14px; }
.field.grow { flex: 1 1 190px; }
.field.compact { min-width: 78px; }
input, select, textarea {
  height: 36px;
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  outline: none;
}
textarea { min-height: 58px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #758be2; box-shadow: 0 0 0 2px rgba(54,89,213,.10); }
[aria-invalid="true"], .invalid { border-color: #b55b52; }
input:disabled, select:disabled, textarea:disabled { color: #999; background: #f5f6f5; }

.checkbox-field { display: flex; align-items: center; gap: 6px; min-height: 30px; }
.checkbox-field input { flex: 0 0 18px; }

.button {
  min-height: 38px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .08s ease;
}
.button:hover { background: #2e4fc4; }
.button:active { background: #2745ae; transform: translateY(1px); }
.button:focus-visible { outline: 3px solid rgba(54, 89, 213, .28); outline-offset: 2px; }
.button:disabled { cursor: wait; opacity: .58; }
.button.secondary { border-color: var(--border); background: #fff; color: #202322; }
.button.secondary:hover { background: #f4f6f5; }
.button.secondary:active { border-color: #c6d0ca; background: #e9eeeb; }
.button.danger { border-color: #b95349; background: #b95349; }
.button.danger:hover { background: #a0443b; }
.button.danger:active { background: #893930; }
.text-action {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--link);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.text-action:hover { background: #eef1fb; text-decoration-thickness: 2px; }
.text-action:active { background: #e1e7f8; }
.text-action:focus-visible { outline: 3px solid rgba(54, 89, 213, .25); outline-offset: 1px; }
.text-action:disabled { cursor: not-allowed; opacity: .5; }
.danger-link { color: #9b4138; }

.record-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 12px;
  padding: 4px;
  width: fit-content;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #eef2ef;
}
.record-tabs a {
  min-width: 112px;
  padding: 6px 12px;
  border-radius: 6px;
  color: #4e5551;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.record-tabs a.active { background: #fff; color: #202322; box-shadow: 0 1px 4px rgba(30,45,38,.12); }
.record-tabs span { margin-left: 5px; color: var(--muted); font-weight: 400; }
.record-actions, .row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.record-actions { margin-top: 12px; }
.row-actions { min-width: 190px; }
.record-actions.is-confirming, .row-actions.is-confirming { align-items: flex-start; font-size: 0; }
.is-confirming > button { display: none !important; }
.inline-confirmation {
  display: grid;
  box-sizing: border-box;
  width: min(100%, 320px);
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid #d8dfdb;
  border-radius: 9px;
  background: #f8faf9;
  color: #202322;
  font-size: 14px;
  line-height: 1.35;
  box-shadow: 0 1px 3px rgba(30, 45, 38, .08);
}
.inline-confirmation.destructive-confirmation { border-color: #e2c8c3; background: #fff8f7; }
.inline-confirmation-copy { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.inline-confirmation-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-confirmation-actions .button { min-height: 36px; padding: 7px 14px; }
.archive-card { border-color: #e4d7d2; background: #fdfaf8; }

.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: 7px; background: #fff; }
table { width: 100%; border-collapse: collapse; }
th {
  padding: 7px 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .4px;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
td { padding: 6px 8px; border-top: 1px solid var(--line); vertical-align: top; }
tbody tr:hover { background: #fafcfb; }
.diff-list { min-width: 140px; margin: 0; padding-left: 16px; }
.nowrap { white-space: nowrap; }

.badge { display: inline-block; padding: 3px 8px; border-radius: 10px; background: #f0f2f1; font-size: 14px; line-height: 1.35; white-space: nowrap; }
.badge.green { background: var(--green); }
.badge.yellow { background: var(--yellow); }
.badge.pink { background: var(--pink); }

.message { margin: 9px 0; padding: 8px 10px; border-radius: 7px; background: var(--green); }
.message.error { background: var(--pink); color: #713d35; }
.loading { color: var(--muted); }

.definition-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 28px; }
.definition { min-width: 0; }
.definition dt { color: var(--muted); font-size: 14px; }
.definition dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.definition-display { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.definition-value { min-width: 0; overflow-wrap: anywhere; }
.edit-field-button {
  display: inline-grid;
  flex: 0 0 36px;
  width: 36px;
  min-height: 36px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--link);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.edit-field-button:hover { border-color: #d8dfeb; background: #f1f4fc; }
.edit-field-button:active { background: #e4eafb; }
.edit-field-button:focus-visible { outline: 3px solid rgba(54, 89, 213, .25); outline-offset: 1px; }
.editable-definition.is-editing {
  margin: -6px;
  padding: 6px;
  border-radius: 9px;
  background: #f7f9fe;
  box-shadow: inset 0 0 0 1px #dce3f4;
}
.inline-field-editor { display: grid; gap: 8px; width: min(100%, 520px); margin-top: 7px; }
.inline-field-editor .field { width: 100%; }
.inline-field-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.inline-field-actions .button { min-height: 34px; padding: 6px 12px; }

.capacity-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.capacity-card { padding: 10px; border: 1px solid var(--border); border-radius: 7px; }
.capacity-head { display: flex; justify-content: space-between; gap: 5px; margin-bottom: 12px; }

.employee-card { max-width: 1100px; }
.employee-chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.employee-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 16px;
  background: var(--green);
}
.employee-chip button { min-height: 24px; padding: 0 3px; border: 0; background: transparent; cursor: pointer; }
.employee-action-form { margin-top: 12px; }
.employee-absence {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.employee-absence p { margin: 3px 0 0; color: var(--muted); }

.visit-workspace-scroll { overflow-x: hidden; }
#visit-needs-filter { max-width: 100%; }
.visit-workspace-list { display: grid; gap: 12px; min-width: 0; }
.visit-workspace-list > .section-card:first-child { margin-top: 0; }
.visit-need-list { display: grid; gap: 9px; }
.visit-need-card {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
}
.visit-need-card.is-overdue { border-color: #e3c6c1; background: #fffafa; }
.visit-need-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.visit-need-main p { margin: 2px 0 0; }
.visit-need-dates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 18px; margin: 0; }
.visit-need-dates dt { color: var(--muted); font-size: 14px; }
.visit-need-dates dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.need-reason { margin: 0; padding: 8px 10px; border-radius: 7px; background: var(--yellow); }
.need-command-stack { display: grid; gap: 6px; }
.need-command-form { display: flex; align-items: end; gap: 8px; }
.need-command-form .field { flex: 1 1 320px; }
.need-command-form textarea { min-height: 58px; }
.need-command-message:empty { display: none; }
.need-conflict p { margin: 0 0 8px; }
.need-conflict .button { min-height: 34px; padding: 6px 10px; }

@media (max-width: 640px) {
  .map-salon-row { align-items: flex-start; flex-direction: column; }
  .map-row-actions { justify-content: flex-start; }
  .route-map-layout { grid-template-columns: 1fr; }
  .route-map-canvas { min-height: 200px; }
  .urgent-route-grid,
  .urgent-route-employees { grid-template-columns: 1fr; }
  .employee-absence { display: grid; }
  .employee-action-form .field { flex-basis: 100%; }
  .employee-action-form .button { flex: 1 1 140px; }
  .visit-need-dates { grid-template-columns: 1fr; gap: 6px; }
  .need-command-form { display: grid; }
  .need-command-form .button { justify-self: start; }
  #visit-needs-filter { display: grid; width: 100%; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #visit-needs-filter a { min-width: 0; padding-inline: 5px; }
}

.schedule-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr);
  gap: 12px;
}
.schedule-board {
  padding: 2px 0 0;
}
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(320px, 1fr));
  gap: 16px;
  align-items: start;
}
.schedule-days { overflow: visible; padding: 2px 0 8px; }
.day-column {
  display: grid;
  grid-template-rows: auto auto minmax(92px, 1fr) auto;
  min-height: 430px;
  overflow: hidden;
  border: 1px solid #d7e0da;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(27, 42, 34, .07);
}
.day-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 13px 10px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfdfb 0%, #fff 100%);
}
.day-card-head h3 {
  margin: 1px 0 0;
  color: #262a28;
  font-size: 14px;
  line-height: 1.25;
}
.day-count {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 24px;
  padding: 0 6px;
  border-radius: 12px;
  font-weight: 700;
}
.day-count.has-visits { background: #e6f1e5; color: #36513c; }
.day-count.is-empty { background: #f4efd6; color: #665d2a; }
.day-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 13px;
  color: var(--muted);
  font-size: 14px;
  border-bottom: 1px solid var(--line);
}
.day-body {
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 12px;
}
.day-employee-group {
  overflow: hidden;
  border: 1px solid #e4ebe7;
  border-radius: 7px;
  background: #fcfdfc;
}
.day-employee-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 8px 10px;
  color: #454a47;
  border-bottom: 1px solid var(--line);
  background: #f6f9f6;
}
.day-employee-head strong {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.day-employee-head span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 14px;
}
.visit-list { display: grid; }
.visit-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 10px;
  border-top: 1px solid #eef3f0;
}
.visit-row:first-child { border-top: 0; }
.visit-index {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 11px;
  background: #eef2ef;
  color: #626966;
  font-size: 14px;
  font-weight: 700;
}
.visit-title {
  min-width: 0;
  color: #343936;
  font-size: 14px;
  line-height: 1.34;
  overflow-wrap: anywhere;
}
.empty-state.compact {
  min-height: 0;
  padding: 10px;
}
.day-control-panel {
  display: grid;
  grid-template-columns: 82px 1fr 1fr;
  gap: 8px;
  align-items: end;
  padding: 11px 12px;
  border-top: 1px solid var(--line);
  background: #fbfcfb;
}
.day-target-field {
  display: grid;
  gap: 4px;
}
.day-target-field span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}
.day-control-panel .button { width: 100%; }
.day-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 1px;
}
.day-message { grid-column: 1 / -1; }
.quality-list { margin: 8px 0; padding-left: 17px; }
.day-readonly-note {
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #fbfcfb;
  font-size: 14px;
}
.schedule-readonly-banner {
  padding: 8px 11px;
  border: 1px solid #d8e2dc;
  border-radius: 8px;
  color: #4c5b53;
  background: #f4f8f5;
}
.schedule-compare { display: grid; min-width: 0; gap: 10px; }
.schedule-compare .inline-form,
.schedule-compare .field { min-width: 0; }
.schedule-compare select { width: 100%; }
.schedule-comparison-summary {
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.schedule-change-list { display: grid; gap: 8px; }
.schedule-change {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}
.schedule-change h3 { margin-bottom: 6px; }

.diagnostics-grid { display: grid; gap: 12px; }
.diagnostics-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.diagnostics-cards article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}
.diagnostics-job-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 10px;
  color: var(--muted);
}
.diagnostics-backup .definition-grid { margin-bottom: 10px; }

.visit-completion-panel { display: grid; gap: 10px; }
.visit-completion-panel[hidden] { display: none; }
.visit-failure-panel { display: grid; gap: 10px; }
.visit-failure-panel[hidden] { display: none; }
.visit-completion-form { display: grid; gap: 10px; }
.visit-failure-form { display: grid; gap: 10px; }
.visit-completion-dates,
.visit-completion-quantities {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.completion-obligations {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.completion-obligations legend { padding: 0 5px; font-weight: 700; }
.completion-form-actions,
.completion-preview-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.completion-attachments small { color: var(--muted); }
.completion-file-list ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.completion-file-list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: #f8faf9; }
.completion-file-list li span { min-width: 0; overflow-wrap: anywhere; }
.completion-file-list li small { color: var(--muted); white-space: nowrap; }
.visit-completion-preview { display: grid; gap: 10px; }
.visit-completion-preview[hidden] { display: none; }
.visit-failure-preview { display: grid; gap: 10px; }
.visit-failure-preview[hidden] { display: none; }
.failure-next-action { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.failure-next-action legend { padding: 0 4px; font-weight: 700; }
.radio-field { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; }
.completion-success {
  padding: 12px;
  border: 1px solid #bdd6c3;
  border-radius: 8px;
  background: #f2f8f3;
}

@media (max-width: 1100px) {
  .schedule-overview { grid-template-columns: 1fr; }
  .schedule-grid { grid-template-columns: repeat(2, minmax(300px, 1fr)); }
}
@media (max-width: 720px) {
  .app-shell { width: calc(100vw - 12px); height: calc(100vh - 12px); margin: 6px auto; border-radius: 7px; }
  .primary-nav { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; }
  .session > span:first-child { display: none; }
  .definition-grid, .capacity-grid { grid-template-columns: 1fr; }
  .schedule-grid { grid-template-columns: 1fr; }
  .schedule-compare { width: calc(100vw - 42px); max-width: 100%; }
  .diagnostics-cards { grid-template-columns: 1fr; }
  .visit-completion-dates,
  .visit-completion-quantities { grid-template-columns: 1fr; }
  .day-control-panel { grid-template-columns: 1fr; }
  .day-actions, .day-message { grid-column: auto; }
  .salons-page > .salon-create-section { margin: 8px 0; padding: 8px; }
  .salons-page > .salon-create-section h2 { margin-bottom: 5px; }
  .salons-page #salon-create-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px 7px;
  }
  .salons-page #salon-create-form > .hint { grid-column: 1 / -1; margin-bottom: 1px; }
  .salons-page #salon-create-form > .field { min-width: 0; }
  .salons-page #salon-create-form > .button { justify-self: start; }
  .workspace-fixed .inline-form,
  .workspace-fixed .toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 8px; }
  .workspace-fixed .field { min-width: 0; }
  .workspace-fixed .inline-form > .button,
  .workspace-fixed .toolbar > .button { justify-self: start; }
  .obligation-card { grid-template-columns: minmax(0, 1fr); }
  .obligation-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .obligation-actions { justify-content: flex-start; max-width: none; }
  .obligation-assignment-form { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; }
}
@media (max-width: 480px) {
  .voice-open span:last-child { display: none; }
  .voice-dialog.voice-dialog-guided[open] {
    top: var(--voice-dialog-top, 50%);
    left: var(--voice-dialog-left, 50%);
    right: auto;
    bottom: auto;
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px - env(safe-area-inset-bottom));
  }
  .voice-dialog.voice-dialog-guided .voice-dialog-shell {
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px - env(safe-area-inset-bottom));
  }
  .voice-dialog-header, .voice-dialog-body { padding-left: 15px; padding-right: 15px; }
  .voice-dialog-actions { padding: 12px 15px 15px; }
  .voice-record-actions { grid-template-columns: minmax(0, 1fr); }
  .voice-record-actions .button { width: 100%; }
  .voice-record-button { width: 100%; min-width: 0; }
  .voice-command-help-head { display: none; }
  .voice-command-help-list {
    height: var(--voice-help-two-rows-height, 128px);
    max-height: var(--voice-help-two-rows-height, 128px);
  }
  .voice-command-help-row { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 11px 12px; }
  .voice-dialog-guided .voice-dialog-actions .button { flex: 1 1 130px; }
  .salons-page-heading .page-lead { margin-bottom: 6px; }
  .salons-page > .record-tabs { margin-bottom: 7px; }
  .salons-page > #salon-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 7px; }
  .salons-page > #salon-search > .field { min-width: 0; }
  .salons-page > #salon-search > a { grid-column: 1 / -1; }
  .obligation-meta { grid-template-columns: minmax(0, 1fr); }
}
@media (max-height: 600px) {
  .app-content.salons-page { padding: 8px; }
  .salons-page-heading .page-lead,
  .salons-page #salon-create-form > .hint { display: none; }
  .salons-page > .salon-create-section h2 { display: none; }
  .salons-page > .record-tabs { margin-bottom: 4px; padding: 2px; }
  .salons-page > .record-tabs a { padding-top: 3px; padding-bottom: 3px; }
  .salons-page > .salon-create-section { margin: 5px 0; padding: 6px; }
  .salons-page #salon-create-form { gap: 3px 6px; }
  .salons-page #salon-create-form input,
  .salons-page #salon-create-form select { height: 34px; min-height: 34px; }
  .salons-page #salon-create-form .field { gap: 0; }
  .salons-page #salon-create-form > .button { min-height: 34px; padding-top: 5px; padding-bottom: 5px; }
  .workspace-fixed { padding-bottom: 6px; }
  .workspace-fixed .page-lead { display: none; }
  .workspace-fixed .workspace-action-panel { padding: 7px; }
  .workspace-fixed .inline-form,
  .workspace-fixed .toolbar { gap: 3px 6px; }
  .voice-dialog-guided .voice-dialog-header { padding-top: 12px; padding-bottom: 10px; }
  .voice-dialog-guided .voice-dialog-body { padding-top: 12px; padding-bottom: 12px; }
  .voice-dialog-guided .voice-dialog-actions { padding-top: 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}
