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

.col3 {
  grid-column: span 3;
}

.col4 {
  grid-column: span 4;
}

.col6 {
  grid-column: span 6;
}

.col8 {
  grid-column: span 8;
}

.col12 {
  grid-column: span 12;
}

label {
  display: block;
  margin: 0 0 6px;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="time"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-text);
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.4;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 4px var(--color-brand-soft);
}

.req {
  color: var(--color-danger);
  font-weight: 800;
}

.agent-form-compact .split {
  gap: 10px;
}

.agent-form-compact label {
  margin-bottom: 5px;
  font-size: 11px;
}

.agent-form-compact input[type="text"],
.agent-form-compact input[type="number"],
.agent-form-compact input[type="email"],
.agent-form-compact input[type="password"],
.agent-form-compact input[type="time"],
.agent-form-compact select,
.agent-form-compact textarea {
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 13px;
}

.agent-form-compact textarea {
  min-height: 80px;
}

.create-mode-card {
  margin-bottom: 14px;
}

.create-mode-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.create-mode-copy h3 {
  margin: 0;
  font-size: 14px;
}

.create-mode-copy p {
  margin: 4px 0 0;
  color: var(--color-text-muted);
  font-size: 12px;
}

.create-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
}

.create-mode-pill {
  appearance: none;
  border: 0;
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  line-height: 1;
}

.create-mode-pill.active {
  color: #fff;
  background: linear-gradient(130deg, var(--color-brand), var(--color-brand-alt));
}

.create-mode-switch.is-locked .create-mode-pill {
  opacity: 0.7;
  cursor: not-allowed;
}

.create-mode-lock-note {
  margin: 6px 0 0;
  color: var(--color-text-muted);
  font-size: 11px;
}

.input-readonly {
  background: rgba(13, 15, 22, 0.03);
  color: var(--color-text-muted);
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: clamp(18px, 6vw, 88px);
  align-items: start;
  justify-content: start;
}

.profile-main {
  min-width: 0;
}

.profile-aside {
  border: 1px solid var(--color-line);
  border-radius: 12px;
  background: var(--color-surface-soft);
  padding: 10px;
}

.avatar-preview-shell {
  width: min(100%, 150px);
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  border: 1px solid var(--color-line);
  background: var(--color-surface-strong);
  overflow: hidden;
  display: grid;
  place-items: center;
  margin: 0 auto 8px;
}

.avatar-source-switch {
  display: inline-flex;
  width: 100%;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  padding: 4px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
}

.avatar-source-pill {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 8px 10px;
  cursor: pointer;
  flex: 1;
}

.avatar-source-pill.active {
  color: #fff;
  background: linear-gradient(130deg, var(--color-brand), var(--color-brand-alt));
}

.avatar-source-panel[hidden] {
  display: none;
}

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

.avatar-preview-fallback {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(140deg, var(--color-brand), rgba(146, 208, 80, 0.88));
}

.profile-aside input[type="file"] {
  width: 100%;
  font-size: 12px;
}

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

.avatar-file-picker {
  display: inline-flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  margin: 0;
  min-height: 48px;
  font-size: 13px;
  line-height: 1.15;
  color: var(--color-text);
}

.avatar-actions-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.avatar-actions-row > .btn {
  display: inline-flex;
  width: 100%;
  height: 52px;
  min-height: 52px;
  margin: 0;
  padding: 10px 12px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.15;
}

.avatar-secondary-btn {
  width: 100%;
  min-width: 0;
  justify-content: center;
}

.avatar-secondary-btn[disabled] {
  cursor: not-allowed;
  opacity: 0.65;
}

.avatar-generate-block {
  margin-top: 10px;
}

.avatar-generate-block textarea {
  min-height: 74px;
  resize: vertical;
}

.avatar-generate-btn {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}

.avatar-generated-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.avatar-generated-option {
  appearance: none;
  border: 1px solid var(--color-line);
  border-radius: 10px;
  padding: 4px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.avatar-generated-option.is-active {
  border-color: rgba(103, 63, 180, 0.38);
  box-shadow: 0 0 0 3px rgba(103, 63, 180, 0.14);
}

.avatar-generated-option img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.avatar-generated-caption {
  font-size: 11px;
  color: var(--color-text-muted);
  line-height: 1.2;
  text-align: center;
}

.avatar-cropper-modal {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 16px;
}

.avatar-cropper-modal[hidden] {
  display: none;
}

.avatar-cropper-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 12, 22, 0.62);
}

.avatar-cropper-dialog {
  position: relative;
  width: min(96vw, 560px);
  border-radius: 16px;
  border: 1px solid var(--color-border-strong);
  background: #fff;
  box-shadow: var(--shadow-md);
  padding: 14px;
}

.avatar-cropper-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.avatar-cropper-head h3 {
  margin: 0;
  font-size: 16px;
}

.avatar-cropper-close {
  min-width: 36px;
  min-height: 36px;
  border-radius: 10px;
  padding: 0;
  font-size: 18px;
}

.avatar-cropper-canvas-wrap {
  border: 1px solid var(--color-line);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(13, 15, 22, 0.02);
}

.avatar-cropper-canvas-wrap canvas {
  width: 100%;
  height: auto;
  display: block;
  touch-action: none;
  cursor: grab;
}

.avatar-cropper-canvas-wrap canvas.is-dragging {
  cursor: grabbing;
}

.avatar-cropper-controls {
  margin-top: 10px;
}

.avatar-cropper-controls label {
  margin: 0;
}

.avatar-cropper-controls input[type="range"] {
  margin-top: 6px;
}

.avatar-cropper-controls p {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

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

.help-error {
  color: var(--color-danger);
  font-weight: 600;
}

.field-required-error {
  border-color: rgba(192, 57, 43, 0.72) !important;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.18) !important;
}

.field-label-error {
  color: var(--color-danger-strong) !important;
}

.field-required-msg {
  margin-top: 6px;
}

.day-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.day-check input[type="checkbox"] {
  accent-color: var(--color-brand);
}

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

.schedule-time-field {
  border: 1px solid var(--color-border-strong);
  border-radius: 12px;
  background: var(--color-surface-soft);
  padding: 10px 12px;
}

.schedule-time-field span {
  display: block;
  margin: 0 0 6px;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
}

.schedule-days-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
}

.schedule-days-action.btn {
  padding: 8px 11px;
  min-height: 34px;
  font-size: 12px;
  box-shadow: none;
}

.schedule-days-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.schedule-day-pill {
  position: relative;
  margin: 0;
}

.schedule-day-pill input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.schedule-day-pill span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--color-border-strong);
  border-radius: 11px;
  background: #fff;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
  user-select: none;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.schedule-day-pill input[type="checkbox"]:checked + span {
  border-color: var(--color-border-strong);
  background: var(--color-surface-strong);
  color: var(--color-text);
}

.schedule-day-pill input[type="checkbox"]:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(180, 198, 217, 0.35);
}

.facet-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

.facet-toolbar-field {
  flex: 1;
}

.facet-groups-container {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.facet-card {
  grid-column: auto;
  margin-top: 0;
  height: 100%;
  border-style: dashed;
  box-shadow: none;
  background: #fff;
}

.facet-card-hd {
  padding-bottom: 10px;
}

.facet-card-bd {
  padding-top: 0;
}

.facet-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.facet-handle {
  color: var(--color-text-muted);
  user-select: none;
  cursor: grab;
}

.facet-delete-btn {
  box-shadow: none;
  padding: 8px 12px;
}

.facet-options {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 10px;
}

.facet-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--color-text-muted);
  font-weight: 600;
}

.facet-option input[type="checkbox"] {
  accent-color: var(--color-brand);
}

.facet-values-editor {
  margin-top: 2px;
}

.specialization-preset-card {
  border: 1px solid var(--color-line);
  border-radius: 12px;
  padding: 9px 12px;
  background: var(--color-surface-soft);
  min-height: 40px;
}

.specialization-preset-inline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.personality-slider input[type="range"] {
  width: 100%;
  accent-color: var(--color-brand);
}

.personality-slider-meta {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  color: var(--color-text-muted);
}

.personality-slider-meta strong {
  color: var(--color-text);
  font-size: 12px;
}

.personality-style-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.personality-preview {
  min-height: 170px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
  background: rgba(13, 15, 22, 0.02);
}
