/* Shared control states. Native input semantics and existing handlers stay intact. */
/* Activate: one clear action area, compact evidence, optional technical details. */
#panel-redeem .redeem-job { padding: 20px; border-radius: 18px; }
#panel-redeem .redeem-job-header { gap: 16px; align-items: flex-start; }
#panel-redeem .redeem-job-heading { min-width: 0; }
#panel-redeem .redeem-job-title-row { gap: 8px; flex-wrap: wrap; align-items: center; }
#panel-redeem .redeem-job-heading > small { display: block; margin-top: 7px; line-height: 1.6; overflow-wrap: anywhere; }
#panel-redeem .redeem-task-progress {
  margin: 16px 0 0; padding: 16px 0 0; gap: 16px;
  border: 0; border-top: 1px solid var(--border); border-radius: 0; background: transparent;
}
#panel-redeem .redeem-task-progress-head strong { font-size: 16px; line-height: 1.45; }
#panel-redeem .redeem-task-live {
  padding: 14px 16px; border: 0; border-radius: 12px; background: var(--surface2);
}
#panel-redeem .redeem-task-live > .redeem-task-state { display: none; }
#panel-redeem .redeem-task-current { font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
#panel-redeem .redeem-task-progress[data-status="waiting"] .redeem-task-live { display: none; }
#panel-redeem .redeem-task-progress #redeem-answer-form {
  margin: 0; padding: 16px; border: 1px solid rgba(var(--accent-rgb),.5);
  border-radius: 14px; background: var(--surface2);
}
#panel-redeem .redeem-game-review figure { margin: 0; max-width: 320px; }
#panel-redeem .redeem-game-review img { width: 100%; height: 160px; max-height: 160px; object-fit: contain; }
#panel-redeem .redeem-job-proof { align-self: start; }
#panel-redeem .redeem-job-proof img { width: 100%; height: 200px; max-height: 200px; object-fit: contain; object-position: center; }
#panel-redeem .redeem-job-proof figcaption { font-size: 12px; line-height: 1.5; }
#panel-redeem .redeem-event-preview {
  display: block; width: min(100%,320px); min-height: 64px;
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  background: var(--surface2); cursor: zoom-in;
}
#panel-redeem .redeem-event-preview img { display: block; width: 100%; height: 180px; object-fit: contain; }
#panel-redeem .redeem-event-preview[aria-busy="true"]::before { content: 'Загружаем снимок…'; display: block; padding: 16px; color: var(--text2); }
#panel-redeem .redeem-event-preview.is-unavailable::before { content: 'Не удалось загрузить · повторить'; display: block; padding: 16px; color: var(--text2); }
#panel-redeem :is(.redeem-job-details,.redeem-task-updates) { border: 0; border-top: 1px solid var(--border); border-radius: 0; padding: 0; margin-top: 16px; background: transparent; }
#panel-redeem :is(.redeem-job-details,.redeem-task-updates) > summary { min-height: 44px; padding: 12px 0; box-sizing: border-box; font-size: 13px; line-height: 1.5; color: var(--text2); cursor: pointer; }
#panel-redeem .redeem-job-details-body { padding-top: 4px; }
#panel-redeem .redeem-task-result-notice { padding: 14px 16px; border-radius: 12px; font-size: 13px; line-height: 1.6; }
@media (max-width:650px) {
  #panel-redeem .redeem-job { padding: 16px; }
  #panel-redeem .redeem-task-steps { grid-template-columns: repeat(5,minmax(0,1fr)); overflow: visible; gap: 6px; }
  #panel-redeem .redeem-task-step-name { display: none; }
  .layout-transfer #panel-redeem .redeem-task-steps li { grid-template-rows: 26px 5px; }
  #panel-redeem .redeem-task-progress #redeem-answer-form { padding: 14px; }
  #panel-redeem .redeem-job-proof img { height: 160px; max-height: 160px; }
}
.layout-transfer #panel-settings .settings-card,
.layout-transfer #panel-settings .settings-section-description {
  width: 100%;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}
/* Utility surfaces share spacing, typography and semantic status colours. */
#panel-settings .settings-card .auth-btn {
  font-family: inherit;
  font-weight: 600;
  min-height: 42px;
  border-radius: 11px;
  transition: filter .15s ease, border-color .15s ease;
}
#panel-settings button:active { transform: none; }
#panel-settings :is(#btn-debug-open,#btn-reset-template,#push-test-btn,#check-mexc-btn) {
  border: 1px solid var(--border);
  border-radius: 11px !important;
  background: var(--surface2);
  color: var(--text);
  min-height: 36px;
  font-family: inherit;
  font-weight: 600;
}
#panel-settings :is(#prefs-status,#mexc-status,#mail-save-status,#template-save-status) {
  text-align: left !important;
  font-size: 13px !important;
  line-height: 1.5;
  font-weight: 500 !important;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface2);
  overflow-wrap: anywhere;
}
#panel-settings #prefs-status[data-state="error"] { color: var(--red) !important; }
#panel-settings #prefs-status[data-state="success"] { color: var(--green) !important; }
#save-prefs-btn[aria-busy="true"] { display: inline-flex; align-items: center; gap: 8px; }
#save-prefs-btn[aria-busy="true"]::before {
  content: ''; width: 13px; height: 13px; flex: none;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: bloom-control-spin .8s linear infinite;
}
@keyframes bloom-control-spin { to { transform: rotate(360deg); } }
:is(.codes-empty,.payment-list-empty,.home-accounts-empty,.keybuy-empty,
    .payout-history-empty,.redeem-history-empty,.redeem-server-empty,.redeem-search-empty) {
  box-sizing: border-box;
  padding: 24px 16px;
  color: var(--text2);
  font: 400 13px/1.6 var(--font-family,Inter,system-ui,sans-serif);
  text-align: center;
  overflow-wrap: anywhere;
}
:is(.payout-dialog,.home-instruction-dialog,dialog.keybuy-order-dialog) {
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 20px 70px #0004;
}
:is(.payout-dialog-head,.home-instruction-dialog-head) { gap: 12px; align-items: flex-start; }
:is(.payout-dialog-head,.home-instruction-dialog-head) h3 { font-size: 18px; line-height: 1.4; }
:is(.payout-dialog-head,.home-instruction-dialog-head) > button {
  flex: 0 0 36px; width: 36px; height: 36px; min-height: 36px;
  display: grid; place-items: center; padding: 0;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface2); color: var(--text2); font: 400 24px/1 system-ui;
}
.payout-dialog-actions { gap: 10px; flex-wrap: wrap; }
.payout-dialog-actions button { min-height: 42px; border-radius: 11px; font-family: inherit; }
#debug-modal > div { background: var(--surface) !important; border-radius: 18px !important; }
#debug-logs-pre { background: var(--bg) !important; color: var(--text2) !important; font-size: 12px !important; line-height: 1.6; }
#debug-modal button { min-height: 36px; border-radius: 10px !important; font-family: inherit; }
#btn-debug-close { background: var(--surface2) !important; color: var(--text) !important; border: 1px solid var(--border) !important; }
@media (max-width:600px) {
  :is(.payout-dialog,.home-instruction-dialog) { max-width: calc(100vw - 24px); }
  :is(.payout-dialog-head,.home-instruction-dialog-head) > button { flex-basis: 44px; width: 44px; height: 44px; }
}
@media (prefers-reduced-motion:reduce) {
  #save-prefs-btn[aria-busy="true"]::before { animation: none; }
  #panel-settings .settings-card .auth-btn { transition: none; }
}
:root { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }

body input[type="checkbox"]:not(.toggle-switch input),
#panel-redeem .redeem-checkbox input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  margin: 0;
  padding: 0;
  border: 1.5px solid var(--text2);
  border-radius: 6px;
  background: var(--surface2);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 16px;
  vertical-align: middle;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}
body input[type="checkbox"]:not(.toggle-switch input):checked,
#panel-redeem .redeem-checkbox input[type="checkbox"]:checked {
  border-color: var(--accent);
  background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m4 10 4 4 8-8' fill='none' stroke='%23132235' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
body input[type="checkbox"]:not(.toggle-switch input):indeterminate,
#panel-redeem .redeem-checkbox input[type="checkbox"]:indeterminate {
  border-color: var(--accent);
  background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10h10' stroke='%23132235' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E");
}
body input[type="checkbox"]:not(.toggle-switch input):disabled,
#panel-redeem .redeem-checkbox input[type="checkbox"]:disabled {
  opacity: .45;
  cursor: not-allowed;
}
body :is(input,select,textarea,button,a,summary):focus-visible {
  outline: 2px solid var(--accent) !important;
  outline-offset: 3px;
}
.toggle-switch input:focus-visible { outline: none !important; }
.toggle-switch input:focus-visible + .toggle-slider {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.toggle-switch:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.toggle-switch input:disabled + .toggle-slider { cursor: not-allowed; }

#panel-redeem .redeem-game-confirm-option {
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  align-items: flex-start;
  transition: background-color .16s ease, border-color .16s ease;
}
#panel-redeem .redeem-game-confirm-option input { margin-top: 1px; }
#panel-redeem .redeem-game-confirm-option > span {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}
#panel-redeem .redeem-game-confirm-option small {
  display: block;
  margin-top: 4px;
  color: var(--text2);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}
#panel-redeem .redeem-game-confirm-option:has(input:checked) {
  border-color: rgba(var(--accent-rgb), .65);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}
:is(.schedule-evening-toggle,.schedule-paid-toggle,.schedule-attended-toggle) {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  cursor: pointer;
}
body button:not(:disabled):active { opacity: .82; }
body button:disabled { cursor: not-allowed; }
body button[aria-busy="true"] { cursor: progress; }

@media (hover:hover) {
  body input[type="checkbox"]:not(.toggle-switch input):not(:disabled):hover,
  #panel-redeem .redeem-checkbox input[type="checkbox"]:not(:disabled):hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .12);
  }
  #panel-redeem .redeem-game-confirm-option:hover {
    border-color: rgba(var(--accent-rgb), .55);
  }
}
@media (prefers-reduced-motion:reduce) {
  body input[type="checkbox"], #panel-redeem .redeem-game-confirm-option,
  .toggle-slider, .toggle-slider:before { transition: none !important; }
}
@media (forced-colors:active) {
  body input[type="checkbox"]:not(.toggle-switch input),
  #panel-redeem .redeem-checkbox input[type="checkbox"] {
    appearance: auto;
    -webkit-appearance: checkbox;
    background-image: none;
  }
}
