.bc-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bc-page);
}

.bc-shell__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  min-height: 68px;
  background: #ede0fa;
  border-bottom: 1px solid color-mix(in srgb, #371168 16%, #ede0fa);
  flex-shrink: 0;
}

.bc-shell__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: #371168;
  white-space: nowrap;
}

.bc-shell__brand-logo {
  height: 36px;
  width: 36px;
  border-radius: 6px;
}

.bc-shell__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bc-shell__main {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 72px;
}

.bc-shell__footer {
  flex-shrink: 0;
  padding: 12px 16px;
  font-size: 12px;
  color: color-mix(in srgb, #fff 72%, transparent);
  border-top: 1px solid color-mix(in srgb, #fff 12%, transparent);
  text-align: center;
  backdrop-filter: blur(6px);
}

.bc-shell__footer a {
  color: #ede0fa;
}

.bc-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bc-narrow {
  max-width: 560px;
  margin-inline: auto;
}

.bc-login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bc-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.bc-alert--success a {
  color: inherit;
  text-decoration: underline;
}

.bc-fieldset {
  border: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bc-fieldset__legend {
  font-size: 13px;
  font-weight: 600;
  color: var(--bc-text);
  padding: 0;
  margin-bottom: 4px;
}

.bc-option-group {
  display: inline-flex;
  flex-wrap: nowrap;
  width: fit-content;
  max-width: 100%;
  padding: 2px;
  gap: 2px;
  background: var(--bc-disabled-bg);
  border: 1px solid var(--bc-accent);
  border-radius: var(--bc-radius-popover);
}

.bc-radio {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-width: 56px;
  height: var(--bc-control-height-compact);
  padding: 0 12px;
  border: none;
  border-radius: var(--bc-radius-control);
  font-size: 12px;
  font-weight: 600;
  color: var(--bc-text-secondary);
  cursor: pointer;
  user-select: none;
  transition: background-color 80ms ease, color 80ms ease;
}

.bc-radio input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.bc-radio:hover:not(:has(input:checked)) {
  background: var(--bc-accent-bg);
  color: var(--bc-text);
}

.bc-radio:has(input:checked) {
  background: var(--bc-accent);
  color: var(--bc-on-accent);
}

.bc-radio:has(input:focus-visible) {
  box-shadow: var(--bc-focus-ring);
}

.bc-option-group:has(input[name="tjanst_aktiv"]) {
  border-color: color-mix(in srgb, var(--bc-status-on) 55%, var(--bc-border-strong));
}

.bc-option-group:has(input[name="tjanst_aktiv"][value="0"]:checked) {
  border-color: color-mix(in srgb, var(--bc-status-off) 60%, var(--bc-border-strong));
}

.bc-radio:has(input[name="tjanst_aktiv"][value="1"]:checked) {
  background: var(--bc-status-on);
  color: var(--bc-on-status-on);
}

.bc-radio:has(input[name="tjanst_aktiv"][value="0"]:checked) {
  background: var(--bc-status-off);
  color: var(--bc-on-status-off);
}

.bc-lockfield {
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--bc-control-height);
  padding: 0 10px 0 12px;
  background: var(--bc-disabled-bg);
  border: 1px solid var(--bc-border);
  border-radius: var(--bc-radius-control);
}

.bc-lockfield__icon {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: var(--bc-muted-2);
}

.bc-lockfield .bc-input {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
  height: 100%;
}

.bc-composer {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 168px;
  background: var(--bc-bg);
  border: 1px solid var(--bc-border-strong);
  border-radius: var(--bc-radius-popover);
  overflow: hidden;
  transition: border-color 80ms ease, box-shadow 80ms ease;
}

.bc-composer:hover:not(:focus-within) {
  border-color: var(--bc-muted);
}

.bc-composer:focus-within {
  border-color: var(--bc-accent);
  box-shadow: var(--bc-focus-ring);
}

.bc-composer__input,
.bc-composer .bc-textarea {
  flex: 1;
  min-height: 128px;
  border: none;
  border-radius: 0;
  box-shadow: none;
  resize: none;
  padding: 12px;
}

.bc-composer__input:hover,
.bc-composer .bc-textarea:hover,
.bc-composer__input:focus,
.bc-composer .bc-textarea:focus {
  border: none;
  box-shadow: none;
}

.bc-composer__bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 6px 8px;
  border-top: 1px solid var(--bc-border);
  background: color-mix(in srgb, var(--bc-surface) 70%, var(--bc-bg));
}

.bc-char-counter {
  font-size: 11px;
  font-weight: 600;
  color: var(--bc-badge-text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bc-badge-bg);
}

.bc-char-counter.is-low {
  background: var(--bc-warning-bg);
  color: var(--bc-warning);
}

.bc-char-counter.is-empty {
  background: var(--bc-danger-bg);
  color: var(--bc-danger);
}

.bc-sms-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--bc-border);
}

.bc-sms-block__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.bc-sms-block__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 228px;
  gap: 16px;
  align-items: stretch;
}

.bc-sms-block__row .bc-composer {
  min-height: 100%;
}

.sms-preview-card {
  background: transparent;
  border: none;
  padding: 0;
  justify-self: end;
}

.phone {
  width: 220px;
}

.phone__bezel {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #1c1c1e;
  border-radius: 28px;
  padding: 11px 8px 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 8px 18px rgba(0, 0, 0, 0.16);
}

.phone__notch {
  position: absolute;
  top: 14px;
  left: 50%;
  width: 68px;
  height: 12px;
  transform: translateX(-50%);
  background: #1c1c1e;
  border-radius: 10px;
  z-index: 2;
}

.phone-topbar {
  background: #fff;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 600;
  color: #222;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
}

.phone-topbar .time {
  min-width: 36px;
  font-variant-numeric: tabular-nums;
}

.phone-topbar .icons {
  display: flex;
  align-items: center;
  gap: 5px;
}

.chat-bg {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px 0 8px;
  background: #f2f2f7;
  min-height: 118px;
}

.phone__home {
  height: 18px;
  background: #f2f2f7;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
  position: relative;
}

.phone__home::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 72px;
  height: 4px;
  transform: translateX(-50%);
  background: #1c1c1e;
  border-radius: 4px;
  opacity: 0.28;
}

.sms-bubble {
  background: #e9e9eb;
  color: #222;
  border-radius: 18px 18px 18px 6px;
  padding: 8px 12px;
  margin: 0 10px 6px;
  font-size: 12px;
  line-height: 1.45;
  max-width: 82%;
  word-break: break-word;
  align-self: flex-start;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.sms-bubble a {
  color: #007aff;
}

.sms-preview-footer {
  display: none;
}

.icon-signal {
  display: inline-block;
  width: 16px;
  height: 10px;
  position: relative;
}

.icon-signal span {
  display: block;
  position: absolute;
  bottom: 0;
  width: 2px;
  background: #222;
  border-radius: 1px;
}

.icon-signal .bar1 { left: 0; height: 3px; }
.icon-signal .bar2 { left: 3px; height: 5px; }
.icon-signal .bar3 { left: 6px; height: 7px; }
.icon-signal .bar4 { left: 9px; height: 8px; }
.icon-signal .bar5 { left: 12px; height: 10px; }

.icon-wifi,
.icon-battery {
  display: inline-flex;
  align-items: center;
}

.bc-sticky-save {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.bc-sticky-save .bc-button--primary {
  box-shadow: 0 0 0 2px var(--bc-surface);
}

.bc-card__header--status {
  align-items: flex-start;
}

.bc-status-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bc-status-list--header {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 20px;
  flex: 1;
}

.bc-status-list--header li {
  color: #371168;
  font-size: 13px;
}

.bc-status-list--header .bc-status-lamp {
  width: 12px;
  height: 12px;
}

.bc-status-list li {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--bc-text);
  white-space: nowrap;
}

.bc-status-lamp {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--bc-status-off);
  box-shadow:
    inset 0 1px 2px color-mix(in srgb, var(--bc-bg) 55%, transparent),
    0 0 0 1px color-mix(in srgb, var(--bc-status-off) 55%, #000),
    0 0 7px color-mix(in srgb, var(--bc-status-off) 70%, transparent);
}

.bc-status-lamp.is-on {
  background: var(--bc-status-on);
  box-shadow:
    inset 0 1px 2px color-mix(in srgb, var(--bc-bg) 55%, transparent),
    0 0 0 1px color-mix(in srgb, var(--bc-status-on) 55%, #000),
    0 0 7px color-mix(in srgb, var(--bc-status-on) 70%, transparent);
}

.bc-status-lamp.is-error {
  background: var(--bc-status-error);
  box-shadow:
    inset 0 1px 2px color-mix(in srgb, var(--bc-bg) 55%, transparent),
    0 0 0 1px color-mix(in srgb, var(--bc-status-error) 55%, #000),
    0 0 7px color-mix(in srgb, var(--bc-status-error) 70%, transparent);
}

.bc-unsaved {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--bc-text);
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--bc-warning-bg);
  border: 1px solid var(--bc-warning-border);
  box-shadow: var(--bc-shadow);
}

.bc-unsaved[hidden] {
  display: none !important;
}

.bc-unsaved__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--bc-status-off);
  box-shadow:
    inset 0 1px 1px color-mix(in srgb, var(--bc-bg) 50%, transparent),
    0 0 5px color-mix(in srgb, var(--bc-status-off) 65%, transparent);
}

.bc-session-timer {
  font-size: 12px;
  line-height: 1.4;
  color: var(--bc-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--bc-surface);
  border: 1px solid var(--bc-border);
  box-shadow: var(--bc-shadow);
}

.bc-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--bc-page) 58%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.bc-loading-overlay[hidden] {
  display: none !important;
}

.bc-loading-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 240px;
  padding: 22px 26px 20px;
  background: var(--bc-surface);
  border: 1px solid var(--bc-border);
  border-radius: var(--bc-radius-card);
  box-shadow: var(--bc-modal-shadow);
}

.bc-loading-panel__text {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--bc-text);
  text-align: center;
}

.bc-loading-panel__hint {
  margin: -4px 0 0;
  font-size: 12px;
  font-weight: 400;
  color: var(--bc-muted);
  text-align: center;
}

.bc-loading-panel__hint[hidden] {
  display: none !important;
}

.bc-loading-panel__count {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--bc-accent);
  line-height: 1.2;
}

.bc-loading-panel__count[hidden] {
  display: none !important;
}

.bc-spinner {
  width: 40px;
  height: 40px;
  position: relative;
  border: none;
  flex-shrink: 0;
}

.bc-spinner::before,
.bc-spinner::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2.5px solid transparent;
}

.bc-spinner::before {
  border-color: color-mix(in srgb, var(--bc-accent) 16%, transparent);
}

.bc-spinner::after {
  border-top-color: var(--bc-accent);
  border-right-color: var(--bc-accent);
  animation: bc-spin 0.7s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

@keyframes bc-spin {
  to { transform: rotate(360deg); }
}

.bc-toast-host {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: min(420px, calc(100vw - 32px));
}

.bc-toast {
  padding: 12px 14px;
  border-radius: var(--bc-radius-card);
  box-shadow: var(--bc-modal-shadow);
  font-size: 13px;
  font-weight: 600;
  pointer-events: auto;
}

.bc-toast--success {
  background: var(--bc-success);
  color: #fff;
}

.bc-toast--error {
  background: var(--bc-danger);
  color: #fff;
}

[hidden] {
  display: none !important;
}

@media (max-width: 959px) {
  .bc-shell__header {
    padding: 10px 12px;
    gap: 10px;
    flex-wrap: wrap;
  }

  .bc-status-list--header {
    order: 3;
    flex: 1 1 100%;
    justify-content: flex-start;
  }

  .bc-shell__brand {
    min-width: 0;
    flex: 1;
  }

  .bc-shell__brand span {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .bc-shell__main {
    padding: 12px;
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }

  .bc-shell__footer {
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 719px) {
  .bc-shell__header {
    min-height: 56px;
    padding: 10px;
  }

  .bc-shell__brand {
    gap: 8px;
    font-size: 13px;
  }

  .bc-shell__brand-logo {
    height: 32px;
    width: 32px;
    flex-shrink: 0;
  }

  .bc-status-list--header li {
    font-size: 12px;
  }

  .bc-shell__main {
    padding: 10px;
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }

  .bc-stack {
    gap: 12px;
  }

  .bc-field--narrow {
    max-width: none;
  }

  .bc-option-group {
    width: 100%;
  }

  .bc-radio {
    flex: 1 1 0;
    height: 32px;
  }

  .bc-sms-block__row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .sms-preview-card {
    justify-self: center;
    margin: 0 auto;
  }

  .phone {
    width: min(220px, 100%);
  }

  .bc-sms-block__row .bc-composer {
    min-height: 120px;
  }

  .bc-sticky-save {
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--bc-surface);
    backdrop-filter: blur(8px);
    border: none;
    border-top: 1px solid var(--bc-border);
    border-radius: 0;
    box-shadow: none;
    box-sizing: border-box;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .bc-sticky-save .bc-button {
    width: 100%;
    height: 40px;
    box-shadow: none;
  }

  .bc-session-timer,
  .bc-unsaved {
    text-align: center;
    justify-content: center;
  }

  .bc-modal-overlay {
    align-items: flex-end;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .bc-modal {
    max-width: none;
    width: 100%;
    max-height: min(90vh, 100dvh - env(safe-area-inset-top, 0px));
    border-radius: var(--bc-radius-card) var(--bc-radius-card) 0 0;
  }

  .bc-modal__footer {
    flex-wrap: wrap;
  }

  .bc-modal__footer .bc-button {
    flex: 1 1 auto;
    min-width: 120px;
  }

  .bc-toast-host {
    top: auto;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 24px);
  }

  .bc-card__desc {
    font-size: 12px;
    line-height: 1.45;
  }

  .bc-alert__actions .bc-button {
    width: 100%;
  }
}
