@import url("../styles.css");

body {
  min-height: 100vh;
}

.admin-root {
  --admin-chat-shell-height: clamp(540px, calc(100dvh - 248px), 1200px);
}

.admin-root .admin-view[hidden],
.admin-root .admin-modal[hidden],
.admin-root .session-summary[hidden],
.admin-root .booking-owner[hidden],
.admin-root .mailing-recipient-menu[hidden],
.admin-root #mailing-attachment-input[hidden],
.admin-root #avatar-file-input[hidden] {
  display: none !important;
}

.admin-root .booking-form-actions > .primary-button[hidden],
.admin-root .booking-form-actions > .ghost-button[hidden],
.admin-root .booking-form-actions > .table-delete[hidden],
.admin-root .admin-modal-actions > .primary-button[hidden],
.admin-root .admin-modal-actions > .table-delete[hidden],
.admin-root .avatar-editor-buttons > .ghost-button[hidden] {
  display: inline-flex !important;
  visibility: hidden;
  pointer-events: none;
}

.admin-page-shell {
  width: calc(100% - 32px);
  max-width: none;
}

.admin-header {
  position: sticky;
  top: 14px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 24px;
  align-items: start;
}

.admin-sidebar {
  display: grid;
  gap: 18px;
  min-width: 0;
  position: sticky;
  top: 112px;
}

.admin-create-card,
.admin-table-card,
.calendar-card,
.booking-form-card,
.selected-day-card {
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.admin-create-card,
.admin-table-card,
.calendar-card,
.booking-form-card,
.selected-day-card {
  padding: 22px;
}

.admin-sidebar-nav {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  padding: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(248, 242, 236, 0.7);
}

.admin-nav-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  position: relative;
}

.admin-nav-row[hidden] {
  display: none;
}

.admin-nav-button {
  min-height: 56px;
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  font-weight: 800;
  text-align: left;
  padding: 0 58px 0 18px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.admin-nav-settings {
  display: grid;
  place-items: center;
  position: absolute;
  right: 10px;
  bottom: 8px;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(85, 125, 169, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 900;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  z-index: 2;
}

.admin-nav-settings[hidden] {
  display: none;
}

.admin-nav-button:hover,
.admin-nav-button:focus-visible {
  transform: translateY(-1px);
  color: var(--text);
}

.admin-nav-button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
  transform: none;
}

.admin-nav-settings:hover:not(:disabled),
.admin-nav-settings:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 24px rgba(43, 70, 101, 0.12);
}

.admin-nav-settings:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
  color: var(--muted);
  box-shadow: none;
}

.admin-nav-button.active {
  color: #fffdf4;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  box-shadow: 0 18px 34px rgba(53, 95, 141, 0.24);
}

.admin-nav-button.active + .admin-nav-settings:not(:disabled) {
  background: rgba(255, 253, 244, 0.92);
  border-color: rgba(255, 253, 244, 0.6);
}

.admin-main-shell {
  margin-top: 0;
  width: 100%;
  min-width: 0;
  min-height: 0;
}

.admin-view {
  display: grid;
  gap: 18px;
}

#chat-view {
  grid-template-rows: auto minmax(0, 1fr);
  height: var(--admin-chat-shell-height);
  min-height: var(--admin-chat-shell-height);
  overflow: hidden;
}

.admin-view > .admin-section-heading {
  display: none;
}

.admin-status-line {
  min-height: 1.6em;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.admin-status-line.error {
  color: var(--danger);
}

.admin-status-line.success {
  color: var(--success);
}

.admin-main-grid {
  display: block;
}

.shop-admin-shell {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.28fr);
  gap: 18px;
  align-items: start;
}

.conference-admin-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.conference-admin-summary article {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 42px rgba(43, 70, 101, 0.08);
}

.conference-admin-summary span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.conference-admin-summary strong {
  color: var(--text);
  font-size: clamp(1.5rem, 2.6vw, 2.35rem);
  line-height: 1;
  font-weight: 900;
}

.conference-toolbar {
  align-items: flex-start;
}

.conference-toolbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.conference-search-input,
.conference-toolbar-actions select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  font-weight: 700;
}

.conference-search-input {
  width: min(260px, 100%);
  padding: 0 12px;
}

.conference-toolbar-actions select {
  padding: 0 34px 0 12px;
}

.live-recordings-admin {
  display: grid;
  gap: 18px;
}

.live-recordings-toolbar {
  display: grid;
  gap: 16px;
}

.live-recordings-filter-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) repeat(2, minmax(140px, 0.7fr)) repeat(2, minmax(128px, 0.55fr));
  gap: 12px;
  align-items: end;
}

.live-recordings-filter-grid select,
.live-recordings-date-filter input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  font-weight: 700;
}

.live-recordings-filter-grid select {
  padding: 0 34px 0 12px;
}

.live-recordings-date-filter {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.live-recordings-date-filter input {
  padding: 0 12px;
}

.live-recordings-layout {
  display: block;
}

.live-recordings-table-card {
  min-width: 0;
}

.live-recordings-table-card {
  padding: 16px;
}

.live-recordings-table-card .table-shell {
  padding: 0;
  overflow-x: auto;
}

.live-recordings-table {
  min-width: 1160px;
  table-layout: fixed;
}

.live-recordings-table th,
.live-recordings-table td {
  height: 48px;
  max-height: 48px;
  padding: 8px 10px;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.86rem;
}

.live-recordings-table th {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.live-recordings-table th:nth-child(1),
.live-recordings-table td:nth-child(1) {
  width: 22%;
}

.live-recordings-table th:nth-child(2),
.live-recordings-table td:nth-child(2) {
  width: 12%;
}

.live-recordings-table th:nth-child(3),
.live-recordings-table td:nth-child(3) {
  width: 8%;
}

.live-recordings-table th:nth-child(4),
.live-recordings-table td:nth-child(4) {
  width: 15%;
}

.live-recordings-table th:nth-child(5),
.live-recordings-table td:nth-child(5) {
  width: 8%;
}

.live-recordings-table th:nth-child(6),
.live-recordings-table td:nth-child(6) {
  width: 7%;
}

.live-recordings-table th:nth-child(7),
.live-recordings-table td:nth-child(7) {
  width: 10%;
}

.live-recordings-table th:nth-child(8),
.live-recordings-table td:nth-child(8) {
  width: 18%;
}

.live-recordings-table tbody tr {
  cursor: pointer;
}

.live-recordings-table tr:focus-visible {
  outline: 2px solid rgba(53, 95, 141, 0.42);
  outline-offset: -2px;
}

.live-recordings-table .role-pill {
  min-height: 26px;
  padding: 0 9px;
  font-size: 0.74rem;
}

.live-recording-title-cell strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
}

.live-recordings-table .table-actions {
  flex-wrap: nowrap;
  gap: 6px;
}

.live-recordings-table .table-save,
.live-recordings-table .ghost-button,
.live-recordings-table .table-delete {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 0.78rem;
  box-shadow: none;
}

.live-recordings-table tr.is-selected {
  background: rgba(76, 117, 157, 0.08);
}

.admin-modal-dialog--live-recording {
  width: min(1080px, 100%);
  max-height: min(92vh, 980px);
}

.live-recording-details-root {
  min-height: 180px;
}

.live-recording-detail-card {
  display: grid;
  gap: 16px;
}

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

.live-recording-detail-head h3 {
  margin: 2px 0 6px;
  color: var(--text);
  font-size: clamp(1.08rem, 2vw, 1.42rem);
  line-height: 1.12;
}

.live-recording-detail-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

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

.live-recording-stat-grid span {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--text);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-recording-stat-grid strong {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.live-recording-language-bar,
.live-recording-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.live-recording-language-bar > span {
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
}

.live-recording-language-bar > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.live-recording-language-bar .ghost-button.active {
  border-color: rgba(53, 95, 141, 0.46);
  background: rgba(53, 95, 141, 0.14);
  color: var(--text);
}

.live-recording-transcript-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--text);
}

.live-recording-transcript-head span {
  color: var(--muted);
  font-weight: 800;
}

.live-recording-transcript-list {
  display: grid;
  gap: 10px;
  max-height: min(42vh, 520px);
  overflow: auto;
  padding-right: 4px;
}

.live-recording-transcript-entry {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(79, 103, 132, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.live-recording-transcript-entry time {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.live-recording-transcript-entry p {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
}

.live-recording-load-more {
  justify-self: center;
}

@media (max-width: 1180px) {
  .live-recordings-layout,
  .live-recordings-filter-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .live-recording-detail-head,
  .live-recording-transcript-head {
    display: grid;
  }

  .live-recording-stat-grid,
  .live-recording-transcript-entry {
    grid-template-columns: 1fr;
  }
}

.conference-table {
  min-width: 1280px;
}

.conference-id-cell {
  display: grid;
  gap: 4px;
}

.conference-id-cell strong {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.8rem;
}

.conference-note-cell {
  max-width: 260px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

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

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

.conference-total-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--accent-ghost);
  color: var(--text);
  font-weight: 900;
}

.admin-modal-dialog--conference {
  width: min(760px, calc(100vw - 28px));
}

.shop-admin-card {
  display: grid;
  gap: 18px;
}

.shop-admin-form {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(85, 125, 169, 0.14);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.62);
}

.shop-admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

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

.shop-admin-form-grid--wide .field:nth-last-child(-n + 2) {
  align-self: stretch;
}

.shop-admin-form textarea {
  min-height: 110px;
  padding: 12px 14px;
  resize: vertical;
}

.shop-admin-check {
  margin: 0;
}

.shop-admin-list,
.shop-admin-product-list {
  display: grid;
  gap: 12px;
}

.shop-admin-list-item,
.shop-admin-product {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(85, 125, 169, 0.14);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
}

.shop-admin-list-item.is-active,
.shop-admin-product.is-active {
  border-color: rgba(85, 125, 169, 0.42);
  box-shadow: 0 14px 30px rgba(43, 70, 101, 0.1);
}

.shop-admin-list-item > div:first-child,
.shop-admin-product-copy {
  display: grid;
  gap: 6px;
}

.shop-admin-list-item strong,
.shop-admin-product-copy strong {
  color: var(--text);
  font-weight: 900;
}

.shop-admin-list-item span,
.shop-admin-product-copy span,
.shop-admin-product-copy p,
.shop-admin-empty {
  color: var(--muted);
  line-height: 1.55;
}

.shop-admin-item-meta,
.shop-admin-product-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.role-pill--muted {
  background: var(--accent-ghost);
  color: var(--muted);
}

.shop-picture-editor {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.shop-product-picture-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid rgba(85, 125, 169, 0.14);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(85, 125, 169, 0.1), rgba(240, 196, 79, 0.16));
}

.shop-product-picture-preview img,
.shop-admin-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-product-picture-preview--empty span {
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.shop-picture-actions {
  display: grid;
  gap: 10px;
}

.shop-admin-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.shop-admin-product {
  grid-template-columns: 128px minmax(0, 1fr) auto;
  align-items: center;
}

.shop-admin-product-image {
  display: grid;
  place-items: center;
  width: 128px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 18px;
  background: var(--accent-ghost);
}

.shop-admin-product-image--empty span {
  color: var(--accent-strong);
  font-weight: 900;
}

.shop-admin-product-copy p {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.admin-modal-dialog--group {
  width: min(760px, calc(100vw - 32px));
}

.admin-modal-dialog--access {
  width: min(820px, calc(100vw - 32px));
}

.access-form {
  display: grid;
  gap: 18px;
}

.access-landing-field {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(85, 125, 169, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
}

.access-landing-toggle {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--text);
  font-weight: 900;
}

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

.access-landing-field small {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.4;
}

.access-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.42fr) auto;
  gap: 12px;
  align-items: end;
}

.access-rules-list {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.access-rule-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 0.36fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(85, 125, 169, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
}

.access-rule-group {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.access-rule-group strong,
.access-rule-group small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.access-rule-group small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.access-empty {
  padding: 14px;
  border-radius: 18px;
  background: rgba(118, 132, 153, 0.1);
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

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

.group-form-grid .field:last-child {
  grid-column: 1 / -1;
  max-width: 220px;
}

.user-group-chips,
.group-members-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.group-members-preview {
  max-width: 360px;
}

.group-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(72, 126, 139, 0.12);
  color: #2f6670;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.2;
}

.group-chip--muted {
  background: rgba(118, 132, 153, 0.12);
  color: var(--muted);
}

.group-member-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 150px;
  padding: 3px 8px 3px 4px;
  border-radius: 999px;
  background: rgba(72, 126, 139, 0.12);
  color: #2f6670;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.2;
}

.group-member-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 24px;
  min-width: 24px;
  height: 24px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(85, 125, 169, 0.28), rgba(255, 255, 255, 0.96));
  border: 1px solid rgba(85, 125, 169, 0.18);
  color: var(--accent-strong);
  font-size: 0.62rem;
  font-weight: 900;
}

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

.group-member-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-member-chip--more {
  justify-content: center;
  min-width: 44px;
  padding-inline: 10px;
  background: rgba(118, 132, 153, 0.12);
  color: var(--muted);
}

.group-members-cell {
  min-width: 180px;
}

.photos-admin-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.38fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.photo-event-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.photo-event-button {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(79, 103, 132, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.photo-event-button.active,
.photo-event-button:hover {
  transform: translateY(-1px);
  border-color: rgba(53, 95, 141, 0.32);
  box-shadow: 0 16px 30px rgba(43, 70, 101, 0.1);
}

.photo-event-cover {
  width: 74px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(79, 103, 132, 0.12);
}

.photo-event-cover img,
.photo-admin-card img,
.photo-modal-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-event-cover span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--accent-strong);
  font-weight: 900;
}

.photo-event-copy,
.photos-detail-card,
.photo-admin-card-body {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.photo-event-copy strong,
.photos-detail-head strong {
  overflow-wrap: anywhere;
}

.photo-event-copy small,
.photos-detail-head p,
.photo-card-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.photos-detail-card {
  gap: 18px;
}

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

.photo-upload-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(79, 103, 132, 0.14);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
}

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

.photo-admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.photo-admin-card {
  display: grid;
  gap: 10px;
  overflow: hidden;
  border: 1px solid rgba(79, 103, 132, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
}

.photo-admin-card img {
  aspect-ratio: 4 / 3;
}

.photo-admin-card-body {
  padding: 12px;
}

.photo-admin-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-modal-dialog--photo {
  width: min(760px, calc(100vw - 28px));
}

.photo-form {
  gap: 16px;
}

.photo-modal-preview {
  overflow: hidden;
  min-height: 260px;
  border-radius: 22px;
  background: rgba(79, 103, 132, 0.08);
}

.photo-modal-preview img {
  display: block;
  max-height: 52vh;
  object-fit: contain;
}

.mailing-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  align-items: start;
}

.mailing-compose-card,
.mailing-side-card,
.mailing-progress-card,
.mailing-preview-card {
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: rgba(250, 252, 249, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.mailing-compose-card {
  display: grid;
  gap: 18px;
  padding: 22px;
  min-width: 0;
}

.mailing-side-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  position: sticky;
  top: 112px;
}

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

.mailing-card-head strong {
  font-size: 1.08rem;
}

.mailing-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.mailing-field > span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.mailing-field input[type="text"] {
  width: 100%;
}

.mailing-recipient-box {
  position: relative;
  display: grid;
  gap: 10px;
  min-width: 0;
  border-radius: 22px;
  border: 1px solid rgba(79, 103, 132, 0.12);
  background:
    radial-gradient(circle at top left, rgba(85, 125, 169, 0.1), transparent 34%),
    rgba(255, 255, 255, 0.76);
  padding: 12px;
}

.mailing-selected-recipients {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 42px;
  align-items: center;
}

.mailing-recipient-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 6px 8px 6px 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(85, 125, 169, 0.18), rgba(255, 255, 255, 0.92));
  border: 1px solid rgba(85, 125, 169, 0.22);
  color: var(--text);
}

.mailing-recipient-avatar {
  position: relative;
  width: 34px;
  min-width: 34px;
  height: 34px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(85, 125, 169, 0.28), rgba(255, 255, 255, 0.96));
  border: 1px solid rgba(85, 125, 169, 0.18);
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

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

.mailing-recipient-avatar--empty span {
  letter-spacing: 0.03em;
}

.mailing-recipient-chip-copy {
  display: grid;
  min-width: 0;
}

.mailing-recipient-chip strong,
.mailing-recipient-chip small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mailing-recipient-chip strong {
  font-size: 0.88rem;
}

.mailing-recipient-chip small {
  color: var(--muted);
  font-size: 0.74rem;
}

.mailing-recipient-chip button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: rgba(79, 103, 132, 0.12);
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
}

.mailing-recipient-empty,
.mailing-attachment-empty,
.mailing-recipient-count {
  color: var(--muted);
  font-size: 0.88rem;
}

.mailing-recipient-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.mailing-recipient-search-row .ghost-button {
  min-height: 48px;
}

.mailing-recipient-menu {
  position: absolute;
  z-index: 30;
  left: 12px;
  right: 12px;
  top: calc(100% - 6px);
  display: grid;
  gap: 6px;
  max-height: 330px;
  overflow: auto;
  padding: 10px;
  border-radius: 20px;
  border: 1px solid rgba(79, 103, 132, 0.14);
  background: rgba(250, 252, 249, 0.98);
  box-shadow: 0 24px 54px rgba(34, 49, 70, 0.18);
}

.mailing-recipient-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.mailing-recipient-option:hover,
.mailing-recipient-option:focus-visible {
  background: rgba(85, 125, 169, 0.12);
}

.mailing-recipient-option--role {
  background: rgba(168, 101, 95, 0.13);
}

.mailing-recipient-option--role {
  display: grid;
}

.mailing-recipient-option span {
  display: grid;
  gap: 3px;
}

.mailing-recipient-option small,
.mailing-recipient-no-match {
  color: var(--muted);
}

.mailing-editor-shell {
  overflow: hidden;
}

.mailing-rich-editor,
.mailing-rich-editor .ql-editor {
  min-height: 330px;
}

.mailing-rich-editor .ql-editor {
  font-size: 1rem;
}

.mailing-attachments-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(34, 58, 90, 0.92), rgba(142, 72, 70, 0.9)),
    var(--text);
  color: #fffdf4;
}

.mailing-attachments-panel p {
  margin: 4px 0 0;
  color: rgba(255, 250, 242, 0.78);
}

.mailing-attachments-panel .ghost-button {
  color: #fffdf4;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
}

.mailing-attachment-list {
  display: grid;
  gap: 10px;
}

.mailing-attachment-item {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(79, 103, 132, 0.12);
  background: rgba(255, 255, 255, 0.78);
}

.mailing-attachment-mark {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(85, 125, 169, 0.26), rgba(255, 255, 255, 0.96));
  border: 1px solid rgba(85, 125, 169, 0.18);
}

.mailing-attachment-item span:not(.mailing-attachment-mark) {
  display: grid;
  min-width: 0;
}

.mailing-attachment-item strong,
.mailing-attachment-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mailing-attachment-item small {
  color: var(--muted);
}

.mailing-progress-card,
.mailing-preview-card {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.mailing-progress-card p,
.mailing-preview-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.mailing-progress-bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(79, 103, 132, 0.1);
}

.mailing-progress-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cta), var(--accent-red));
  transition: width 240ms ease;
}

.mailing-progress-meta {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.mailing-actions {
  display: grid;
  gap: 10px;
}

.admin-card-head {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.admin-card-head strong {
  font-size: 1.1rem;
}

.admin-card-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.admin-form {
  display: grid;
  gap: 14px;
}

.admin-table-card,
.calendar-card {
  min-width: 0;
}

.admin-toolbar,
.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.admin-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.team-language-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(79, 103, 132, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
}

.team-filter-button {
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0 16px;
  font-weight: 900;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.team-filter-button.active {
  background: rgba(255, 202, 64, 0.92);
  color: var(--text);
  box-shadow: 0 10px 22px rgba(16, 34, 56, 0.08);
}

.team-filter-button:focus-visible {
  outline: 3px solid rgba(255, 202, 64, 0.5);
  outline-offset: 2px;
}

.church-editor-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.48fr);
  gap: 22px;
  align-items: start;
}

.church-editor-card,
.church-preview-card {
  min-width: 0;
}

.church-preview-card {
  position: sticky;
  top: 112px;
  display: grid;
  gap: 16px;
  padding: 22px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: rgba(250, 252, 249, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.church-toolbar {
  align-items: flex-start;
}

.church-toolbar > div:first-child {
  display: grid;
  gap: 10px;
}

.church-form,
.church-form-fields,
.church-cards-editor {
  display: grid;
  gap: 16px;
}

.church-form-head,
.church-card-editor-head,
.church-card-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.church-field-panel,
.church-card-row {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(79, 103, 132, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.church-card-row--empty {
  color: var(--muted);
}

.church-video-fields,
.church-card-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

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

.church-style-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 92px 96px;
  gap: 10px;
  align-items: end;
}

.church-style-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.church-style-row input,
.church-style-row select,
.church-form input,
.church-form textarea {
  width: 100%;
}

.church-style-row input[type="color"] {
  min-height: 42px;
  padding: 6px;
}

.church-visible-field {
  margin: 0;
}

.church-form-actions {
  justify-content: flex-end;
}

.church-preview {
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(85, 125, 169, 0.14);
  background: linear-gradient(135deg, rgba(252, 251, 243, 0.95) 0%, rgba(235, 243, 249, 0.94) 100%);
}

.church-preview-layout {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.church-preview-copy {
  display: grid;
  gap: 12px;
}

.church-preview-copy p,
.church-preview-copy h3,
.church-preview-copy div {
  margin: 0;
}

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

.church-preview-stat {
  display: grid;
  gap: 5px;
  min-height: 118px;
  padding: 13px;
  border-radius: 16px;
  border: 1px solid rgba(85, 125, 169, 0.14);
  background: rgba(255, 255, 255, 0.78);
}

.church-preview-stat strong,
.church-preview-stat span,
.church-preview-stat small {
  line-height: 1.15;
}

.church-preview-video {
  width: min(100%, 220px);
  aspect-ratio: 55 / 98;
  justify-self: center;
  overflow: hidden;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 42px rgba(16, 28, 44, 0.16);
}

.church-preview-video iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.church-preview-video-empty {
  display: grid;
  place-content: center;
  gap: 8px;
  height: 100%;
  padding: 18px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 900px) {
  .team-language-filter {
    width: 100%;
  }

  .team-filter-button {
    flex: 1 1 0;
  }

  .church-editor-shell,
  .photos-admin-shell,
  .church-video-fields,
  .church-card-fields,
  .church-style-row {
    grid-template-columns: 1fr;
  }

  .church-preview-card {
    position: static;
  }

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

.calendar-toolbar {
  padding: 18px 20px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: rgba(250, 252, 249, 0.9);
}

.calendar-toolbar-copy {
  display: grid;
  gap: 4px;
  text-align: center;
}

.calendar-toolbar-copy strong {
  font-family: "Montserrat", "Segoe UI", sans-serif;
  font-size: 1.4rem;
  text-transform: capitalize;
}

.calendar-toolbar-copy span {
  color: var(--muted);
  font-size: 0.95rem;
}

.calendar-nav-button {
  min-width: 170px;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.calendar-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(79, 103, 132, 0.1);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.calendar-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex: 0 0 12px;
}

.calendar-legend-swatch.booked {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
}

.calendar-legend-swatch.range {
  background: rgba(85, 125, 169, 0.28);
}

.calendar-legend-swatch.today {
  background: rgba(47, 122, 81, 0.82);
}

.calendar-legend-swatch.active {
  background: rgba(53, 95, 141, 0.78);
}

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

.calendar-card {
  min-width: 0;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.calendar-weekdays span {
  display: grid;
  place-items: center;
  min-height: 38px;
  border-radius: 14px;
  background: rgba(248, 240, 236, 0.95);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.calendar-day {
  position: relative;
  min-height: 150px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(79, 103, 132, 0.12);
  background: rgba(255, 255, 255, 0.82);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  align-content: stretch;
  text-align: left;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.calendar-day:hover,
.calendar-day:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 22px 34px rgba(43, 70, 101, 0.1);
  border-color: rgba(85, 125, 169, 0.28);
}

.calendar-day.is-outside-month {
  opacity: 0.56;
}

.calendar-day.is-booked {
  background: linear-gradient(180deg, rgba(247, 236, 232, 0.96) 0%, rgba(250, 252, 249, 0.98) 100%);
}

.calendar-day.is-selected-range {
  background:
    linear-gradient(180deg, rgba(222, 232, 242, 0.78) 0%, rgba(250, 252, 249, 0.98) 100%);
}

.calendar-day.is-range-start,
.calendar-day.is-range-end {
  border-color: rgba(53, 95, 141, 0.42);
}

.calendar-day.is-selected-day {
  box-shadow: inset 0 0 0 2px rgba(53, 95, 141, 0.32);
}

.calendar-day.is-active-booking {
  border-color: rgba(85, 125, 169, 0.35);
  box-shadow: inset 0 0 0 2px rgba(85, 125, 169, 0.18);
}

.calendar-day.is-today::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(47, 122, 81, 0.14);
}

.calendar-day-top {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
}

.calendar-day-number {
  font-family: "Montserrat", "Segoe UI", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
}

.calendar-day-body {
  display: grid;
  min-height: 0;
  align-content: center;
  justify-items: center;
  gap: 10px;
}

.calendar-day-comment {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: center;
  max-width: 100%;
}

.calendar-day-avatar {
  position: relative;
  width: 45px;
  height: 45px;
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid rgba(85, 125, 169, 0.24);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 18px rgba(43, 70, 101, 0.12);
}

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

.calendar-day-avatar--initials {
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.calendar-side {
  display: grid;
  gap: 16px;
  min-width: 0;
  align-content: start;
  position: sticky;
  top: 112px;
}

.booking-form-card,
.selected-day-card {
  width: 100%;
}

.selected-day-card {
  min-height: 220px;
}

.booking-owner {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: 18px;
  background: rgba(248, 240, 236, 0.9);
  border: 1px solid rgba(79, 103, 132, 0.1);
}

.booking-owner-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.booking-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.booking-form-actions .primary-button,
.booking-form-actions .ghost-button,
.booking-form-actions .table-delete {
  flex: 1 1 180px;
}

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

.selected-day-empty {
  border-radius: 20px;
  padding: 18px;
  background: rgba(248, 240, 236, 0.9);
  color: var(--muted);
  line-height: 1.65;
}

.selected-booking-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(79, 103, 132, 0.12);
  background: rgba(250, 252, 249, 0.92);
}

.selected-booking-card.is-active {
  border-color: rgba(85, 125, 169, 0.32);
  box-shadow: inset 0 0 0 2px rgba(85, 125, 169, 0.14);
}

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

.selected-booking-head strong {
  font-size: 1.05rem;
}

.selected-booking-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.selected-booking-line span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.selected-booking-line strong {
  text-align: right;
  line-height: 1.5;
}

.selected-booking-actions {
  display: flex;
  justify-content: flex-end;
}

.selected-booking-open {
  min-height: 46px;
  padding-inline: 18px;
}

.duties-calendar-day .calendar-day-body {
  align-content: center;
}

.duty-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(85, 125, 169, 0.16);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 900;
}

.duty-calendar-avatars,
.duty-assignee-strip {
  display: flex;
  align-items: center;
}

.duty-calendar-avatars {
  justify-content: center;
  min-height: 50px;
  padding-left: 12px;
}

.duty-calendar-avatar {
  margin-left: -12px;
  background: #fff;
}

.duty-calendar-avatar:first-child {
  margin-left: 0;
}

.duty-card {
  background:
    radial-gradient(circle at top left, rgba(85, 125, 169, 0.12), transparent 40%),
    rgba(250, 252, 249, 0.94);
}

.duty-assignee-strip {
  flex-wrap: wrap;
  gap: 8px;
}

.duty-assignee-strip .calendar-day-avatar {
  width: 38px;
  height: 38px;
}

.admin-modal-dialog--duty {
  width: min(860px, 100%);
}

.duty-form {
  gap: 18px;
}

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

.table-delete {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(181, 67, 67, 0.2);
  color: var(--danger);
  background: rgba(181, 67, 67, 0.08);
  font-weight: 800;
}

.table-empty {
  text-align: center;
  color: var(--muted);
}

.session-summary--sidebar {
  width: 100%;
  max-width: 100%;
  padding: 20px 22px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(247, 242, 236, 0.96) 0%, rgba(255, 255, 255, 0.96) 100%);
  box-shadow: var(--shadow);
}

.session-summary-kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.session-summary--sidebar .session-line {
  overflow-wrap: anywhere;
}

.signalr-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(79, 103, 132, 0.12);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
  font-size: 1rem;
  line-height: 1;
  cursor: help;
}

.signalr-status-chip--connected {
  background: rgba(94, 123, 53, 0.14);
  border-color: rgba(94, 123, 53, 0.2);
}

.signalr-status-chip--pending {
  background: rgba(201, 151, 69, 0.16);
  border-color: rgba(201, 151, 69, 0.2);
}

.signalr-status-chip--offline {
  background: rgba(181, 67, 67, 0.12);
  border-color: rgba(181, 67, 67, 0.2);
}

.signalr-status-chip--idle {
  background: rgba(123, 132, 145, 0.12);
  border-color: rgba(123, 132, 145, 0.18);
}

.session-user-name,
.team-cell-name,
.chat-bubble-author,
.booking-owner strong,
.selected-booking-head strong,
.selected-booking-line strong,
.service-day-item-meta span,
.service-owner-summary strong,
.mailing-recipient-chip strong,
.mailing-recipient-option strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.online-presence-badge {
  position: relative;
  display: inline-flex;
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  border-radius: 999px;
  background: #2fcf72;
  box-shadow: 0 0 0 3px rgba(250, 252, 249, 0.98), 0 0 0 6px rgba(47, 207, 114, 0.16);
}

.online-presence-badge::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  border: 1px solid rgba(47, 207, 114, 0.38);
  animation: online-presence-pulse 1.9s ease-out infinite;
}

.online-presence-badge--avatar {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 13px;
  height: 13px;
  flex-basis: 13px;
  z-index: 2;
}

.calendar-day-avatar .online-presence-badge--avatar {
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  flex-basis: 9px;
  box-shadow: 0 0 0 2px rgba(250, 252, 249, 0.98), 0 0 0 4px rgba(47, 207, 114, 0.14);
}

.calendar-day-avatar .online-presence-badge--avatar::after {
  inset: -4px;
}

.online-presence-badge--cell {
  margin-left: 2px;
}

@keyframes online-presence-pulse {
  0% {
    opacity: 0.5;
    transform: scale(0.55);
  }

  100% {
    opacity: 0;
    transform: scale(1.25);
  }
}

.avatar-editor-shell {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.avatar-cell-shell {
  position: relative;
  width: 92px;
}

.admin-user-name-cell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.admin-user-name-cell.has-presence {
  grid-template-columns: auto minmax(0, 1fr);
}

.admin-user-name-stack {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.admin-user-last-login {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.avatar-preview-button {
  display: block;
  width: 92px;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 20px;
  cursor: pointer;
}

.avatar-preview-button:hover .avatar-preview-card,
.avatar-preview-button:focus-visible .avatar-preview-card {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(43, 70, 101, 0.18);
  border-color: rgba(85, 125, 169, 0.28);
}

.avatar-preview-card {
  position: relative;
  width: 92px;
  height: 124px;
  border-radius: 20px;
  border: 1px solid rgba(79, 103, 132, 0.14);
  background: linear-gradient(180deg, rgba(247, 237, 232, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%);
  overflow: hidden;
  display: grid;
  place-items: center;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

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

.avatar-preview-card--empty::before {
  content: "250 × 340";
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.avatar-editor-actions {
  display: grid;
  gap: 10px;
}

.avatar-editor-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ghost-button--muted {
  background: rgba(255, 255, 255, 0.58);
}

.avatar-file-name {
  display: block;
  color: var(--text);
  font-size: 0.94rem;
  line-height: 1.5;
  word-break: break-word;
}

.avatar-file-name--muted {
  color: var(--muted);
  font-weight: 600;
}

.avatar-table-actions {
  position: absolute;
  right: -6px;
  bottom: -6px;
}

.avatar-clear-button {
  position: relative;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #a3534e;
  color: transparent;
  box-shadow: 0 10px 18px rgba(34, 49, 70, 0.2);
  cursor: pointer;
}

.avatar-clear-button::before {
  content: "\00D7";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
}

.avatar-clear-button:hover,
.avatar-clear-button:focus-visible {
  background: #8e3f45;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
}

#crop-avatar-modal {
  z-index: 80;
}

.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(34, 49, 70, 0.48);
  backdrop-filter: blur(10px);
}

.admin-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  max-height: min(90vh, 920px);
  overflow: auto;
  padding: 24px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(250, 252, 249, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
  box-shadow: 0 28px 70px rgba(34, 49, 70, 0.28);
}

.admin-modal-dialog--wide {
  width: min(980px, 100%);
}

.admin-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-card-head--compact {
  margin-bottom: 0;
}

.modal-close-button {
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
}

.admin-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

.admin-modal-actions--stacked {
  display: grid;
  justify-content: stretch;
}

.crop-modal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 22px;
  align-items: start;
}

.crop-stage-panel,
.crop-controls-card {
  border-radius: 24px;
  border: 1px solid rgba(79, 103, 132, 0.12);
  background: rgba(255, 255, 255, 0.82);
  padding: 20px;
}

.crop-stage-shell {
  display: grid;
  place-items: center;
  min-height: 460px;
}

.crop-canvas {
  width: min(100%, 300px);
  aspect-ratio: 25 / 34;
  border-radius: 24px;
  border: 1px solid rgba(79, 103, 132, 0.14);
  background: linear-gradient(135deg, #e5eef6 0%, #f8eee7 100%);
  touch-action: none;
  cursor: grab;
}

.crop-canvas.is-dragging {
  cursor: grabbing;
}

.crop-status {
  min-height: 1.5em;
  margin: 14px 0 0;
  color: var(--muted);
}

.crop-status.error {
  color: var(--danger);
}

.crop-dimension-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(79, 103, 132, 0.12);
  background: rgba(247, 242, 236, 0.96);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.services-calendar-day .calendar-day-body {
  grid-template-rows: minmax(0, 1fr);
  align-content: start;
  justify-items: stretch;
  overflow: hidden;
}

.services-calendar-day .calendar-day-top {
  align-items: baseline;
  gap: 6px;
}

.services-count-badge {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
}

.services-time-list {
  display: grid;
  width: 100%;
  height: 100%;
  gap: 6px;
  align-content: start;
  min-height: 0;
  align-self: stretch;
  overflow-y: auto;
  padding-right: 2px;
}

.services-time-badge {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-height: 26px;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(85, 125, 169, 0.16);
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.services-day-card {
  min-height: 320px;
}

.services-day-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.services-day-list {
  display: grid;
  gap: 14px;
}

.service-day-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(79, 103, 132, 0.1);
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.service-day-item.is-active {
  box-shadow: inset 0 0 0 2px rgba(85, 125, 169, 0.24);
}

.service-day-item:hover,
.service-day-item:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(85, 125, 169, 0.28);
  box-shadow: 0 18px 30px rgba(43, 70, 101, 0.1);
  outline: none;
}

.service-day-item-media {
  width: 92px;
  height: 92px;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(85, 125, 169, 0.18) 0%, rgba(255, 255, 255, 0.94) 100%);
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  font-family: "Montserrat", "Segoe UI", sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
}

.service-day-item-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-day-item-copy {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.service-day-item-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.role-pill--visible {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.role-pill--hidden {
  background: rgba(168, 83, 78, 0.12);
  color: #a3534e;
}

.service-day-item-title {
  color: var(--text);
  line-height: 1.6;
}

.service-day-item-title > *:first-child {
  margin-top: 0;
}

.service-day-item-title > *:last-child {
  margin-bottom: 0;
}

.service-day-item-meta {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.service-lock-note {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.admin-modal-dialog--service {
  width: min(1180px, 100%);
}

.service-form {
  gap: 18px;
}

.service-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.service-modal-main {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 320px;
  gap: 20px;
  align-items: start;
}

.service-editors {
  display: grid;
  gap: 16px;
}

.rich-editor-shell {
  border-radius: 24px;
  border: 1px solid rgba(79, 103, 132, 0.12);
  overflow: hidden;
  background: #fffdf8;
}

.rich-editor-toolbar {
  border: 0;
  border-bottom: 1px solid rgba(79, 103, 132, 0.12);
  background: rgba(248, 242, 236, 0.96);
}

.rich-editor-toolbar .ql-picker {
  color: var(--muted);
}

.rich-editor {
  min-height: 220px;
}

.rich-editor--title {
  min-height: 70px;
}

.rich-editor .ql-editor {
  min-height: inherit;
  color: var(--text);
  line-height: 1.7;
  font-size: 1rem;
}

.rich-editor--title .ql-editor {
  font-size: 1.05rem;
  font-weight: 600;
}

.service-side-panel {
  display: grid;
  gap: 16px;
  align-content: start;
}

.service-picture-shell {
  display: grid;
  gap: 12px;
}

.service-picture-preview {
  width: 100%;
  aspect-ratio: 300 / 256;
  border-radius: 26px;
  border: 1px solid rgba(79, 103, 132, 0.12);
  background: linear-gradient(135deg, rgba(85, 125, 169, 0.12) 0%, rgba(255, 255, 255, 0.94) 100%);
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  font-family: "Montserrat", "Segoe UI", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.service-picture-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-picture-preview--empty::before {
  content: "300 × 256";
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.service-picture-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.service-picture-hint {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.service-owner-summary {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(79, 103, 132, 0.1);
  background: rgba(248, 240, 236, 0.9);
}

.team-table {
  min-width: 1240px;
}

.news-table {
  min-width: 1180px;
}

.news-thumb {
  display: grid;
  place-items: center;
  width: 98px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(85, 125, 169, 0.16) 0%, rgba(252, 219, 124, 0.2) 100%);
  color: var(--accent-strong);
  font-weight: 900;
}

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

.news-cell-title {
  display: grid;
  gap: 6px;
  min-width: 240px;
}

.news-cell-title strong {
  color: var(--text);
  font-size: 0.96rem;
  font-weight: 900;
}

.news-cell-title span,
.news-cell-muted {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.news-author-cell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.news-author-avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  overflow: hidden;
  border-radius: 50%;
  background: rgba(85, 125, 169, 0.14);
  color: var(--accent-strong);
  font-weight: 900;
}

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

.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
}

.admin-pagination span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.admin-modal-dialog--news {
  width: min(1180px, 100%);
}

.news-switch-field {
  align-self: end;
  min-height: 52px;
}

.news-picture-preview {
  aspect-ratio: 16 / 9;
}

.news-picture-preview.service-picture-preview--empty::before {
  content: "640 × 360";
}

.team-order-controls {
  display: inline-grid;
  grid-template-columns: 34px minmax(28px, auto) 34px;
  align-items: center;
  gap: 6px;
}

.team-order-index {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
  text-align: center;
}

.team-order-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(79, 103, 132, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 900;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.team-order-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(255, 202, 64, 0.7);
  box-shadow: 0 10px 20px rgba(16, 34, 56, 0.08);
}

.team-order-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.team-photo-thumb {
  position: relative;
  width: 72px;
  aspect-ratio: 300 / 320;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(79, 103, 132, 0.12);
  background: linear-gradient(135deg, rgba(85, 125, 169, 0.14) 0%, rgba(255, 255, 255, 0.96) 100%);
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  font-weight: 900;
  letter-spacing: 0.08em;
}

.team-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-cell-name {
  display: block;
}

.team-cell-title {
  color: var(--muted);
  line-height: 1.55;
}

.team-inline-link {
  color: var(--accent-strong);
  text-decoration: underline;
  word-break: break-word;
}

.team-inline-muted {
  color: var(--muted);
}

.admin-modal-dialog--pastor {
  width: min(980px, 100%);
}

.pastor-form {
  gap: 18px;
}

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

.pastor-form-fields,
.pastor-side-panel {
  display: grid;
  gap: 16px;
  align-content: start;
}

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

.pastor-photo-shell {
  display: grid;
  gap: 12px;
}

.pastor-photo-preview {
  width: 100%;
  aspect-ratio: 300 / 320;
  border-radius: 26px;
  border: 1px solid rgba(79, 103, 132, 0.12);
  background: linear-gradient(135deg, rgba(85, 125, 169, 0.14) 0%, rgba(255, 255, 255, 0.94) 100%);
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  font-family: "Montserrat", "Segoe UI", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.pastor-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pastor-photo-preview--empty::before {
  content: "300 Ã— 320";
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

@media (max-width: 1220px) {
  .calendar-layout-grid {
    grid-template-columns: 1fr;
  }

  .calendar-side {
    position: static;
  }

  .service-modal-main {
    grid-template-columns: 1fr;
  }

  .pastor-form-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1120px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

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

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

  .admin-sidebar {
    position: static;
  }
}

@media (max-width: 900px) {
  .admin-page-shell {
    width: min(1360px, calc(100% - 20px));
  }

  .admin-header {
    display: grid;
    gap: 14px;
  }

  .access-add-row,
  .access-rule-row {
    grid-template-columns: 1fr;
  }

  .admin-header .header-actions {
    display: grid;
    gap: 12px;
  }

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

  .admin-toolbar-actions {
    width: 100%;
  }

  .admin-toolbar-actions > * {
    flex: 1 1 0;
  }

  .conference-form-grid {
    grid-template-columns: 1fr;
  }

  .conference-toolbar-actions {
    justify-content: flex-start;
  }

  .conference-search-input,
  .conference-toolbar-actions select,
  .conference-toolbar-actions button {
    width: 100%;
  }

  .calendar-toolbar {
    grid-template-columns: 1fr;
    justify-items: stretch;
    text-align: center;
    display: grid;
  }

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

  .pastor-form-grid {
    grid-template-columns: 1fr;
  }

  .photo-upload-grid,
  .photo-admin-grid {
    grid-template-columns: 1fr;
  }

  .shop-admin-form-grid,
  .shop-admin-form-grid--wide,
  .shop-picture-editor,
  .shop-admin-product {
    grid-template-columns: 1fr;
  }

  .shop-admin-product-image {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .calendar-grid {
    gap: 8px;
  }

  .calendar-day {
    min-height: 124px;
    padding: 12px;
  }

  .calendar-nav-button {
    min-width: 0;
  }

  .crop-modal-layout,
  .service-modal-main,
  .services-day-head,
  .service-day-item {
    grid-template-columns: 1fr;
  }

  .service-day-item-media {
    width: 100%;
    height: 180px;
  }
}

@media (max-width: 640px) {
  .conference-admin-summary {
    grid-template-columns: 1fr;
  }

  .admin-page-shell {
    width: min(1360px, calc(100% - 16px));
  }

  .admin-create-card,
  .admin-table-card,
  .calendar-card,
  .booking-form-card,
  .selected-day-card {
    padding: 18px;
  }

  .calendar-weekdays,
  .calendar-grid {
    gap: 6px;
  }

  .calendar-weekdays span {
    min-height: 34px;
    font-size: 0.74rem;
  }

  .calendar-day {
    min-height: 110px;
  }

  .calendar-day-comment {
    display: none;
  }

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

  .selected-booking-line strong {
    text-align: left;
  }

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

  .avatar-preview-card {
    width: 100%;
    max-width: 120px;
    height: 162px;
  }

  .avatar-cell-shell,
  .avatar-preview-button {
    width: 100%;
    max-width: 120px;
  }

  .admin-modal {
    padding: 14px;
  }

  .admin-modal-dialog {
    padding: 18px;
  }

  .service-form-grid {
    grid-template-columns: 1fr;
  }

  .service-picture-buttons,
  .admin-modal-actions {
    flex-direction: column;
  }
}
  overflow: hidden;
  display: grid;
  place-items: center;
}

.service-picture-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-picture-preview--empty::before {
  content: "300 × 256";
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 0.08em;
}

@media (max-width: 1220px) {
  .calendar-layout-grid {
    grid-template-columns: 1fr;
  }

  .calendar-side {
    position: static;
  }
}

@media (max-width: 1120px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
  }
}

@media (max-width: 900px) {
  .admin-page-shell {
    width: min(1360px, calc(100% - 20px));
  }

  .admin-header {
    display: grid;
    gap: 14px;
  }

  .admin-header .header-actions {
    display: grid;
    gap: 12px;
  }

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

  .admin-toolbar-actions {
    width: 100%;
  }

  .admin-toolbar-actions > * {
    flex: 1 1 0;
  }

  .calendar-toolbar {
    grid-template-columns: 1fr;
    justify-items: stretch;
    text-align: center;
  }

  .calendar-toolbar {
    display: grid;
  }

  .service-modal-main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .calendar-grid {
    gap: 8px;
  }

  .calendar-day {
    min-height: 124px;
    padding: 12px;
  }

  .calendar-nav-button {
    min-width: 0;
  }

  .crop-modal-layout {
    grid-template-columns: 1fr;
  }

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

  .services-day-head,
  .service-day-item {
    grid-template-columns: 1fr;
  }

  .service-day-item-media {
    width: 100%;
    height: 180px;
  }
}

@media (max-width: 640px) {
  .admin-page-shell {
    width: min(1360px, calc(100% - 16px));
  }

  .admin-create-card,
  .admin-table-card,
  .calendar-card,
  .booking-form-card,
  .selected-day-card {
    padding: 18px;
  }

  .calendar-weekdays,
  .calendar-grid {
    gap: 6px;
  }

  .calendar-weekdays span {
    min-height: 34px;
    font-size: 0.74rem;
  }

  .calendar-day {
    min-height: 110px;
  }

  .calendar-day-comment {
    display: none;
  }

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

  .selected-booking-line strong {
    text-align: left;
  }

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

  .avatar-preview-card {
    width: 100%;
    max-width: 120px;
    height: 162px;
  }

  .avatar-cell-shell,
  .avatar-preview-button {
    width: 100%;
    max-width: 120px;
  }

  .admin-modal {
    padding: 14px;
  }

  .admin-modal-dialog {
    padding: 18px;
  }

  .service-form-grid {
    grid-template-columns: 1fr;
  }
}

.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;
}

.chat-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.chat-groups-card,
.chat-room-card {
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  padding: 22px;
}

.chat-groups-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  align-content: start;
  min-height: 0;
}

.chat-groups-toolbar {
  align-items: flex-start;
}

.chat-groups-list {
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  overscroll-behavior: contain;
}

.chat-group-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px;
  width: 100%;
  padding: 14px;
  border: 1px solid rgba(79, 103, 132, 0.1);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  text-align: left;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.chat-group-card:hover,
.chat-group-card:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(85, 125, 169, 0.32);
  box-shadow: 0 18px 30px rgba(43, 70, 101, 0.1);
  outline: none;
}

.chat-group-card.is-active {
  border-color: rgba(53, 95, 141, 0.36);
  background: linear-gradient(180deg, rgba(234, 242, 248, 0.95) 0%, rgba(255, 255, 255, 0.94) 100%);
  box-shadow: inset 0 0 0 2px rgba(85, 125, 169, 0.18);
}

.chat-group-card-avatar,
.chat-active-avatar,
.chat-group-avatar-preview {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(79, 103, 132, 0.12);
  background: linear-gradient(135deg, rgba(85, 125, 169, 0.18) 0%, rgba(255, 255, 255, 0.96) 100%);
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  flex: 0 0 64px;
}

.chat-group-card-avatar img,
.chat-active-avatar img,
.chat-group-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-group-avatar-preview--empty::before,
.chat-group-card-avatar--empty::before,
.chat-active-avatar--empty::before {
  content: "64";
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.chat-group-card-body {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.chat-group-card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.chat-group-card-top strong {
  min-width: 0;
  font-size: 1rem;
  line-height: 1.28;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1em * 1.28 * 2);
  max-height: calc(1em * 1.28 * 2);
}

.chat-group-card-time {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  flex: 0 0 auto;
  padding-top: 2px;
}

.chat-group-card-preview {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1em * 1.45 * 2);
  max-height: calc(1em * 1.45 * 2);
}

.chat-access-pill {
  justify-self: start;
  width: fit-content;
  max-width: 100%;
  padding: 5px 9px;
  border-radius: 999px;
  color: #355f8d;
  background: rgba(85, 125, 169, 0.12);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.2;
}

.chat-access-pill--disabled {
  color: #a23b3b;
  background: rgba(208, 93, 93, 0.12);
}

.chat-access-pill--readonly {
  color: #6f5c18;
  background: rgba(206, 164, 58, 0.16);
}

.chat-empty-card {
  border-radius: 22px;
  border: 1px dashed rgba(79, 103, 132, 0.16);
  background: rgba(248, 240, 236, 0.82);
  padding: 20px;
  color: var(--muted);
  line-height: 1.65;
}

.chat-empty-card--error {
  border-color: rgba(181, 67, 67, 0.22);
  color: var(--danger);
}

.chat-room-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 16px;
  min-width: 0;
  min-height: 0;
}

.chat-room-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(79, 103, 132, 0.1);
}

.chat-room-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chat-room-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.chat-room-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.chat-room-copy strong {
  min-width: 0;
  font-size: 1.08rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-room-copy span {
  color: var(--muted);
  font-size: 0.9rem;
}

.chat-messages {
  position: relative;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 8px 12px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(85, 125, 169, 0.08), transparent 38%),
    linear-gradient(180deg, rgba(247, 242, 236, 0.96) 0%, rgba(255, 255, 255, 0.96) 100%);
  border: 1px solid rgba(79, 103, 132, 0.08);
  overscroll-behavior: contain;
}

.chat-message-stream {
  display: grid;
  gap: 12px;
  align-content: start;
}

.chat-day-divider {
  display: flex;
  justify-content: center;
  margin: 4px 0;
}

.chat-day-divider span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(79, 103, 132, 0.1);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chat-bubble-row {
  display: flex;
  justify-content: flex-start;
  align-items: flex-end;
  gap: 12px;
}

.chat-bubble-row.is-mine {
  justify-content: flex-end;
}

.chat-bubble-avatar {
  position: relative;
  width: 48px;
  min-width: 48px;
  height: 48px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(79, 103, 132, 0.12);
  background: linear-gradient(135deg, rgba(85, 125, 169, 0.18) 0%, rgba(255, 255, 255, 0.96) 100%);
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  flex: 0 0 48px;
}

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

.chat-bubble-avatar--empty span {
  letter-spacing: 0.04em;
}

.chat-bubble {
  position: relative;
  max-width: min(76%, 720px);
  display: grid;
  gap: 8px;
  padding: 14px 16px 12px;
  border-radius: 22px 22px 22px 8px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(79, 103, 132, 0.08);
  box-shadow: 0 14px 28px rgba(43, 70, 101, 0.08);
}

.chat-bubble.has-menu {
  padding-right: 48px;
}

.chat-bubble.is-deleted {
  background: rgba(255, 255, 255, 0.72);
  border-style: dashed;
  box-shadow: none;
}

.chat-bubble-row.is-mine .chat-bubble {
  border-radius: 22px 22px 8px 22px;
  background: linear-gradient(180deg, rgba(85, 125, 169, 0.16) 0%, rgba(234, 242, 248, 0.96) 100%);
  border-color: rgba(85, 125, 169, 0.18);
}

.chat-bubble-author {
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.chat-bubble-text {
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-bubble-text--deleted {
  color: var(--muted);
  font-style: italic;
}

.chat-bubble-content {
  display: grid;
  gap: 10px;
}

.chat-message-menu-button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(79, 103, 132, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--accent-strong);
  box-shadow: 0 10px 20px rgba(43, 70, 101, 0.1);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.chat-message-menu-button:hover,
.chat-message-menu-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(85, 125, 169, 0.32);
  box-shadow: 0 14px 24px rgba(43, 70, 101, 0.14);
}

.chat-delete-icon {
  position: relative;
  display: block;
  width: 14px;
  height: 15px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 4px 4px;
}

.chat-delete-icon::before,
.chat-delete-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: currentColor;
}

.chat-delete-icon::before {
  top: -6px;
  width: 18px;
  height: 2px;
  border-radius: 999px;
}

.chat-delete-icon::after {
  top: -9px;
  width: 8px;
  height: 2px;
  border-radius: 999px 999px 0 0;
}

.chat-picture-card {
  position: relative;
  width: min(360px, 100%);
  padding: 0;
  border: 0;
  border-radius: 20px;
  overflow: hidden;
  background: #243a57;
  box-shadow: 0 18px 34px rgba(34, 49, 70, 0.18);
  cursor: zoom-in;
}

.chat-picture-card img {
  display: block;
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  transition: transform 180ms ease, filter 180ms ease;
}

.chat-picture-card span {
  position: absolute;
  left: 12px;
  bottom: 12px;
  min-height: 30px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  color: #fff;
  background: rgba(34, 49, 70, 0.52);
  backdrop-filter: blur(8px);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.chat-picture-card:hover img,
.chat-picture-card:focus-visible img {
  transform: scale(1.035);
  filter: saturate(1.08);
}

.chat-attachment-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: min(380px, 100%);
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(79, 103, 132, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.chat-attachment-card:hover,
.chat-attachment-card:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(85, 125, 169, 0.26);
  box-shadow: 0 16px 28px rgba(43, 70, 101, 0.12);
}

.chat-attachment-icon {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(85, 125, 169, 0.24), rgba(255, 255, 255, 0.98));
  border: 1px solid rgba(85, 125, 169, 0.18);
}

.chat-attachment-icon::before,
.chat-attachment-icon::after {
  content: "";
  position: absolute;
  border-radius: 3px;
  background: var(--accent-strong);
}

.chat-attachment-icon::before {
  left: 15px;
  top: 11px;
  width: 18px;
  height: 24px;
  opacity: 0.9;
}

.chat-attachment-icon::after {
  right: 12px;
  top: 11px;
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.88);
}

.chat-attachment-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.chat-attachment-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.94rem;
}

.chat-attachment-copy small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chat-bubble-meta {
  display: flex;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.chat-bubble-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
}

.chat-reaction-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chat-like-button,
.chat-like-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(79, 103, 132, 0.1);
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.chat-like-button {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  font-size: 1rem;
  box-shadow: 0 10px 18px rgba(43, 70, 101, 0.08);
}

.chat-like-button.is-active {
  background: rgba(255, 235, 239, 0.94);
  border-color: rgba(222, 82, 104, 0.28);
  box-shadow: 0 12px 22px rgba(222, 82, 104, 0.16);
}

.chat-like-button:hover,
.chat-like-button:focus-visible,
.chat-like-count:hover:not(:disabled),
.chat-like-count:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(85, 125, 169, 0.28);
}

.chat-like-count {
  min-width: 30px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
}

.chat-like-count:disabled {
  opacity: 0.58;
  cursor: default;
}

.chat-read-receipts {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 4px 2px 10px;
  border: 1px solid rgba(79, 103, 132, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  cursor: pointer;
}

.chat-person-avatar,
.chat-read-avatar,
.chat-people-avatar {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.92);
  background: linear-gradient(135deg, rgba(85, 125, 169, 0.2), rgba(255, 255, 255, 0.96));
  color: var(--accent-strong);
  display: grid;
  place-items: center;
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1;
}

.chat-person-avatar img,
.chat-read-avatar img,
.chat-people-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-read-avatar + .chat-read-avatar {
  margin-left: -9px;
}

.chat-read-avatar--count {
  background: rgba(85, 125, 169, 0.95);
  color: #fff;
}

.chat-read-avatar--empty span,
.chat-people-avatar--empty span,
.chat-person-avatar--empty span {
  letter-spacing: 0.02em;
}

.chat-compose-form {
  position: relative;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.chat-attach-button,
.chat-emoji-button {
  width: 58px;
  min-width: 58px;
  height: 58px;
  border-radius: 18px;
  border: 1px solid rgba(79, 103, 132, 0.14);
  background: rgba(255, 255, 255, 0.86);
  color: var(--accent-strong);
  box-shadow: 0 12px 24px rgba(43, 70, 101, 0.1);
  font-size: 1.45rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.chat-attach-button:hover,
.chat-attach-button:focus-visible,
.chat-emoji-button:hover,
.chat-emoji-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(85, 125, 169, 0.3);
  box-shadow: 0 18px 32px rgba(43, 70, 101, 0.16);
}

.chat-attach-button:disabled,
.chat-emoji-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.chat-emoji-panel {
  position: absolute;
  z-index: 8;
  left: 70px;
  bottom: calc(100% + 10px);
  width: min(328px, calc(100vw - 48px));
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  padding: 10px;
  border-radius: 22px;
  border: 1px solid rgba(79, 103, 132, 0.12);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 56px rgba(34, 49, 70, 0.18);
}

.chat-emoji-panel[hidden] {
  display: none;
}

.chat-emoji-option {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: rgba(245, 248, 252, 0.9);
  cursor: pointer;
  font-size: 1.08rem;
  transition: transform 140ms ease, background 140ms ease;
}

.chat-emoji-option:hover,
.chat-emoji-option:focus-visible {
  transform: translateY(-1px);
  background: rgba(224, 238, 249, 0.96);
}

.chat-compose-field {
  display: block;
}

.chat-compose-field textarea {
  width: 100%;
  min-height: 58px;
  max-height: 170px;
  resize: none;
}

.chat-compose-form .primary-button {
  min-width: 146px;
}

.chat-image-modal {
  z-index: 90;
}

.chat-image-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1120px, calc(100vw - 32px));
  height: min(86vh, 860px);
  overflow: hidden;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background:
    radial-gradient(circle at 18% 0%, rgba(85, 125, 169, 0.24), transparent 34%),
    linear-gradient(145deg, rgba(24, 42, 66, 0.96) 0%, rgba(31, 28, 44, 0.96) 100%);
  box-shadow: 0 34px 90px rgba(16, 28, 44, 0.46);
}

.chat-image-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.chat-image-toolbar strong {
  min-width: 0;
  color: #fffdf4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-image-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chat-image-actions .ghost-button {
  min-height: 42px;
  padding: 0 14px;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: #fffdf4;
  text-decoration: none;
  box-shadow: none;
}

.chat-image-actions .ghost-button:hover,
.chat-image-actions .ghost-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.16);
}

.chat-image-actions .ghost-button:disabled {
  opacity: 0.44;
  transform: none;
  cursor: not-allowed;
}

.chat-image-actions .modal-close-button {
  width: 42px;
  height: 42px;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.12);
  color: #fffdf4;
}

.chat-image-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: auto;
  padding: clamp(18px, 3vw, 36px);
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.035) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.035) 75%);
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-size: 24px 24px;
  cursor: zoom-in;
}

.chat-image-preview {
  display: block;
  max-width: min(100%, 980px);
  max-height: 100%;
  border-radius: 18px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.44);
  transform-origin: center center;
  transition: transform 160ms ease;
}

.chat-people-modal {
  z-index: 92;
}

.admin-modal-dialog--compact {
  width: min(520px, 100%);
}

.chat-people-list {
  display: grid;
  gap: 10px;
  max-height: min(56vh, 440px);
  overflow-y: auto;
  padding-right: 4px;
}

.chat-people-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid rgba(79, 103, 132, 0.08);
  background: rgba(255, 255, 255, 0.74);
}

.chat-people-avatar {
  width: 44px;
  height: 44px;
  min-width: 44px;
  font-size: 0.82rem;
  border-width: 1px;
}

.chat-people-row div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chat-people-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.chat-people-row span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.chat-people-empty {
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed rgba(79, 103, 132, 0.16);
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.admin-modal-dialog--chat-group {
  width: min(820px, 100%);
}

.chat-group-form {
  gap: 18px;
}

.chat-group-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 20px;
  align-items: start;
}

.chat-group-form-fields,
.chat-group-side-panel,
.chat-group-avatar-shell {
  display: grid;
  gap: 16px;
}

.chat-group-side-panel {
  align-content: start;
}

.chat-group-access-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(85, 125, 169, 0.14);
  border-radius: 18px;
  background: rgba(234, 242, 248, 0.58);
}

.chat-group-access-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 0.4fr) auto;
  gap: 12px;
  align-items: end;
}

.chat-group-access-rules-list {
  display: grid;
  gap: 10px;
  max-height: 300px;
  overflow: auto;
  padding-right: 4px;
}

.chat-group-access-rule-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 0.36fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(85, 125, 169, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
}

@media (max-width: 1220px) {
  .admin-root {
    --admin-chat-shell-height: clamp(620px, calc(100dvh - 220px), 1200px);
  }

  .chat-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(220px, 0.72fr) minmax(0, 1fr);
  }

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

  .mailing-side-card {
    position: static;
  }

  .chat-group-form-layout {
    grid-template-columns: 1fr;
  }

  .chat-group-access-add-row,
  .chat-group-access-rule-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .mailing-attachments-panel,
  .mailing-attachment-item {
    grid-template-columns: 1fr;
  }

  .chat-compose-form {
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  .chat-compose-form .primary-button {
    grid-column: 1 / -1;
  }

  .chat-emoji-panel {
    left: 0;
    grid-template-columns: repeat(6, 1fr);
  }

  .chat-image-toolbar {
    grid-template-columns: 1fr;
  }

  .chat-image-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .chat-group-card {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .chat-group-card-avatar,
  .chat-active-avatar,
  .chat-group-avatar-preview {
    width: 56px;
    height: 56px;
    flex-basis: 56px;
  }

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

  .chat-picture-card,
  .chat-attachment-card {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .admin-root {
    --admin-chat-shell-height: clamp(580px, calc(100dvh - 180px), 1200px);
  }

  .chat-groups-card,
  .chat-room-card {
    padding: 18px;
  }

  .chat-room-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .chat-room-actions {
    width: 100%;
    justify-content: stretch;
  }

  .chat-messages {
    min-height: 0;
  }

  .mailing-compose-card,
  .mailing-side-card {
    padding: 18px;
  }

  .mailing-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .mailing-recipient-search-row {
    grid-template-columns: 1fr;
  }

  .chat-bubble-row {
    align-items: flex-start;
  }

  .chat-image-dialog {
    width: calc(100vw - 20px);
    height: calc(100dvh - 20px);
    border-radius: 24px;
  }

  .chat-image-actions .ghost-button {
    min-height: 38px;
    padding: 0 10px;
    font-size: 0.82rem;
  }
}
