:root {
  color-scheme: light;
  --bg: #f4f6f5;
  --panel: #ffffff;
  --ink: #16212b;
  --muted: #697681;
  --line: #dfe5e2;
  --teal: #0f766e;
  --red: #c93124;
  --amber: #b56a13;
  --shadow: 0 20px 60px rgba(22, 33, 43, 0.1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1215;
  --panel: #151c20;
  --ink: #e8eeee;
  --muted: #9aa8ad;
  --line: #2a363b;
  --teal: #2dd4bf;
  --red: #f87171;
  --amber: #fbbf24;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
}

.admin-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.admin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
  margin-bottom: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--ink);
  color: #ffffff;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 18px;
}

.brand small,
.eyebrow {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.actions {
  display: flex;
  gap: 8px;
}

.login-panel,
.appointments-view,
.users-view,
.chat-view,
.site-view {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel {
  width: min(460px, 100%);
  margin: 64px auto 0;
  padding: 28px;
}

h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.08;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

input,
select {
  min-height: 46px;
  padding: 0 13px;
}

textarea {
  min-height: 88px;
  padding: 12px 13px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(15, 118, 110, 0.16);
}

.primary-btn,
.ghost-btn {
  min-height: 42px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 850;
}

.primary-btn {
  background: var(--teal);
  color: #ffffff;
}

.primary-btn:hover {
  background: #0d625c;
}

.ghost-btn {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  padding: 0 14px;
}

.ghost-btn:hover {
  border-color: #bac7c2;
}

:root[data-theme="dark"] .brand-mark {
  background: #e8eeee;
  color: #0d1215;
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] .ghost-btn,
:root[data-theme="dark"] .tab-btn,
:root[data-theme="dark"] .scope-btn,
:root[data-theme="dark"] .appointment,
:root[data-theme="dark"] .chat-conversation,
:root[data-theme="dark"] .admin-chat-dialog,
:root[data-theme="dark"] .editor-card {
  background: #10171b;
  color: var(--ink);
  border-color: var(--line);
}

:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder {
  color: #708087;
}

:root[data-theme="dark"] .ghost-btn:hover,
:root[data-theme="dark"] .tab-btn:hover,
:root[data-theme="dark"] .scope-btn:hover {
  border-color: #3d4d54;
}

:root[data-theme="dark"] .tab-btn.active,
:root[data-theme="dark"] .scope-btn.active {
  background: #dce8e5;
  border-color: #dce8e5;
  color: #0d1215;
}

.notice {
  min-height: 22px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.notice.error {
  color: var(--red);
}

.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.tab-btn {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  font-weight: 850;
}

.tab-counter {
  align-items: center;
  background: rgba(201, 49, 36, 0.14);
  border-radius: 999px;
  color: var(--red);
  display: inline-flex;
  font-size: 12px;
  height: 22px;
  justify-content: center;
  min-width: 22px;
  padding: 0 7px;
}

.tab-counter[hidden] {
  display: none;
}

.tab-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
}

.appointments-view,
.users-view,
.chat-view,
.site-view {
  padding: 24px;
}

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

.counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 34px;
  border-radius: 999px;
  background: rgba(181, 106, 19, 0.12);
  color: var(--amber);
  font-weight: 900;
}

.counter.has-new {
  animation: pulseCounter 1s ease-in-out infinite;
  background: rgba(201, 49, 36, 0.12);
  color: var(--red);
}

.appointment-scope {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 16px;
}

.scope-btn {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  font-weight: 850;
}

.scope-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
}

.new-appointment-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 8px;
  background: #eaf7f4;
  color: #123f3c;
}

.new-appointment-alert[hidden] {
  display: none;
}

.new-appointment-alert strong,
.new-appointment-alert span {
  display: block;
}

.new-appointment-alert strong {
  margin-bottom: 3px;
  font-size: 15px;
}

.new-appointment-alert span {
  color: #315c59;
  font-size: 14px;
}

.alert-close-btn {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(15, 118, 110, 0.3);
  border-radius: 8px;
  background: #ffffff;
  color: var(--teal);
  cursor: pointer;
  font-weight: 850;
}

:root[data-theme="dark"] .new-appointment-alert {
  border-color: rgba(45, 212, 191, 0.26);
  background: rgba(45, 212, 191, 0.1);
  color: #d9fffa;
}

:root[data-theme="dark"] .new-appointment-alert span {
  color: #a8dcd5;
}

:root[data-theme="dark"] .alert-close-btn {
  border-color: rgba(45, 212, 191, 0.32);
  background: #111a1d;
  color: var(--teal);
}

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

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

.admin-chat-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.6fr);
}

.admin-chat-conversations {
  display: grid;
  align-content: start;
  gap: 10px;
}

.chat-conversation {
  display: grid;
  gap: 7px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  position: relative;
  text-align: left;
}

.chat-conversation.active {
  border-color: rgba(15, 118, 110, 0.55);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.chat-conversation.unread {
  border-color: rgba(201, 49, 36, 0.3);
  background: linear-gradient(0deg, rgba(201, 49, 36, 0.04), rgba(201, 49, 36, 0.04)), #ffffff;
}

.chat-conversation-head {
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.chat-conversation-head strong {
  overflow-wrap: anywhere;
}

.chat-conversation-head span,
.chat-conversation-details,
.chat-conversation-last {
  color: var(--muted);
  font-size: 13px;
}

.chat-conversation-last {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-unread-badge {
  align-items: center;
  background: var(--red);
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  height: 24px;
  justify-content: center;
  min-width: 24px;
  padding: 0 7px;
  position: absolute;
  right: 10px;
  top: 10px;
}

.admin-chat-dialog {
  display: grid;
  gap: 12px;
  min-height: 480px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.admin-chat-dialog h2 {
  margin: 0 0 5px;
  font-size: 24px;
}

.admin-chat-dialog p {
  margin: 0;
  color: var(--muted);
}

.admin-chat-messages {
  align-content: start;
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 6px;
}

.admin-chat-message {
  display: grid;
  gap: 5px;
  justify-self: start;
  max-width: 78%;
  padding: 11px 13px;
  border-radius: 8px;
  background: #f3f6f5;
}

.admin-chat-message.admin {
  justify-self: end;
  background: var(--teal);
  color: #ffffff;
}

.admin-chat-message p {
  color: inherit;
  white-space: pre-line;
}

.admin-chat-message span {
  color: inherit;
  font-size: 11px;
  font-weight: 800;
  opacity: 0.72;
}

.admin-chat-form {
  display: grid;
  gap: 10px;
  align-self: end;
}

.admin-chat-form[hidden] {
  display: none;
}

.admin-chat-form button {
  justify-self: start;
  min-width: 170px;
  padding: 0 16px;
}

:root[data-theme="dark"] .chat-conversation.unread {
  border-color: rgba(248, 113, 113, 0.28);
  background: linear-gradient(0deg, rgba(248, 113, 113, 0.08), rgba(248, 113, 113, 0.08)), #10171b;
}

:root[data-theme="dark"] .admin-chat-message {
  background: #182226;
}

:root[data-theme="dark"] .admin-chat-message.admin {
  background: #0f766e;
}

.appointment {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(180px, 1fr) minmax(180px, 1.2fr) minmax(190px, 1.3fr) minmax(150px, 0.85fr);
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.user-card {
  display: grid;
  grid-template-columns: minmax(190px, 1.1fr) minmax(130px, 0.7fr) minmax(230px, 1.35fr) minmax(170px, 0.95fr) minmax(155px, 0.85fr) minmax(130px, 0.65fr);
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.user-card.verified {
  border-color: rgba(15, 118, 110, 0.25);
}

.user-card.unverified {
  border-color: rgba(201, 49, 36, 0.22);
}

.user-card.is-recent {
  border-color: rgba(15, 118, 110, 0.7);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.user-card.blocked {
  border-color: rgba(201, 49, 36, 0.55);
  box-shadow: 0 0 0 3px rgba(201, 49, 36, 0.08);
}

.appointment.approved {
  border-color: rgba(15, 118, 110, 0.36);
  background: linear-gradient(0deg, rgba(15, 118, 110, 0.04), rgba(15, 118, 110, 0.04)), #ffffff;
}

.appointment.rejected {
  border-color: rgba(201, 49, 36, 0.26);
  background: linear-gradient(0deg, rgba(201, 49, 36, 0.04), rgba(201, 49, 36, 0.04)), #ffffff;
}

.appointment.archived {
  border-color: #cdd7d3;
  background: #f8faf9;
}

.appointment.is-recent {
  border-color: rgba(15, 118, 110, 0.7);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

:root[data-theme="dark"] .appointment.approved {
  border-color: rgba(45, 212, 191, 0.35);
  background: linear-gradient(0deg, rgba(45, 212, 191, 0.08), rgba(45, 212, 191, 0.08)), #10171b;
}

:root[data-theme="dark"] .appointment.rejected {
  border-color: rgba(248, 113, 113, 0.3);
  background: linear-gradient(0deg, rgba(248, 113, 113, 0.08), rgba(248, 113, 113, 0.08)), #10171b;
}

:root[data-theme="dark"] .appointment.archived {
  border-color: #354348;
  background: #12191d;
}

:root[data-theme="dark"] .user-card {
  background: #10171b;
  border-color: var(--line);
}

:root[data-theme="dark"] .user-card.verified {
  border-color: rgba(45, 212, 191, 0.28);
}

:root[data-theme="dark"] .user-card.unverified {
  border-color: rgba(248, 113, 113, 0.26);
}

:root[data-theme="dark"] .user-card.is-recent {
  border-color: rgba(45, 212, 191, 0.7);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.14);
}

:root[data-theme="dark"] .user-card.blocked {
  border-color: rgba(248, 113, 113, 0.55);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.1);
}

:root[data-theme="dark"] .user-avatar,
:root[data-theme="dark"] .user-vehicle-avatar {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.2);
  color: #fca5a5;
}

:root[data-theme="dark"] .user-vehicle-line.primary .user-vehicle-avatar {
  background: rgba(45, 212, 191, 0.12);
  border-color: rgba(45, 212, 191, 0.24);
  color: #5eead4;
}

:root[data-theme="dark"] .appointment.is-recent {
  border-color: rgba(45, 212, 191, 0.7);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.14);
}

.cell {
  min-width: 0;
}

.label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.value {
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.45;
  white-space: pre-line;
}

.value.strong {
  font-weight: 850;
}

.user-identity {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.user-identity strong,
.user-identity span {
  display: block;
  overflow-wrap: anywhere;
}

.user-identity span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.user-avatar,
.user-vehicle-avatar {
  align-items: center;
  background: rgba(201, 49, 36, 0.1);
  border: 1px solid rgba(201, 49, 36, 0.18);
  border-radius: 8px;
  color: var(--red);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 900;
  justify-content: center;
  overflow: hidden;
}

.user-avatar {
  height: 42px;
  width: 42px;
}

.user-vehicle-avatar {
  height: 34px;
  width: 34px;
}

.user-avatar img,
.user-vehicle-avatar img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

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

.user-vehicle-line {
  align-items: flex-start;
  display: flex;
  gap: 9px;
  min-width: 0;
}

.user-vehicle-line strong,
.user-vehicle-line span {
  display: block;
  overflow-wrap: anywhere;
}

.user-vehicle-line strong {
  font-size: 14px;
}

.user-vehicle-line span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.user-vehicle-line.primary .user-vehicle-avatar {
  background: rgba(15, 118, 110, 0.12);
  border-color: rgba(15, 118, 110, 0.24);
  color: var(--teal);
}

.appointment-actions {
  display: grid;
  align-content: start;
  gap: 8px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  width: fit-content;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(181, 106, 19, 0.12);
  color: var(--amber);
  font-size: 13px;
  font-weight: 900;
}

.status-badge.approved {
  background: rgba(15, 118, 110, 0.12);
  color: var(--teal);
}

.status-badge.rejected {
  background: rgba(201, 49, 36, 0.1);
  color: var(--red);
}

.status-badge.blocked {
  background: rgba(201, 49, 36, 0.12);
  color: var(--red);
}

.status-badge.archived {
  background: #e9eeee;
  color: #50606a;
}

.status-badge.admin {
  background: rgba(22, 33, 43, 0.1);
  color: var(--ink);
}

:root[data-theme="dark"] .status-badge.admin {
  background: rgba(232, 238, 238, 0.12);
  color: var(--ink);
}

.user-status-cell {
  display: grid;
  align-content: start;
  gap: 7px;
}

.user-status-cell .decision-btn {
  justify-self: start;
  min-width: 150px;
}

.user-work-cell {
  display: grid;
  align-content: start;
  gap: 8px;
}

.user-work-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.user-work-panel[hidden] {
  display: none;
}

.user-work-panel h3 {
  margin: 0;
  font-size: 21px;
}

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

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

.user-work-form button[type="submit"] {
  width: fit-content;
  min-width: 180px;
  padding: 0 16px;
}

.admin-client-works-list {
  display: grid;
  gap: 10px;
}

.admin-client-work {
  display: grid;
  gap: 7px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.admin-client-work strong {
  font-size: 16px;
}

.admin-client-work span {
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
}

.admin-client-work p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.text-doc-btn {
  justify-self: start;
  background: transparent;
  color: var(--red);
  cursor: pointer;
  font-weight: 850;
  padding: 0;
  text-align: left;
  text-decoration: underline;
}

:root[data-theme="dark"] .admin-client-work {
  background: #12191d;
  border-color: var(--line);
}

.status-updated {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.decision-actions {
  display: grid;
  gap: 8px;
}

.decision-btn {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
}

.decision-btn:disabled {
  cursor: wait;
  opacity: 0.64;
}

.decision-btn.approve {
  background: var(--teal);
  color: #ffffff;
}

.decision-btn.reject {
  border: 1px solid rgba(201, 49, 36, 0.25);
  background: rgba(201, 49, 36, 0.08);
  color: var(--red);
}

.decision-btn.delete {
  border: 1px solid #cdd7d3;
  background: #f3f6f5;
  color: #40505a;
}

:root[data-theme="dark"] .decision-btn.delete {
  border-color: #354348;
  background: #182226;
  color: #c8d4d8;
}

.empty {
  padding: 24px;
  border: 1px dashed #bfcac5;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

:root[data-theme="dark"] .empty {
  border-color: #3a474d;
  background: #10171b;
}

.save-content-btn {
  min-width: 148px;
  padding: 0 18px;
}

.content-save-strip {
  align-items: center;
  background: #eef6f4;
  border: 1px solid rgba(15, 118, 110, 0.2);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 16px;
  padding: 12px;
  position: sticky;
  top: 10px;
  z-index: 4;
}

.content-save-strip.is-dirty {
  background: #fff7e8;
  border-color: rgba(181, 106, 19, 0.32);
}

.content-save-status {
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
}

.content-save-strip.is-dirty .content-save-status {
  color: var(--amber);
}

.save-content-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

:root[data-theme="dark"] .content-save-strip {
  background: #101b1d;
  border-color: rgba(45, 212, 191, 0.22);
}

:root[data-theme="dark"] .content-save-strip.is-dirty {
  background: #1f1b12;
  border-color: rgba(251, 191, 36, 0.34);
}

.editor-section {
  display: grid;
  gap: 14px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

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

.editor-head h2 {
  margin: 0;
  font-size: 24px;
}

.editor-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

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

.site-text-editor {
  display: grid;
  gap: 14px;
}

.owner-tools {
  border-top: 0;
  padding: 16px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 8px;
  background: #eaf7f4;
}

.owner-code-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

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

.owner-code-form input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

:root[data-theme="dark"] .owner-tools {
  border-color: rgba(45, 212, 191, 0.22);
  background: #101b1d;
}

:root[data-theme="dark"] .owner-code-form input {
  background: #0d1417;
  color: var(--ink);
}

.site-text-group {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.site-text-group h3 {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 18px;
}

.site-text-group .wide {
  grid-column: 1 / -1;
}

.site-field-row {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 118px;
}

.site-field-control {
  min-width: 0;
}

.font-size-control {
  align-items: end;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.font-size-control > span:first-child {
  grid-column: 1 / -1;
  margin: 0;
}

.font-size-control input {
  min-height: 46px;
  padding: 0 10px;
}

.font-size-unit {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  padding-bottom: 13px;
}

.range-field {
  display: grid;
  gap: 10px;
}

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

.range-value {
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
}

input[type="range"] {
  min-height: 28px;
  padding: 0;
  accent-color: var(--teal);
}

:root[data-theme="dark"] .site-text-group {
  background: #10171b;
  border-color: var(--line);
}

.editor-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

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

.editor-card-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.remove-btn {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(201, 49, 36, 0.25);
  border-radius: 8px;
  background: rgba(201, 49, 36, 0.08);
  color: var(--red);
  cursor: pointer;
  font-weight: 850;
}

:root[data-theme="dark"] .remove-btn {
  border-color: rgba(248, 113, 113, 0.34);
  background: rgba(248, 113, 113, 0.12);
  color: var(--red);
}

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

.editor-grid .wide {
  grid-column: 1 / -1;
}

@media (max-width: 860px) {
  .appointment,
  .user-card {
    grid-template-columns: 1fr 1fr;
  }

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

@media (max-width: 620px) {
  .admin-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 16px;
  }

  .admin-top,
  .view-head {
    align-items: stretch;
    flex-direction: column;
  }

  .actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .ghost-btn {
    flex: 1;
  }

  .new-appointment-alert {
    align-items: stretch;
    flex-direction: column;
  }

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

  .login-panel,
  .appointments-view,
  .users-view,
  .chat-view,
  .site-view {
    padding: 18px;
  }

  .appointment,
  .user-card {
    grid-template-columns: 1fr;
  }

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

  .user-work-form .wide {
    grid-column: auto;
  }

  .user-work-form button[type="submit"] {
    width: 100%;
  }

  .admin-tabs,
  .editor-head {
    flex-direction: column;
  }

  .tab-btn,
  .save-content-btn {
    width: 100%;
  }

  .content-save-strip,
  .save-content-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-chat-message {
    max-width: 92%;
  }

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

  .site-text-group {
    grid-template-columns: 1fr;
  }

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

  .font-size-control {
    max-width: 160px;
  }

  h1 {
    font-size: 29px;
  }
}

@keyframes pulseCounter {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }
}
