/* Recuerdi's own small controls (WED-224), see public/shared/controls.js. Tokens only (accent via --accent*), full
   borders only. The element rules use :where() (no specificity), so every area's own styling of a control wins. */

/* ---------- checkboxes and radios: own box and dot instead of the browser's ---------- */
:where(input[type="checkbox"], input[type="radio"]):not(:where(.switch > input)) {
  -webkit-appearance: none; appearance: none; box-sizing: border-box; flex: none;
  display: inline-grid; place-content: center; width: 20px; height: 20px; margin: 0; vertical-align: -4px;
  border: 1.5px solid var(--rule-strong, #b9b0a0); border-radius: 6px; background: var(--ivory, #fffdf8) center / 14px 14px no-repeat;
  color: var(--accent, #561623); cursor: pointer;
  transition: background-color var(--dur-1, 160ms) ease, border-color var(--dur-1, 160ms) ease, box-shadow var(--dur-1, 160ms) ease;
}
:where(input[type="radio"]):not(:where(.switch > input)) { border-radius: 50%; }
:where(input[type="checkbox"], input[type="radio"]):not(:where(.switch > input)):hover { border-color: var(--ink-3, #8a8273); }
:where(input[type="checkbox"]):not(:where(.switch > input)):checked {
  border-color: var(--accent, #561623); background-color: var(--accent, #561623);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23FBF8F2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
:where(input[type="checkbox"]):not(:where(.switch > input)):indeterminate {
  border-color: var(--accent, #561623); background-color: var(--accent, #561623);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8h8' stroke='%23FBF8F2' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}
:where(input[type="radio"]):not(:where(.switch > input)):checked { border-color: var(--accent, #561623); background-color: var(--accent, #561623); box-shadow: inset 0 0 0 4px var(--ivory, #fffdf8); }
[data-theme="dark"] :where(input[type="checkbox"]):not(:where(.switch > input)):checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%2314130F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
:where(input[type="checkbox"], input[type="radio"]):not(:where(.switch > input)):focus-visible { outline: none; box-shadow: var(--ring, 0 0 0 3px rgba(86, 22, 35, .2)); }
:where(input[type="radio"]):not(:where(.switch > input)):checked:focus-visible { box-shadow: inset 0 0 0 4px var(--ivory, #fffdf8), var(--ring, 0 0 0 3px rgba(86, 22, 35, .2)); }
:where(input[type="checkbox"], input[type="radio"]):not(:where(.switch > input))[aria-invalid="true"] { border-color: var(--danger, #8a3b2e); }
:where(input[type="checkbox"], input[type="radio"]):disabled { opacity: .5; cursor: not-allowed; }

/* ---------- <details>: no browser triangle; every summary carries its own chevron or +/− ---------- */
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::marker { content: ""; }

/* ---------- number fields: − and + instead of the browser's arrows ---------- */
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.rq-num { display: inline-flex; align-items: stretch; max-width: 100%; border: 1px solid var(--rule-strong, #cfc6b6); border-radius: var(--radius-2, 6px); background: var(--ivory, #fffdf8); overflow: hidden; }
.rq-num:focus-within { border-color: var(--accent, #561623); box-shadow: var(--ring, 0 0 0 3px rgba(86, 22, 35, .2)); }
.rq-num .rq-num__in { width: 4.5em; min-width: 0; min-height: 48px; margin: 0; padding: 0 4px; border: 0 !important; border-radius: 0; background: transparent; box-shadow: none !important; outline: none; text-align: center; font: inherit; font-size: var(--step-0, 16px); font-variant-numeric: tabular-nums; color: var(--ink, #1c1a16); }
.rq-num__b { flex: none; width: 44px; border: 0; background: transparent; color: var(--ink-2, #4a453c); font: inherit; font-size: 20px; line-height: 1; cursor: pointer; }
.rq-num__b:hover:not(:disabled) { background: var(--paper-2, #efe8da); color: var(--ink, #1c1a16); }
.rq-num__b:disabled { opacity: .35; cursor: default; }

/* ---------- RqFile: upload area ---------- */
.rq-file { display: grid; gap: 8px; width: 100%; }
.rq-file__zone { position: relative; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 16px; border: 1.5px dashed var(--rule-strong, #cfc6b6); border-radius: var(--radius-3, 14px); background: var(--paper, #f5f0e6); color: var(--ink-2, #4a453c); cursor: pointer; transition: border-color var(--dur-1, 160ms) ease, background-color var(--dur-1, 160ms) ease; }
.rq-file__zone svg { flex: none; color: var(--accent-text, #561623); }
.rq-file__zone:hover, .rq-file.is-over .rq-file__zone { border-color: var(--accent, #561623); background: var(--accent-soft, #f3e6e8); }
.rq-file:focus-within .rq-file__zone { border-color: var(--accent, #561623); box-shadow: var(--ring, 0 0 0 3px rgba(86, 22, 35, .2)); }
.rq-file__t { font-size: var(--step--1, 14px); line-height: 1.4; }
.rq-file__pick { font-weight: 600; color: var(--accent-text, #561623); }
.rq-file .rq-file__native { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; margin: -1px !important; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0 !important; opacity: 0; }
.rq-file__chosen { display: flex; align-items: center; gap: 10px; font-size: var(--step--1, 14px); color: var(--ink-2, #4a453c); }
.rq-file__chosen[hidden] { display: none; }
.rq-file__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rq-file__rm { flex: none; border: 1px solid var(--rule-strong, #cfc6b6); border-radius: var(--radius-pill, 999px); background: transparent; color: var(--ink, #1c1a16); font: inherit; font-size: 13px; padding: 4px 12px; cursor: pointer; }
.rq-file__rm:hover { border-color: var(--ink-3, #8a8273); }
.rq-file__rm:focus-visible { outline: none; box-shadow: var(--ring, 0 0 0 3px rgba(86, 22, 35, .2)); }
.rq-file:has([aria-invalid="true"]) .rq-file__zone { border-color: var(--danger, #8a3b2e); }

/* ---------- RqAudio: own player ---------- */
.rq-audio { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 420px; min-height: 48px; padding: 6px 14px 6px 6px; border: 1px solid var(--rule, #e4ddd0); border-radius: var(--radius-pill, 999px); background: var(--ivory, #fffdf8); color: var(--ink, #1c1a16); }
.rq-audio[hidden] { display: none; }
.rq-audio audio { display: none; }
.rq-audio__play { flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--accent, #561623); color: var(--accent-ink, #fbf8f2); cursor: pointer; }
.rq-audio__play:focus-visible { outline: none; box-shadow: var(--ring, 0 0 0 3px rgba(86, 22, 35, .2)); }
.rq-audio__bar { position: relative; flex: 1; min-width: 60px; height: 6px; border-radius: 3px; background: var(--paper-3, #e4dccb); cursor: pointer; }
.rq-audio__bar:focus-visible { outline: none; box-shadow: var(--ring, 0 0 0 3px rgba(86, 22, 35, .2)); }
.rq-audio__fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 3px; background: var(--accent, #561623); }
.rq-audio__time { flex: none; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink-3, #8a8273); }

/* ---------- own error texts (RqValidate) ---------- */
.rq-err.rq-err { display: block; margin: 6px 0 0; font-family: inherit; font-size: var(--step--1, 14px); font-weight: 400; line-height: 1.4; letter-spacing: normal; text-transform: none; color: var(--danger, #8a3b2e); text-align: left; }
:where(input, textarea, select)[aria-invalid="true"]:not([type="checkbox"]):not([type="radio"]) { border-color: var(--danger, #8a3b2e); }
.rq-sel__btn[aria-invalid="true"] { border-color: var(--danger, #8a3b2e); }

@media (prefers-reduced-motion: reduce) {
  :where(input[type="checkbox"], input[type="radio"]), .rq-file__zone { transition: none; }
}
