/* EasyUC component language, shared by website and application surfaces.
   Only Aurora/Midnight opt in; native semantics and Classic remain untouched. */
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) {
  --ui-control-height: 42px;
  --ui-control-radius: 12px;
  --ui-panel-radius: 20px;
  --ui-focus: 0 0 0 4px color-mix(in srgb, var(--ui-accent) 16%, transparent);
  --ui-hover-border: color-mix(in srgb, var(--ui-accent) 50%, var(--ui-border));
}
html[data-ui-theme="aurora"] { --ui-input: rgba(255,255,255,.9); --ui-control-shadow: 0 2px 4px rgba(47,30,99,.035); }
html[data-ui-theme="midnight"] { --ui-input: #0f162b; --ui-control-shadow: inset 0 1px 2px rgba(0,0,0,.12); }

/* Primary actions, quiet secondary pills, and unmistakable destructive actions. */
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) :is(.btn, :where(.hb-search button)) {
  min-height: var(--ui-control-height);
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--ui-border);
  border-radius: 999px;
  background: var(--ui-surface-solid);
  color: var(--ui-accent-text);
  font: 500 13px/1.4 var(--ui-font);
  box-shadow: var(--ui-control-shadow);
  text-align: center;
  transition: background-color .16s, border-color .16s, box-shadow .16s, transform .16s;
}
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) :is(.btn, :where(.hb-search button)):hover {
  color: var(--ui-accent-text);
  background: var(--ui-surface-soft);
  border-color: var(--ui-hover-border);
  box-shadow: 0 4px 12px -8px var(--ui-accent);
}
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) :is(.btn, :where(.hb-search button)):active { transform: translateY(1px); }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) :is(.btn--primary, .btn--accent, :where(.hb-search button)) {
  color: var(--ui-on-accent);
  background: var(--ui-primary-gradient);
  border-color: transparent;
  box-shadow: 0 6px 16px -8px var(--ui-accent), inset 0 1px 0 rgba(255,255,255,.16);
}
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) :is(.btn--primary, .btn--accent, :where(.hb-search button)):hover {
  color: var(--ui-on-accent);
  background: var(--ui-primary-gradient);
  border-color: transparent;
  box-shadow: 0 7px 20px -6px var(--ui-accent), inset 0 0 0 999px rgba(0,0,0,.07);
}
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) .btn--danger {
  background: var(--red-soft); color: var(--red);
  border-color: color-mix(in srgb, var(--red) 24%, transparent);
}
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) .btn--danger:hover {
  background: color-mix(in srgb, var(--red) 12%, var(--red-soft)); color: var(--red); border-color: var(--red);
}
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) .btn--ghost { background: transparent; border-color: transparent; box-shadow: none; }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) .btn--ghost:hover { background: var(--ui-surface-soft); border-color: var(--ui-border); }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) .btn--sm { min-height: 34px; padding: 7px 12px; font-size: 11.5px; gap: 6px; }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) .btn--lg { min-height: 48px; padding: 13px 24px; font-size: 14px; }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) .btn:is(:disabled, .is-disabled, [aria-disabled="true"]) { opacity: .48; box-shadow: none; transform: none; }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) .btn-row { gap: 10px; }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) .app-side .btn--ghost { color: #eeeafa !important; }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) .app-side .btn--ghost:hover { background: rgba(192,179,255,.13) !important; }

/* Spacious forms with inset fields; labels stay sentence case and readable. */
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) .form { gap: 22px; }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) .form-row { gap: 20px; }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) .field { gap: 8px; }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) :is(.field > label, .label, .auth-label-row label) { color: var(--ui-heading); font-size: 12px; font-weight: 600; line-height: 1.6; }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) :is(.input, .select, .textarea, :where(.hb-search input), :where(.he-fields input), :where(.he-fields textarea), :where(.he-dialog input)) {
  min-height: var(--ui-control-height);
  padding: 11px 14px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-control-radius);
  background-color: var(--ui-input);
  color: var(--ui-text);
  font-size: 13px;
  line-height: 1.5;
  box-shadow: var(--ui-control-shadow);
  transition: border-color .16s, box-shadow .16s, background-color .16s;
}
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) :is(.input, .select, .textarea, :where(.hb-search input)):hover:not(:disabled):not([readonly]) { border-color: var(--ui-hover-border); }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) :is(.input, .select, .textarea, :where(.hb-search input), :where(.he-fields input), :where(.he-fields textarea)):focus {
  outline: none; border-color: var(--ui-accent); box-shadow: var(--ui-focus); background-color: var(--ui-surface-solid);
}
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) :is(.input, .select, .textarea, :where(.hb-search input)):is(:disabled, [readonly]) { background-color: var(--ui-surface-soft); color: var(--ui-muted); box-shadow: none; }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) :is(.input, .select, .textarea, :where(.hb-search input)):disabled { cursor: not-allowed; opacity: .7; }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) .select { padding-right: 38px; background-position: right 15px center; }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) .select[multiple] { background-image: none; min-height: 126px; padding: 8px; }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) .select[multiple] option { padding: 6px 9px; border-radius: 6px; }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) :is(.input--sm, .select--sm) { min-height: 34px; padding-top: 7px; padding-bottom: 7px; font-size: 12px; }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) .textarea { min-height: 138px; line-height: 1.75; }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) :is(.field--error .input, .field--error .select, .field--error .textarea, [aria-invalid="true"]) { border-color: var(--red); }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) .hint { font-size: 11.5px; line-height: 1.7; color: var(--ui-muted); }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) .form-actions { gap: 10px; padding-top: 18px; border-top: 1px solid var(--ui-border); }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) :is(.input-unit .input, .ops-suffix .input) { border-radius: 12px 0 0 12px; }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) :is(.input-unit__suffix, .ops-suffix span) { border-color: var(--ui-border); border-radius: 0 12px 12px 0; background: var(--ui-surface-soft); display: grid; align-items: center; }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) input[type="file"]::file-selector-button {
  margin: 0 12px 0 0; padding: 8px 13px; border: 1px solid var(--ui-border); border-radius: 999px;
  background: var(--ui-surface-soft); color: var(--ui-accent-text); font: 500 12px var(--ui-font); cursor: pointer;
}

/* Native keyboard/form behaviour with EasyUC's rounded selection controls. */
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) input:is([type="checkbox"], [type="radio"]) {
  appearance: none; -webkit-appearance: none; display: inline-block; vertical-align: middle;
  flex: 0 0 20px; width: 20px; height: 20px; min-height: 20px; padding: 0;
  border: 1.5px solid color-mix(in srgb, var(--ui-accent) 35%, var(--ui-border));
  border-radius: 6px; background-color: var(--ui-input); box-shadow: var(--ui-control-shadow); cursor: pointer;
}
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) input[type="radio"] { border-radius: 50%; }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) input:is([type="checkbox"], [type="radio"]):checked {
  border-color: transparent; background: var(--ui-primary-gradient); box-shadow: 0 3px 8px -3px var(--ui-accent);
}
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) input[type="checkbox"]:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m5 10 3 3 7-7' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"), var(--ui-primary-gradient);
}
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) input[type="checkbox"]:indeterminate {
  border-color: transparent; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10h10' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"), var(--ui-primary-gradient);
}
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) input[type="radio"]:checked { background-image: radial-gradient(circle, #fff 0 3px, transparent 4px), var(--ui-primary-gradient); }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) input:is([type="checkbox"], [type="radio"]):disabled { opacity: .45; cursor: not-allowed; }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) .check { gap: 11px; font-size: 13px; line-height: 1.7; }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) .check input { margin-top: 1px; }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) .radio-cards { gap: 12px; }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) .radio-card {
  gap: 14px; padding: 18px; border-radius: 16px; background: var(--ui-input); border-color: var(--ui-border); font-size: 13px; line-height: 1.6;
}
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) .radio-card:hover { border-color: var(--ui-hover-border); }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) .radio-card:has(input:checked) { border-color: var(--ui-accent); background: var(--ui-surface-soft); box-shadow: 0 0 0 1px var(--ui-accent); }

/* Status is a distinct compact component, not a block of tinted text. */
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) :is(.badge, .security-badge) {
  gap: 6px; padding: 5px 10px; border-radius: 999px; font: 600 10.5px/1.4 var(--ui-font); letter-spacing: .01em;
}
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) .tag { padding: 6px 9px; border: 1px solid var(--ui-border); border-radius: 8px; font-size: 10.5px; }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) :is(.flash, .notice) {
  --notice-color: var(--amber); --notice-bg: var(--amber-soft);
  gap: 12px; padding: 16px 18px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--notice-color) 22%, transparent);
  border-left: 4px solid var(--notice-color); color: var(--notice-color); background: var(--notice-bg);
  font-size: 12.5px; line-height: 1.75;
}
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) .flash--success { --notice-color: var(--green); --notice-bg: var(--green-soft); }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) :is(.flash--error, .dl-security) { --notice-color: var(--red); --notice-bg: var(--red-soft); }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) :is(.flash--info, .notice--info) { --notice-color: var(--teal-ink); --notice-bg: var(--teal-soft); }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) .notice--muted { --notice-color: var(--ui-muted); --notice-bg: var(--ui-surface-soft); border-left-width: 1px; }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) .dl-security .link { color: var(--red); }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) :is(.flash, .notice) > .icon { flex-shrink: 0; width: 19px; height: 19px; margin-top: 1px; }

/* Popovers and dialogs form an elevated, solid layer above the glass panels. */
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) :is(.row-menu__body, .he-dialog) {
  padding: 22px; border: 1px solid var(--ui-border); border-radius: 20px;
  background: var(--ui-surface-solid); color: var(--ui-text);
  box-shadow: var(--ui-shadow), 0 24px 70px -24px rgba(20,14,54,.45);
}
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) .row-menu__body { gap: 18px; top: calc(100% + 10px); width: 330px; max-width: calc(100vw - 32px); }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) .row-menu[open] > summary { color: var(--ui-accent-text); background: var(--ui-surface-soft); border-color: var(--ui-hover-border); }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) .he-dialog { padding: 28px; }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) .he-dialog::backdrop { background: rgba(12,10,30,.55); backdrop-filter: blur(5px); }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) .he-dialog label { display: block; color: var(--ui-heading); font-size: 16px; font-weight: 600; margin-bottom: 18px; }
html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) .he-dialog .he-actions { justify-content: flex-end; border-top: 1px solid var(--ui-border); padding-top: 20px; margin-bottom: 0; }

/* Respect system accessibility settings, including native forced-colour controls. */
@media (max-width: 650px) {
  html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) :is(.input, .select, .textarea, :where(.hb-search input)) { font-size: 16px; }
  html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) .form-actions { align-items: stretch; }
  html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) .form-actions .btn { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) :is(.btn, :where(.hb-search button), .input, .select, .textarea, :where(.hb-search input)) { transition: none; transform: none; }
}
@media (forced-colors: active) {
  html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) input:is([type="checkbox"], [type="radio"]) { appearance: auto; -webkit-appearance: auto; }
  html:is([data-ui-theme="aurora"], [data-ui-theme="midnight"]) body:is(.app, .site) :is(.btn, :where(.hb-search button)) { border-color: ButtonText; }
}
