/* Кнопки */
.btn {
  display: flex;
  gap: 14px;
  align-items: center;
  width: 100%;
  min-height: var(--tap);
  padding: 12px 18px;
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  background: var(--surface);
  border: 2px solid var(--line-strong);
  border-radius: var(--radius);
  -webkit-tap-highlight-color: transparent;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn--primary {
  color: var(--on-primary);
  background: var(--primary);
  border-color: var(--primary);
}

.btn--call {
  color: var(--on-call);
  background: var(--call);
  border-color: var(--call);
}

.btn--danger {
  color: var(--danger);
  border-color: var(--danger);
}

.btn--quiet {
  justify-content: center;
  min-height: 52px;
  font-weight: 500;
  color: var(--ink-soft);
  background: transparent;
  border-color: transparent;
}

.btn--xl {
  min-height: var(--tap-xl);
  padding: 16px 20px;
  font-size: 1.3rem;
  border-radius: var(--radius-lg);
}

.btn--center {
  justify-content: center;
  text-align: center;
}

.btn--listening {
  color: var(--danger);
  border-color: var(--danger);
}

label.btn:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.btn__icon {
  display: flex;
  flex: none;
}

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

.btn__sub {
  font-size: 0.9rem;
  font-weight: 400;
  opacity: 0.92;
}

.btn__tail {
  display: flex;
  margin-left: auto;
}

/* Шапка внутренних экранов */
.topbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.topbar__back {
  width: auto;
  min-height: 56px;
  padding: 8px 18px 8px 10px;
}

/* Поля формы */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field__label {
  font-size: 1.1rem;
  font-weight: 600;
}

.field__optional {
  display: block;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--ink-soft);
}

.input {
  width: 100%;
  min-height: var(--tap);
  padding: 12px 16px;
  font-size: 1.25rem;
  background: var(--surface);
  border: 2px solid var(--line-strong);
  border-radius: var(--radius);
}

.input::placeholder {
  color: var(--ink-soft);
  opacity: 0.7;
}

.input:focus {
  border-color: var(--primary);
}

textarea.input {
  min-height: 132px;
  line-height: 1.35;
  resize: vertical;
}

.phone-input {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 2px solid var(--line-strong);
  border-radius: var(--radius);
}

.phone-input:focus-within {
  border-color: var(--primary);
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.phone-input__prefix {
  padding-left: 16px;
  font-size: 1.25rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.phone-input .input {
  flex: 1;
  min-width: 0;
  padding-left: 8px;
  font-variant-numeric: tabular-nums;
  background: transparent;
  border: 0;
  outline: none;
}

.field--error .input,
.field--error .phone-input {
  border-color: var(--danger);
}

.field--error .phone-input .input {
  border: 0;
}

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

/* Выбор из нескольких вариантов */
.choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

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

.choice {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 8px;
  font-weight: 600;
  overflow-wrap: anywhere;
  cursor: pointer;
  background: var(--surface);
  border: 2px solid var(--line-strong);
  border-radius: var(--radius);
}

/* Выбранный вариант залит целиком: его видно и без различения цветов */
.choice--on {
  color: var(--on-primary);
  background: var(--primary);
  border-color: var(--primary);
}

/* Состояние заявки */
.chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  padding: 5px 14px;
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  border-radius: 999px;
}

.chip--large {
  padding: 8px 20px;
  font-size: 1.15rem;
}

.chip--wait { color: var(--st-wait-fg); background: var(--st-wait-bg); }
.chip--new { color: var(--st-new-fg); background: var(--st-new-bg); }
.chip--work { color: var(--st-work-fg); background: var(--st-work-bg); }
.chip--done { color: var(--st-done-fg); background: var(--st-done-bg); }
.chip--off { color: var(--st-off-fg); background: var(--st-off-bg); }

/* Блок с рамкой */
.panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
}

.panel__title {
  font-size: 1.15rem;
  font-weight: 700;
  text-wrap: balance;
}

.panel__row {
  display: grid;
  gap: 10px;
}

.note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  font-weight: 500;
  color: var(--st-wait-fg);
  background: var(--st-wait-bg);
  border-radius: var(--radius);
}

.note svg {
  flex: none;
}

/* Окно поверх экрана */
.sheet-backdrop {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: flex-end;
  background: var(--shade);
}

.sheet {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-height: 92%;
  padding: 24px 18px 22px;
  overflow-y: auto;
  background: var(--bg);
  border-radius: 26px 26px 0 0;
}

.sheet__title {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
  text-wrap: balance;
}

.sheet__text {
  color: var(--ink-soft);
}

.sheet__actions {
  display: grid;
  gap: 12px;
}

/* Короткое сообщение внизу */
.toast-slot {
  position: absolute;
  right: 14px;
  bottom: 18px;
  left: 14px;
  z-index: 40;
  pointer-events: none;
}

.toast {
  padding: 14px 18px;
  font-weight: 600;
  color: var(--bg);
  text-align: center;
  background: var(--ink);
  border-radius: var(--radius);
  animation: rise 0.2s ease-out;
}

/* Уведомление сверху */
.push-slot {
  position: absolute;
  top: 10px;
  right: 10px;
  left: 10px;
  z-index: 50;
}

.push {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 28px -12px var(--shade);
  animation: drop 0.25s ease-out;
}

.push__badge {
  display: grid;
  flex: none;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--on-primary);
  background: var(--primary);
  border-radius: 14px;
}

.push__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.push__app {
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.push__title {
  font-weight: 700;
}

.push__text {
  font-size: 0.95rem;
  color: var(--ink-soft);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes drop {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}
