/* ── Reset ───────────────────────────────────────────────────────────── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  color: #222;
  background: #fff;
  min-height: 100vh;
}

/* ── Page wrapper (phone-sized) ──────────────────────── */
.page {
  max-width: 390px;
  margin: 0 auto;
}

/* ── Header ──────────────────────────────────────────── */
.header {
  padding: 22px 16px 12px;
  text-align: center;
  border-bottom: 1px solid #e8e8e8;
}

.logo-text {
  font-size: 32px;
  color: #1d506c;
  line-height: 1;
}

.logo-dzb   { font-weight: 800; }
.logo-lesen { font-weight: 300; }

.logo-dots {
  display: flex;
  gap: 7px;
  justify-content: center;
  margin-top: 10px;
}

.dot {
  width: 11px;
  height: 11px;
  background: #e63c1e;
  border-radius: 50%;
}

/* ── Device info ─────────────────────────────────────── */
.device-info {
  background: #ececec;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  line-height: 1.6;
  min-height: 40px;
}

/* ── Loading / Error ─────────────────────────────────── */
.loading-msg {
  padding: 28px 16px;
  text-align: center;
  color: #888;
  font-size: 13px;
}

.error-banner {
  margin: 12px 8px;
  padding: 10px 14px;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
  color: #856404;
  font-size: 13px;
}

/* ── Buttons list ────────────────────────────────────── */
.buttons-list {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Individual accordion card ───────────────────────── */
.btn-card {
  border: 2px solid #e63c1e;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.btn-header {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.btn-circle {
  width: 46px;
  height: 46px;
  background: #e63c1e;
  border-radius: 50%;
  flex-shrink: 0;
}

.btn-text {
  flex: 1;
  min-width: 0;
}

.btn-type {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-fn {
  font-size: 13px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.btn-chevron {
  font-size: 11px;
  color: #bbb;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.btn-card.expanded .btn-chevron {
  transform: rotate(90deg);
}

/* ── Expandable body ─────────────────────────────────── */
.btn-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease-out;
}

.btn-card.expanded .btn-body {
  max-height: 400px;
}

.btn-body-inner {
  padding: 12px;
  border-top: 1px solid #f5ddd9;
  background: #fdf8f7;
}

/* ── Radio options ───────────────────────────────────── */
.radio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 12px;
  margin-bottom: 12px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  cursor: pointer;
}

.radio-option input[type="radio"] {
  accent-color: #e63c1e;
  flex-shrink: 0;
}

/* ── Function text input ─────────────────────────────── */
.fn-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  outline: none;
}

.fn-input:focus {
  border-color: #e63c1e;
  box-shadow: 0 0 0 2px rgba(230, 60, 30, 0.1);
}

select.fn-input {
  cursor: pointer;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  -webkit-appearance: none;
  appearance: none;
}

/* ── Save row ────────────────────────────────────────── */
.save-row {
  padding: 8px;
}

.save-btn {
  width: 100%;
  padding: 12px;
  background: #1d506c;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.3px;
}

.save-btn:disabled {
  background: #8ea8b5;
  cursor: not-allowed;
}

.status-msg {
  display: block;
  text-align: center;
  font-size: 12px;
  padding: 5px 0 2px;
  min-height: 22px;
}

.status-ok   { color: #198754; }
.status-fail { color: #dc3545; }

/* ── Desktop: subtle phone-frame look ───────────────── */
@media (min-width: 480px) {
  body {
    background: #e8e8e8;
    padding: 28px 16px;
  }

  .page {
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 6px 40px rgba(0, 0, 0, 0.18);
    background: #fff;
  }
}
