/* ============================================================
   VOIDX PRIVATE OS — POLISH LAYER
   Loaded after base, preferences and page styles. Presentation
   only: no layout contracts, no content, no behaviour.
   ============================================================ */

/* ── Self-hosted typefaces ─────────────────────────────────── */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../../assets/fonts/inter-variable-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("../../assets/fonts/space-grotesk-variable-latin.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../../assets/fonts/jetbrains-mono-variable-latin.woff2") format("woff2");
}

:root {
  --vx-font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --vx-font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --vx-font-mono: "JetBrains Mono", "SF Mono", Monaco, "Cascadia Code", monospace;

  /* Kept above 4.5:1 on every dark surface the private shell uses. */
  --vx-text-secondary: #b3b3be;
  --vx-text-tertiary: #9a9aa6;
  --vx-text-muted: #858592;

  --vx-border-default: rgba(255, 255, 255, 0.085);
  --vx-border-strong: rgba(255, 255, 255, 0.15);
  --vx-accent-hover: #8bc4cc;
  --vx-danger: #d27272;
  --vx-success: #69cf98;
  --vx-warning: #d3b36c;
  --vx-info: #74a3d8;
  --vx-shadow-medium: 0 10px 32px rgba(0, 0, 0, 0.38);
  --vx-shadow-large: 0 24px 70px rgba(0, 0, 0, 0.5);
  --vx-shadow-accent: 0 14px 42px rgba(107, 159, 168, 0.2);
  --vx-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--vx-header-height) + 1rem);
}

body {
  font-family: var(--vx-font-sans);
  letter-spacing: -0.004em;
  background-image:
    radial-gradient(min(900px, 90vw) 540px at 8% -8%, rgba(107, 159, 168, 0.055), transparent 68%),
    radial-gradient(min(780px, 85vw) 620px at 106% 4%, rgba(139, 122, 184, 0.045), transparent 64%);
  background-attachment: fixed;
}

::selection {
  background: rgba(107, 159, 168, 0.28);
  color: #fff;
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  background-clip: content-box;
  border-radius: 999px;
}
* { scrollbar-width: thin; scrollbar-color: var(--vx-border-strong) transparent; }

:focus-visible {
  outline: 2px solid #8bc4cc;
  outline-offset: 3px;
  border-radius: 6px;
}

/* ── Skip link ─────────────────────────────────────────────── */
.vx-skip-link {
  position: fixed;
  top: 0.85rem;
  left: 0.85rem;
  z-index: 10000;
  padding: 0.8rem 1.15rem;
  font-family: var(--vx-font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: #071114;
  background: #8bc4cc;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  transform: translateY(-180%);
  transition: transform 0.22s var(--vx-ease-out);
}
.vx-skip-link:focus {
  transform: translateY(0);
  color: #071114;
}
main[tabindex="-1"]:focus { outline: none; }

/* ── Shell / surfaces ──────────────────────────────────────── */
.vx-shell { position: relative; }

.vx-sidebar {
  background:
    radial-gradient(320px circle at 0% 0%, rgba(107, 159, 168, 0.055), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 34%),
    var(--vx-bg-secondary);
  border-right-color: var(--vx-border-default);
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.vx-sidebar__header {
  border-bottom-color: var(--vx-border-default);
}
.vx-sidebar__logo {
  font-family: var(--vx-font-display);
  font-weight: 700;
  letter-spacing: 0.17em;
}
.vx-sidebar__logo img {
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 8px 24px rgba(0, 0, 0, 0.32);
  transition: transform 0.4s var(--vx-ease-out), box-shadow 0.4s var(--vx-ease-out);
}
.vx-sidebar__logo:hover img {
  transform: rotate(-4deg) scale(1.04);
  box-shadow: 0 0 0 1px rgba(107, 159, 168, 0.32), 0 10px 28px rgba(107, 159, 168, 0.16);
}
.vx-sidebar__tag {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
}

.vx-sidebar__nav { padding-block: 0.9rem; }
.vx-nav-filter {
  background: rgba(255, 255, 255, 0.014);
  border-bottom-color: var(--vx-border-subtle);
  padding: 0.65rem 0.85rem;
}
#vxNavFilter {
  min-height: 36px;
  font-family: var(--vx-font-mono);
  text-transform: none;
  letter-spacing: 0.03em;
  background: rgba(255, 255, 255, 0.025);
  border-color: var(--vx-border-subtle);
  transition: border-color 0.2s ease, box-shadow 0.25s ease, background 0.2s ease;
}
#vxNavFilter:focus {
  border-color: var(--vx-accent);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 0 3px var(--vx-accent-muted);
  outline: none;
}
.vx-nav-group__toggle {
  letter-spacing: 0.12em;
}
.vx-nav-item {
  border-radius: 9px;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.3s var(--vx-ease-out);
}
.vx-nav-item:hover { transform: translateX(2px); }
.vx-nav-item--active {
  background:
    linear-gradient(90deg, rgba(107, 159, 168, 0.16), rgba(107, 159, 168, 0.035));
  color: #a9d3d8;
}
.vx-nav-item--active::before {
  background: linear-gradient(180deg, #a6d5da, var(--vx-accent));
  box-shadow: 0 0 12px rgba(107, 159, 168, 0.45);
  height: 26px;
}
.vx-nav-item__icon { width: 17px; height: 17px; }

.vx-sidebar__footer {
  border-top-color: var(--vx-border-subtle);
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.012));
}

.vx-topbar {
  background: rgba(12, 12, 16, 0.78);
  -webkit-backdrop-filter: blur(16px) saturate(145%);
  backdrop-filter: blur(16px) saturate(145%);
  border-bottom-color: var(--vx-border-subtle);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.16);
  padding-top: env(safe-area-inset-top);
  height: calc(var(--vx-header-height) + env(safe-area-inset-top));
}
.vx-topbar__hamburger,
.vx-topbar__btn { border-color: transparent; }
.vx-topbar__btn:hover,
.vx-topbar__hamburger:hover {
  border-color: var(--vx-border-subtle);
  background: rgba(255, 255, 255, 0.05);
}
.vx-topbar__badge {
  box-shadow: 0 0 0 2px var(--vx-bg-secondary);
  background: #8bc4cc;
}
.vx-breadcrumb__current { letter-spacing: -0.005em; }

.vx-content {
  padding:
    clamp(1rem, 2.2vw, 2rem)
    clamp(1rem, 2.4vw, 2.25rem)
    max(2rem, env(safe-area-inset-bottom));
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: -1px -1px;
  animation: vx-polish-content-in 0.5s var(--vx-ease-out) both;
}
@keyframes vx-polish-content-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.vx-page-head {
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--vx-border-subtle);
  margin-bottom: 0.35rem;
}
.vx-page-head__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
}
.vx-page-head__eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--vx-accent);
  box-shadow: 0 0 8px rgba(107, 159, 168, 0.4);
}
.vx-page-head__title {
  font-family: var(--vx-font-display);
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.035em;
}
.vx-page-head__sub {
  max-width: 68ch;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--vx-text-tertiary);
}

/* ── Cards ────────────────────────────────────────────────── */
.vx-card {
  position: relative;
  border-radius: 14px;
  border-color: var(--vx-border-subtle);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.028), transparent 38%),
    var(--vx-bg-elevated);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
  transition:
    border-color 0.25s ease,
    box-shadow 0.35s var(--vx-ease-out),
    transform 0.35s var(--vx-ease-out);
}
.vx-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
  opacity: 0.55;
  pointer-events: none;
  z-index: 1;
}
.vx-card:hover {
  border-color: var(--vx-border-default);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.24);
}
.vx-card__header {
  padding: 0.95rem 1.15rem;
  border-bottom-color: var(--vx-border-subtle);
  background: rgba(255, 255, 255, 0.012);
}
.vx-card__title {
  font-family: var(--vx-font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.vx-card__body { padding: clamp(1rem, 1.7vw, 1.4rem); }
.vx-card__footer {
  border-top-color: var(--vx-border-subtle);
  background: rgba(0, 0, 0, 0.14);
}

/* ── Buttons ──────────────────────────────────────────────── */
.vx-btn {
  border-radius: 8px;
  font-weight: 600;
  letter-spacing: 0.003em;
  transition:
    transform 0.22s var(--vx-ease-out),
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.25s ease;
}
.vx-btn:hover { transform: translateY(-1px); }
.vx-btn:active { transform: translateY(0) scale(0.994); }
.vx-btn--primary {
  background: linear-gradient(180deg, #8bc2ca 0%, var(--vx-accent) 100%);
  border-color: rgba(255, 255, 255, 0.22);
  color: #071114;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.28) inset,
    0 8px 24px rgba(107, 159, 168, 0.12);
}
.vx-btn--primary:hover {
  background: linear-gradient(180deg, #9bd0d7 0%, #78adb5 100%);
  border-color: rgba(255, 255, 255, 0.3);
  color: #050d0f;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.34) inset,
    0 12px 30px rgba(107, 159, 168, 0.2);
}
.vx-btn--secondary {
  background: rgba(107, 159, 168, 0.1);
  border-color: rgba(107, 159, 168, 0.2);
  color: #a9d3d8;
}
.vx-btn--secondary:hover {
  background: rgba(107, 159, 168, 0.16);
  border-color: rgba(107, 159, 168, 0.3);
  color: #c2e4e8;
}
.vx-btn--ghost { color: var(--vx-text-tertiary); }
.vx-btn--ghost:hover { color: var(--vx-text-primary); }
.vx-btn--sm { border-radius: 6px; }

/* ── Forms ────────────────────────────────────────────────── */
.vx-input, .vx-textarea, .vx-select {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.024);
  border-color: var(--vx-border-default);
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.25s ease;
}
.vx-input:hover, .vx-textarea:hover, .vx-select:hover {
  background: rgba(255, 255, 255, 0.032);
}
.vx-input:focus, .vx-textarea:focus, .vx-select:focus {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--vx-accent);
  box-shadow: 0 0 0 3px var(--vx-accent-muted), 0 0 24px rgba(107, 159, 168, 0.06);
}
.vx-field__label {
  font-family: var(--vx-font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  color: var(--vx-text-tertiary);
}
.vx-toggle { min-height: 34px; }
.vx-toggle__switch { border-color: var(--vx-border-strong); }
.vx-toggle input:focus-visible + .vx-toggle__switch {
  outline: 2px solid #8bc4cc;
  outline-offset: 3px;
}

/* ── Tables ───────────────────────────────────────────────── */
.vx-table th {
  font-family: var(--vx-font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.11em;
  color: var(--vx-text-tertiary);
  background: rgba(255, 255, 255, 0.016);
}
.vx-table tbody tr:hover td { background: rgba(255, 255, 255, 0.024); }
.vx-table-wrap {
  border: 1px solid var(--vx-border-subtle);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.08);
}

/* ── Toasts, menus and modals ─────────────────────────────── */
.vx-toast-wrap {
  top: calc(var(--vx-space-6) + env(safe-area-inset-top));
  right: calc(var(--vx-space-6) + env(safe-area-inset-right));
}
.vx-toast {
  border-radius: 10px;
  background: rgba(20, 20, 26, 0.95);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.46);
}
.vx-user-menu {
  border-radius: 10px;
  background: rgba(17, 17, 22, 0.98);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.5);
}
.vx-user-menu__item { border-radius: 6px; }
.vx-modal {
  border-radius: 14px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.035), transparent 40%),
    var(--vx-bg-elevated);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.62);
}
.vx-modal-backdrop {
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  backdrop-filter: blur(10px) saturate(120%);
}
.vx-modal__header,
.vx-modal__footer { border-color: var(--vx-border-subtle); }
.vx-badge { letter-spacing: 0.1em; }

/* ── Login ────────────────────────────────────────────────── */
body.vx-login-page {
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  /* Center when there is room, but start at the top and scroll when a
     short landscape viewport (or an open keyboard) makes it taller. */
  align-items: flex-start;
  padding:
    max(1.5rem, env(safe-area-inset-top))
    max(1.5rem, env(safe-area-inset-right))
    max(1.5rem, env(safe-area-inset-bottom))
    max(1.5rem, env(safe-area-inset-left));
  background:
    radial-gradient(760px 560px at 50% -10%, rgba(107, 159, 168, 0.11), transparent 65%),
    radial-gradient(620px 520px at 96% 100%, rgba(139, 122, 184, 0.075), transparent 66%),
    var(--vx-bg-primary);
}
body.vx-login-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(107, 159, 168, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(107, 159, 168, 0.055) 1px, transparent 1px);
  background-size: 58px 58px;
  -webkit-mask-image: radial-gradient(ellipse 50% 56% at 50% 42%, #000 0%, transparent 78%);
  mask-image: radial-gradient(ellipse 50% 56% at 50% 42%, #000 0%, transparent 78%);
}
body.vx-login-page::after {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(820px, 130vw);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(107, 159, 168, 0.08);
  box-shadow:
    0 0 0 8rem rgba(107, 159, 168, 0.018),
    0 0 0 17rem rgba(139, 122, 184, 0.012);
  pointer-events: none;
}

.vx-login {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 384px;
  margin-block: auto;
  gap: 1.9rem;
  animation: vx-polish-login-in 0.7s var(--vx-ease-out) both;
}
@keyframes vx-polish-login-in {
  from { opacity: 0; transform: translateY(14px) scale(0.992); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.vx-login__brand { position: relative; }
.vx-login__mark {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 16px 46px rgba(0, 0, 0, 0.45),
    0 0 60px rgba(107, 159, 168, 0.16);
}
.vx-login__logo {
  font-family: var(--vx-font-display);
  font-size: 2rem;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
}
.vx-login__sub {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--vx-text-tertiary);
}
.vx-login__card {
  position: relative;
  border-radius: 16px;
  padding: 1.55rem;
  gap: 1rem;
  overflow: hidden;
  border-color: var(--vx-border-default);
  background:
    radial-gradient(440px circle at 50% 0%, rgba(107, 159, 168, 0.07), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.028), transparent 38%),
    var(--vx-bg-elevated);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
}
.vx-login__card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(107, 159, 168, 0.5), rgba(139, 122, 184, 0.35), transparent);
}
.vx-login__heading {
  font-size: 0.65rem;
  letter-spacing: 0.24em;
  color: var(--vx-text-tertiary);
}
.vx-login__card .vx-field { gap: 0.4rem; }
.vx-login__card .vx-field__label {
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  color: var(--vx-text-tertiary);
}
.vx-login__card .vx-input {
  min-height: 46px;
  padding: 0.72rem 0.85rem;
  font-size: 0.9rem;
  border-radius: 8px;
}
.vx-login__card .vx-btn {
  min-height: 46px;
  margin-top: 0.25rem;
  border-radius: 9px;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.vx-login__error {
  border: 1px solid rgba(210, 114, 114, 0.22);
  border-radius: 6px;
  letter-spacing: 0.06em;
  line-height: 1.5;
  text-transform: none;
}
.vx-login__status {
  color: var(--vx-text-tertiary);
  letter-spacing: 0.12em;
}
.vx-login__status-dot {
  box-shadow: 0 0 0 3px rgba(105, 207, 152, 0.1), 0 0 12px rgba(105, 207, 152, 0.3);
}

/* ── Gate ─────────────────────────────────────────────────── */
body.vx-boot {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(700px 520px at 50% 46%, rgba(107, 159, 168, 0.1), transparent 65%),
    radial-gradient(520px 420px at 74% 72%, rgba(139, 122, 184, 0.08), transparent 68%),
    var(--vx-bg-primary);
}
body.vx-boot::before,
body.vx-boot::after {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  pointer-events: none;
}
body.vx-boot::before {
  width: min(560px, 92vw);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(107, 159, 168, 0.14);
  box-shadow:
    0 0 0 6rem rgba(107, 159, 168, 0.018),
    0 0 0 13rem rgba(139, 122, 184, 0.012);
  animation: vx-gate-ring 12s linear infinite;
}
body.vx-boot::after {
  width: min(360px, 62vw);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 1px dashed rgba(139, 122, 184, 0.16);
  animation: vx-gate-ring 22s linear infinite reverse;
}
@keyframes vx-gate-ring {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
.vx-gate {
  position: relative;
  z-index: 1;
  gap: 0.9rem;
}
.vx-gate img {
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 70px rgba(107, 159, 168, 0.18);
}
.vx-gate__mark {
  font-family: var(--vx-font-display);
  font-size: 2.1rem;
  letter-spacing: 0.36em;
  text-indent: 0.36em;
}
.vx-gate__label {
  font-size: 0.62rem;
  letter-spacing: 0.19em;
  color: var(--vx-text-tertiary);
}
.vx-gate__status {
  margin-top: 1.2rem;
  padding: 0.45rem 0.8rem;
  font-family: var(--vx-font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--vx-text-tertiary);
  border: 1px solid var(--vx-border-subtle);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.018);
}

/* ── Light theme adjustments ──────────────────────────────── */
html[data-theme="light"] body {
  background-image:
    radial-gradient(min(900px, 90vw) 540px at 8% -8%, rgba(74, 125, 134, 0.07), transparent 68%),
    radial-gradient(min(780px, 85vw) 620px at 106% 4%, rgba(110, 95, 155, 0.055), transparent 64%);
}
html[data-theme="light"] .vx-sidebar {
  background:
    radial-gradient(320px circle at 0% 0%, rgba(74, 125, 134, 0.055), transparent 62%),
    var(--vx-bg-secondary);
}
html[data-theme="light"] .vx-topbar { background: rgba(255, 255, 255, 0.8); }
html[data-theme="light"] .vx-content {
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.02) 1px, transparent 1px);
}
html[data-theme="light"] .vx-card,
html[data-theme="light"] .vx-login__card,
html[data-theme="light"] .vx-modal {
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.7), transparent 38%),
    var(--vx-bg-elevated);
}
html[data-theme="light"] .vx-user-menu,
html[data-theme="light"] .vx-toast { background: rgba(255, 255, 255, 0.97); }
html[data-theme="light"] .vx-input,
html[data-theme="light"] .vx-textarea,
html[data-theme="light"] .vx-select { background: rgba(0, 0, 0, 0.018); }
html[data-theme="light"] .vx-input:focus,
html[data-theme="light"] .vx-textarea:focus,
html[data-theme="light"] .vx-select:focus { background: #fff; }
html[data-theme="light"] body.vx-login-page {
  background:
    radial-gradient(760px 560px at 50% -10%, rgba(74, 125, 134, 0.09), transparent 65%),
    radial-gradient(620px 520px at 96% 100%, rgba(110, 95, 155, 0.06), transparent 66%),
    var(--vx-bg-primary);
}
html[data-theme="light"] .vx-skip-link { background: #4a7d86; color: #fff; }

/* ── Responsive refinements ───────────────────────────────── */
@media (max-width: 1100px) {
  .vx-content { padding-inline: clamp(0.9rem, 2.6vw, 1.35rem); }
}
@media (max-width: 768px) {
  .vx-topbar {
    height: calc(58px + env(safe-area-inset-top));
    padding-left: max(0.75rem, env(safe-area-inset-left));
    padding-right: max(0.75rem, env(safe-area-inset-right));
  }
  .vx-topbar__left { gap: 0.625rem; }
  .vx-topbar__hamburger { width: 44px; height: 44px; }
  .vx-sidebar {
    width: min(310px, 88vw);
    box-shadow: 24px 0 70px rgba(0, 0, 0, 0.48);
  }
  .vx-content {
    padding:
      max(0.9rem, env(safe-area-inset-top))
      max(0.85rem, env(safe-area-inset-right))
      max(1.5rem, env(safe-area-inset-bottom))
      max(0.85rem, env(safe-area-inset-left));
    background-size: 56px 56px;
  }
  .vx-page-head__title { font-size: clamp(1.6rem, 7vw, 2rem); }
  .vx-card { border-radius: 12px; }
  .vx-card__header { padding: 0.85rem 1rem; }
  .vx-toast-wrap {
    left: max(0.8rem, env(safe-area-inset-left));
    right: max(0.8rem, env(safe-area-inset-right));
    top: auto;
    bottom: max(0.8rem, env(safe-area-inset-bottom));
  }
  .vx-toast { animation-name: vx-polish-toast-in; }
  body.vx-login-page { padding: max(1.25rem, env(safe-area-inset-top)) 1.15rem max(1.25rem, env(safe-area-inset-bottom)); }
  .vx-login__card { padding: 1.35rem; border-radius: 14px; }
  /* iOS zooms any focused control below 16px. */
  .vx-login__card .vx-input { font-size: 16px; }
}
@keyframes vx-polish-toast-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 430px) {
  .vx-page-head__title { font-size: 1.55rem; }
  .vx-card__body { padding: 1rem; }
  body.vx-login-page::after { box-shadow: 0 0 0 4rem rgba(107, 159, 168, 0.018); }
}
@media (max-height: 620px) and (min-width: 769px) {
  .vx-login { gap: 1rem; }
  .vx-login__mark { width: 52px; height: 52px; border-radius: 13px; }
  .vx-login__logo { font-size: 1.55rem; }
  .vx-login__card { padding: 1.15rem; gap: 0.8rem; }
}

/* ── Preferences ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  body.vx-boot::before,
  body.vx-boot::after,
  .vx-login,
  .vx-content { animation: none !important; }
  .vx-card,
  .vx-btn,
  .vx-nav-item { transition: none; }
}
@media (prefers-contrast: more) {
  :root {
    --vx-text-secondary: #e0e0e6;
    --vx-text-tertiary: #c6c6d0;
    --vx-text-muted: #b2b2be;
    --vx-border-default: rgba(255, 255, 255, 0.2);
    --vx-border-subtle: rgba(255, 255, 255, 0.14);
  }
  .vx-card,
  .vx-login__card,
  .vx-modal,
  .vx-input,
  .vx-textarea,
  .vx-select { border-color: var(--vx-border-default); }
}
@media (prefers-reduced-transparency: reduce) {
  .vx-topbar,
  .vx-user-menu,
  .vx-toast,
  .vx-modal-backdrop {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .vx-topbar { background: var(--vx-bg-secondary); }
  .vx-user-menu { background: var(--vx-bg-elevated); }
  .vx-toast { background: var(--vx-bg-elevated); }
}
@media (forced-colors: active) {
  .vx-skip-link,
  .vx-btn,
  .vx-card,
  .vx-login__card,
  .vx-modal { border: 1px solid CanvasText; }
  body.vx-login-page::before,
  body.vx-login-page::after,
  body.vx-boot::before,
  body.vx-boot::after { display: none; }
}
