:root {
  --bg: #ffffff;
  --text: #111111;
  --hint: #6b7280;
  --link: #2481cc;
  --button: #2481cc;
  --button-text: #ffffff;
  --accent: var(--button);
  --secondary-bg: #f4f6fb;
  --input-bg: #ffffff;
  --border: rgba(0, 0, 0, 0.12);
  --group-border: rgba(0, 0, 0, 0.72);
  --danger: #ff3b30;
  --success: #34c759;
  --warning: #ff9500;
  --sparkline: #2481cc;
  --radius-lg: 8px;
  --radius-md: 6px;
  --radius-sm: 4px;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-seg: 0 1px 3px rgba(0, 0, 0, 0.08);
  --hero-glow: rgba(56, 132, 255, 0.14);
  --surface: var(--bg);
  --surface-elevated: var(--secondary-bg);
  --z-modal: 400;
  --z-toast: 550;
  --z-confirm: 650;
  --z-photo-viewer: 700;
  --z-update-banner: 560;
}

html[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0b0b0f;
  --text: #ffffff;
  --hint: #a1a1aa;
  --link: #6eb6ff;
  --button: #2481cc;
  --button-text: #ffffff;
  --accent: var(--button);
  --secondary-bg: #16161d;
  --input-bg: #1f1f28;
  --border: rgba(255, 255, 255, 0.14);
  --group-border: rgba(255, 255, 255, 0.42);
  --sparkline: #6eb6ff;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-seg: 0 1px 3px rgba(0, 0, 0, 0.4);
  --hero-glow: rgba(56, 132, 255, 0.22);
  color-scheme: dark;
}

html[data-theme="dark"] .theme-toggle {
  background: rgba(255, 255, 255, 0.08);
}

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

html {
  height: -webkit-fill-available;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  overflow-x: hidden;
}

#app.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

.ios-install-modal__title {
  margin: 0 0 8px;
  font-size: 18px;
}

.ios-install-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}

.ios-install-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.45;
}

.ios-install-step__num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ios-share-icon {
  display: inline-block;
  font-size: 18px;
  line-height: 1;
  vertical-align: middle;
}

.ios-install-other {
  margin: 12px 0;
}

.ios-install-other .btn {
  width: 100%;
  margin-top: 8px;
}

.header {
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
  background: var(--secondary-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header__user {
  font-size: 14px;
  color: var(--hint);
  min-width: 0;
  flex: 1;
}

.header__tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.tasks-wrap {
  position: relative;
}

.header-tasks-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  min-width: 7.25rem;
  padding: 0 12px 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--secondary-bg);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  font: inherit;
}

.header-tasks-btn:hover,
.header-tasks-btn[aria-expanded="true"] {
  border-color: var(--button);
}

.header-tasks-btn__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.header-tasks-btn__label {
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}

.header-tasks-panel {
  right: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: contain;
  box-sizing: border-box;
}

.header-tasks-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
  padding: 14px 16px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.header-tasks-panel__header .profile-menu__name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.header-tasks-panel__header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.tasks-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.tasks-btn:active {
  transform: scale(0.97);
}

.tasks-btn--primary {
  background: var(--button);
  color: var(--button-text);
  box-shadow: 0 1px 2px rgba(36, 129, 204, 0.28);
}

.tasks-btn--primary:hover {
  filter: brightness(1.06);
}

.tasks-btn__plus {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
}

.tasks-btn--ghost {
  width: 36px;
  padding: 0;
  background: var(--secondary-bg);
  color: var(--hint);
  font-size: 1.35rem;
  font-weight: 500;
}

.tasks-btn--ghost:hover {
  background: color-mix(in srgb, var(--border) 55%, var(--secondary-bg));
  color: var(--text);
}

.header-tasks-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.header-tasks-toolbar {
  flex-shrink: 0;
  padding: 12px 16px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.header-tasks-layout {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}

.header-tasks-list-pane {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.header-tasks-body {
  padding: 8px 12px 16px;
}

.header-tasks-detail-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--secondary-bg);
}

.header-tasks-detail-back {
  align-self: flex-start;
  margin: 8px 12px 0;
  border: 0;
  background: transparent;
  color: var(--link);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
  padding: 4px 0;
}

.header-tasks-detail-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 4px 12px 16px;
}

.tasks-group {
  margin-bottom: 12px;
}

.tasks-group__title {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hint);
}

.tasks-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tasks-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.tasks-row--active {
  border-color: var(--button);
  background: rgba(10, 132, 255, 0.06);
}

.tasks-row__check {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 8px;
  flex-shrink: 0;
}

.tasks-row__complete {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--secondary-bg);
  color: var(--hint);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.tasks-row__complete:hover {
  border-color: #1b7a32;
  color: #1b7a32;
}

.tasks-row__complete--done {
  border-color: #1b7a32;
  background: rgba(52, 199, 89, 0.12);
  color: #1b7a32;
  cursor: default;
}

.tasks-row__complete--idle {
  opacity: 0.35;
  cursor: default;
}

.tasks-row__main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 10px 8px 0;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.tasks-row__title {
  font-weight: 650;
  font-size: 0.92rem;
  line-height: 1.3;
}

.tasks-row__sub {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
  font-size: 0.76rem;
  color: var(--hint);
}

.tasks-row__due--overdue {
  color: #b42318;
  font-weight: 650;
}

.tasks-row__due--today {
  color: #b45309;
  font-weight: 650;
}

.tasks-row__progress {
  font-weight: 650;
  color: var(--link);
}

.tasks-row__tag {
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 650;
}

.tasks-row__tag--done {
  color: #1b7a32;
  background: rgba(52, 199, 89, 0.1);
}

.tasks-row__tag--cancel {
  color: #8b2e24;
  background: rgba(192, 57, 43, 0.1);
}

.tasks-dept {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}

.tasks-dept--sales {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.tasks-dept--subscribers {
  background: rgba(5, 150, 105, 0.12);
  color: #047857;
}

.tasks-dept--tech {
  background: rgba(217, 119, 6, 0.14);
  color: #b45309;
}

.tasks-item__tag.tasks-dept {
  font-weight: 600;
}

.tasks-detail__head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.tasks-detail__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
}

.tasks-detail__due {
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--link);
}

.tasks-detail__due.tasks-row__due--overdue {
  color: #b42318;
}

.tasks-detail__due.tasks-row__due--today {
  color: #b45309;
}

.tasks-detail {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tasks-create {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.tasks-create__title,
.tasks-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hint);
}

.tasks-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--hint);
}

.tasks-field .input {
  font-size: 0.92rem;
}

.tasks-picks {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 140px;
  overflow: auto;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
}

.tasks-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
}

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

.ticket-helpers-field__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.ticket-helpers-picks {
  max-height: 160px;
}

.tasks-mode {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tasks-mode__opt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
}

.tasks-create__submit {
  align-self: flex-start;
}

.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tasks-item {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
}

.tasks-item__top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.tasks-item__title {
  font-weight: 650;
  font-size: 0.95rem;
}

.tasks-item__due {
  flex-shrink: 0;
  font-size: 0.78rem;
  color: var(--link);
  font-weight: 600;
}

.tasks-item__body {
  margin: 6px 0 0;
  font-size: 0.88rem;
  color: var(--text);
  white-space: pre-wrap;
}

.tasks-check {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tasks-check__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tasks-check__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hint);
}

.tasks-check__progress {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--link);
}

.tasks-check__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tasks-check__item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  padding: 2px 0;
}

.tasks-check__item input {
  margin-top: 2px;
  flex-shrink: 0;
}

.tasks-check__item span {
  flex: 1;
  min-width: 0;
}

.tasks-check__item--done span {
  text-decoration: line-through;
  color: var(--hint);
}

.tasks-check__del {
  border: 0;
  background: transparent;
  color: var(--hint);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.tasks-check__del:hover {
  color: var(--danger, #b42318);
}

.tasks-check__add {
  display: flex;
  gap: 6px;
  align-items: center;
}

.tasks-check__add .input {
  flex: 1;
  min-width: 0;
  font-size: 0.88rem;
  padding: 6px 8px;
}

.tasks-check__enable {
  align-self: flex-start;
  border: 0;
  background: transparent;
  color: var(--link);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.tasks-check--empty {
  margin-top: 6px;
}

.tasks-checklist-toggle {
  margin-top: 2px;
}

.tasks-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--hint);
}

.tasks-item__tag {
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(10, 132, 255, 0.12);
  color: var(--link);
  font-weight: 650;
}

.tasks-assignee--done {
  text-decoration: line-through;
  opacity: 0.7;
}

.tasks-item__people {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  flex: 1 1 100%;
}

.tasks-assignee-block {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  max-width: 100%;
}

.tasks-assignee-result,
.tasks-result__text {
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.35;
}

.tasks-result {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tasks-result__toggle {
  align-self: flex-start;
  border: 0;
  background: transparent;
  color: var(--link);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.tasks-result__editor {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tasks-result__input {
  width: 100%;
  min-height: 56px;
  resize: vertical;
  font-size: 0.88rem;
}

.tasks-result__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.tasks-result__actions--main {
  justify-content: flex-start;
}

.tasks-result__label {
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.tasks-result--done {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(52, 199, 89, 0.08);
}

.tasks-view-nav {
  margin: 0;
}

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

.tasks-toolbar-top .tasks-seg {
  flex: 1 1 auto;
  min-width: 0;
}

.tasks-more__btn {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--secondary-bg);
  color: var(--hint);
  font: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.tasks-more__btn:hover,
.tasks-more__btn--active {
  color: var(--text);
  border-color: color-mix(in srgb, var(--link, #0a84ff) 45%, var(--border));
  background: color-mix(in srgb, var(--link, #0a84ff) 8%, var(--secondary-bg));
}

.tasks-more__btn--dirty::after {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  margin: -14px 0 0 22px;
  border-radius: 50%;
  background: var(--link, #0a84ff);
}

.tasks-filters-wrap {
  margin-top: 8px;
}

.tasks-filters-wrap.hidden {
  display: none;
}

.tasks-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--secondary-bg);
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
}

.tasks-seg__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 10px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--hint);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.tasks-seg__btn:hover {
  color: var(--text);
}

.tasks-seg__btn--active {
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-seg);
}

.tasks-seg__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--button) 14%, transparent);
  color: var(--button);
  font-size: 0.72rem;
  font-weight: 700;
}

.tasks-seg__btn--active .tasks-seg__count {
  background: color-mix(in srgb, var(--button) 18%, transparent);
}

.tasks-filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
}

.tasks-scope-nav,
.tasks-pills {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.tasks-pills::-webkit-scrollbar {
  display: none;
}

.tasks-pill {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--hint);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tasks-pill:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--secondary-bg) 80%, transparent);
}

.tasks-pill--active {
  background: color-mix(in srgb, var(--button) 12%, var(--bg));
  border-color: color-mix(in srgb, var(--button) 28%, transparent);
  color: var(--button);
}

.tasks-search {
  display: block;
  margin: 0;
}

.tasks-search__input {
  width: 100%;
  height: 40px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  border-radius: 12px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tasks-search__input:focus {
  border-color: color-mix(in srgb, var(--button) 55%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--button) 16%, transparent);
}

.tasks-search__input::placeholder {
  color: var(--hint);
}

.tasks-create__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.tasks-ticket-results {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
  max-height: 160px;
  overflow: auto;
}

.tasks-ticket-hit {
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  padding: 8px 10px;
  font-size: 0.88rem;
  cursor: pointer;
  color: var(--text);
}

.tasks-ticket-hit:hover {
  border-color: var(--accent, #3b82f6);
}

.tasks-ticket-picked {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface, var(--bg));
  font-size: 0.9rem;
}

.task-tpl-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 12px 0;
}

.task-tpl-row {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-tpl-row__head {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: end;
}

@media (max-width: 720px) {
  .task-tpl-row__head {
    grid-template-columns: 1fr;
  }
}

.tasks-item__tag--cancel {
  color: #8b2e24;
  background: rgba(192, 57, 43, 0.1);
}

.tasks-item--cancelled {
  opacity: 0.88;
}

.tasks-result__text--empty {
  color: var(--hint);
  font-style: italic;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.card--compact__helper-hint {
  font-size: 0.78rem;
  color: var(--hint);
  font-weight: 600;
}

.tasks-item--journal {
  opacity: 0.96;
}

.tasks-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  align-items: center;
}

.tasks-item__done {
  font-size: 0.82rem;
  color: #1b7a32;
  font-weight: 600;
}

.header-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--secondary-bg);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}

.header-bell:hover,
.header-bell[aria-expanded="true"] {
  border-color: var(--button);
}

.header-bell__icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.header-bell__badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 999px;
  background: #c0392b;
  border: 1.5px solid var(--secondary-bg);
}

.header-bell__badge:not(:empty) {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  color: #fff;
  text-align: center;
}

@keyframes header-bell-ring {
  0%,
  100% {
    transform: rotate(0deg);
  }
  15% {
    transform: rotate(14deg);
  }
  30% {
    transform: rotate(-12deg);
  }
  45% {
    transform: rotate(10deg);
  }
  60% {
    transform: rotate(-6deg);
  }
  75% {
    transform: rotate(3deg);
  }
}

.header-bell--ring .header-bell__icon {
  transform-origin: top center;
  animation: header-bell-ring 0.85s ease-in-out;
}

.header-bell-wrap {
  position: relative;
}

.header-bell-panel {
  right: 0;
}

/* Phone: keep bell/profile dropdown on-screen; tasks use fullscreen layout below. */
@media (max-width: 720px) {
  .header-bell-panel.profile-menu__panel,
  .profile-menu > .profile-menu__panel {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 56px);
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    max-height: min(70dvh, calc(100dvh - 72px - env(safe-area-inset-bottom, 0px)));
    z-index: 210;
  }
}

/* Tasks: fullscreen on phone/tablet, large panel on desktop. */
@media (max-width: 1024px) {
  .header-tasks-panel.profile-menu__panel {
    position: fixed;
    inset: 0;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border-radius: 0;
    border: none;
    z-index: 320;
    box-shadow: none;
    padding-top: max(8px, env(safe-area-inset-top, 0px));
    padding-right: max(8px, env(safe-area-inset-right, 0px));
    padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
    padding-left: max(8px, env(safe-area-inset-left, 0px));
  }

  .header-tasks-layout.show-detail .header-tasks-list-pane {
    display: none;
  }

  .header-tasks-detail-pane:not(.hidden) {
    position: absolute;
    inset: 0;
    z-index: 2;
  }

  body.tasks-panel-open {
    overflow: hidden;
  }
}

@media (min-width: 1025px) {
  .header-tasks-panel.profile-menu__panel {
    position: fixed;
    top: max(12px, env(safe-area-inset-top, 0px));
    right: max(16px, env(safe-area-inset-right, 0px));
    left: auto;
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    width: min(920px, calc(100vw - 32px));
    max-width: none;
    max-height: none;
    height: auto;
    z-index: 320;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
  }

  .header-tasks-layout.has-detail .header-tasks-list-pane {
    flex: 0 0 38%;
    max-width: 38%;
    border-right: 1px solid var(--border);
  }

  .header-tasks-layout.has-detail .header-tasks-detail-pane {
    flex: 1 1 auto;
  }
}

/* Phone + tablet: assistant fills the viewport (not a floating dropdown). */
@media (max-width: 1024px) {
  .assistant-panel.profile-menu__panel {
    position: fixed;
    inset: 0;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding-top: max(12px, env(safe-area-inset-top, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    z-index: 320;
    box-shadow: none;
  }

  .assistant-panel .assistant-thread,
  .assistant-panel .assistant-thread.has-messages {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
  }

  body.assistant-fullscreen-open {
    overflow: hidden;
  }
}

.header-bell-inbox {
  margin: 8px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(42vh, 320px);
  overflow: auto;
}

.header-bell-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.header-bell-clear {
  flex-shrink: 0;
  padding: 4px 10px;
  font-size: 12px;
}

.header-bell-item {
  padding: 10px 10px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.header-bell-item--unread {
  border-color: color-mix(in srgb, #c0392b 45%, var(--border));
  background: color-mix(in srgb, #c0392b 6%, var(--surface));
}

.header-bell-item__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.header-bell-item__title {
  font-size: 0.92rem;
  font-weight: 650;
  margin: 0 0 4px;
}

.header-bell-item__dismiss {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin: -2px -4px 0 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--hint);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.header-bell-item__dismiss:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--hint) 16%, transparent);
}

.header-bell-item__body {
  font-size: 0.86rem;
  color: var(--text);
  white-space: pre-wrap;
  margin: 0 0 6px;
}

.header-bell-item__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--hint);
}

.header-bell-item__link {
  color: var(--button);
  text-decoration: none;
  font-weight: 600;
}

.header-bell-empty {
  padding: 16px 12px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 88%, var(--hint));
}

.header-bell-empty__title {
  margin: 0 0 4px;
  font-size: 0.92rem;
  font-weight: 600;
}

/* Compact notification settings under the empty inbox (collapsed by default) */
.header-bell-settings.profile-menu__section {
  gap: 0;
  padding-top: 8px;
  margin-top: 0;
}

.header-bell-settings__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 2px 0;
}

.header-bell-settings__summary::-webkit-details-marker {
  display: none;
}

.header-bell-settings__summary-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.header-bell-settings__chevron {
  flex: 0 0 auto;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--hint);
  border-bottom: 2px solid var(--hint);
  transform: rotate(45deg);
  opacity: 0.7;
  transition: transform 0.15s ease;
}

.header-bell-settings[open] > .header-bell-settings__summary .header-bell-settings__chevron {
  transform: rotate(-135deg);
}

.header-bell-settings__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
}

.header-bell-panel #notifications-panel > .card__meta,
.header-bell-panel #notifications-panel .notifications-subsection > .card__meta,
.header-bell-panel .header-bell-settings__body > .card__meta {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
}

.header-bell-panel #notifications-panel .notifications-subsection {
  margin-top: 0;
  padding-top: 6px;
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.header-bell-panel #notifications-panel .notifications-subsection .btn,
.header-bell-panel #notifications-panel > .btn,
.header-bell-panel .header-bell-settings__body > .header-bell-settings__actions .btn {
  width: auto;
  min-height: 30px;
  margin-top: 0;
  padding: 4px 10px;
  font-size: 12px;
}

.header-bell-panel .header-bell-settings__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.header-bell-panel .push-quiet-form {
  margin-top: 4px;
  padding-top: 6px;
}

.header-bell-panel .push-quiet-form__row {
  gap: 6px;
  margin-bottom: 4px;
}

.header-bell-panel .push-quiet-form__row label {
  gap: 2px;
  font-size: 11px;
  flex: 1 1 90px;
}

.header-bell-panel .push-quiet-form__row .input {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 12px;
}

.header-bell-panel .push-quiet-form .btn {
  width: 100%;
}

.profile-menu {
  position: relative;
}

.profile-menu__backdrop {
  position: fixed;
  inset: 0;
  z-index: 190;
  background: transparent;
  touch-action: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: default;
}

.header.header--profile-open {
  z-index: 200;
}

.profile-menu__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--secondary-bg);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}

.profile-menu__btn:hover,
.profile-menu__btn[aria-expanded="true"] {
  border-color: var(--button);
}

.profile-menu__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  border-radius: 50%;
  background: var(--button);
  color: var(--button-text);
  overflow: hidden;
}

.profile-menu__avatar--photo {
  background: transparent;
  padding: 0;
}

.profile-menu__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-menu__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 120;
  width: min(320px, calc(100vw - 24px));
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--secondary-bg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
}

.profile-menu__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.profile-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.profile-menu__name {
  font-size: 15px;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-menu__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  line-height: 1.4;
}

.profile-menu__row > span:first-child {
  color: var(--hint);
  flex-shrink: 0;
}

.profile-menu__row > span:last-child {
  text-align: right;
  min-width: 0;
  word-break: break-word;
}

.profile-menu__notice {
  font-size: 13px;
  color: var(--warning);
  line-height: 1.4;
}

.id-badge {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: rgba(15, 22, 32, 0.72);
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

body.id-badge-open {
  overflow: hidden !important;
  overscroll-behavior: none;
  touch-action: none;
}

.id-badge__close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.id-badge__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 100%;
  max-height: 100%;
  pointer-events: auto;
}

.id-badge__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-shrink: 0;
}

.id-badge__action {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.id-badge__action:active {
  background: rgba(255, 255, 255, 0.28);
}

.id-badge__action svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* PDF портрет 1133×1600 px (≈ A6/A7 ratio 0.71) — одинаково на PC и телефоне */
.id-badge__card {
  position: relative;
  width: min(420px, 92vw, calc((92vh - 72px) * 1133 / 1600));
  aspect-ratio: 1133 / 1600;
  max-height: min(calc(92vh - 72px), 880px);
  border-radius: 8px;
  border: 2px solid #1a3a6b;
  background-color: #fff;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  color: #1a2a44;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.4),
    0 0 0 3px rgba(255, 255, 255, 0.92),
    0 0 0 5px #1a3a6b,
    0 0 0 6px rgba(184, 150, 90, 0.85),
    inset 0 0 0 1.5px rgba(184, 150, 90, 0.55);
  overflow: hidden;
  container-type: size;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Номер после «Удостоверение №» — чуть ниже, в линию с № */
.id-badge__heading {
  position: absolute;
  left: 76.5%;
  top: 19.7%;
  max-width: 21%;
  font-size: 5.6cqh;
  font-weight: 800;
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  color: #1a3a6b;
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Фото перекрывает пунктир со всех сторон.
   Подгонка вручную: left/top/width/height (проценты от карточки).
   Файл: app/web/static/styles.css → блок .id-badge__photo
   left↑ = правее, top↑ = ниже, width/height↑ = больше. */
.id-badge__photo {
  position: absolute;
  left: 7.0%;
  top: 31.0%;
  width: 40.2%;
  height: 38.0%;
  border-radius: 5px;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  background: transparent;
  z-index: 1;
  /* Простая тонкая рамка — не как у карточки (без золота и двойного контура) */
  border: 1px solid rgba(26, 42, 68, 0.28);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.85),
    0 1px 3px rgba(15, 22, 32, 0.12);
}

.id-badge__photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  border-radius: 0;
}

.id-badge__photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10cqh;
  font-weight: 700;
  color: #9aa6b5;
  background: rgba(243, 245, 248, 0.35);
}

.id-badge__v {
  position: absolute;
  left: 52%;
  right: 8%;
  font-size: 2.7cqh;
  font-weight: 700;
  color: #1a2a44;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.id-badge__v--last { top: 38.2%; }
.id-badge__v--first { top: 44.6%; }
.id-badge__v--middle { top: 51.0%; }
.id-badge__v--job { top: 64.8%; }

.id-badge__v--issued {
  left: 24.6%;
  right: auto;
  width: 32%;
  top: 74.6%;
  font-size: 3.05cqh;
  font-weight: 700;
  color: #1a2a44;
  background: transparent;
}

/* Дата окончания — только текст поверх волны, без подложки */
.id-badge__v--until {
  left: 46.0%;
  right: auto;
  width: auto;
  max-width: 30%;
  top: 80.6%;
  font-size: 3.05cqh;
  font-weight: 700;
  color: #1a2a44;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0;
  border: 0;
  line-height: 1;
  vertical-align: baseline;
}

/* Телефон — под «Действительно до:»; подпись серая, номер как даты */
.id-badge__v--phone {
  left: 7.2%;
  right: auto;
  width: auto;
  max-width: 55%;
  top: 86.3%;
  font-size: 2.9cqh;
  font-weight: 700;
  background: transparent;
  line-height: 1;
}

.id-badge__phone-label {
  font-weight: 600;
  color: #80899f;
}

.id-badge__phone-num {
  font-weight: 700;
  color: #1a2a44;
}

@media print {
  @page {
    size: auto;
    margin: 8mm;
  }

  body * {
    visibility: hidden !important;
  }

  body.id-badge-open .id-badge__card,
  body.id-badge-open .id-badge__card * {
    visibility: visible !important;
  }

  body.id-badge-open .id-badge {
    position: static !important;
    inset: auto !important;
    background: none !important;
    padding: 0 !important;
    gap: 0 !important;
    overflow: visible !important;
    touch-action: auto !important;
  }

  body.id-badge-open .id-badge__close,
  body.id-badge-open .id-badge__actions {
    display: none !important;
  }

  body.id-badge-open .id-badge__stage {
    max-height: none !important;
  }

  body.id-badge-open .id-badge__card {
    width: 90mm !important;
    max-height: none !important;
    box-shadow:
      0 0 0 3px #fff,
      0 0 0 5px #1a3a6b,
      0 0 0 6px #b8965a,
      inset 0 0 0 1.5px rgba(184, 150, 90, 0.55) !important;
    margin: 0 auto !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

@media (max-width: 560px) {
  .id-badge__v--issued,
  .id-badge__v--until {
    font-size: 3.1cqh;
  }
}

.profile-menu__section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}

.profile-menu__section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-menu__theme,
.profile-menu__theme.theme-toggle {
  display: flex;
  width: 100%;
  height: auto;
  min-height: 40px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  justify-content: center;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
}

.profile-menu__panel > .btn {
  display: flex;
  width: 100%;
  margin-top: 8px;
  box-sizing: border-box;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-card);
}

.theme-toggle .btn__icon {
  width: 18px;
  height: 18px;
}

.theme-toggle--floating {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 130;
}

.theme-toggle.login-only {
  display: none;
}

body.login-visible .theme-toggle.login-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.content {
  flex: 1;
  padding: 16px;
}

.tab {
  display: none;
}

.tab.active {
  display: block;
}

/* —— Shared page shell (timesheet look) —— */
.page-hero,
.ts-hero,
.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 80% at 0% 0%, var(--hero-glow), transparent 55%),
    linear-gradient(160deg, var(--secondary-bg), var(--bg));
  border: 1px solid var(--border);
}

.page-hero__text,
.ts-hero__text {
  min-width: 0;
  flex: 1 1 160px;
}

.page-hero__title,
.ts-hero__title,
.section-header h2,
.section-header > h2 {
  margin: 0 0 2px;
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-hero__sub,
.ts-hero__sub,
.section-header__subtitle {
  margin: 0;
  color: var(--hint);
  font-size: 0.82rem;
  line-height: 1.3;
}

.page-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.seg-nav,
.ts-subnav,
.work-view-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
  padding: 4px;
  border-radius: var(--radius-md);
  background: var(--secondary-bg);
  border: 1px solid var(--border);
  width: fit-content;
  max-width: 100%;
}

.work-view-switch {
  justify-content: center;
  width: 100%;
  max-width: 100%;
}

.seg-nav__btn,
.ts-subnav__btn,
.work-view-switch__btn {
  flex: 0 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--hint);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.work-view-switch__btn {
  flex: 1 1 120px;
  max-width: 200px;
}

.seg-nav__btn:hover,
.ts-subnav__btn:hover,
.work-view-switch__btn:hover {
  color: var(--text);
}

.seg-nav__btn.active,
.ts-subnav__btn.active,
.work-view-switch__btn.active {
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-seg);
  font-weight: 600;
}

a.work-view-switch__btn {
  color: inherit;
  text-decoration: none;
}

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

.offline-indicator {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
}

.offline-indicator--offline {
  background: #dc2626;
}

.offline-indicator--syncing {
  background: #d97706;
}

.badge--compact {
  font-size: 11px;
  padding: 2px 8px;
  flex-shrink: 0;
}

.card--compact__indicators {
  display: inline-flex;
  gap: 4px;
  flex-shrink: 0;
}

.card--compact__indicator {
  font-size: 12px;
  line-height: 1;
}

.card--compact__indicator--new {
  color: #ef4444;
  font-size: 14px;
}

.card--compact__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.card--compact__action {
  flex: 1 1 auto;
}

.section-header h3 {
  font-size: 16px;
  margin: 16px 0 12px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--secondary-bg);
}

/* Compact chip controls — same look as «Сегодня»: Все техники / статусы / время */
.filters .input {
  flex: 1 1 0;
  min-width: 0;
  max-width: 200px;
  width: auto;
  margin-top: 0;
  font-size: 12px;
  padding: 6px 8px;
  line-height: 1.2;
  text-align: left;
}

.filters__search {
  flex: 1 1 280px;
  min-width: 0;
  max-width: 420px;
  width: 100%;
  font-size: 13px;
  padding: 8px 10px;
}

.filters__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: 100%;
}

.filters__chips .input {
  flex: 0 1 160px;
  min-width: 0;
  max-width: 200px;
}

.filters__sep {
  flex: 0 0 auto;
  color: var(--hint);
  font-size: 12px;
  line-height: 1;
}

.filters input[type="date"] {
  flex: 0 1 148px;
  max-width: 160px;
  min-width: 0;
}

.filters .btn {
  flex: 0 0 auto;
  margin-top: 0;
  padding: 6px 12px;
  font-size: 12px;
  line-height: 1.2;
}

.filters--inline {
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
  margin-bottom: 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.filters--inline .input {
  flex: 0 1 160px;
  min-width: 0;
  max-width: 200px;
}

/* Desktop: search + dates + selects + button — wrap instead of clipping under sidebar */
@media (min-width: 721px) {
  .filters--oneline {
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .filters--oneline .filters__search {
    flex: 1 1 200px;
    min-width: 160px;
    max-width: 280px;
    width: auto;
  }

  .filters--oneline > .input,
  .filters--oneline > select.input {
    flex: 0 1 140px;
    min-width: 110px;
    max-width: 170px;
    width: auto;
  }

  .filters--oneline > input[type="date"] {
    flex: 0 1 138px;
    max-width: 138px;
    min-width: 120px;
  }

  .filters--oneline > .filters__sep {
    flex: 0 0 auto;
  }

  .filters--oneline > .btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .filters--oneline .salary-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: auto;
    flex: 1 1 100%;
  }

  .filters--oneline .salary-presets .btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

/* Salary: presets on first row, controls on the next — never spill under sidebar */
#salary-filters.filters {
  justify-content: flex-start;
  max-width: 100%;
  box-sizing: border-box;
}

#salary-filters .salary-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  flex: 1 1 100%;
}

.push-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  margin: 0;
  padding: 10px 16px;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--border);
  background: var(--card-bg, #f4f8ff);
}

.push-banner.hidden {
  display: none !important;
}

.push-banner__text {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  flex: 1 1 180px;
}

.push-banner__actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.app-update-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #f59e0b;
  background: #fffbeb;
  color: #92400e;
}

html[data-theme="dark"] .app-update-banner {
  background: #422006;
  color: #fde68a;
  border-bottom-color: #b45309;
}

.app-update-banner.hidden {
  display: none !important;
}

.app-update-banner__title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
}

.app-update-banner__text,
.app-update-banner__hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}

.app-update-banner__hint {
  margin-top: 6px;
  font-weight: 600;
}

.app-update-banner__content {
  flex: 1 1 220px;
}

.app-update-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}

.push-quiet-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.push-quiet-form__row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.push-quiet-form__row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  flex: 1 1 120px;
}

.card__map-link {
  margin-left: 8px;
  font-size: 13px;
  color: var(--link);
  text-decoration: none;
}

.phone-link {
  color: var(--link);
  text-decoration: underline;
  font-weight: 500;
}

.salary-rates-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.salary-rates-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 0;
  font-size: 12px;
  color: var(--hint);
}

.salary-rates-form label .input {
  margin-top: 0;
}

.input--readonly,
.input:disabled {
  opacity: 0.75;
  background: var(--bg);
}

.input--required {
  border-color: color-mix(in srgb, var(--accent, #2481cc) 55%, var(--border));
}

label.label--required::after {
  content: " *";
  color: #c2410c;
  font-weight: 600;
}

.salary-rate-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg);
}

.salary-rate-group__title {
  margin: 0;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--hint);
  background: var(--secondary-bg);
  border-bottom: 1px solid var(--border);
}

.salary-rate-group__body {
  display: flex;
  flex-direction: column;
}

.salary-rate-group__body--flat {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg);
}

.salary-rate-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
}

.salary-rate-row:last-child {
  border-bottom: none;
}

.salary-rate-row__name {
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}

.salary-rate-row__control {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.salary-rate-row__input {
  width: 88px;
  margin: 0;
  padding: 5px 8px;
  font-size: 13px;
  line-height: 1.2;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.salary-rate-row__unit {
  min-width: 28px;
  font-size: 11px;
  font-weight: 650;
  color: var(--hint);
}

.salary-rate-row__delete {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  color: var(--hint);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.salary-rate-row__delete:hover {
  color: var(--danger, #ff3b30);
  border-color: rgba(255, 59, 48, 0.35);
}

.salary-rates-actions {
  margin-top: 4px;
}

.salary-rates-actions .btn {
  width: auto;
}

.notif-templates-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 12px;
}

.notif-tpl {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  padding: 0 12px 10px;
}

.notif-tpl > summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 0;
}

.notif-tpl > summary::-webkit-details-marker {
  display: none;
}

.notif-tpl__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 4px;
}

.notif-tpl__meta {
  display: grid;
  gap: 10px;
}

@media (min-width: 720px) {
  .notif-tpl__meta {
    grid-template-columns: 1fr 1fr;
  }
}

.notif-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 2px 10px 2px 0;
  font-size: 13px;
}

.notif-check--summary {
  font-size: 14px;
}

.notif-manual-send {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notif-manual-audience {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.salary-rate-add-form {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--secondary-bg);
}

.salary-rate-add-form__title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 650;
  color: var(--text);
}

.salary-rate-add-form__row {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

@media (min-width: 720px) {
  .salary-rate-add-form__row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .salary-rate-add-form__row--compact {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr);
  }
}

/* .filters .input / .filters__search — defined above with compact chip sizing */

#tab-settings .settings-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: min(100%, 720px);
  max-width: 720px;
  margin: 0 auto;
}

.settings-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  margin: 0 auto 14px;
  padding: 4px;
  width: min(100%, 720px);
  max-width: 720px;
  border-radius: var(--radius-md);
  background: var(--secondary-bg);
  border: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.settings-chips::-webkit-scrollbar {
  display: none;
}

.settings-chip {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--hint);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.settings-chip:hover {
  color: var(--text);
}

.settings-chip--active {
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-seg);
  font-weight: 600;
}

.settings-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-subcard + .settings-subcard {
  margin-top: 0;
}

.settings-subcard .card__subtitle {
  font-size: 14px;
  font-weight: 600;
  margin: 12px 0 6px;
}

.notifications-subsection {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.notifications-subsection .card__subtitle {
  font-size: 14px;
  font-weight: 600;
  margin: 12px 0 6px;
}

.notifications-subsection .btn {
  width: 100%;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  box-sizing: border-box;
}

.btn__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15em;
  height: 1.15em;
  font-size: 1.1em;
  line-height: 1;
  flex-shrink: 0;
}

.btn__icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.settings-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.settings-tab {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}

.settings-tab--active {
  border-color: var(--link);
  color: var(--link);
  background: rgba(36, 129, 204, 0.1);
}

.logs-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  margin-bottom: 12px;
}

.logs-filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--hint);
}

.profile-card--enhanced .profile-card__header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.profile-card__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--link);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
}

.profile-card__name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.role-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
}

.role-badge--super_admin { background: #ede9fe; color: #5b21b6; }
.role-badge--dispatcher { background: #dbeafe; color: #1d4ed8; }
.role-badge--technician { background: #dcfce7; color: #15803d; }
.role-badge--salesperson { background: #ffedd5; color: #c2410c; }
.role-badge--none { background: var(--border); color: var(--hint); }

[data-theme="dark"] .role-badge--super_admin { background: #3b2d6b; color: #ddd6fe; }
[data-theme="dark"] .role-badge--dispatcher { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .role-badge--technician { background: #14532d; color: #86efac; }
[data-theme="dark"] .role-badge--salesperson { background: #7c2d12; color: #fdba74; }

.team-users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.team-user-card {
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.team-user-card:hover {
  border-color: var(--link);
}

.team-user-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.team-user-card__name {
  font-weight: 600;
}

.modal__content--wide {
  max-width: 560px;
  width: calc(100% - 24px);
}

.modal__header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.user-editor-panel label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 13px;
}

.password-reset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.password-reset-row .input {
  flex: 1 1 160px;
  min-width: 140px;
}

.user-editor-guest-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.user-editor-badge-photo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.checkbox-row input {
  width: 16px;
  height: 16px;
}

.user-editor-badge-preview {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: var(--surface-2, var(--bg));
  overflow: hidden;
  flex: 0 0 auto;
}

.user-editor-badge-preview--has-photo {
  border-style: solid;
}

.user-editor-badge-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-editor-badge-upload {
  cursor: pointer;
}

.modal__actions--danger {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.settings-collapse > .settings-collapse__toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.settings-collapse__title {
  font-size: 1.05rem;
  font-weight: 700;
}

.settings-collapse__chevron {
  flex: 0 0 auto;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.55;
  transition: transform 0.15s ease;
}

.settings-collapse--open > .settings-collapse__toggle .settings-collapse__chevron {
  transform: rotate(-135deg);
}

.settings-collapse__body {
  margin-top: 12px;
}

.settings-collapse__body[hidden] {
  display: none !important;
}

.dancer-sync-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.dancer-sync-row--webt {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.dancer-sync-row__label {
  font-weight: 600;
  min-width: 5.5rem;
}

.dancer-sync-badge {
  margin: 0;
}

.dancer-ctor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.dancer-webt-hint {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 85%, #0ea5e9 15%);
}

.dancer-webt-filters {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  width: 100%;
  box-sizing: border-box;
}

.dancer-webt-filters__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 8px 0 12px;
}

.dancer-webt-filters__checks {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 8px 0 12px;
}

.dancer-webt-filters__cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 10px;
}

.dancer-webt-filters__cols--3 {
  grid-template-columns: 1fr;
}

@media (min-width: 1100px) {
  .dancer-webt-filters__cols {
    grid-template-columns: 1fr 1fr;
  }

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

.dancer-webt-check-list {
  max-height: 360px;
  min-height: 220px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  background: var(--surface);
}

.dancer-webt-check-list--sm {
  max-height: 280px;
  min-height: 180px;
}

.dancer-webt-check-list label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 0.95rem;
  line-height: 1.35;
  margin: 5px 0;
  word-break: break-word;
}

.dancer-webt-check-list label span {
  flex: 1;
  min-width: 0;
  white-space: normal;
}

.dancer-webt-check-list__cat {
  margin-top: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--hint);
}

.dancer-preview-card {
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 88%, var(--accent, #2563eb) 12%);
}

.dancer-preview-card__label {
  font-size: 1.05rem;
  font-weight: 700;
}

.dancer-preview-card__meta {
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--hint);
}

.dancer-preview-card__arrow {
  margin: 10px 0;
  font-size: 0.85rem;
  color: var(--hint);
}

.dancer-preview-card__value {
  margin-top: 10px;
  font-size: 1rem;
}

.dashboard-departments,
.dashboard-command {
  display: grid;
  gap: 14px;
  margin: 0 0 20px;
}

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

.dashboard-command {
  grid-template-columns: 1fr;
}

.dashboard-command--loading {
  opacity: 0.72;
  transition: opacity 0.2s ease;
}

.kpi-range {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.kpi-range__presets {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, var(--hint));
}

.kpi-range__preset {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.kpi-range__preset.active {
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--border);
}

/* Date row matches schedule «График» filters (compact .input + —). */
.kpi-range__dates {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--secondary-bg);
  width: 100%;
  box-sizing: border-box;
}

.kpi-range__dates .input,
.kpi-range__dates > input[type="date"] {
  width: 100%;
  max-width: none;
  min-width: 0;
  margin-top: 0;
  font-size: 12px;
  padding: 6px 8px;
  line-height: 1.2;
  box-sizing: border-box;
}

.kpi-range__dates .filters__sep {
  flex: 0 0 auto;
  color: var(--hint);
  font-weight: 600;
}

@media (min-width: 721px) {
  .kpi-range {
    flex-wrap: nowrap;
  }

  .kpi-range__dates {
    width: auto;
    min-width: min(320px, 100%);
  }
}

@media (max-width: 720px) {
  #tab-dashboard .page-hero {
    flex-direction: column;
    align-items: stretch;
  }

  #tab-dashboard .page-hero__actions {
    width: 100%;
    margin: 0;
    padding: 0;
  }

  #tab-dashboard .kpi-range {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  #tab-dashboard .kpi-range__presets {
    width: 100%;
    display: inline-flex;
    flex-wrap: nowrap;
    justify-content: stretch;
    box-sizing: border-box;
  }

  #tab-dashboard .kpi-range__preset {
    flex: 1 1 0;
    text-align: center;
    padding: 8px 6px;
    min-width: 0;
  }

  #tab-dashboard .kpi-range__dates {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
  }
}

@media (max-width: 480px) {
  .kpi-range__dates .input,
  .kpi-range__dates > input[type="date"] {
    font-size: 11px;
    padding: 5px 6px;
  }
}

.dashboard-command__range {
  margin: 0;
}

.dashboard-command__columns {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dashboard-dept-col {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.dashboard-dept-col__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 10px;
}

.dashboard-dept-col__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.dashboard-dept-col__hint {
  margin: 0;
  font-size: 0.82rem;
}

.dashboard-dept-col__head .dashboard-fill {
  flex: 1 1 180px;
  max-width: 280px;
}

.dashboard-dept-col__tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.dashboard-dept-empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--hint);
}

.dashboard-fill {
  appearance: none;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--secondary-bg, var(--bg)) 70%, var(--surface));
  padding: 8px 10px;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.dashboard-fill--pending,
.dashboard-fill--error {
  cursor: default;
  opacity: 0.85;
}

.dashboard-fill__head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 6px;
}

.dashboard-fill__label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--hint);
}

.dashboard-fill__meta {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.dashboard-fill__track {
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border) 70%, transparent);
  overflow: hidden;
}

.dashboard-fill__bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent, #2563eb);
  transition: width 0.35s ease;
}

.dashboard-fill.is-good .dashboard-fill__bar {
  background: #15803d;
}

.dashboard-fill.is-mid .dashboard-fill__bar {
  background: #ca8a04;
}

.dashboard-fill.is-low .dashboard-fill__bar {
  background: #b91c1c;
}

.dashboard-fill-extras {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

@media (max-width: 900px) {
  .dashboard-dept-col__head .dashboard-fill {
    max-width: none;
    flex-basis: 100%;
  }
}

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

.dashboard-tile {
  --tile-i: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  padding: 14px 14px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background:
    linear-gradient(165deg, color-mix(in srgb, var(--surface) 92%, var(--accent, #2563eb) 8%) 0%, var(--surface) 55%);
  overflow: hidden;
  animation: dashboard-tile-in 0.42s ease both;
  animation-delay: calc(var(--tile-i) * 45ms);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.dashboard-tile:hover {
  transform: translateY(-2px) scale(1.01);
  border-color: color-mix(in srgb, var(--border) 40%, var(--accent, #2563eb) 60%);
}

@keyframes dashboard-tile-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dashboard-tile__top {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  margin-bottom: 8px;
}

.dashboard-tile__dept {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hint);
}

.dashboard-tile__label {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}

.dashboard-tile__label-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
}

.dashboard-tile__asof {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 999px;
  color: #9a3412;
  background: #ffedd5;
  border: 1px solid #fdba74;
}

.dashboard-tile--asof-yesterday {
  border-color: color-mix(in srgb, #fdba74 55%, var(--border));
}

.dashboard-tile__value-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 10px;
  margin-top: auto;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.dashboard-tile__value {
  font-size: clamp(1.55rem, 3.2vw, 2rem);
  font-weight: 760;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text);
}

.dashboard-tile__value.is-up {
  color: color-mix(in srgb, var(--text) 70%, #15803d 30%);
}

.dashboard-tile__value.is-down {
  color: color-mix(in srgb, var(--text) 70%, #b91c1c 30%);
}

.dashboard-tile__delta {
  font-size: 0.82rem;
  font-weight: 600;
  animation: dashboard-delta-pulse 0.55s ease;
}

.dashboard-tile__delta.is-up {
  color: #15803d;
}

.dashboard-tile__delta.is-down {
  color: #b91c1c;
}

.dashboard-tile__delta.is-flat {
  color: var(--hint);
}

@keyframes dashboard-delta-pulse {
  0% {
    opacity: 0.35;
    transform: translateY(3px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.dashboard-sparkline,
.dashboard-tile__fill-track {
  flex-shrink: 0;
}

.dashboard-sparkline {
  display: block;
  width: 100%;
  height: 36px;
  color: color-mix(in srgb, var(--accent, #2563eb) 75%, var(--text) 25%);
}

.dashboard-sparkline.is-up {
  color: #15803d;
}

.dashboard-sparkline.is-down {
  color: #b91c1c;
}

.dashboard-sparkline.is-flat {
  color: var(--hint);
}

.dashboard-sparkline__area {
  fill: currentColor;
  opacity: 0.12;
}

.kpi-pins-editor {
  margin: 0 0 24px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  animation: dashboard-tile-in 0.28s ease both;
}

.kpi-pins-editor__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.kpi-pins-editor__title {
  font-size: 1.05rem;
  font-weight: 700;
}

.kpi-pins-editor__actions {
  display: flex;
  gap: 8px;
}

.kpi-pins-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.kpi-pins-section__title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hint);
  padding: 4px 2px 0;
}

.dashboard-tile--fill .dashboard-tile__fill-track {
  margin-top: 2px;
}

.dashboard-tile--fill .dashboard-tile__fill-track.is-good .dashboard-fill__bar {
  background: #15803d;
}

.dashboard-tile--fill .dashboard-tile__fill-track.is-mid .dashboard-fill__bar {
  background: #ca8a04;
}

.dashboard-tile--fill .dashboard-tile__fill-track.is-low .dashboard-fill__bar {
  background: #b91c1c;
}

.dashboard-tile__link {
  appearance: none;
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent, #2563eb);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.kpi-pins-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(60vh, 520px);
  overflow: auto;
}

.kpi-pins-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm, 8px);
  background: color-mix(in srgb, var(--secondary-bg, var(--bg)) 80%, var(--surface));
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.kpi-pins-row.is-pinned {
  border-color: color-mix(in srgb, var(--border) 50%, var(--accent, #2563eb) 50%);
  transform: scale(1.01);
}

.kpi-pins-row__check {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  min-width: 0;
  flex: 1;
  cursor: pointer;
}

.kpi-pins-row__label {
  font-weight: 600;
}

.kpi-pins-row__dept {
  font-size: 0.78rem;
  color: var(--hint);
}

.kpi-pins-row__order {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.dashboard-dept-loading {
  grid-column: 1 / -1;
  padding: 20px 12px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 88%, var(--hint));
}

.dashboard-dept-col {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.dashboard-dept-col__title {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 700;
}

.dashboard-dept-col__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dashboard-dept-empty {
  margin: 0;
  font-size: 0.9rem;
  color: var(--hint);
}

.dashboard-dept-metric {
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.dashboard-dept-col__body > .dashboard-dept-metric:first-child,
.dashboard-dept-col__body > .dashboard-dept-metric-row:first-child {
  padding-top: 0;
  border-top: none;
}

.dashboard-dept-metric-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.dashboard-dept-metric-row .dashboard-dept-metric {
  flex: 1 1 0;
  min-width: 0;
  padding-top: 0;
  border-top: none;
}

.dashboard-dept-metric-row__bar {
  flex: 0 0 auto;
  width: 1px;
  align-self: stretch;
  margin: 2px 10px;
  background: var(--border);
}

.dashboard-dept-metric--compact {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.dashboard-dept-metric__label {
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--hint);
}

.dashboard-dept-metric__value-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
}

.dashboard-dept-metric__value-row--total {
  margin: 4px 0 8px;
}

.dashboard-dept-metric__value {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
}

.dashboard-dept-metric__delta {
  font-size: 0.82rem;
  font-weight: 600;
}

.dashboard-dept-metric__delta.is-up {
  color: #1f8a4c;
}

.dashboard-dept-metric__delta.is-down {
  color: #c0392b;
}

.dashboard-dept-metric__delta.is-flat {
  color: var(--hint);
}

.dashboard-dept-metric__value.is-up {
  color: #1f8a4c;
}

.dashboard-dept-metric__value.is-down {
  color: #c0392b;
}

.dashboard-dept-metric__value.is-flat {
  color: var(--hint);
}

.dashboard-dept-metric__hint {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--hint);
}

.dashboard-dept-metric__hint .is-up {
  color: #1f8a4c;
  font-weight: 600;
}

.dashboard-dept-metric__hint .is-down {
  color: #c0392b;
  font-weight: 600;
}

.dashboard-dept-metric__hint .is-flat {
  color: var(--hint);
  font-weight: 600;
}

#tab-dashboard .kpi-period-switch {
  flex-shrink: 0;
}

.dashboard-dept-block__title {
  margin: 0 0 4px;
  font-size: 0.88rem;
  color: var(--hint);
}

.dashboard-dept-week-range {
  margin: 0 0 10px;
  font-size: 12px;
}

.dashboard-dept-week-range--snap {
  margin-top: -6px;
  margin-bottom: 10px;
  opacity: 0.85;
}

.dashboard-dept-categories {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (max-width: 900px) {
  .dashboard-departments {
    grid-template-columns: 1fr;
  }
}

.dashboard-kpi-grid {
  margin: 0 0 20px;
}

.dashboard-kpi-heading {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 700;
}

.dashboard-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.dashboard-kpi-card {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.dashboard-kpi-card__label {
  font-size: 0.85rem;
  color: var(--hint);
}

.dashboard-kpi-card__value {
  margin-top: 4px;
  font-size: 1.35rem;
  font-weight: 700;
}

.dashboard-kpi-card__meta {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--hint);
}

.backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.dancer-metric-row__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.status-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

.status-badge--ok { background: #dcfce7; color: #166534; }
.status-badge--warn { background: #fef3c7; color: #92400e; }
.status-badge--error { background: #fee2e2; color: #991b1b; }
.status-badge--muted { background: var(--border); color: var(--hint); }

.ops-pulse__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.ops-pulse__title {
  font-size: 1.05rem;
  font-weight: 700;
}

.ops-pulse__head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ops-pulse__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.ops-pulse__item {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card, transparent);
}

.ops-pulse__item--error {
  border-color: #fecaca;
}

.ops-pulse__item--warn {
  border-color: #fde68a;
}

.ops-pulse__item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.ops-pulse__label {
  font-weight: 600;
  font-size: 0.92rem;
}

.ops-pulse__detail,
.ops-pulse__last {
  font-size: 12px;
  color: var(--hint);
  line-height: 1.35;
  word-break: break-word;
}

.ops-pulse__last {
  margin-top: 4px;
}

.dancer-metrics-list {
  margin-bottom: 12px;
}

.dancer-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.dancer-metric-row .work-item-row__actions {
  display: flex;
  flex-wrap: nowrap;
  flex-shrink: 0;
  gap: 6px;
  white-space: nowrap;
}

.dancer-metric-row .work-item-row__actions .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.dancer-metric-add-form__row {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

@media (min-width: 600px) {
  .dancer-metric-add-form__row {
    grid-template-columns: 1fr 1fr;
  }
}

.settings-advanced {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.settings-advanced summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 10px;
}

.form-sticky-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 0 4px;
  margin-top: 12px;
  background: linear-gradient(to top, var(--secondary-bg) 70%, transparent);
  z-index: 2;
}

.form-dirty-indicator {
  font-size: 12px;
  color: #c2410c;
  font-weight: 600;
}

.form--dirty .form-sticky-actions .btn--primary {
  box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.35);
}

#tab-settings .settings-layout > .card,
#tab-settings .settings-layout > .profile-card,
#tab-settings .settings-layout > .settings-section,
#tab-settings .settings-layout > .notice,
#tab-settings .settings-layout > #admin-panel,
#tab-settings .settings-layout > .btn {
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}

#tab-settings .settings-layout > .card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

#tab-settings .settings-layout > .card > .btn,
#tab-settings .settings-layout .settings-section__body > .btn {
  width: 100%;
  margin-top: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  box-sizing: border-box;
}

#tab-settings .settings-layout .web-only {
  margin: 0;
}

#admin-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

#admin-panel > .settings-section {
  width: 100%;
  margin: 0;
}

#btn-web-logout {
  display: block;
}

.card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.card__title {
  font-size: 16px;
  font-weight: 650;
  margin-bottom: 6px;
}

.card__meta {
  font-size: 13px;
  color: var(--hint);
  margin-bottom: 4px;
}

.card__address {
  font-size: 14px;
  margin-bottom: 8px;
}

.card__desc {
  font-size: 14px;
  color: var(--hint);
  margin-bottom: 10px;
}

.badge {
  display: inline-block;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: var(--radius-md);
  font-weight: 500;
}

.badge--pending { background: #fff3cd; color: #856404; }
.badge--in_progress { background: #cce5ff; color: #004085; }
.badge--awaiting_confirmation { background: #fff3e0; color: #e65100; }
.badge--confirmed { background: #d4edda; color: #155724; }
.badge--completed { background: #fff3e0; color: #e65100; }

.card__response {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 14px;
}

.card__actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn:active { opacity: 0.7; }

.btn--primary {
  background: var(--button);
  color: var(--button-text);
}

.btn--secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn--small,
.btn--sm {
  padding: 6px 12px;
  font-size: 13px;
}

.input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  background: var(--input-bg);
  color: var(--text);
  margin-top: 4px;
}

label {
  display: block;
  font-size: 13px;
  color: var(--hint);
  margin-bottom: 12px;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 4px;
  background: var(--secondary-bg);
  border-top: 1px solid var(--border);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
  z-index: 100;
}

.bottom-nav:has(.nav-group--open) {
  z-index: 260;
}

.nav-group--bottom {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.nav-group--bottom .nav-btn--parent {
  flex: 1;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  border: none;
  background: none;
  color: var(--hint);
  font-size: 11px;
  cursor: pointer;
  min-width: 0;
  overflow: visible;
  text-decoration: none;
}

.nav-btn .nav-label {
  max-width: 100%;
  text-align: center;
  line-height: 1.15;
}

.nav-label--short {
  display: none;
}

.nav-btn.active {
  color: var(--text);
  background: var(--bg);
  box-shadow: var(--shadow-seg);
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.nav-group {
  position: relative;
}

.nav-group.hidden {
  display: none !important;
}

.nav-btn--parent {
  width: 100%;
}

.nav-btn__caret {
  margin-left: auto;
  font-size: 12px;
  opacity: 0.7;
}

.nav-submenu {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 220;
  background: var(--secondary-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  padding: 6px;
  min-width: 220px;
}

.nav-submenu--dropup {
  top: auto;
  bottom: calc(100% + 8px);
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  min-width: 220px;
  max-width: min(92vw, 280px);
}

.nav-group--open .nav-submenu {
  display: block;
}

.nav-group--bottom.nav-group--open .nav-submenu--dropup {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(68px + env(safe-area-inset-bottom, 8px));
  transform: none;
  width: auto;
  max-width: none;
  z-index: 270;
  max-height: min(50vh, 360px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-submenu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .nav-submenu-backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.nav-submenu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.nav-submenu__item:hover,
.nav-submenu__item.active {
  background: rgba(36, 129, 204, 0.12);
  color: var(--link);
}

.nav-submenu__icon {
  font-size: 18px;
  line-height: 1;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-size: 20px;
  line-height: 1;
}

.nav-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: var(--z-modal);
}

#confirm-dialog {
  z-index: var(--z-confirm);
  background: rgba(0, 0, 0, 0.62);
}

.modal--morning-checkin {
  z-index: calc(var(--z-confirm) + 20);
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(2px);
}

.morning-checkin {
  max-width: 400px;
  text-align: center;
  padding: 28px 20px 22px;
}

.morning-checkin__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: var(--radius-lg);
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--accent, #2563eb);
}

.morning-checkin h3 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.morning-checkin__text {
  margin: 0 0 12px;
  color: var(--hint);
  font-size: 0.95rem;
  line-height: 1.45;
}

.morning-checkin__date {
  margin: 0 0 16px;
  font-size: 0.85rem;
}

.morning-checkin__error {
  min-height: 1.2em;
  margin: 0 0 10px;
  color: var(--danger, #b91c1c);
  font-size: 0.9rem;
}

.morning-checkin__btn {
  width: 100%;
  min-height: 48px;
  font-size: 1.05rem;
}

body.morning-checkin-locked {
  overflow: hidden;
}

body.morning-checkin-locked #app,
body.morning-checkin-locked .modal:not(.modal--morning-checkin) {
  pointer-events: none;
  user-select: none;
}

.modal__content {
  background: var(--bg);
  width: 100%;
  max-width: 560px;
  max-height: min(90vh, calc(100vh - 32px));
  overflow-y: auto;
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.modal__subtitle {
  font-size: 14px;
  color: var(--hint);
  margin-bottom: 16px;
}

.response-cancel-panel {
  margin: 0 0 12px;
  padding: 8px 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 92%, var(--hint));
}

.response-cancel-panel__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.response-cancel-panel__title {
  font-size: 0.92rem;
  font-weight: 700;
  margin: 0;
}

.response-cancel-banner {
  margin: 0 0 12px;
  padding: 8px 10px;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, #c0392b 12%, var(--surface));
  color: #8b2e24;
  font-size: 0.9rem;
}

.btn--link {
  margin-top: 8px;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent, #2563eb);
  text-decoration: underline;
  cursor: pointer;
}

.modal__actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.modal__actions .btn {
  flex: 1;
}

.salary-summary {
  background: var(--button);
  color: var(--button-text);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

.salary-summary__total {
  font-size: 28px;
  font-weight: 700;
}

.salary-summary__detail {
  font-size: 14px;
  opacity: 0.85;
  margin-top: 4px;
}

.salary-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: auto;
  max-width: 100%;
  justify-content: center;
}

.salary-presets .btn {
  flex: 0 1 auto;
  min-width: 0;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.2;
}

.salary-breakdown {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  display: grid;
  gap: 6px;
}

.salary-breakdown__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.salary-breakdown__label {
  opacity: 0.9;
}

.salary-breakdown__value {
  font-weight: 600;
  white-space: nowrap;
}

.salary-comparison {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
}

.salary-comparison--up {
  color: #b8f5c3;
}

.salary-comparison--down {
  color: #ffd0d0;
}

.salary-banners {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.salary-banner {
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 13px;
}

.salary-banner--warning {
  background: rgba(255, 193, 7, 0.15);
  border: 1px solid rgba(255, 193, 7, 0.35);
  color: var(--text);
}

.salary-banner--info {
  background: rgba(33, 150, 243, 0.12);
  border: 1px solid rgba(33, 150, 243, 0.25);
  color: var(--text);
}

.salary-banner__link {
  color: var(--accent, #2196f3);
  text-decoration: underline;
  margin-left: 6px;
}

.salary-tech-strip {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
}

.salary-tech-strip__label {
  font-size: 13px;
  color: var(--muted);
}

.salary-tech-strip__amount {
  font-size: 22px;
  font-weight: 700;
}

.salary-tech-strip__hours {
  font-size: 13px;
  color: var(--muted);
}

.salary-group-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin: 14px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.salary-group-header:first-child {
  margin-top: 0;
}

.salary-group-header__count {
  opacity: 0.7;
  font-weight: 600;
}

.salary-export-log {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--secondary-bg);
}

.salary-export-log__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.salary-export-log__title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.salary-export-log__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.salary-export-log__actions .btn--link {
  margin-top: 0;
  font-size: 12px;
}

.salary-export-log.is-collapsed .salary-export-log__list {
  display: none;
}

.salary-export-log.is-collapsed .salary-export-log__head {
  margin-bottom: 0;
}

.salary-export-log__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.salary-export-log__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--text);
}

.salary-card--warning {
  border-color: rgba(255, 193, 7, 0.45);
}

.salary-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.salary-card__meta-row {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 12px;
  color: var(--muted);
}

.salary-card__hours,
.salary-card__rate {
  white-space: nowrap;
}

.salary-card__rate--zero {
  color: #e65100;
  font-weight: 600;
}

.salary-card__work {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.35;
}

.salary-card__warning {
  margin-top: 8px;
  font-size: 12px;
  color: #e65100;
  line-height: 1.3;
}

.today-summary {
  background: var(--secondary-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
}

.today-summary__total {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
}

.today-summary__amount-block {
  margin-bottom: 4px;
}

.today-summary__pending {
  font-size: 13px;
  color: var(--hint);
  margin-top: 4px;
}

.today-summary__amount-col {
  text-align: right;
}

.today-summary__amount-col .today-summary__amount {
  font-size: 16px;
  font-weight: 600;
  color: var(--link);
}

.today-summary__amount-col .today-summary__pending {
  margin-top: 2px;
}

.today-summary__detail,
.today-summary__empty {
  font-size: 14px;
  color: var(--hint);
  margin-top: 8px;
}

.today-summary__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.today-summary__item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.today-summary__item:first-child {
  border-top: none;
  padding-top: 0;
}

.today-summary__name {
  font-size: 15px;
  font-weight: 500;
}

.today-summary__amount {
  font-size: 16px;
  font-weight: 600;
  color: var(--link);
}

.today-summary__meta {
  grid-column: 1 / -1;
  font-size: 13px;
  color: var(--hint);
}

.card--compact {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-left-style: solid;
  border-radius: var(--radius-md);
}

.card--status-pending {
  border-left-color: #e6b800;
}

.card--status-in_progress {
  border-left-color: #007aff;
}

.card--status-awaiting_confirmation,
.card--status-completed {
  border-left-color: #ff9500;
}

.card--status-confirmed {
  border-left-color: #34c759;
}

.card--carryover {
  background: rgba(230, 81, 0, 0.06);
}

.card--schedule-conflict {
  border-left-color: #c2410c;
  background: rgba(194, 65, 12, 0.08);
  box-shadow: inset 0 0 0 1px rgba(194, 65, 12, 0.18);
}

.card--returned {
  border-left-color: #e65100;
}

.card--compact__date {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: #c2410c;
}

.today-section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 2px 10px;
}

.today-section-divider--today {
  margin-top: 18px;
}

.today-section-divider__line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.today-section-divider__label {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #c2410c;
}

.today-section-divider--today .today-section-divider__label {
  color: var(--hint);
}

.card--compact__row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.card--compact__main {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  flex: 1;
  font-size: 14px;
  line-height: 1.3;
}

.card--compact__body {
  min-width: 0;
  flex: 1;
}

.card--compact__headline {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.card--compact__status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
}

.card--compact__time {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}

.card--compact__sep {
  color: var(--hint);
  flex-shrink: 0;
}

.card--compact__address {
  min-width: 0;
  flex: 1;
  font-size: 13px;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  word-break: break-word;
}

.card--compact__date {
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--hint);
  font-size: 13px;
}

.card--schedule {
  padding: 10px 12px;
  border-radius: var(--radius-md);
}

#schedule-list.card-list {
  gap: 10px;
}

.card--schedule__head {
  align-items: flex-start;
  gap: 8px;
}

.card--schedule__when {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  min-width: 0;
  flex: 1;
}

.card--schedule__when .card--compact__time {
  font-size: 14px;
  line-height: 1.25;
  font-weight: 600;
}

.card--schedule__when .card--compact__date {
  font-size: 12px;
}

.card--schedule__when .card--compact__date::before {
  content: "·";
  margin-right: 6px;
  color: var(--hint);
}

.card--schedule__status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.card--schedule__status .badge--compact {
  font-size: 10px;
  padding: 2px 7px;
}

.card--schedule__photo-hint {
  font-size: 11px;
  color: var(--hint);
  white-space: nowrap;
}

.card--schedule__address {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.3;
  color: var(--text);
  min-width: 0;
}

.card--schedule__address-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card--schedule__map {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--link);
  text-decoration: none;
}

.card--schedule__map:hover {
  text-decoration: underline;
}

.card--schedule__desc {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.card--schedule__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-top: 6px;
  min-width: 0;
}

.card--schedule__tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.card--schedule__tags .tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  line-height: 1.3;
}

.card--schedule__tech {
  font-size: 12px;
  line-height: 1.2;
  color: var(--hint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card--schedule__return {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--warning);
  word-break: break-word;
}

.card--schedule__response {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.4;
  color: var(--text);
  word-break: break-word;
}

.card--schedule__response-text {
  white-space: pre-wrap;
}

.card--schedule__response-meta {
  margin-top: 3px;
  font-size: 11px;
  color: var(--hint);
}

.card--schedule .card--compact__actions {
  margin-top: 7px;
  gap: 4px;
}

.card--schedule .card--compact__action {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 11px;
}

.card--clickable {
  cursor: pointer;
}

.card--clickable:active {
  opacity: 0.92;
}

.card--compact__hint {
  font-size: 12px;
  color: var(--hint);
  margin-top: 8px;
}

.modal__content--wide .card {
  border: none;
  padding: 0;
  margin: 0;
}

.modal__content--wide {
  max-width: 760px;
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: visible;
}

.modal__content--wide .card__menu-dropdown {
  z-index: 200;
}

.profile-card {
  background: var(--secondary-bg);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border);
}

.profile-card__row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.profile-card__row:last-child {
  border-bottom: none;
}

.admin-users-list {
  gap: 10px;
}

.admin-users-divider {
  margin: 16px 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.admin-user {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.admin-user__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.admin-user__delete {
  flex-shrink: 0;
}

.admin-user__controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-user__controls select,
.admin-user__controls input {
  flex: 1;
  min-width: 100px;
}

.admin-user__web-auth {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.admin-user__web-auth-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--hint);
}

.backup-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 16px;
}

.backup-list__item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  font-size: 13px;
}

.backup-list__item span:last-child {
  color: var(--hint);
  text-align: right;
  white-space: nowrap;
}

.backup-list__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.diag-reports-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 16px;
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

.diag-reports-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

#telegram-bot-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

#system-telegram-bot-hint {
  width: 100%;
  margin: 0;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
}

#system-telegram-bot-link {
  position: static;
  display: inline-flex;
  width: auto;
  max-width: 100%;
  margin: 0;
  flex: 0 0 auto;
}

.diag-reports-list__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  font-size: 13px;
}

.diag-reports-list__title {
  font-weight: 600;
}

.audit-log-filters {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}

.audit-log-filters .input {
  flex: 1;
}

.audit-log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
}

.audit-log-item {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  font-size: 13px;
}

.audit-log-item__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.audit-log-item__action {
  font-weight: 600;
}

.audit-log-item__time {
  color: var(--hint);
  white-space: nowrap;
}

.audit-log-item__actor {
  color: var(--hint);
}

.audit-log-item__meta {
  margin-top: 4px;
  color: var(--text);
}

.settings-section {
  padding: 0;
}

.settings-section__title {
  list-style: none;
  cursor: pointer;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.settings-section__title::-webkit-details-marker {
  display: none;
}

.settings-section__title::after {
  content: "›";
  font-size: 20px;
  line-height: 1;
  color: var(--hint);
  transform: rotate(90deg);
  transition: transform 0.15s ease;
}

.settings-section[open] > .settings-section__title::after {
  transform: rotate(-90deg);
}

.settings-section__body {
  padding: 0 14px 14px;
}

.settings-section__body .card__meta:first-child {
  margin-top: 0;
}

.timezone-info {
  font-size: 14px;
  color: var(--hint);
  margin: 8px 0 12px;
  line-height: 1.5;
}

.timezone-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-assign__form,
.admin-maps-city__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.notice {
  background: #fff3cd;
  color: #856404;
  padding: 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  text-align: center;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--hint);
  font-size: 15px;
}

.toast {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  z-index: var(--z-toast);
  max-width: calc(100vw - 32px);
  text-align: center;
  word-break: break-word;
  transition: opacity 0.3s;
}

.app-update-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-update-banner);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: var(--button);
  color: var(--button-text);
  font-size: 14px;
  box-sizing: border-box;
}

.app-update-banner.hidden {
  display: none !important;
}

.app-update-banner__text {
  font-weight: 500;
}

.app-update-banner .btn {
  flex-shrink: 0;
}

body.login-visible #app.app-shell {
  display: none !important;
}

.hidden { display: none !important; }

.time-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.address-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.address-row .input {
  margin-top: 0;
  margin-bottom: 0;
}

.address-row select.input {
  flex: 2;
  min-width: 0;
}

.address-row #ticket-address-house {
  flex: 1;
  min-width: 56px;
  max-width: 88px;
}

.address-row #ticket-address-apartment {
  flex: 1;
  min-width: 56px;
  max-width: 88px;
}

.time-range .input {
  flex: 1;
}

.photo-paste-zone {
  flex: 1;
  border: 2px dashed var(--border, #d0d5dd);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  text-align: center;
  cursor: text;
  background: rgba(0, 0, 0, 0.02);
  outline: none;
}

.photo-paste-zone:focus {
  border-color: var(--link);
}

.photo-paste-zone__hint {
  display: block;
  font-size: 13px;
  color: var(--text-muted, #667085);
  line-height: 1.4;
  pointer-events: none;
}

.photo-upload-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 8px;
}

.photo-upload-row__btn {
  flex-shrink: 0;
  align-self: center;
  min-width: 72px;
}

.photo-preview__item {
  position: relative;
  width: 80px;
  height: 80px;
}

.photo-preview__item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

.photo-preview__remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: var(--danger, #dc3545);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.confirm-dialog__text {
  white-space: pre-line;
  margin: 0 0 16px;
  line-height: 1.45;
}

.modal__content--compact {
  max-width: 340px;
}

.photo-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.photo-thumb-wrap {
  position: relative;
  display: inline-flex;
}

.photo-thumb__delete {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 2;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: var(--danger, #dc3545);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.photo-gallery img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

.photo-thumb {
  border: none;
  padding: 0;
  background: none;
  cursor: zoom-in;
  line-height: 0;
}

.photo-thumb img {
  display: block;
}

.card__photo.photo-thumb,
.card__photo .photo-thumb {
  width: 100%;
}

.card__photo.photo-thumb img,
.card__photo .photo-thumb img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: var(--z-photo-viewer);
  background: rgba(0, 0, 0, 0.94);
  display: flex;
  flex-direction: column;
}

.photo-viewer__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.photo-viewer__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.photo-viewer__nav--prev { left: 10px; }
.photo-viewer__nav--next { right: 10px; }

.photo-viewer__stage {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 12px 12px;
  touch-action: none;
}

.photo-viewer__canvas {
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  will-change: transform;
}

.photo-viewer__canvas img {
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 140px);
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.photo-viewer__bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 16px 20px;
  flex-wrap: wrap;
}

.photo-viewer__hint {
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  text-align: center;
}

.photo-viewer__counter {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

.card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.card__header .card__tags {
  margin-bottom: 0;
  flex: 1;
}

.card__header .card__title {
  margin-bottom: 0;
  flex: 1;
}

.card__menu {
  position: relative;
}

.card__menu-btn {
  border: none;
  background: none;
  color: var(--hint);
  font-size: 20px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
}

.card__menu-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--secondary-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  min-width: 150px;
  z-index: 20;
  overflow: hidden;
}

.card__menu-dropdown button {
  display: block;
  width: 100%;
  border: none;
  background: none;
  text-align: left;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}

.card__menu-dropdown button:active {
  background: rgba(0, 0, 0, 0.05);
}

.card__menu-dropdown button.danger {
  color: var(--danger);
}

.card__time {
  font-size: 14px;
  font-weight: 600;
  color: var(--link);
  margin-bottom: 6px;
}

.photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

#ticket-existing-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.photo-preview img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

.card__photo {
  margin: 10px 0;
}

.card__tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.tag {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: var(--radius-md);
  background: rgba(36, 129, 204, 0.12);
  color: var(--link);
}

.salary-item__amount {
  font-weight: 600;
  color: var(--success);
}

.salary-card__amount {
  font-size: 20px;
  font-weight: 700;
  color: var(--success);
  margin-bottom: 10px;
}

.card__response-amount {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--success);
}

.salary-card .card__header {
  margin-bottom: 4px;
}

.card__return-comment {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  background: rgba(230, 81, 0, 0.08);
  border: 1px solid rgba(230, 81, 0, 0.2);
  font-size: 14px;
}

.user-features-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}

.user-feature-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  font-size: 14px;
}

.user-features-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-access-editor {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 12px 0;
  max-height: min(58vh, 520px);
  overflow-y: auto;
}

.user-access-intro {
  margin: 0 0 4px;
}

.user-access-group__title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.user-access-group__items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-access-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  font-size: 14px;
}

.user-access-row__check {
  padding-top: 2px;
}

.user-access-row__title {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-weight: 500;
}

.user-access-row__hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--hint);
  line-height: 1.35;
}

.user-access-row__expires {
  display: block;
  margin-top: 8px;
}

.user-access-row__expires-label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--hint);
}

.access-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.access-badge--role {
  background: rgba(36, 129, 204, 0.12);
  color: var(--link);
}

.nav-group.hidden {
  display: none;
}

.login-screen {
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(120% 80% at 0% 0%, var(--hero-glow), transparent 55%),
    linear-gradient(160deg, var(--secondary-bg), var(--bg));
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  text-align: center;
  box-shadow: var(--shadow-card), 0 12px 40px rgba(0, 0, 0, 0.06);
}

.login-card__logo {
  font-size: 1.45rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.login-card__subtitle {
  color: var(--hint);
  font-size: 0.92rem;
  line-height: 1.5;
  margin-bottom: 24px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  margin-bottom: 16px;
}

.login-form label {
  margin-bottom: 0;
}

.login-form .btn {
  width: 100%;
  margin-top: 4px;
}

.login-card__hint {
  color: var(--hint);
  font-size: 13px;
  line-height: 1.5;
}

.login-card__diag {
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
}

.login-card__diag a {
  color: var(--link);
  text-decoration: none;
}

.login-card__diag a:hover {
  text-decoration: underline;
}

.ios-http-hint {
  color: var(--hint);
}

.ios-help-banner {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: #fff7ed;
  border: 1px solid #fdba74;
  text-align: left;
  font-size: 13px;
  line-height: 1.45;
}

html[data-theme="dark"] .ios-help-banner {
  background: rgba(217, 119, 6, 0.12);
  border-color: rgba(217, 119, 6, 0.35);
}

.ios-help-banner__title {
  margin: 0 0 6px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.ios-help-banner__text {
  margin: 0 0 8px;
  color: var(--hint);
}

.ios-help-banner__text code {
  font-size: 12px;
}

.ios-help-banner__link {
  display: block;
  margin: 0 0 8px;
  font-weight: 600;
  word-break: break-all;
  color: var(--link);
  text-decoration: none;
}

.ios-help-banner__list {
  margin: 0;
  padding-left: 18px;
  color: var(--hint);
}

.ios-help-banner__list a {
  color: var(--link);
}

.app-boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

html[data-theme="dark"] .app-boot-overlay {
  background: rgba(0, 0, 0, 0.88);
}

.app-boot-overlay__card {
  max-width: 320px;
  text-align: center;
}

.app-boot-overlay__title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
}

.app-boot-overlay__hint {
  color: var(--hint);
  font-size: 14px;
  margin: 0 0 12px;
}

.app-boot-overlay__link {
  color: var(--link);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
}

.login-card__error {
  margin-top: 16px;
  color: var(--danger);
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}

.login-card__boot-status {
  color: var(--hint);
  font-size: 14px;
  margin-bottom: 12px;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
}

.sidebar-nav {
  display: none;
}

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

.web-only {
  width: 100%;
  margin: 0 0 16px;
}

.web-mode .web-only.hidden {
  display: none !important;
}

.reporting-empty {
  padding: 0 0 24px;
}

.reporting-empty__hint {
  margin: 0 0 16px;
}

.reporting-dashboard {
  display: grid;
  gap: 16px;
}

.reporting-dashboard-card {
  width: 100%;
  text-align: left;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.reporting-dashboard-card:hover {
  border-color: var(--link);
  box-shadow: var(--shadow-seg);
}

.reporting-dashboard-card__head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.reporting-dashboard-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: var(--secondary-bg);
  border: 1px solid var(--border);
  color: var(--link);
}

.reporting-dashboard-card__icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reporting-dashboard-card__title {
  font-size: 18px;
  font-weight: 700;
}

.reporting-dashboard-card__meta {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.reporting-form-header {
  align-items: center;
}

.reporting-form-header .page-hero__text {
  min-width: 0;
  flex: 1 1 auto;
}

.reporting-sheet-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.reporting-sheet-tab {
  border: 1px solid var(--border);
  background: var(--secondary-bg, #f8fafc);
  color: var(--muted, #64748b);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.reporting-sheet-tab:hover {
  border-color: var(--link);
  color: var(--link);
}

.reporting-sheet-tab.is-active {
  background: var(--link);
  border-color: var(--link);
  color: #fff;
}

.reporting-sheet-tab--soon:not(.is-active) {
  opacity: 0.85;
  border-style: dashed;
}

.reporting-sheet-tab__badge {
  margin-left: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  opacity: 0.85;
}

.reporting-sheet-tab.is-active .reporting-sheet-tab__badge {
  opacity: 0.95;
}

.reporting-coming-soon {
  margin-top: 12px;
  padding: 28px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg, 14px);
  background: var(--secondary-bg, #f8fafc);
  text-align: center;
}

.reporting-coming-soon__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text, #0f172a);
}

.reporting-coming-soon__text {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--muted, #64748b);
  line-height: 1.45;
}

.reporting-intro {
  margin-bottom: 12px;
}

.reporting-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.reporting-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg);
  box-shadow: var(--shadow-card);
}

.reporting-group + .reporting-group {
  margin-top: 12px;
}

.reporting-group__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--secondary-bg) 0%, var(--bg) 100%);
}

.reporting-group__title-text {
  min-width: 0;
}

.reporting-group__count {
  flex-shrink: 0;
  min-width: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--hint);
  font-size: 11px;
  font-weight: 650;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.reporting-group__body {
  display: flex;
  flex-direction: column;
}

.reporting-group__body > :last-child {
  border-bottom: none;
}

.reporting-subheader {
  padding: 10px 14px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--hint);
}

.reporting-filters {
  /* inherit compact .filters chip layout */
  margin-bottom: 0;
  justify-content: flex-start;
}

.reporting-filters .input {
  flex: 0 1 160px;
  max-width: 200px;
}

.reporting-filters .reporting-search {
  flex: 1 1 180px;
  max-width: 280px;
  margin-bottom: 0;
}

.reporting-summary {
  background: rgba(36, 129, 204, 0.08);
  color: var(--text);
  border: 1px solid rgba(36, 129, 204, 0.18);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 0;
  font-size: 13px;
  font-weight: 500;
}

.reporting-summary__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}

.reporting-summary__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
}

.reporting-summary__sheet {
  font-weight: 700;
  color: var(--text);
}

.reporting-summary__date,
.reporting-summary__note {
  color: var(--hint);
  font-weight: 500;
}

.reporting-summary__autosave {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(36, 129, 204, 0.12);
  color: var(--link);
  font-size: 11px;
  font-weight: 650;
}

.reporting-summary__track {
  flex: 1 1 120px;
  min-width: 100px;
  max-width: 220px;
  height: 6px;
  border-radius: 999px;
  background: rgba(36, 129, 204, 0.12);
  overflow: hidden;
}

.reporting-summary__fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3b82f6, #2481cc);
  transition: width 0.25s ease;
}

.reporting-summary__count {
  margin-left: auto;
  color: var(--link);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.reporting-summary--done {
  border-color: rgba(52, 199, 89, 0.35);
  background: rgba(52, 199, 89, 0.1);
}

.reporting-summary--done .reporting-summary__fill {
  background: linear-gradient(90deg, #34c759, #248a3d);
}

.reporting-summary--done .reporting-summary__count,
.reporting-summary--done .reporting-summary__autosave {
  color: #248a3d;
}

.reporting-field--filled .reporting-field__input {
  border-color: rgba(36, 129, 204, 0.35);
  background: rgba(36, 129, 204, 0.04);
}

.reporting-field--empty .reporting-field__input {
  color: var(--hint);
}

.reporting-field:focus-within {
  background: rgba(36, 129, 204, 0.04);
}

.reporting-field:focus-within .reporting-field__input {
  border-color: var(--link);
  box-shadow: 0 0 0 2px rgba(36, 129, 204, 0.15);
}

.reporting-sheet {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}

.reporting-row--indent {
  margin-left: 16px;
}

.reporting-row--indent .reporting-row__label,
.reporting-row--indent .reporting-field__label {
  font-size: 12px;
}

.reporting-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}


.mp-crm {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.mp-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.mp-toolbar__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  border-radius: 10px;
  white-space: nowrap;
}

.mp-toolbar__ellipsis {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp-toolbar__search {
  flex: 1 1 160px;
  min-width: 140px;
}

.mp-toolbar__status {
  width: 140px;
  height: 42px;
  border-radius: 10px !important;
}

.mp-muted { color: #94a3b8; font-size: 12px; }

.mp-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #0369a1;
  text-decoration: none;
  max-width: 160px;
}

.mp-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-link:hover { text-decoration: underline; }

#mp-pop-host {
  position: fixed;
  inset: 0;
  z-index: 85;
  pointer-events: none;
}

#mp-pop-host:has(.mp-pop) { pointer-events: auto; }

.mp-pop-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.22);
}

.mp-pop {
  position: absolute;
  top: 120px;
  left: 50%;
  transform: translateX(-50%);
  width: min(380px, calc(100vw - 24px));
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mp-pop__title {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.mp-pop__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.mp-pop--groups { max-height: min(70vh, 520px); }

.mp-group-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: auto;
  max-height: 320px;
}

.mp-group-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 10px 10px;
  cursor: pointer;
  color: #0f172a;
  font-size: 13px;
}

.mp-group-row {
  display: flex;
  align-items: center;
  gap: 2px;
  border-radius: 10px;
}

.mp-group-row.is-active {
  background: #e0f2fe;
}

.mp-group-row .mp-group-item {
  flex: 1;
  min-width: 0;
}

.mp-group-del {
  flex: 0 0 auto;
  color: #94a3b8;
}

.mp-group-del:hover {
  color: #b91c1c;
  background: #fee2e2;
}

.mp-group-item:hover { background: #f8fafc; }
.mp-group-item.is-active { background: #e0f2fe; color: #0369a1; font-weight: 650; }

.mp-group-item__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-group-item__go {
  flex: 0 0 auto;
  font-size: 11px;
  color: #64748b;
}

.mp-group-add {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.mp-group-add .input { flex: 1; height: 40px; border-radius: 10px; }

@media (max-width: 720px) {
  .mp-toolbar__status { width: 100%; }
  .mp-toolbar__btn { flex: 1 1 auto; justify-content: center; }
}


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

.mp-kpi__card {
  min-height: 72px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--group-border, #e5e7eb);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mp-kpi__card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.mp-kpi__value {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text, #0f172a);
}

.mp-kpi__label {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted, #64748b);
}

.mp-filters {
  display: grid;
  grid-template-columns: 140px minmax(140px, 1.4fr) minmax(120px, 1fr) minmax(140px, 1.2fr);
  gap: 8px;
  align-items: center;
}

.mp-filters__control {
  height: 42px;
  border-radius: 10px !important;
}

.mp-filters__search {
  position: relative;
  display: block;
  min-width: 0;
}

.mp-filters__search .input {
  width: 100%;
  padding-left: 36px;
}

.mp-filters__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted, #94a3b8);
  display: flex;
  pointer-events: none;
}

.mp-table-wrap {
  border: 1px solid var(--group-border, #e5e7eb);
  border-radius: 12px;
  background: var(--card-bg, #fff);
  overflow: auto;
  max-height: min(62vh, 640px);
}

.mp-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.mp-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  border-bottom: 1px solid var(--group-border, #e5e7eb);
  text-align: left;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #64748b;
  padding: 11px 12px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.mp-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: #0f172a;
}

.mp-table__row {
  cursor: pointer;
  transition: background 0.12s ease;
}

.mp-table__row:hover {
  background: #f8fafc;
}

.mp-table__platform,
.mp-table__topic {
  display: inline-block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.mp-table__actions {
  width: 44px;
  text-align: right;
}

.mp-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.mp-badge--planned { background: #e0f2fe; color: #0369a1; }
.mp-badge--progress { background: #fef3c7; color: #a16207; }
.mp-badge--done { background: #dcfce7; color: #15803d; }
.mp-badge--overdue { background: #fee2e2; color: #b91c1c; }

.mp-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
}

.mp-icon-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.mp-empty {
  text-align: center;
  padding: 48px 16px;
  color: #64748b;
  border: 1px dashed var(--group-border, #e5e7eb);
  border-radius: 12px;
  background: #fff;
}

.mp-empty__icon { margin-bottom: 10px; color: #94a3b8; }
.mp-empty__title { font-weight: 650; color: #0f172a; margin-bottom: 4px; }
.mp-empty__text { font-size: 13px; }

.mp-skel {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 37%, #f1f5f9 63%);
  background-size: 400% 100%;
  animation: mp-skel 1.2s ease infinite;
  border-radius: 12px;
}

@keyframes mp-skel {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

#mp-drawer-host {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
}

#mp-drawer-host.is-open { pointer-events: auto; }

.mp-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
  opacity: 0;
  transition: opacity 0.2s ease;
}

#mp-drawer-host.is-open .mp-drawer-backdrop { opacity: 1; }

.mp-drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: min(420px, 100%);
  height: 100%;
  background: #fff;
  border-left: 1px solid #e2e8f0;
  box-shadow: -8px 0 24px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.22s ease;
}

#mp-drawer-host.is-open .mp-drawer { transform: translateX(0); }

.mp-drawer__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid #f1f5f9;
}

.mp-drawer__eyebrow {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}

.mp-drawer__title {
  margin: 4px 0 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.mp-drawer__body {
  flex: 1;
  overflow: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mp-drawer__foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid #f1f5f9;
}

.mp-drawer__foot .btn--danger {
  margin-right: auto;
  background: #fff;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.mp-drawer__foot .btn--danger:hover {
  background: #fef2f2;
}

.mp-icon-btn--danger:hover {
  color: #b91c1c;
  background: #fee2e2;
}

.mp-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.mp-field .input {
  font-weight: 500;
  color: #0f172a;
  height: 42px;
  border-radius: 10px;
}

.mp-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 900px) {
  .mp-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .mp-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mp-filters { grid-template-columns: 1fr 1fr; }
  .mp-filters__search { grid-column: 1 / -1; }
  .mp-table__platform,
  .mp-table__topic { max-width: 110px; }
  .mp-drawer { width: 100%; }
}

@media (max-width: 420px) {
  .mp-field-row { grid-template-columns: 1fr; }
}

.reporting-section__body.reporting-content {
  gap: 12px;
  margin-bottom: 0;
  padding: 12px;
}

.reporting-section--collapsed {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--group-border);
  border-radius: var(--radius-md);
  background: var(--secondary-bg);
}

.reporting-section--collapsed .reporting-section__title {
  cursor: pointer;
  font-weight: 600;
  padding: 14px 16px;
  list-style: none;
  user-select: none;
}

.reporting-section--collapsed .reporting-section__title::-webkit-details-marker {
  display: none;
}

.reporting-section--collapsed .reporting-section__title::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.15s ease;
}

.reporting-section--collapsed[open] .reporting-section__title::before {
  transform: rotate(90deg);
}

.reporting-section--collapsed .reporting-section__body {
  padding: 0 12px 12px;
  border-top: 1px solid var(--border);
}

.reporting-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.reporting-legend__item {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--hint);
}

.reporting-legend__item--input,
.reporting-legend__item--readonly,
.reporting-legend__item--header,
.reporting-legend__item--auto {
  background: transparent;
  color: var(--hint);
}

.reporting-legend__item--auto {
  border-color: rgba(36, 129, 204, 0.35);
  color: var(--button);
}

.reporting-row--auto {
  background: transparent;
}

.reporting-row__badge--auto {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--button);
  background: rgba(36, 129, 204, 0.12);
  vertical-align: middle;
}

.reporting-field__input--auto {
  background: var(--secondary-bg);
  border-color: rgba(0, 0, 0, 0.1);
}

.reporting-row {
  border-radius: 0;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.reporting-row--header {
  display: none;
}

.reporting-row--readonly {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
}

.reporting-row__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.reporting-row--input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
}

.reporting-row__main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.reporting-row__label {
  font-size: 13px;
  color: var(--hint);
  line-height: 1.35;
}

.reporting-row__value {
  font-size: 16px;
  font-weight: 600;
}

.reporting-row__badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--hint);
}

.reporting-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reporting-field__control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.reporting-field__control .input,
.reporting-field__input {
  flex: 1;
  min-width: 0;
  width: auto;
  margin-top: 0;
  font-size: 13px;
  padding: 6px 10px;
  line-height: 1.2;
}

.reporting-sparkline {
  flex-shrink: 0;
  color: var(--sparkline);
  opacity: 0.9;
}

.reporting-sparkline--empty {
  width: 56px;
  flex-shrink: 0;
}

.reporting-field__status {
  flex-shrink: 0;
  width: 22px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--hint);
}

.reporting-field__status--pending {
  color: var(--hint);
}

.reporting-field__status--saving {
  color: var(--link);
  animation: reporting-spin 0.8s linear infinite;
}

.reporting-field__status--saved {
  color: #248a3d;
}

.reporting-field__status--error {
  color: var(--danger, #ff3b30);
}

@keyframes reporting-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.reporting-field__label {
  font-size: 12px;
  color: var(--hint);
  line-height: 1.3;
}

.reporting-search {
  margin-bottom: 12px;
  font-size: 13px;
  padding: 8px 10px;
}

/* Desktop: denser reporting form — less scrolling */
@media (min-width: 900px) {
  #tab-reporting #reporting-form .reporting-form-header {
    padding: 12px 16px;
    margin-bottom: 10px;
  }

  #tab-reporting #reporting-form .reporting-form-header .page-hero__title {
    font-size: 1.25rem;
  }

  #tab-reporting #reporting-form .reporting-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    margin: 0 0 10px;
  }

  #tab-reporting #reporting-form .reporting-legend__item {
    font-size: 11px;
    padding: 4px 8px;
  }

  #tab-reporting #reporting-form .reporting-toolbar {
    position: sticky;
    top: 0;
    z-index: 6;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-card);
  }

  #tab-reporting #reporting-form .reporting-filters {
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    margin-bottom: 0;
  }

  #tab-reporting #reporting-form .reporting-filters .reporting-search {
    flex: 1 1 220px;
    max-width: 320px;
  }

  #tab-reporting #reporting-form .reporting-summary {
    border: none;
    background: transparent;
    padding: 4px 0 0;
  }

  #tab-reporting #reporting-form .reporting-content {
    gap: 12px;
  }

  #tab-reporting #reporting-form .reporting-group + .reporting-group {
    margin-top: 0;
  }

  #tab-reporting #reporting-form .reporting-group__title {
    padding: 8px 12px;
    font-size: 13px;
  }

  #tab-reporting #reporting-form .reporting-group__body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    background: var(--border);
  }

  #tab-reporting #reporting-form .reporting-group__body > :last-child {
    border-bottom: none;
  }

  #tab-reporting #reporting-form .reporting-subheader {
    grid-column: 1 / -1;
    padding: 6px 12px;
    background: var(--secondary-bg);
    border: none;
    font-size: 11px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }

  #tab-reporting #reporting-form .reporting-field.reporting-row--input,
  #tab-reporting #reporting-form .reporting-row--readonly {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 10px;
    margin: 0;
    padding: 8px 10px;
    border: none;
    background: var(--bg);
    min-height: 44px;
    transition: background 0.12s ease;
  }

  #tab-reporting #reporting-form .reporting-field.reporting-row--input.reporting-row--auto {
    background: var(--bg);
    box-shadow: none;
  }

  #tab-reporting #reporting-form .reporting-field.reporting-row--input:hover {
    background: color-mix(in srgb, var(--secondary-bg) 70%, var(--bg));
  }

  #tab-reporting #reporting-form .reporting-field.reporting-row--input.reporting-row--auto:hover {
    background: var(--bg);
  }

  #tab-reporting #reporting-form .reporting-field.reporting-row--auto .reporting-field__input--auto {
    background: var(--secondary-bg);
    border-color: rgba(0, 0, 0, 0.1);
  }

  #tab-reporting #reporting-form .reporting-row--readonly {
    background: color-mix(in srgb, var(--secondary-bg) 55%, var(--bg));
  }

  #tab-reporting #reporting-form .reporting-row__main {
    display: contents;
  }

  #tab-reporting #reporting-form .reporting-row__label,
  #tab-reporting #reporting-form .reporting-field__label {
    margin: 0;
    font-size: 12px;
    line-height: 1.25;
    color: var(--text);
  }

  #tab-reporting #reporting-form .reporting-field.reporting-row--auto .reporting-field__label {
    color: var(--text);
  }

  #tab-reporting #reporting-form .reporting-row__value {
    font-size: 13px;
    font-weight: 650;
    text-align: right;
    min-width: 64px;
    font-variant-numeric: tabular-nums;
  }

  #tab-reporting #reporting-form .reporting-row__badge {
    display: none;
  }

  #tab-reporting #reporting-form .reporting-row__badge--auto {
    display: inline-flex;
    flex-shrink: 0;
    margin-left: 6px;
    vertical-align: middle;
  }

  #tab-reporting #reporting-form .reporting-field__label {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 0;
  }

  #tab-reporting #reporting-form .reporting-field__control {
    justify-content: flex-end;
  }

  #tab-reporting #reporting-form .reporting-field__input {
    width: 88px;
    flex: 0 0 88px;
    max-width: 88px;
    text-align: right;
    padding: 5px 8px;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    border-radius: var(--radius-lg);
  }

  #tab-reporting #reporting-form .reporting-field--filled {
    box-shadow: inset 3px 0 0 var(--link);
  }

  #tab-reporting #reporting-form .reporting-row--indent {
    margin-left: 0;
    padding-left: 18px;
  }

  #tab-reporting #reporting-form .reporting-section--collapsed .reporting-section__title {
    padding: 10px 12px;
  }
}

@media (min-width: 1200px) {
  #tab-reporting #reporting-form .reporting-group__body {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #tab-reporting #reporting-form .reporting-field__input {
    width: 80px;
    flex-basis: 80px;
    max-width: 80px;
  }
}

@media (min-width: 900px) {
  body.web-mode {
    overflow: auto;
  }

  body.web-mode #app.app-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    min-height: 100vh;
    padding-bottom: 0;
  }

  body.web-mode .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    grid-column: 1;
    grid-row: 1;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 20px 12px;
    background: var(--secondary-bg);
    border-right: 1px solid var(--border);
  }

  body.web-mode .app-main {
    grid-column: 2;
    grid-row: 1;
    min-height: 100vh;
  }

  body.web-mode .bottom-nav {
    display: none;
  }

  .sidebar-nav__brand {
    font-size: 1.15rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    padding: 8px 12px 20px;
  }

  .sidebar-nav .nav-btn {
    flex: 0;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
  }

  .sidebar-nav .nav-group {
    width: 100%;
  }

  .sidebar-nav .nav-btn--parent {
    justify-content: flex-start;
  }

  .sidebar-nav .nav-group:hover .nav-submenu,
  .sidebar-nav .nav-group:focus-within .nav-submenu {
    display: block;
  }

  .sidebar-nav .nav-group--open .nav-submenu {
    display: block;
  }

  .sidebar-nav .nav-submenu {
    left: calc(100% + 4px);
    right: auto;
    top: 0;
    min-width: 240px;
  }

  .sidebar-nav .nav-submenu::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 0;
    width: 6px;
    height: 100%;
  }

  .sidebar-nav .nav-btn.active {
    background: var(--bg);
    color: var(--text);
    box-shadow: var(--shadow-seg);
  }

  .content {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 24px;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .header {
    padding: 16px 24px;
  }

  .page-hero__title,
  .ts-hero__title,
  .section-header h2 {
    font-size: 1.25rem;
  }

  .filters {
    gap: 10px;
    justify-content: flex-start;
    max-width: 100%;
    box-sizing: border-box;
  }

  .filters .input:not(.filters__search) {
    flex: 0 1 160px;
    min-width: 120px;
    max-width: 200px;
  }

  .filters__chips {
    width: auto;
  }

  .filters__chips .input {
    flex: 0 1 160px;
    max-width: 200px;
  }

  .filters__search {
    flex: 0 1 420px;
    max-width: 420px;
  }

  .salary-presets .btn {
    flex: 0 1 auto;
  }

  .card-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
  }

  .card-list.admin-users-list,
  #schedule-list.card-list,
  #today-list.card-list {
    display: flex;
    flex-direction: column;
  }

  .modal {
    padding: 24px;
  }

  .modal__content {
    max-height: calc(100vh - 48px);
  }

  .address-row {
    grid-template-columns: 1.4fr 0.8fr 0.8fr;
  }

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

  .admin-user__controls {
    max-width: 420px;
  }

  .settings-section {
    max-width: 720px;
  }

  .profile-card,
  .home-screen-panel,
  #btn-web-logout,
  #web-push-panel,
  #admin-panel {
    max-width: 720px;
  }
}

@media (min-width: 1200px) {
  .content {
    max-width: 1200px;
  }
}

/* --- Mobile: bottom nav + work cards --- */
@media (max-width: 520px) and (min-width: 421px) {
  .bottom-nav .nav-label--full {
    display: none;
  }

  .bottom-nav .nav-label--short {
    display: block;
    font-size: 10px;
  }

  .bottom-nav .nav-btn {
    padding: 6px 2px;
  }
}

@media (max-width: 420px) {
  .bottom-nav .nav-label--full,
  .bottom-nav .nav-label--short {
    display: none;
  }

  .bottom-nav .nav-btn {
    padding: 8px 2px;
    gap: 0;
  }

  .bottom-nav .nav-icon {
    font-size: 22px;
    width: 24px;
    height: 24px;
  }

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

  #app.app-shell {
    padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  }
}

@media (min-width: 720px) {
  .card--compact__time,
  .card--compact__address {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .content {
    padding: 12px;
  }

  .page-hero,
  .ts-hero,
  .section-header {
    padding: 8px 12px;
    margin-bottom: 8px;
    gap: 6px 10px;
  }

  .page-hero__title,
  .ts-hero__title,
  .section-header h2 {
    font-size: 1.1rem;
  }

  .page-hero__sub,
  .ts-hero__sub,
  .section-header__subtitle {
    font-size: 0.78rem;
  }

  /* Работа: «Из WEBT» и «+ Заявка» справа, друг под другом */
  #tab-today .page-hero {
    flex-wrap: nowrap;
    align-items: center;
  }

  #tab-today .page-hero__text {
    flex: 1 1 auto;
    min-width: 0;
  }

  #tab-today .page-hero__actions {
    flex: 0 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  #tab-today .page-hero__actions .btn {
    width: 100%;
    white-space: nowrap;
  }

  .seg-nav,
  .ts-subnav,
  .work-view-switch {
    width: 100%;
  }

  .work-view-switch__btn {
    max-width: none;
  }

  .card--compact {
    padding: 10px 12px;
  }

  .card--compact__row {
    flex-wrap: wrap;
    row-gap: 6px;
  }

  .card--compact__status {
    margin-left: 0;
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .card--schedule__head {
    align-items: stretch;
  }

  .card--schedule__when {
    min-width: 0;
  }

  .card--schedule__status {
    align-self: flex-end;
  }

  .badge--compact {
    font-size: 10px;
    padding: 2px 6px;
  }

  .card--compact__action {
    flex: 1 1 calc(50% - 3px);
    min-width: 0;
  }

  .filters .input,
  .filters--inline .input,
  .filters__chips .input,
  .filters--oneline > .input {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    font-size: 11px;
    padding: 5px 6px;
  }

  .filters__chips {
    width: 100%;
  }

  .filters input[type="date"],
  .filters--oneline > input[type="date"] {
    flex: 1 1 0;
    max-width: none;
    min-width: 0;
  }

  .filters__search,
  .filters--oneline .filters__search {
    flex: 1 1 100%;
    max-width: none;
    width: 100%;
    font-size: 13px;
    padding: 8px 10px;
  }

  .salary-presets {
    width: 100%;
  }

  .salary-presets .btn {
    flex: 1 1 0;
  }

  .filters--oneline {
    flex-wrap: wrap;
  }

  .work-view-switch__btn {
    flex: 1 1 calc(50% - 4px);
    max-width: none;
    min-width: 0;
  }

  .section-header h2 {
    font-size: 18px;
  }
}

@media (max-width: 360px) {
  .card--compact__main {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .card--compact__sep {
    display: none;
  }

  .card--compact__address {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-break: break-word;
  }

  .card--schedule__address {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-break: break-word;
  }
}

.ticket-timeline-section {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.ticket-address-history {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.ticket-address-history.hidden {
  display: none;
}

.ticket-address-history__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.ticket-address-history__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.ticket-address-history__count {
  font-weight: 500;
  color: var(--hint);
}

.ticket-address-history__chevron {
  flex-shrink: 0;
  width: 0.55em;
  height: 0.55em;
  border-right: 2px solid var(--hint);
  border-bottom: 2px solid var(--hint);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.ticket-address-history__toggle[aria-expanded="true"] .ticket-address-history__chevron {
  transform: rotate(45deg);
}

.ticket-address-history__body {
  margin-top: 10px;
}

.ticket-address-history__body.hidden {
  display: none;
}

.ticket-address-history__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ticket-address-history__item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--secondary-bg);
  overflow: hidden;
}

.ticket-address-history__item--open {
  border-color: color-mix(in srgb, var(--button) 40%, var(--border));
}

.ticket-address-history__row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ticket-address-history__theme {
  grid-column: 1;
  grid-row: 1;
  font-size: 14px;
  font-weight: 600;
}

.ticket-address-history__meta {
  grid-column: 1;
  grid-row: 2;
  font-size: 12px;
  color: var(--hint);
}

.ticket-address-history__row .ticket-address-history__chevron {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 0.45em;
  height: 0.45em;
}

.ticket-address-history__row[aria-expanded="true"] .ticket-address-history__chevron {
  transform: rotate(45deg);
}

.ticket-address-history__detail {
  padding: 0 10px 10px;
  border-top: 1px solid var(--border);
}

.ticket-address-history__detail.hidden {
  display: none;
}

.ticket-address-history__response {
  margin: 10px 0;
  font-size: 13px;
  line-height: 1.4;
}

.ticket-address-history__response--empty {
  color: var(--hint);
}

.ticket-address-history__response-label {
  font-weight: 600;
  margin-bottom: 4px;
}

.ticket-address-history__response-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.ticket-address-history__response-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--hint);
}

.ticket-address-history__open {
  margin-top: 4px;
}

.ticket-address-history__empty {
  font-size: 13px;
  color: var(--hint);
}

.ticket-timeline-section__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.ticket-timeline-section__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.ticket-timeline-section__chevron {
  flex-shrink: 0;
  width: 0.55em;
  height: 0.55em;
  border-right: 2px solid var(--hint);
  border-bottom: 2px solid var(--hint);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.ticket-timeline-section__toggle[aria-expanded="true"] .ticket-timeline-section__chevron {
  transform: rotate(45deg);
}

.ticket-timeline-section__body {
  margin-top: 10px;
}

.ticket-timeline-section__body.hidden {
  display: none;
}

.ticket-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.timeline-item {
  background: var(--secondary-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.timeline-item__meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.timeline-item__title {
  font-weight: 600;
  margin-bottom: 4px;
}

.timeline-item__summary,
.timeline-item__body {
  font-size: 14px;
  white-space: pre-wrap;
}

.timeline-item--comment {
  border-left: 3px solid var(--accent, #2563eb);
}

.ticket-comment-form textarea {
  width: 100%;
  margin-top: 4px;
}

.ticket-comment-form__photos {
  display: block;
  margin: 8px 0;
}

.tab-placeholder {
  text-align: center;
  padding: 56px 24px;
  margin-top: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.tab-placeholder__title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 650;
  color: var(--text);
}

.tab-placeholder__hint {
  margin: 0;
  font-size: 14px;
  color: var(--hint);
}


/* —— Табель (HR) —— */
.ts-month-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ts-month-label {
  min-width: 9rem;
  text-align: center;
  font-weight: 600;
}
.ts-today-card {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--secondary-bg);
}
.ts-today-card__info {
  min-width: 0;
  flex: 1 1 auto;
}
.ts-today-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.ts-today-card__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hint);
  margin: 0;
}
.ts-today-card__times {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  font-size: 0.9rem;
}
.ts-today-card__range strong {
  font-variant-numeric: tabular-nums;
}
.ts-today-card__norm {
  color: var(--hint);
  font-weight: 500;
}
.ts-today-card__actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.ts-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 8px;
}
.ts-toolbar__hint {
  flex: 1 1 12rem;
  min-width: 0;
  line-height: 1.35;
}
.ts-paint-dirty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 6px 10px;
  border-radius: var(--radius-md, 10px);
  border: 1px solid rgba(10, 132, 255, 0.28);
  background: rgba(10, 132, 255, 0.08);
}
.ts-paint-dirty.hidden {
  display: none;
}
.ts-paint-dirty__label {
  font-size: 0.85rem;
  color: var(--text);
}
.ts-paint {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--secondary-bg);
}
.ts-paint__title {
  cursor: pointer;
  font-weight: 650;
  font-size: 0.9rem;
  list-style: none;
  margin: 0;
  user-select: none;
}
.ts-paint__title::-webkit-details-marker {
  display: none;
}
.ts-paint__title::before {
  content: "▸ ";
  color: var(--hint);
  font-weight: 500;
}
.ts-paint[open] > .ts-paint__title::before {
  content: "▾ ";
}
.ts-paint__body {
  margin-top: 10px;
}
.ts-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ts-legend .ts-chip {
  cursor: pointer;
  border: 1px solid transparent;
  font: inherit;
}
.ts-legend .ts-chip--active {
  outline: 2px solid var(--link);
  outline-offset: 1px;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.18);
}
.ts-chip--clear {
  background: rgba(120, 120, 128, 0.1);
  color: var(--text);
  border-style: dashed;
}
.ts-chip--none {
  background: rgba(120, 120, 128, 0.08);
  color: var(--muted, #6b7280);
}
.ts-chip--edit {
  background: rgba(10, 132, 255, 0.1);
  color: #0a66c2;
}
.ts-bulk summary.ts-bulk__title {
  cursor: pointer;
  font-weight: 650;
  list-style: none;
  margin-bottom: 0;
}
.ts-bulk summary.ts-bulk__title::-webkit-details-marker {
  display: none;
}
.ts-bulk__body {
  margin-top: 10px;
}
#ts-matrix {
  /* pan-y: phone can scroll the list of people; paint-drag still works via pointer events */
  touch-action: pan-y;
  user-select: none;
}
.ts-chip,
.ts-day {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 0.78rem;
  border: 1px solid transparent;
}
.ts-chip--work,
.ts-day.ts-chip--work {
  background: rgba(46, 160, 67, 0.14);
  color: #1b7a32;
  border-color: rgba(46, 160, 67, 0.28);
}
.ts-chip--off,
.ts-day.ts-chip--off {
  background: rgba(120, 120, 128, 0.12);
  color: var(--hint);
}
.ts-chip--leave,
.ts-day.ts-chip--leave {
  background: rgba(88, 86, 214, 0.14);
  color: #3d3ab8;
  border-color: rgba(88, 86, 214, 0.28);
}
.ts-chip--sick,
.ts-day.ts-chip--sick {
  background: rgba(255, 149, 0, 0.16);
  color: #a35b00;
}
.ts-chip--unpaid,
.ts-day.ts-chip--unpaid {
  background: rgba(142, 142, 147, 0.18);
  color: #5c5c62;
  border-color: rgba(142, 142, 147, 0.35);
}
.ts-chip--planned,
.ts-day.ts-chip--planned {
  background: rgba(10, 132, 255, 0.12);
  color: #0a66c2;
  border-style: dashed;
  border-color: rgba(10, 132, 255, 0.35);
}
.ts-chip--absent,
.ts-day.ts-chip--absent {
  background: rgba(255, 59, 48, 0.12);
  color: #c0392b;
}
.ts-matrix {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ts-person {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  padding: 12px 12px 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.ts-person__head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.ts-person__avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  background: linear-gradient(145deg, #3b82f6, #6366f1);
  color: #fff;
}
.ts-person__meta {
  flex: 1;
  min-width: 140px;
}
.ts-person__name {
  font-weight: 650;
}
.ts-person__job {
  font-size: 0.82rem;
  color: var(--hint);
}
.ts-person__stats {
  display: flex;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--hint);
}
.ts-person__stats strong {
  display: block;
  color: var(--text);
  font-size: 1rem;
}
.ts-person__sum strong {
  color: var(--accent, #2563eb);
  white-space: nowrap;
}
.ts-person__days {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.ts-cal {
  width: 100%;
}
.ts-cal__weekdays,
.ts-cal__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.ts-cal__weekdays {
  margin-bottom: 4px;
}
.ts-cal__wd {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--hint);
  text-transform: lowercase;
  padding: 2px 0;
}
.ts-day {
  flex: 0 0 auto;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  min-width: 0;
  min-height: 2.7rem;
  padding: 4px 2px;
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--secondary-bg);
  font: inherit;
}
.ts-day--empty {
  min-height: 2.7rem;
  border: none;
  background: transparent;
  pointer-events: none;
}
.ts-day:disabled {
  cursor: default;
  opacity: 1;
}
.ts-day__n {
  font-size: 0.65rem;
  color: var(--hint);
  line-height: 1;
}
.ts-day__v {
  font-weight: 650;
  font-size: 0.8rem;
  line-height: 1.1;
}
.ts-muted {
  color: var(--hint);
  font-size: 0.92rem;
}
.ts-leaves-soon {
  margin-bottom: 16px;
}
.ts-leaves-soon__title {
  margin: 0 0 10px;
  font-size: 1rem;
}
.ts-leaves-soon__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.ts-leave-card {
  border-radius: var(--radius-lg);
  padding: 12px;
  border: 1px solid var(--border);
  background: var(--secondary-bg);
}
.ts-leave-card--active {
  background: rgba(88, 86, 214, 0.12);
  border-color: rgba(88, 86, 214, 0.3);
}
.ts-leave-card__code {
  display: inline-block;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: #3d3ab8;
}
.ts-leave-card__name {
  font-weight: 650;
}
.ts-leave-card__dates,
.ts-leave-card__meta {
  font-size: 0.82rem;
  color: var(--hint);
}
.ts-leave-form {
  margin-bottom: 16px;
  padding: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--secondary-bg);
}
.ts-leave-form h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}
.ts-leave-form__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.ts-leave-form__note {
  grid-column: 1 / -1;
}
.ts-leaves-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ts-leave-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg);
}
.ts-leave-row__name {
  font-weight: 650;
}
.ts-leave-row__meta,
.ts-leave-row__note {
  font-size: 0.85rem;
  color: var(--hint);
}
.ts-leave-row__side {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ts-badge {
  font-size: 0.72rem;
  font-weight: 650;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--secondary-bg);
}
.ts-badge--planned { background: rgba(10, 132, 255, 0.14); color: #0a66c2; }
.ts-badge--active { background: rgba(88, 86, 214, 0.16); color: #3d3ab8; }
.ts-badge--done { background: rgba(120, 120, 128, 0.14); color: var(--hint); }

.ts-bulk {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--secondary-bg);
}
.ts-bulk__title {
  font-weight: 650;
  margin-bottom: 10px;
}
.ts-bulk__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 10px;
}
.ts-bulk__row label {
  flex: 1 1 220px;
}
.ts-bulk__row select[multiple] {
  min-height: 96px;
  width: 100%;
}
.ts-bulk__side {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ts-bulk__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}

.ts-upcoming {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--secondary-bg);
}
.ts-upcoming__title {
  font-weight: 650;
  margin-bottom: 8px;
}
.ts-upcoming__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ts-upcoming__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 72px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 0.85rem;
}
.ts-upcoming__item--today {
  border-color: var(--link);
  background: rgba(10, 132, 255, 0.1);
}
.ts-today-card__plan {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--link);
  margin: 0;
}
.ts-today-card__plan--off {
  color: var(--hint);
  font-weight: 500;
}
.ts-day-modal__check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  font-size: 0.95rem;
  color: var(--text);
}
.ts-pay-card input[readonly] {
  background: var(--secondary-bg, rgba(120, 120, 128, 0.08));
  color: var(--text);
  cursor: default;
}
.ts-pay-card__wide {
  grid-column: 1 / -1;
}
.ts-payroll-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 12px 0 16px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--secondary-bg);
}
.ts-payroll-totals span {
  display: block;
  font-size: 0.78rem;
  color: var(--hint);
}
.ts-payroll-totals strong {
  font-size: 1.05rem;
}
.ts-payroll {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ts-pay-card {
  padding: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg);
}
.ts-pay-card__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.ts-pay-card__name {
  font-weight: 650;
}
.ts-pay-card__job,
.ts-pay-card__meta {
  font-size: 0.85rem;
  color: var(--hint);
}
.ts-pay-card__total {
  display: flex;
  gap: 14px;
  text-align: right;
}
.ts-pay-card__total span {
  display: block;
  font-size: 0.72rem;
  color: var(--hint);
}
.ts-pay-card__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.ts-pay-card__grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
}
.ts-nfc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.ts-nfc-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg);
}
.ts-nfc-row__name {
  font-weight: 650;
}
.ts-nfc-row__meta {
  font-size: 0.85rem;
  color: var(--hint);
}
.ts-nfc-row__meta code {
  font-size: 0.8rem;
}

@media (max-width: 640px) {
  .ts-hero {
    padding: 8px 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .ts-hero .page-hero__text,
  .ts-hero .ts-hero__text {
    flex: 0 0 auto;
  }

  .ts-month-nav {
    width: 100%;
    justify-content: space-between;
  }

  .ts-month-label {
    flex: 1 1 auto;
    min-width: 0;
  }

  .ts-person__stats {
    width: 100%;
    justify-content: space-between;
  }
}

/* Work item builder: ticket + response preview */
.work-item-builder {
  display: grid;
  gap: 16px;
  margin: 12px 0 8px;
}

@media (min-width: 860px) {
  .work-item-builder {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}

.work-item-builder__section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.work-item-builder__section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.work-item-builder__check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--secondary-bg);
  font-size: 13px;
  color: var(--text);
}

.work-item-builder__check em {
  color: var(--hint);
  font-style: normal;
  font-size: 11px;
}

.work-item-builder__check--inline {
  padding: 4px 6px;
  background: transparent;
  border: none;
}

.work-item-custom-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.work-item-custom-field {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: center;
}

.work-item-builder__advanced {
  margin-top: 8px;
  font-size: 12px;
  color: var(--hint);
}

.work-item-builder__advanced summary {
  cursor: pointer;
  margin-bottom: 8px;
}

.work-item-builder__preview {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--secondary-bg);
}

.work-item-preview-ticket__card,
.work-item-preview-response__card {
  margin-top: 8px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg);
  box-shadow: var(--shadow-card);
}

.work-item-preview-ticket__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.work-item-preview-ticket__time {
  font-weight: 650;
  font-size: 13px;
}

.work-item-preview-ticket__title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
}

.work-item-preview-ticket__meta,
.work-item-preview-response__title {
  font-size: 12px;
  color: var(--hint);
}

.work-item-preview-response__title {
  font-weight: 700;
  color: var(--text);
  font-size: 14px;
  margin-bottom: 4px;
}

.work-item-preview-field {
  display: block;
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--hint);
}

.work-item-preview-field .input {
  margin-top: 4px;
  opacity: 0.9;
}

.work-item-preview-response__photos {
  margin: 10px 0;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--hint);
  text-align: center;
}

.work-item-row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.work-item-constructor {
  margin: 12px 0 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  box-shadow: var(--shadow-card);
}

.work-item-constructor__head {
  margin-bottom: 12px;
}

.work-item-constructor__head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.work-item-constructor__title {
  margin: 0;
  font-size: 1.05rem;
}

.work-item-constructor__actions {
  margin-top: 12px;
}

.work-item-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.work-item-meta-grid label {
  margin: 0;
  font-size: 12px;
  color: var(--hint);
}

.work-item-meta-grid .input {
  margin-top: 4px;
}

@media (max-width: 720px) {
  .work-item-meta-grid {
    grid-template-columns: 1fr;
  }
}

.work-item-row--selected {
  outline: 2px solid rgba(36, 129, 204, 0.45);
  outline-offset: 1px;
  background: rgba(36, 129, 204, 0.06);
}

.work-items-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0 6px;
}

.work-items-list-head .work-items-group__title {
  margin: 0;
}

.work-items-cat-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  margin: 0 0 12px;
  padding: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-radius: var(--radius-md);
  background: var(--secondary-bg);
  border: 1px solid var(--border);
}

.work-items-cat-nav::-webkit-scrollbar {
  display: none;
}

.work-items-cat-nav .settings-chip {
  flex: 0 0 auto;
  white-space: nowrap;
}

.ctor-preview-card {
  margin-top: 8px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--secondary-bg) 70%, var(--bg)), var(--bg));
}

.ctor-preview-card--form {
  background: var(--bg);
}

.ctor-preview-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.ctor-preview-card__time {
  font-size: 13px;
  font-weight: 650;
}

.ctor-preview-card__badge {
  font-size: 11px;
  font-weight: 650;
  color: var(--link);
  background: rgba(36, 129, 204, 0.12);
  border-radius: 999px;
  padding: 3px 8px;
}

.ctor-preview-card__title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.ctor-preview-card__line {
  font-size: 12px;
  color: var(--hint);
  margin-bottom: 8px;
}

.ctor-preview-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ctor-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--hint);
}

.ctor-chip--accent {
  color: var(--link);
  border-color: rgba(36, 129, 204, 0.35);
  background: rgba(36, 129, 204, 0.08);
}

.ctor-preview-field {
  display: block;
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--hint);
}

.ctor-preview-field span {
  display: block;
  margin-bottom: 4px;
}

.ctor-preview-field .input {
  margin-top: 0;
}

.ctor-preview-photos {
  margin: 10px 0;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  text-align: center;
  font-size: 12px;
  color: var(--hint);
  background: var(--secondary-bg);
}

.tag--webt {
  color: #0b5f4a;
  border-color: rgba(11, 95, 74, 0.35);
  background: rgba(11, 95, 74, 0.08);
}

.tag--crew-primary {
  color: #166534;
  background: rgba(22, 163, 74, 0.14);
  font-weight: 700;
}

.tag--crew-helper {
  color: #1e40af;
  background: rgba(59, 130, 246, 0.14);
  font-weight: 700;
}

.tag--rescheduled {
  color: #6b4f1d;
  border-color: rgba(180, 130, 40, 0.4);
  background: rgba(180, 130, 40, 0.12);
}

.tag--conflict {
  color: #9a3412;
  border-color: rgba(194, 65, 12, 0.45);
  background: rgba(194, 65, 12, 0.14);
  font-weight: 700;
}

.tag--cancel {
  color: #8b2e24;
  border-color: rgba(192, 57, 43, 0.35);
  background: rgba(192, 57, 43, 0.1);
}

.tag--muted {
  opacity: 0.75;
}

.webt-import-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(55vh, 420px);
  overflow: auto;
  margin: 12px 0;
}

.webt-import-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 0;
}

.card__account,
.card--schedule__account {
  margin-top: 4px;
  font-size: 0.88rem;
  color: var(--text);
}

.card__account a,
.card--schedule__account a {
  font-weight: 650;
}

.webt-import-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--secondary-bg);
  cursor: pointer;
}

.webt-import-item--imported {
  opacity: 0.7;
  cursor: default;
}

.webt-import-item--cancelled {
  border-color: #f5c2c0;
  background: #fff5f5;
}

.webt-import-item__top {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  margin-bottom: 4px;
}

.webt-import-item__comment {
  margin-top: 6px;
  font-size: 13px;
  color: var(--hint);
  white-space: pre-wrap;
}

.webt-import-status {
  min-height: 1.2em;
  font-size: 13px;
  color: var(--hint);
  margin: 0 0 8px;
}

.webt-import-status--error {
  color: var(--danger, #b42318);
}

/* Assistant */
.assistant-wrap {
  position: relative;
}

.assistant-panel {
  width: min(400px, calc(100vw - 24px));
  right: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(560px, 70vh);
  overflow: hidden;
  overscroll-behavior: contain;
  box-sizing: border-box;
}

.assistant-panel__header-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.assistant-thread {
  flex: 1 1 auto;
  min-height: 140px;
  max-height: min(420px, 55vh);
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 2px 8px;
  border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.08));
}

.assistant-thread:empty {
  display: flex;
}

.assistant-thread.has-messages {
  display: flex;
  min-height: 160px;
}

.assistant-guide {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 0 0 2px;
}

.assistant-memory-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--hint, #6b7280);
  cursor: pointer;
  user-select: none;
}

.assistant-memory-toggle input {
  accent-color: var(--accent, #2563eb);
}

.assistant-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.assistant-guide__title {
  display: none;
}

.assistant-guide.hidden {
  display: none;
}

.assistant-msg {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 100%;
}

.assistant-msg--user {
  align-items: flex-end;
}

.assistant-msg--bot {
  align-items: flex-start;
}

.assistant-msg__bubble {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.assistant-msg--user .assistant-msg__bubble {
  background: color-mix(in srgb, var(--accent, #2563eb) 16%, var(--surface, #fff));
  border: 1px solid color-mix(in srgb, var(--accent, #2563eb) 28%, var(--border, #ddd));
  border-bottom-right-radius: 4px;
}

.assistant-msg--bot .assistant-msg__bubble {
  background: color-mix(in srgb, var(--secondary-bg, var(--bg)) 80%, var(--surface, #fff));
  border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
  border-bottom-left-radius: 4px;
}

.assistant-suggestions-details {
  border: 1px solid var(--border, rgba(0, 0, 0, 0.12));
  border-radius: var(--radius-md, 6px);
  background: color-mix(in srgb, var(--secondary-bg, #f4f6fb) 88%, var(--surface, #fff));
  overflow: hidden;
}

.assistant-suggestions-toggle {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--hint, #6b7280);
}

.assistant-suggestions-toggle::-webkit-details-marker {
  display: none;
}

.assistant-suggestions-toggle::after {
  content: "";
  width: 0.45em;
  height: 0.45em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
  opacity: 0.75;
}

.assistant-suggestions-details[open] > .assistant-suggestions-toggle {
  color: var(--text, #111);
  border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.08));
}

.assistant-suggestions-details[open] > .assistant-suggestions-toggle::after {
  transform: rotate(-135deg);
  margin-top: 0.2em;
}

.assistant-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px 10px;
}

.assistant-chip {
  appearance: none;
  border: 1px solid var(--border, rgba(0, 0, 0, 0.12));
  background: var(--surface, #fff);
  color: inherit;
  font: inherit;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.assistant-chip:hover {
  border-color: color-mix(in srgb, var(--accent, #2563eb) 50%, var(--border));
}

.assistant-typing {
  color: var(--hint);
  font-style: italic;
}

.assistant-brain-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent, #2563eb);
  margin-bottom: 4px;
}

.assistant-panel .input,
.assistant-panel textarea.input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  resize: none;
  min-height: 44px;
}

.assistant-voice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 8px 0 4px;
  position: sticky;
  bottom: 0;
  background: var(--surface, #fff);
  z-index: 2;
}

.assistant-composer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  padding: 8px 0 4px;
  position: sticky;
  bottom: 0;
  background: var(--surface, #fff);
  z-index: 2;
  border-top: 1px solid var(--border, #e5e7eb);
  margin-top: 4px;
}

.assistant-composer__input {
  width: 100%;
  box-sizing: border-box;
  min-height: 52px;
  max-height: 120px;
  resize: vertical;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.4;
  background: var(--bg, #fafafa);
  color: var(--text, #111);
}

.assistant-composer__input:focus {
  outline: 2px solid color-mix(in srgb, var(--accent, #2563eb) 35%, transparent);
  outline-offset: 1px;
  border-color: var(--accent, #2563eb);
}

.assistant-composer__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.assistant-composer__send {
  flex: 1;
  min-height: 40px;
}

.assistant-mic--compact {
  width: 40px;
  height: 40px;
  min-width: 40px;
  font-size: 16px;
  border-width: 1.5px;
}

.assistant-mic--compact .assistant-mic__icon {
  width: 20px;
  height: 20px;
}

.assistant-md__list {
  margin: 0.35em 0 0.35em 1.1em;
  padding: 0;
}

.assistant-md__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin: 0.4em 0;
}

.assistant-md__table th,
.assistant-md__table td {
  border: 1px solid var(--border, #e5e7eb);
  padding: 4px 6px;
  text-align: left;
}

.assistant-md__pre {
  overflow-x: auto;
  padding: 8px;
  border-radius: 8px;
  background: var(--bg, #f3f4f6);
  font-size: 0.8rem;
}

.assistant-md__code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--bg, #f3f4f6);
}

.assistant-status p {
  margin: 0 0 0.4em;
}

.assistant-status p:last-child {
  margin-bottom: 0;
}

.assistant-voice__live {
  margin: 0;
  max-width: 100%;
  max-height: 2.7em;
  text-align: center;
  font-size: 0.85rem;
  line-height: 1.35;
  color: var(--accent, #2563eb);
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow-wrap: anywhere;
}

.assistant-voice__live.hidden {
  display: none !important;
}

.assistant-voice__live.is-active {
  display: -webkit-box;
}

.assistant-voice__status {
  margin: 0;
  text-align: center;
  font-size: 0.85rem;
  line-height: 1.3;
  color: var(--hint);
  max-width: 100%;
  overflow-wrap: anywhere;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.assistant-mic {
  appearance: none;
  -webkit-appearance: none;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid #2563eb;
  background: #eff6ff;
  color: #2563eb;
  font-size: 28px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.assistant-mic svg,
.assistant-mic__icon {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px;
  min-height: 32px;
  display: block !important;
  pointer-events: none;
  overflow: visible;
}

.assistant-mic svg path,
.assistant-mic svg rect {
  fill: #2563eb !important;
}

.assistant-mic:hover:not(:disabled) {
  transform: scale(1.04);
}

.assistant-mic:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.assistant-mic.is-listening,
.assistant-btn.is-listening {
  background: color-mix(in srgb, var(--accent, #2563eb) 28%, var(--surface, #fff));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent, #2563eb) 25%, transparent);
  outline: none;
  animation: assistant-mic-pulse 1.1s ease-in-out infinite;
}

@keyframes assistant-mic-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #2563eb) 22%, transparent);
  }
  50% {
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent, #2563eb) 10%, transparent);
  }
}

.assistant-panel__form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  flex-shrink: 0;
}

.assistant-panel__actions {
  display: flex;
  gap: 8px;
  justify-content: stretch;
  flex-wrap: wrap;
}

.assistant-panel__actions .btn {
  flex: 1 1 auto;
  min-width: 0;
}

.assistant-status {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 8px;
}

.assistant-status--error {
  color: var(--danger, #b42318);
}

.assistant-status--need_clarification {
  color: var(--hint);
}

.assistant-status--done,
.assistant-status--ready {
  color: inherit;
}

.assistant-answer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
  font-size: 22px;
}

.assistant-answer__delta {
  font-size: 16px;
  font-weight: 600;
  color: #15803d;
}

.assistant-candidates {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.assistant-candidates li,
.assistant-candidate {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
  font-size: 13px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  background: color-mix(in srgb, var(--surface, #fff) 88%, var(--secondary-bg, #f4f6fb));
}

.assistant-candidate__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.assistant-candidate__id {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.assistant-candidate__addr {
  color: var(--text);
  line-height: 1.3;
}

.assistant-candidate__meta {
  color: var(--hint);
  font-size: 12px;
}

.assistant-panel__confirm {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.assistant-feedback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.assistant-feedback__btn {
  appearance: none;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}

.assistant-feedback__btn:hover:not(:disabled) {
  border-color: #2563eb;
}

.assistant-feedback__btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.assistant-feedback__correct {
  flex: 1 1 100%;
  display: grid;
  gap: 6px;
}

.assistant-feedback__correct.hidden {
  display: none;
}

.assistant-panel__confirm .btn {
  flex: 1 1 auto;
}

.assistant-btn.is-listening,
#btn-assistant-mic.is-listening {
  outline: none;
}

@media (max-width: 720px) {
  .assistant-mic {
    width: 76px;
    height: 76px;
  }
}

/* Today: List / Day-scale toggle (desktop) */
#tab-today .page-hero__actions .today-layout-switch {
  margin: 0;
  padding: 2px;
  flex: 0 0 auto;
}

#tab-today .page-hero__actions .today-layout-switch .seg-nav__btn {
  padding: 6px 12px;
  font-size: 13px;
}

#work-view-today #today-filters {
  margin-bottom: 12px;
}

.today-list--hidden {
  display: none !important;
}

.today-scale {
  width: 100%;
  max-width: 100%;
  margin-bottom: 16px;
  min-width: 0;
}

.today-scale__day-title {
  margin: 18px 0 10px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--text);
}

.today-scale__day-title:first-child {
  margin-top: 0;
}

.today-scale__carry {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--warning) 12%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in srgb, var(--warning) 32%, transparent);
  color: var(--text);
  font-size: 13px;
}

.today-scale__carry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  margin-bottom: 10px;
}

.today-scale__carry-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.today-scale__carry-sub {
  font-size: 12px;
  color: var(--hint);
}

.today-scale__carry-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.today-scale__carry-item {
  display: grid;
  grid-template-columns: 44px 92px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px 10px;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: 10px;
  border-left: 3px solid transparent;
  background: color-mix(in srgb, var(--surface) 92%, var(--secondary-bg));
  color: var(--text);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.today-scale__carry-item:hover,
.today-scale__carry-item:focus-visible {
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.today-scale__carry-item:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--button) 70%, white);
  outline-offset: 1px;
}

.today-scale__carry-date {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--warning) 75%, var(--text));
}

.today-scale__carry-time {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.today-scale__carry-addr {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-scale__carry-tech {
  color: var(--hint);
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.today-scale__carry-status {
  justify-self: end;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  background: color-mix(in srgb, var(--secondary-bg) 85%, transparent);
  color: var(--hint);
}

.today-scale__carry-item--pending {
  border-left-color: #d4a800;
}

.today-scale__carry-item--pending .today-scale__carry-status {
  background: rgba(230, 184, 0, 0.18);
  color: #8a6a00;
}

.today-scale__carry-item--in_progress {
  border-left-color: #2481cc;
}

.today-scale__carry-item--in_progress .today-scale__carry-status {
  background: rgba(36, 129, 204, 0.16);
  color: #1a5f96;
}

.today-scale__carry-item--awaiting_confirmation {
  border-left-color: #ff9500;
}

.today-scale__carry-item--awaiting_confirmation .today-scale__carry-status {
  background: rgba(255, 149, 0, 0.16);
  color: #a85f00;
}

html[data-theme="dark"] .today-scale__carry-item--pending .today-scale__carry-status {
  color: #f0d56a;
}

html[data-theme="dark"] .today-scale__carry-item--in_progress .today-scale__carry-status {
  color: #8ec5f0;
}

html[data-theme="dark"] .today-scale__carry-item--awaiting_confirmation .today-scale__carry-status {
  color: #ffb84d;
}

@media (max-width: 1100px) {
  .today-scale__carry-item {
    grid-template-columns: 40px 84px minmax(0, 1fr) auto;
  }

  .today-scale__carry-tech {
    display: none;
  }
}

.today-scale__board {
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: 14px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--secondary-bg) 55%, transparent), transparent 48px),
    var(--surface);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  min-width: 0;
}

.today-scale__board-inner {
  width: 100%;
  min-width: 0;
}

.today-scale__header,
.today-scale__row {
  display: grid;
  grid-template-columns: minmax(132px, 168px) minmax(0, 1fr);
  align-items: stretch;
  min-width: 0;
}

.today-scale__header {
  border-bottom: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  background: color-mix(in srgb, var(--secondary-bg) 70%, transparent);
}

.today-scale__header-label,
.today-scale__lane-label {
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--hint);
  border-right: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  background: color-mix(in srgb, var(--surface) 88%, var(--secondary-bg));
}

.today-scale__header-label {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
}

.today-scale__lane-label {
  color: var(--text);
  font-weight: 550;
  font-size: 13px;
}

.today-scale__avatar {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--button-text);
  background: linear-gradient(145deg, color-mix(in srgb, var(--button) 88%, white), var(--button));
}

.today-scale__lane-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-scale__header-axis,
.today-scale__track {
  position: relative;
  min-height: 40px;
  min-width: 0;
}

.today-scale__header-axis {
  height: 40px;
}

.today-scale__row + .today-scale__row {
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.today-scale__row:hover .today-scale__lane-label {
  background: color-mix(in srgb, var(--secondary-bg) 55%, var(--surface));
}

.today-scale__grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.today-scale__hour-band {
  position: absolute;
  top: 0;
  bottom: 0;
  background: transparent;
}

.today-scale__hour-band--alt {
  background: color-mix(in srgb, var(--hint) 4.5%, transparent);
}

.today-scale__vline {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: color-mix(in srgb, var(--border) 55%, transparent);
}

.today-scale__vline--major {
  background: color-mix(in srgb, var(--border) 85%, transparent);
}

.today-scale__tick {
  position: absolute;
  top: 0;
  bottom: 0;
  transform: translateX(-50%);
}

.today-scale__tick-label {
  position: absolute;
  top: 11px;
  left: 0;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  color: var(--hint);
  white-space: nowrap;
}

.today-scale__tick--start {
  transform: translateX(0);
}

.today-scale__tick--start .today-scale__tick-label {
  transform: translateX(8px);
}

.today-scale__tick--end {
  transform: translateX(-100%);
}

.today-scale__tick--end .today-scale__tick-label {
  transform: translateX(-8px);
}

.today-scale__bar {
  position: absolute;
  box-sizing: border-box;
  margin: 0;
  padding: 4px 8px;
  border: 0;
  border-radius: 10px;
  border-left: 3px solid transparent;
  color: var(--text);
  font: inherit;
  font-size: 11px;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  z-index: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.today-scale__bar:hover,
.today-scale__bar:focus-visible {
  outline: none;
  z-index: 3;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  filter: saturate(1.05);
}

.today-scale__bar:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--button) 70%, white);
  outline-offset: 1px;
}

.today-scale__bar-time {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.today-scale__bar-addr {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.88;
}

.today-scale__bar--pending {
  background: linear-gradient(180deg, rgba(230, 184, 0, 0.28), rgba(230, 184, 0, 0.16));
  border-left-color: #d4a800;
}

.today-scale__bar--in_progress {
  background: linear-gradient(180deg, rgba(36, 129, 204, 0.28), rgba(36, 129, 204, 0.14));
  border-left-color: #2481cc;
}

.today-scale__bar--awaiting_confirmation {
  background: linear-gradient(180deg, rgba(255, 149, 0, 0.28), rgba(255, 149, 0, 0.14));
  border-left-color: #ff9500;
}

.today-scale__bar--confirmed {
  background: linear-gradient(180deg, rgba(52, 199, 89, 0.26), rgba(52, 199, 89, 0.12));
  border-left-color: #34c759;
}

.today-scale__bar--conflict {
  box-shadow: inset 0 0 0 1px #c2410c, 0 1px 2px rgba(0, 0, 0, 0.05);
}

.today-scale__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--hint);
}

.today-scale__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--secondary-bg) 80%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.today-scale__legend-item::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border-left: 0;
}

.today-scale__legend-item--pending::before {
  background: #e6b800;
}

.today-scale__legend-item--in_progress::before {
  background: #2481cc;
}

.today-scale__legend-item--awaiting::before {
  background: #ff9500;
}

.today-scale__legend-item--confirmed::before {
  background: #34c759;
}

.today-scale__legend-item--conflict::before {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px #c2410c;
}

@media (max-width: 1100px) {
  .today-scale__header,
  .today-scale__row {
    grid-template-columns: minmax(112px, 136px) minmax(0, 1fr);
  }

  .today-scale__tick-label {
    font-size: 10px;
  }

  .today-scale__bar {
    font-size: 10px;
    padding: 3px 6px;
  }
}

@media (max-width: 899px) {
  .today-layout-switch,
  .today-scale {
    display: none !important;
  }

  .today-list--hidden {
    display: block !important;
  }
}


.instructions-block {
  margin: 0 0 1.25rem;
}
.instructions-block__title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.instructions-block__list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text);
  line-height: 1.45;
}
.instructions-block__list li + li {
  margin-top: 0.35rem;
}


.instructions-tiles-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
  gap: 8px;
}

.instructions-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.instructions-tile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  text-align: left;
  min-height: 148px;
  padding: 16px 16px 14px;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 92%, var(--secondary-bg));
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.instructions-tile:nth-child(4n + 2) {
  border-color: color-mix(in srgb, #c4a574 35%, var(--border));
  background: #fff;
}

.instructions-tile:nth-child(4n + 3) {
  border-color: color-mix(in srgb, #7aa2c4 40%, var(--border));
}

.instructions-tile:hover,
.instructions-tile:focus-visible {
  border-color: var(--button);
  box-shadow: var(--shadow-card);
  outline: none;
  transform: translateY(-1px);
}

.instructions-tile__label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.instructions-tile__badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, #c4a574 55%, var(--border));
  color: #9a6b2f;
  background: transparent;
}

.instructions-tile__value {
  margin-top: auto;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

.instructions-tile__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 1.1em;
  font-size: 0.78rem;
  color: var(--hint);
}

.instructions-tile__meta {
  color: var(--muted);
}

.instructions-full-host {
  min-height: calc(100vh - 220px);
}

.instructions-full {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: inherit;
}

.instructions-article--full {
  flex: 1 1 auto;
  padding: 20px 22px 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.instructions-article__actions {
  display: flex;
  gap: 8px;
  margin-bottom: 0;
  flex-wrap: wrap;
}

.instructions-article__title {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 700;
}

.instructions-article__summary {
  margin: 0 0 16px;
  color: var(--hint);
  font-size: 14px;
}

.instructions-article__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
}

.instructions-article__text {
  white-space: normal;
}

.instructions-inline-photo {
  margin: 4px 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--secondary-bg);
}

.instructions-inline-photo img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  background: #fff;
}

.instructions-inline-photo__btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.instructions-inline-photo figcaption {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--hint);
}

.instructions-inline-photo--missing {
  padding: 10px 12px;
  color: var(--hint);
  font-size: 13px;
}

.instructions-nested {
  padding: 16px 18px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 88%, var(--secondary-bg));
}

.instructions-nested__title {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 650;
}

.instruction-editor-photos {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0 4px;
}

.instruction-editor-photos__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
}

.instruction-editor-photos .photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.instruction-editor-photos .instructions-insert-photo {
  margin-top: 4px;
  width: 100%;
}

.modal__content--wide {
  max-width: min(720px, 96vw);
}

.instruction-editor-form__check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.instructions-article__body {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  white-space: normal;
}

.instruction-editor-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.instruction-editor-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.instruction-editor-form__check {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
}

.ts-conn-rates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--hint);
}

.ts-conn-rate strong {
  color: var(--text);
  font-weight: 650;
}

.ts-conn-list {
  margin-bottom: 16px;
}

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

.ts-conn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ts-conn-table th,
.ts-conn-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.ts-conn-table th {
  font-weight: 600;
  color: var(--hint);
  background: color-mix(in srgb, var(--surface) 85%, var(--secondary-bg));
}

.ts-conn-table tr:last-child td {
  border-bottom: 0;
}

.ts-conn-pick {
  padding: 14px 16px 16px;
  margin-top: 8px;
}

.ts-conn-pick__title {
  margin: 0 0 10px;
  font-size: 1rem;
}

.ts-conn-pick__row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.ts-conn-pick__row .input {
  flex: 1 1 auto;
}

.ts-conn-available {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
}

.ts-conn-avail {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 92%, var(--secondary-bg));
  cursor: pointer;
}

.ts-conn-avail:hover:not(:disabled),
.ts-conn-avail:focus-visible:not(:disabled) {
  border-color: var(--button);
  outline: none;
}

.ts-conn-avail:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ts-conn-avail__addr {
  font-weight: 650;
  color: var(--text);
}

.ts-conn-avail__meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--hint);
}

/* Access matrix (admin, read-only) */
.access-matrix__h{margin:0.75rem 0 0.35rem;font-size:0.9rem}
.access-matrix__scroll{overflow:auto;max-height:22rem;border:1px solid color-mix(in srgb, var(--border, #ccc) 80%, transparent);border-radius:8px}
.access-matrix__table{width:100%;border-collapse:collapse;font-size:0.8rem}
.access-matrix__table th,.access-matrix__table td{padding:0.35rem 0.5rem;border-bottom:1px solid color-mix(in srgb, var(--border, #ccc) 70%, transparent);text-align:center}
.access-matrix__table th:first-child,.access-matrix__table td:first-child{text-align:left;position:sticky;left:0;background:var(--surface, #fff);z-index:1}
.access-matrix__on{color:var(--ok, #1a7f37);font-weight:600}
.access-matrix__off{opacity:0.45}
