/* settings.css v9 */
#screen-settings,
#screen-presets { background: #0d0d0d; font-family: 'Google Sans', -apple-system, sans-serif; overflow: hidden; }
.settings-container { display: flex; flex-direction: column; height: 100%; }

.settings-header {
  display: flex; align-items: center; gap: 12px; padding: 16px 20px 14px;
  padding-top: calc(env(safe-area-inset-top) + 16px);
  border-bottom: 1px solid rgba(255,255,255,0.07); flex-shrink: 0;
}
.settings-back {
  background: rgba(52,199,89,0.12); border: none; color: #34c759;
  font-size: 30px; width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; padding-bottom: 2px;
  cursor: pointer; transition: background 0.15s;
}
.settings-back:active { background: rgba(52,199,89,0.24); }
.settings-title { font-size: 22px; font-weight: 700; color: #fff; flex: 1; }
.settings-header-spacer { width: 42px; height: 42px; flex-shrink: 0; }
.settings-help-btn {
  height: 38px;
  border: 1px solid rgba(52,199,89,0.22);
  background: rgba(52,199,89,0.10);
  color: #dff7e6;
  border-radius: 19px;
  padding: 0 10px 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  font-family: 'Google Sans', sans-serif;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.settings-help-btn:active {
  background: rgba(52,199,89,0.18);
}
.settings-help-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(52,199,89,0.24);
  color: #34c759;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.settings-help-icon svg {
  width: 14px;
  height: 14px;
  display: block;
  fill: currentColor;
}
.settings-help-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.settings-help-modal[hidden] {
  display: none !important;
}
.settings-help-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.66);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.settings-help-dialog {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 48px));
  overflow-y: auto;
  background: #161616;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  box-shadow: 0 18px 48px rgba(0,0,0,0.42);
}
.settings-help-dialog::-webkit-scrollbar { display: none; }
.settings-help-dialog-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 12px;
}
.settings-help-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}
.settings-help-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}
.settings-help-version {
  font-size: 12px;
  font-weight: 500;
  color: #7a7a7a;
  letter-spacing: 0.04em;
}
.settings-help-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  color: #d8d8d8;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.settings-help-close:active {
  background: rgba(255,255,255,0.12);
}
.settings-help-body {
  padding: 0 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.settings-help-item {
  background: #1d1d1d;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 14px;
  padding: 14px 15px;
}
.settings-help-label {
  color: #34c759;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 7px;
}
.settings-help-item p {
  margin: 0;
  color: #d5d5d5;
  font-size: 13px;
  line-height: 1.5;
}

body.license-locked .screen.active,
body.license-locked .settings-help-modal {
  pointer-events: none;
}
body.license-locked .screen.active {
  filter: blur(2px) brightness(0.78);
  transition: filter 0.2s ease;
}
.license-modal {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.license-modal[hidden] {
  display: none !important;
}
.license-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}
.license-modal-card {
  position: relative;
  width: min(400px, calc(100vw - 32px));
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(0,0,0,0.38);
  padding: 24px 22px 20px;
  color: #222;
}
.license-modal-card h2 {
  margin: 0 0 10px;
  font-size: 24px;
  line-height: 1.15;
  color: #111;
}
.license-modal-sub {
  margin: 0 0 18px;
  color: #5d5d5d;
  font-size: 14px;
  line-height: 1.45;
}
.license-modal-card label {
  display: block;
  margin: 14px 0 6px;
  color: #444;
  font-size: 13px;
  font-weight: 700;
}
.license-modal-card input {
  width: 100%;
  height: 46px;
  border: 1px solid #d5d5d5;
  border-radius: 10px;
  padding: 0 13px;
  font-size: 16px;
  color: #111;
  background: #fff;
  box-sizing: border-box;
  outline: none;
  font-family: 'Google Sans', -apple-system, sans-serif;
}
.license-modal-card input:focus {
  border-color: #0066ff;
  box-shadow: 0 0 0 3px rgba(0,102,255,0.12);
}
.license-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.license-btn {
  flex: 1;
  height: 44px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Google Sans', -apple-system, sans-serif;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease, background 0.12s ease;
}
.license-btn:active {
  transform: scale(0.98);
}
.license-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}
.license-btn-activate {
  background: #0066ff;
  color: #fff;
}
.license-btn-cancel {
  background: #d8d8d8;
  color: #303030;
}
.license-modal-message {
  min-height: 20px;
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.4;
}

.settings-scroll {
  flex: 1; overflow-y: auto; padding: 16px;
  padding-bottom: calc(env(safe-area-inset-bottom) + 40px);
  -webkit-overflow-scrolling: touch;
}
.settings-scroll::-webkit-scrollbar { display: none; }

.settings-section { margin-bottom: 20px; }
.section-label { font-size: 13px; font-weight: 700; color: #34c759; letter-spacing: 0.12em; margin-bottom: 9px; padding-left: 4px; }
.settings-license-status {
  margin: 28px 4px 0;
  color: #6a6a6a;
  font-size: 12px;
  text-align: center;
  word-break: break-word;
}

.settings-card { background: #1a1a1a; border-radius: 16px; overflow: hidden; border: 1px solid rgba(255,255,255,0.06); }
.card-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; gap: 12px; }
.card-divider { height: 1px; background: rgba(255,255,255,0.06); margin: 0 16px; }
.row-label { font-size: 14px; font-weight: 500; color: #fff; flex-shrink: 0; }
.row-sub { font-size: 12px; color: #666; display: block; margin-top: 2px; }

/* Segmented */
.segmented-control { display: flex; background: #0d0d0d; border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; max-width: 100%; }
.seg-btn { background: none; border: none; color: #555; font-size: 11px; font-weight: 700; padding: 6px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap; font-family: 'Google Sans', sans-serif; transition: background 0.15s, color 0.15s; flex: 1 1 58px; }
.seg-btn.active { background: #34c759; color: #000; }
.force-mode-row { align-items: flex-start; flex-wrap: wrap; }
.force-mode-row .segmented-control { width: 100%; }
#force-mode .seg-btn,
#preset-force-mode .seg-btn { font-size: 12px; min-height: 36px; }

/* Digit inputs */
.digits-row { flex-wrap: wrap; padding: 12px 16px; }
.digit-inputs { display: flex; gap: 8px; align-items: flex-end; justify-content: flex-end; flex-wrap: wrap; }
.digit-input-group { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.digit-input-group label { font-size: 10px; color: #34c759; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.digit-input-group input {
  width: 62px; height: 54px; background: #0d0d0d; border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 12px; color: #fff; font-size: 28px; font-weight: 700; text-align: center;
  font-variant-numeric: tabular-nums; outline: none; -webkit-appearance: none;
  font-family: 'Google Sans', sans-serif; transition: border-color 0.15s;
}
.digit-input-group input:focus { border-color: #34c759; }

/* Perform button */
.confirm-row { padding: 8px 16px 16px; }
.perform-btn {
  width: 100%; height: 52px; background: #2a2a2a; border: none; border-radius: 14px;
  color: #444; font-size: 16px; font-weight: 700; cursor: not-allowed;
  letter-spacing: 0.04em; font-family: 'Google Sans', sans-serif;
  transition: background 0.25s, color 0.25s, transform 0.1s;
}
.perform-btn.ready {
  background: linear-gradient(135deg, #1a5c2e, #218a3e);
  /* White gradient text */
  color: transparent;
  background-clip: text;
  -webkit-background-clip: text;
  background-image: linear-gradient(135deg, #1a5c2e, #218a3e);
  position: relative;
  cursor: pointer;
}
/* Use a layered approach: green bg + white text overlay */
.perform-btn.ready {
  background: linear-gradient(135deg, #1a5c2e, #218a3e);
  color: #fff;
  -webkit-background-clip: unset;
  background-clip: unset;
  background-image: unset;
  text-shadow: 0 1px 8px rgba(255,255,255,0.3);
  box-shadow: 0 0 18px rgba(52,199,89,0.45), 0 4px 20px rgba(52,199,89,0.18);
}
.perform-btn.ready:active { transform: scale(0.97); }
.perform-lock-note {
  margin-top: 10px;
  color: #75cf91;
  font-size: 12px;
  text-align: center;
  line-height: 1.4;
}
.preset-editor-scroll {
  padding-top: calc(env(safe-area-inset-top) + 18px);
}
.preset-editor-title {
  margin: 0 0 14px 4px;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
}
.preset-editor-section {
  margin-bottom: 0;
}

/* Presets */
.presets-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.presets-header-btn {
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
  color: #e1e1e1;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Google Sans', sans-serif;
  cursor: pointer;
  padding: 0 12px;
}
.presets-header-btn:active { transform: scale(0.98); }
.presets-add-header-btn {
  color: #34c759;
  border-color: rgba(52,199,89,0.24);
  background: rgba(52,199,89,0.10);
}
.presets-reorder-toggle {
  min-width: 40px;
  padding: 0 10px;
  font-size: 18px;
  line-height: 1;
}
.presets-reorder-toggle.is-saving {
  min-width: 52px;
  font-size: 13px;
  color: #34c759;
  border-color: rgba(52,199,89,0.24);
  background: rgba(52,199,89,0.10);
}
.presets-scroll {
  display: block;
  padding-top: 24px;
}
.presets-empty {
  color: #666;
  text-align: center;
  font-size: 14px;
  padding: 28px 16px 12px;
}
.presets-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.preset-card {
  width: 100%;
  background: transparent;
  border: 2px solid #5e5e5e;
  border-radius: 11px;
  padding: 14px 16px;
  box-sizing: border-box;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.preset-card.selected {
  border-color: #34c759;
  box-shadow: 0 0 0 1px rgba(52,199,89,0.12), 0 10px 26px rgba(52,199,89,0.08);
  background: rgba(52,199,89,0.04);
}
.preset-card.reorder-mode {
  cursor: default;
}
.preset-card-top,
.preset-card-bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.preset-card-bottom {
  align-items: center;
  margin-top: 16px;
}
.preset-card-name {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}
.preset-card-value {
  color: #d5d5d5;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: right;
}
.preset-card-method {
  color: #8b8b8b;
  font-size: 12px;
  text-align: right;
  line-height: 1.35;
}
.preset-card-method strong {
  font-weight: 700;
  color: #d3d3d3;
}
.preset-edit-btn {
  min-width: 68px;
  height: 34px;
  padding: 0 12px;
  background: rgba(247,160,31,0.10);
  border: 1px solid rgba(247,160,31,0.24);
  border-radius: 8px;
  color: #F7A01F;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Google Sans', sans-serif;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.preset-edit-btn:active {
  border-color: rgba(247,160,31,0.44);
  background: rgba(247,160,31,0.18);
  color: #ffb54d;
}
.preset-edit-icon { font-size: 13px; line-height: 1; }
.preset-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.preset-reorder-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.preset-reorder-handle {
  width: 38px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
  color: #d7d7d7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  touch-action: none;
  user-select: none;
}
.preset-reorder-handle:active {
  border-color: rgba(247,160,31,0.34);
  color: #F7A01F;
  cursor: grabbing;
}
.preset-reorder-handle svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
}
.preset-delete-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(210,80,80,0.28);
  background: rgba(210,80,80,0.14);
  color: #f1a0a0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.preset-delete-btn:active {
  background: rgba(210,80,80,0.24);
  border-color: rgba(210,80,80,0.44);
}
.preset-delete-svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: currentColor;
}
.presets-list.is-reordering {
  position: relative;
}
.preset-card.reorder-mode {
  user-select: none;
}
.preset-card.is-dragging {
  position: fixed;
  z-index: 40;
  margin: 0;
  box-shadow: 0 16px 34px rgba(0,0,0,0.32);
  border-color: rgba(247,160,31,0.42);
  background: rgba(30,30,30,0.96);
  pointer-events: none;
}
.preset-drag-placeholder {
  border: 1.5px dashed rgba(247,160,31,0.34);
  border-radius: 11px;
  background: rgba(247,160,31,0.06);
  box-sizing: border-box;
}
.preset-name-input {
  flex: 1;
  height: 42px;
  background: #0d0d0d;
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  padding: 0 12px;
  outline: none;
  font-family: 'Google Sans', sans-serif;
}
.preset-name-input:focus { border-color: #34c759; }
.preset-editor-actions {
  display: flex;
  gap: 10px;
  padding: 16px;
}
.preset-save-btn,
.preset-cancel-btn {
  flex: 1 1 50%;
  width: calc(50% - 5px);
  height: 52px;
}
.preset-save-btn {
  margin: 0;
}
.preset-cancel-btn {
  background: rgba(212, 84, 84, 0.16);
  border: 1px solid rgba(212, 84, 84, 0.34);
  border-radius: 14px;
  color: #f0a4a4;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Google Sans', sans-serif;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.preset-cancel-btn:active {
  background: rgba(212, 84, 84, 0.28);
  transform: scale(0.98);
}

/* Method options */
.method-options { padding: 4px 0; }
.method-option { display: block; cursor: pointer; }
.method-option input[type="radio"] { display: none; }
.method-content {
  display: flex; align-items: center; gap: 14px; padding: 13px 16px;
  border-left: 3px solid transparent; transition: border-color 0.15s, background 0.15s;
}
.method-option.selected .method-content {
  border-left-color: #34c759;
  background: rgba(52,199,89,0.10);
}
.method-option.selected .method-icon {
  background: rgba(52,199,89,0.18);
}
.method-option.selected .method-title { color: #34c759; }
.method-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.method-title { font-size: 13px; font-weight: 500; color: #fff; }
.method-desc  { font-size: 12px; color: #666; }
.method-sub {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px 13px 52px; font-size: 14px; color: #aaa;
  background: rgba(52,199,89,0.03); border-left: 3px solid rgba(52,199,89,0.35);
}
.method-sub.hidden { display: none; }

/* Steppers */
.num-stepper { display: flex; align-items: center; gap: 10px; background: #0d0d0d; border-radius: 12px; padding: 4px 8px; }
.stepper-btn { background: #2a2a2a; border: none; color: #34c759; font-size: 22px; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.1s; }
.stepper-btn:active { background: #34c759; color: #000; }
.stepper-val { font-size: 22px; font-weight: 700; color: #34c759; min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; }

/* Toggle */
.toggle-switch { position: relative; width: 52px; height: 30px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider { position: absolute; inset: 0; background: #2a2a2a; border-radius: 30px; cursor: pointer; transition: background 0.22s; }
.toggle-slider::before { content: ''; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; background: #555; border-radius: 50%; transition: transform 0.22s, background 0.22s; box-shadow: 0 2px 6px rgba(0,0,0,0.4); }
.toggle-switch input:checked + .toggle-slider { background: rgba(52,199,89,0.25); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(22px); background: #34c759; }

/* Add Up */
.addUp-detail { padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.addUp-input-row { display: flex; align-items: center; gap: 10px; }
.sum-input { width: 100%; height: 56px; background: #0d0d0d; border: 1.5px solid rgba(255,255,255,0.1); border-radius: 12px; color: #fff; font-size: 30px; font-weight: 700; text-align: center; outline: none; -webkit-appearance: none; font-family: 'Google Sans', sans-serif; transition: border-color 0.15s; }
.sum-input:focus { border-color: #34c759; }
.addUp-hint { font-size: 12px; color: #555; text-align: center; }

/* ── Customize panel ───────────────────────────────────── */
.cust-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 10px; row-gap: 16px; padding: 12px 16px; }
.cust-field { display: flex; flex-direction: column; gap: 5px; }
.cust-field label { font-size: 11px; color: #8a8a8a; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.android-style-title-row { padding-bottom: 4px; }
.android-style-title {
  font-size: 13px;
  color: #fff;
}
.android-style-subtitle-row { padding-top: 2px; padding-bottom: 4px; }
.android-style-subtitle {
  font-size: 12px;
  color: #666;
}
.cust-field input[type="number"], .cust-field input[type="text"] {
  height: 42px; background: #0d0d0d; border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 10px; color: #fff; font-size: 16px; font-weight: 600; text-align: center;
  outline: none; -webkit-appearance: none; width: 100%;
}
.cust-field input[type="color"] {
  height: 42px; border: 1.5px solid rgba(255,255,255,0.1); border-radius: 10px;
  background: #0d0d0d; cursor: pointer; width: 100%; padding: 4px;
}
.cust-field input:focus { border-color: #34c759; }
.cust-stepper-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) 1px repeat(2, minmax(0, 1fr));
  column-gap: 10px;
  align-items: start;
  padding: 0 16px 12px;
}
.cust-stepper-field {
  align-items: center;
}
.cust-stepper-field label {
  text-align: center;
}
.cust-stepper-divider {
  width: 1px;
  height: 74px;
  align-self: center;
  background: rgba(255,255,255,0.08);
}
.cust-save-row { padding: 8px 16px 6px; display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.cust-save-btn {
  width: 100%; height: 46px; background: linear-gradient(135deg, #1a5c2e, #218a3e);
  border: none; border-radius: 12px; color: #4cde80; font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: 'Google Sans', sans-serif;
}
.cust-save-feedback { font-size: 12px; color: #34c759; opacity: 0; transition: opacity 0.3s; text-align: center; line-height: 1.1; min-height: 13px; }

/* Font upload */
.font-upload-row { padding: 8px 16px 14px; }
.font-upload-actions {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.font-upload-label {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer;
  padding: 12px 14px; background: #0d0d0d; border-radius: 12px;
  border: 1.5px dashed rgba(52,199,89,0.35); color: #34c759; font-size: 14px; font-weight: 600;
}
.font-upload-label input { display: none; }
.font-reset-btn {
  flex: 1;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: #202020;
  color: #d8d8d8;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Google Sans', sans-serif;
  cursor: pointer;
  min-height: 50px;
}
.font-reset-btn:active {
  background: #2a2a2a;
}

/* Edit Language */
.lang-trigger-row { padding: 12px 16px 10px; }
.lang-trigger-btn {
  width: 100%; height: 46px; background: #1a1a1a; border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; color: #fff; font-size: 14px; font-weight: 500; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.lang-panel {
  max-height: 0; overflow: hidden; transition: max-height 0.3s ease;
  background: #111; border-radius: 12px; margin: 0 16px;
}
.lang-panel.open { max-height: 680px; }
.lang-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; }
.lang-field { display: flex; flex-direction: column; gap: 4px; }
.lang-field label { font-size: 10px; color: #888; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.lang-field input {
  height: 36px; background: #1a1a1a; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; color: #fff; font-size: 13px; padding: 0 10px; outline: none; width: 100%;
}
.lang-field input:focus { border-color: #34c759; }
.lang-action-row {
  display: flex;
  gap: 8px;
  padding: 0 12px 8px;
}
.lang-alt-btn {
  flex: 1;
  height: 38px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  background: #1a1a1a;
  color: #f2f2f2;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Google Sans', sans-serif;
  cursor: pointer;
}
.lang-alt-btn:active {
  border-color: rgba(52,199,89,0.34);
  color: #34c759;
}
.lang-reset-btn {
  color: #f0aaaa;
  border-color: rgba(210,80,80,0.24);
  background: rgba(210,80,80,0.10);
}
.lang-reset-btn:active {
  border-color: rgba(210,80,80,0.40);
  color: #ffb8b8;
}
.lang-save-row { padding: 8px 12px 12px; }
.lang-save-btn {
  width: 100%; height: 42px; background: #34c759; border: none; border-radius: 10px;
  color: #000; font-size: 14px; font-weight: 700; cursor: pointer;
}

/* Peek Method */
.peek-desc { font-size: 12px; color: #666; padding: 0 16px 12px; line-height: 1.5; }
.peek-delay-row { padding: 12px 16px 16px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.peek-delay-input {
  width: 88px; height: 40px; background: #1a1a1a;
  border: 1.5px solid rgba(255,255,255,0.1); border-radius: 10px;
  color: #fff; font-size: 14px; font-weight: 600; text-align: center;
  outline: none;
}
.peek-delay-input:focus { border-color: #34c759; }

/* Perform button glow */
.perform-btn.ready {
  box-shadow: 0 0 18px rgba(52,199,89,0.45), 0 4px 20px rgba(52,199,89,0.18) !important;
}

/* Offset inputs: allow full negative range */
#cust-btn-x, #cust-btn-y {
  -moz-appearance: textfield;
}
#cust-btn-x::-webkit-inner-spin-button,
#cust-btn-y::-webkit-inner-spin-button { display: none; }

/* API select styling */
#api-mode-select option { background: #1a1a1a; }

/* Offset stepper arrows (replace number inputs) */
.offset-stepper {
  display: flex; flex-direction: column; align-items: center;
  background: #0d0d0d; border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 10px; overflow: hidden; width: 62px;
}
.offset-stepper-val {
  font-size: 18px; font-weight: 700; color: #fff; text-align: center;
  padding: 4px 0; min-width: 40px; font-variant-numeric: tabular-nums;
}
.offset-stepper-btn {
  background: rgba(52,199,89,0.08); border: none; color: #34c759;
  font-size: 16px; width: 100%; height: 26px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.1s; line-height: 1;
}
.offset-stepper-btn:active { background: rgba(52,199,89,0.22); }

@media (max-width: 380px) {
  .cust-stepper-row {
    column-gap: 8px;
  }
  .offset-stepper {
    width: 58px;
  }
  .cust-stepper-field label {
    font-size: 10px;
  }
}

/* API URL input inside card */
.api-url-wrap {
  padding: 0 16px 12px;
  display: flex; gap: 8px; align-items: center;
}
.api-url-input {
  flex: 1; height: 44px; background: #0d0d0d;
  border: 1.5px solid rgba(255,255,255,0.1); border-radius: 10px;
  color: #fff; font-size: 13px; padding: 0 12px; outline: none;
}
.api-url-input:focus { border-color: #34c759; }
.api-paste-btn {
  width: 40px; height: 44px; background: #1a1a1a;
  border: 1.5px solid rgba(255,255,255,0.1); border-radius: 10px;
  color: #888; font-size: 18px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s;
}
.api-paste-btn:active { color: #34c759; border-color: #34c759; }
.api-save-btn {
  height: 44px; padding: 0 16px; background: rgba(52,199,89,0.12);
  border: 1.5px solid rgba(52,199,89,0.3); border-radius: 10px;
  color: #34c759; font-size: 13px; font-weight: 700; cursor: pointer;
  flex-shrink: 0; transition: background 0.15s;
}
.api-save-btn:active { background: rgba(52,199,89,0.25); }
.api-mode-row { padding: 0 16px 14px; display: flex; align-items: center; justify-content: space-between; }
.api-mode-select {
  background: #1a1a1a; border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 10px; color: #fff; font-size: 15px; font-weight: 600;
  padding: 8px 14px; outline: none; cursor: pointer;
}
.api-delay-input {
  width: 88px; height: 40px; background: #1a1a1a;
  border: 1.5px solid rgba(255,255,255,0.1); border-radius: 10px;
  color: #fff; font-size: 14px; font-weight: 600; text-align: center;
  outline: none;
}
.api-delay-input:focus { border-color: #34c759; }
.api-help {
  padding: 0 16px 14px;
  color: #7a7a7a;
  font-size: 12px;
  line-height: 1.45;
}
#api-send-detail .card-divider { display: none; }

/* ── Card Stack select ─────────────────────────────────── */
.stack-select {
  background: #0d0d0d; border: 1.5px solid rgba(255,255,255,0.12);
  color: #fff; font-size: 14px; font-weight: 500;
  padding: 8px 12px; border-radius: 10px; outline: none;
  font-family: 'Google Sans', sans-serif; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  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='%2334c759'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 28px; min-width: 160px;
}
.stack-select option { background: #1a1a1a; color: #fff; }

/* ── Card Picker Screen ─────────────────────────────────── */
#screen-cardpicker {
  background: #0a0a0a;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: calc(env(safe-area-inset-bottom) + 24px);
}
#screen-cardpicker.active {
  display: flex;
}

.cp-container {
  display: flex; flex-direction: column; align-items: center;
  width: 100%; max-width: 420px; padding: 0 14px;
  box-sizing: border-box; gap: 0;
}

/* Display — separated with big gap from values */
.cp-display {
  width: 100%; min-height: 72px;
  background: rgba(255,255,255,0.04); border-radius: 16px;
  border: 1.5px solid rgba(255,255,255,0.10);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 32px;
}

.cp-display-label {
  font-size: 24px; font-weight: 700; color: #4e4e4e;
  font-family: 'Google Sans', sans-serif; letter-spacing: 0.04em;
  transition: color 0.2s, font-size 0.15s;
}
.cp-display-label.has-card { color: #fff; font-size: 28px; }
.cp-display-label.has-full { color: #34c759; font-size: 32px; }

.cp-row { display: flex; gap: 8px; width: 100%; }

/* Value rows group */
.cp-values-group {
  width: 100%; display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 28px;
}

/* Suits row */
.cp-suits-group {
  width: 100%;
  margin-bottom: 20px;
}

/* Cancel row */
.cp-cancel-group {
  width: 100%;
}

.cp-val-btn {
  flex: 1; height: 70px; background: transparent; border: 1.5px solid #333;
  border-radius: 14px; color: #ddd; font-size: 22px; font-weight: 700;
  font-family: 'Google Sans', sans-serif; cursor: pointer;
  transition: border-color 0.12s, color 0.12s, transform 0.08s;
  -webkit-tap-highlight-color: transparent;
}
.cp-val-btn.selected {
  border-color: #34c759; color: #34c759;
  background: rgba(52,199,89,0.08);
}
.cp-val-btn:active { transform: scale(0.93); border-color: #555; }

.cp-suit-btn {
  flex: 1; height: 70px; background: transparent;
  border: 1.5px solid #333;
  border-radius: 14px; font-size: 36px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.12s, background 0.12s, transform 0.08s;
  -webkit-tap-highlight-color: transparent;
  line-height: 1;
}
.cp-suit-btn.selected { background: rgba(255,255,255,0.06); border-color: currentColor; }
.cp-suit-btn:active { transform: scale(0.93); }

.cp-cancel-btn {
  width: 100%; height: 50px; background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 14px; color: #7b7b7b; font-size: 14px; font-weight: 700;
  font-family: 'Google Sans', sans-serif; letter-spacing: 0.1em;
  cursor: pointer; transition: border-color 0.12s, color 0.12s, background 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.cp-cancel-btn:active { border-color: #4a4a4a; color: #9a9a9a; background: rgba(255,255,255,0.08); }

/* Stack top-card hint */
.stack-hint {
  display: flex; justify-content: flex-end;
  font-size: 16px; color: #555; padding: 0 16px 12px;
  font-family: 'Google Sans', sans-serif; letter-spacing: 0.03em; text-align: right;
}

/* ── Alarm Screens ──────────────────────────────────────── */

/* iOS Alarm */
#screen-alarm-ios {
  background: #000; flex-direction: column;
  padding-top: calc(env(safe-area-inset-top) + 0px);
  padding-bottom: calc(env(safe-area-inset-bottom) + 0px);
}
#screen-alarm-ios.active { display: flex; }
.alarm-ios-container { display: flex; flex-direction: column; height: 100%; }
.alarm-ios-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 18px) 20px 14px;
  border-bottom: 0.5px solid rgba(255,255,255,0.10);
}
.alarm-ios-title { font-size: 17px; font-weight: 600; color: #fff; font-family: -apple-system, sans-serif; }
.alarm-ios-add {
  background: none; border: none; color: #F7A01F;
  font-size: 28px; font-weight: 300; cursor: pointer; line-height: 1;
  padding: 0 4px; font-family: -apple-system, sans-serif;
}
.alarm-ios-scroll { flex: 1; overflow-y: auto; padding: 24px 16px 16px; }
.alarm-ios-section-title {
  font-size: 12px; font-weight: 600; color: #888; letter-spacing: 0.08em;
  margin-bottom: 10px; font-family: -apple-system, sans-serif;
}
.alarm-ios-card {
  background: #1c1c1e; border-radius: 14px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; min-height: 12vh;
}
.alarm-ios-card-left { display: flex; flex-direction: column; gap: 4px; }
.alarm-ios-time { font-size: 42px; font-weight: 200; color: #fff; font-family: -apple-system, sans-serif; line-height: 1; }
.alarm-ios-ampm { font-size: 22px; font-weight: 300; }
.alarm-ios-label { font-size: 13px; color: #888; font-family: -apple-system, sans-serif; }
.alarm-ios-toggle { flex-shrink: 0; }
.alarm-ios-back {
  background: none; border: none; color: #F7A01F;
  font-size: 17px; font-weight: 400; cursor: pointer;
  padding: calc(env(safe-area-inset-bottom) + 16px) 20px 20px;
  text-align: left; font-family: -apple-system, sans-serif;
  flex-shrink: 0;
}

/* Android Alarm */
#screen-alarm-android {
  background: #000; flex-direction: column;
}
#screen-alarm-android.active { display: flex; }
.alarm-android-container { display: flex; flex-direction: column; height: 100%; }
.alarm-android-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 20px) 20px 16px;
}
.alarm-android-title { font-size: 22px; font-weight: 500; color: #fff; font-family: 'Google Sans', sans-serif; }
.alarm-android-add {
  background: none; border: none; color: #fff;
  font-size: 28px; font-weight: 300; cursor: pointer; line-height: 1;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.08);
}
.alarm-android-scroll { flex: 1; overflow-y: auto; padding: 8px 16px; }
.alarm-android-card {
  background: #1a1a1a; border-radius: 16px; border: 1px solid rgba(255,255,255,0.07);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; min-height: 12vh; width: 100%;
}
.alarm-android-card-left { display: flex; flex-direction: column; gap: 4px; }
.alarm-android-time { font-size: 44px; font-weight: 200; color: #fff; font-family: 'Google Sans', sans-serif; line-height: 1.1; }
.alarm-android-sublabel { font-size: 13px; color: #888; font-family: 'Google Sans', sans-serif; }
.alarm-android-back {
  background: none; border: none; color: rgba(255,255,255,0.6);
  font-size: 32px; cursor: pointer;
  padding: 16px 20px calc(env(safe-area-inset-bottom) + 16px);
  flex-shrink: 0; line-height: 1;
}
