/* ================================================================
   Tenant login page  ·  "proof sheet"
   ----------------------------------------------------------------
   Concept: a print proof.  Resayil is the press, the tenant is the job.
   A dark brand panel carries the platform mark (Resayil, always first)
   over a halftone screen and registration mark; the tenant sits below as
   the workspace being signed into, in its own colour.  The form is a
   clean sheet with crop marks at its corners.  The interface stays
   Resayil orange; login_brand.py expands palette + workspace colour into
   the --kx-* tokens injected in <head>.

   Standalone page: this is the only stylesheet besides fonts.css.
   Logical properties throughout, so RTL (Arabic) is a mirror, not a
   second layout.  Mobile first.
   ================================================================ */

/* ---------- 0. Tokens ---------- */
/* Serif wordmark face (only fetched when a tenant opts into wordmark: "serif").
   Noto Serif, SIL OFL 1.1, latin subset, variable weight. */
@font-face {
  font-family: "Noto Serif";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/erpnext_cli/fonts/noto-serif/noto-serif-latin-wght.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122;
}

:root {
  color-scheme: light;
  --kx-font-sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --kx-font-ar: "Cairo", "Segoe UI", Tahoma, system-ui, sans-serif;
  --kx-font-serif: "Noto Serif", Georgia, "Times New Roman", serif;
  --kx-ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* status colours (fixed, contrast checked on the surfaces below) */
  --kx-err-ink: #a3261b;
  --kx-err-bg: #fdeeec;
  --kx-err-line: #e7a59d;
  --kx-ok-ink: #1d6b3b;
  --kx-ok-bg: #eaf6ee;
  --kx-ok-line: #9ccfae;

  /* active theme (light) */
  --c-bg: var(--kx-bg);
  --c-surface: var(--kx-surface);
  --c-field: var(--kx-field);
  --c-ink: var(--kx-ink);
  --c-muted: var(--kx-muted);
  --c-line: var(--kx-line);
  --c-line-strong: var(--kx-line-strong);
  --c-accent: var(--kx-accent);
  --c-on-accent: var(--kx-on-accent);
  --c-accent-ink: var(--kx-accent-ink);
  --c-mark: var(--kx-line-strong);
  --c-shadow: 0 1px 2px rgb(var(--kx-shadow-c, 40 30 10) / 0.05), 0 18px 40px -18px rgb(var(--kx-shadow-c, 40 30 10) / 0.18);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --c-bg: var(--kx-d-bg);
  --c-surface: var(--kx-d-surface);
  --c-field: var(--kx-d-field);
  --c-ink: var(--kx-d-ink);
  --c-muted: var(--kx-d-muted);
  --c-line: var(--kx-d-line);
  --c-line-strong: var(--kx-d-line-strong);
  --c-accent: var(--kx-d-accent);
  --c-on-accent: var(--kx-d-on-accent);
  --c-accent-ink: var(--kx-d-accent-ink);
  --c-mark: var(--kx-d-line-strong);
  --c-shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 22px 48px -20px rgb(0 0 0 / 0.6);

  --kx-err-ink: #ffb4aa;
  --kx-err-bg: #3a1b18;
  --kx-err-line: #7d3b34;
  --kx-ok-ink: #9be0b6;
  --kx-ok-bg: #16301f;
  --kx-ok-line: #2f6b45;
}

/* ---------- 1. Reset, base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body.kx-body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--kx-font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
html[data-lang="ar"] body.kx-body,
html[data-lang="ar"] .kx-root button,
html[data-lang="ar"] .kx-root input { font-family: var(--kx-font-ar); }
.kx-root button, .kx-root input { font-family: inherit; }
.kx-root a { color: inherit; }
.kx-root :where(h1, p) { margin: 0; }
.kx-root [hidden] { display: none !important; }
.kx-root .hide { display: none !important; }

/* only the active language is shown; both are in the DOM so the switch is instant */
html:not([data-lang="en"]) [data-l="en"],
html:not([data-lang="ar"]) [data-l="ar"],
html:not([data-lang="ms"]) [data-l="ms"] { display: none !important; }

.kx-sr, .kx-root .sr-only {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- 2. Shell ---------- */
.kx-root {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  position: relative;
}

/* ---------- 3. Brand panel ---------- */
.kx-brand {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 14px 22px 54px;
  min-height: 128px;
  background: var(--kx-panel);
  color: var(--kx-panel-ink);
}
.kx-brand::before { /* photo, duotoned into the panel colour */
  content: "";
  position: absolute; inset: 0; z-index: -3;
  background-size: cover; background-position: center;
  mix-blend-mode: luminosity; opacity: 0.3;
}
.kx-brand::after { /* soft glow + legibility floor */
  content: "";
  position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--kx-panel-hi) 42%, transparent), transparent 62%),
    linear-gradient(to top, color-mix(in srgb, var(--kx-panel) 92%, transparent), transparent 55%);
}
html[dir="rtl"] .kx-brand::after {
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--kx-panel-hi) 42%, transparent), transparent 62%),
    linear-gradient(to top, color-mix(in srgb, var(--kx-panel) 92%, transparent), transparent 55%);
}
.kx-halftone {
  position: absolute; inset: 0; z-index: -1;
  width: 100%; height: 100%;
  opacity: 0; transition: opacity 1.2s ease;
}
.kx-halftone.is-ready { opacity: 1; }

.kx-reg { display: none; }

/* platform mark: Resayil, always the first thing on the page */
.kx-brand-top { display: flex; align-items: center; min-height: 60px; }
.kx-platform { display: block; }
.kx-platform img { display: block; height: 58px; width: auto; }

/* workspace (tenant) block: desktop only, the chip above the form covers phones */
.kx-workspace { display: none; }
.kx-logo { display: block; max-height: 56px; max-width: 280px; width: auto; height: auto; }

.kx-wordmark {
  position: relative;
  display: inline-block;
  padding-block-end: 12px;
  font-weight: 700;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: -0.015em;
}
.kx-wordmark [lang="ar"] { font-family: var(--kx-font-ar); font-weight: 800; letter-spacing: 0; line-height: 1.3; }
.kx-root[data-wordmark="serif"] .kx-wordmark [lang="en"] {
  font-family: var(--kx-font-serif);
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-size: 0.86em;
}
.kx-wordmark::after { /* workspace rule, in the tenant colour */
  content: "";
  position: absolute; inset-inline: 0; inset-block-end: 0;
  height: 2px;
  background: linear-gradient(to right, var(--kx-ws-on-panel), color-mix(in srgb, var(--kx-ws-on-panel) 0%, transparent));
}
html[dir="rtl"] .kx-wordmark::after {
  background: linear-gradient(to left, var(--kx-ws-on-panel), color-mix(in srgb, var(--kx-ws-on-panel) 0%, transparent));
}

.kx-tagline, .kx-brand-foot { display: none; }

/* workspace chip above the form (all sizes) */
.kx-chip {
  display: inline-flex; align-items: center; gap: 9px;
  margin-block-end: 16px;
  padding-block: 5px; padding-inline: 10px 13px;
  border: 1px solid var(--c-line); border-radius: 999px;
  background: var(--c-field);
  color: var(--c-ink);
  font-size: 13px; font-weight: 600; line-height: 1.4;
}
.kx-chip-dot { flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--kx-ws-sheet); }
:root[data-theme="dark"] .kx-chip-dot { background: var(--kx-ws-sheet-d); }
.kx-chip-name [lang="ar"] { font-family: var(--kx-font-ar); font-weight: 700; }

/* ---------- 4. Controls (language + theme) ---------- */
.kx-controls {
  position: absolute;
  inset-block-start: 14px;
  inset-inline-end: 14px;
  z-index: 5;
  display: flex;
  gap: 8px;
  color: var(--kx-panel-ink);
}
.kx-ctl {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; min-width: 44px; padding: 0 14px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, currentColor 32%, transparent);
  background: color-mix(in srgb, var(--kx-panel) 55%, transparent);
  color: inherit;
  font-size: 13px; font-weight: 600; line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.12s var(--kx-ease);
}
.kx-ctl:hover { background: color-mix(in srgb, currentColor 14%, transparent); }
.kx-ctl:active { transform: scale(0.96); }
.kx-ctl-theme { padding: 0; width: 44px; }
.kx-sun { display: none; }
:root[data-theme="dark"] .kx-sun { display: block; }
:root[data-theme="dark"] .kx-moon { display: none; }

/* ---------- 5. Main + sheet ---------- */
.kx-main {
  position: static; /* so .kx-controls anchors to .kx-root and sits on the brand band */
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 14px 18px;
  margin-block-start: -30px;
}
.kx-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  margin-block: 0 auto;
  padding: 26px 20px 22px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: 20px;
  box-shadow: var(--c-shadow);
}

.kx-view { animation: kx-in 0.5s var(--kx-ease) both; }
.kx-head { margin-block-end: 22px; }
.kx-title {
  font-size: 26px; line-height: 1.18; font-weight: 700; letter-spacing: -0.015em; word-spacing: 0.06em;
  color: var(--c-ink);
  text-wrap: balance;
}
html[data-lang="ar"] .kx-title { letter-spacing: 0; font-weight: 800; line-height: 1.35; }
.kx-sub { margin-block-start: 8px; color: var(--c-muted); font-size: 15px; line-height: 1.5; }

/* ---------- 6. Form ---------- */
.page-card-body { display: grid; gap: 18px; }
.page-card-actions { display: grid; gap: 10px; margin-block-start: 22px; }
.kx-field { display: grid; gap: 7px; }
.kx-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kx-label, .kx-root .form-label {
  font-size: 13px; font-weight: 600; color: var(--c-ink); line-height: 1.3;
}
.kx-root .form-label.sr-only { position: static !important; width: auto; height: auto; margin: 0 0 7px; clip: auto; overflow: visible; white-space: normal; display: block; }

.kx-input, .kx-root .form-control {
  display: block; width: 100%;
  height: 52px; padding: 0 14px;
  font-size: 16px; line-height: 1.2; /* 16px stops iOS zooming into the field */
  color: var(--c-ink);
  background: var(--c-field);
  border: 1.5px solid var(--c-line-strong);
  border-radius: 12px;
  outline: none;
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  appearance: none;
}
.kx-root .form-control::placeholder { color: transparent; }
.kx-root .form-signup .form-control::placeholder { opacity: 0; }
.kx-input:hover, .kx-root .form-control:hover { border-color: var(--c-muted); }
.kx-input:focus, .kx-root .form-control:focus {
  border-color: var(--c-accent-ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-accent-ink) 24%, transparent);
  background: var(--c-surface);
}
.kx-input[aria-invalid="true"], .page-card-body.invalid .kx-input { border-color: var(--kx-err-ink); }
.kx-input:-webkit-autofill, .kx-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--c-ink);
  box-shadow: 0 0 0 1000px var(--c-field) inset;
  caret-color: var(--c-ink);
}
.kx-input[dir], #login_email { text-align: start; }
#login_email, #forgot_email, #login_with_email_link_email { direction: ltr; } /* addresses are always LTR */
html[dir="rtl"] #login_email, html[dir="rtl"] #forgot_email, html[dir="rtl"] #login_with_email_link_email { text-align: right; }

.kx-pw { position: relative; }
.kx-pw .kx-input { padding-inline-end: 84px; }
#login_password { direction: ltr; }
html[dir="rtl"] #login_password { text-align: right; }
.kx-reveal {
  position: absolute; inset-block: 0; inset-inline-end: 0;
  min-width: 72px; padding: 0 16px;
  border: 0; background: none;
  color: var(--c-accent-ink);
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  border-start-end-radius: 12px; border-end-end-radius: 12px;
}
.kx-reveal:hover { text-decoration: underline; text-underline-offset: 3px; }
.kx-reveal:focus-visible { outline: 2px solid var(--c-accent-ink); outline-offset: -4px; }

.kx-link {
  color: var(--c-accent-ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  transition: text-decoration-color 0.15s ease;
}
.kx-link:hover { text-decoration-color: currentColor; }
.kx-link:focus-visible { outline: 2px solid var(--c-accent-ink); outline-offset: 3px; border-radius: 4px; }
.kx-forgot { font-size: 13px; display: inline-flex; align-items: center; min-height: 44px; margin-block: -14px; }

/* buttons */
.kx-btn, .kx-root .btn {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 52px; padding: 0 18px;
  border: 1.5px solid transparent; border-radius: 12px;
  background: var(--c-accent); color: var(--c-on-accent);
  font-size: 16px; font-weight: 700; line-height: 1.2; text-align: center; text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s var(--kx-ease), filter 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.kx-btn:hover, .kx-root .btn:hover { filter: brightness(1.08); }
.kx-btn:active, .kx-root .btn:active { transform: scale(0.985) translateY(1px); }
.kx-btn:focus-visible, .kx-root .btn:focus-visible { outline: 3px solid var(--c-accent-ink); outline-offset: 3px; }
.kx-btn-quiet, .kx-root .btn-default {
  background: transparent; color: var(--c-ink);
  border-color: var(--c-line-strong); font-weight: 600;
}
.kx-btn-quiet:hover, .kx-root .btn-default:hover { filter: none; background: var(--c-field); border-color: var(--c-muted); }
.kx-root .btn-sm { min-height: 52px; }
.kx-root .btn-block { width: 100%; }
.kx-root .mt-3 { margin-block-start: 16px; }
.kx-btn.is-busy { pointer-events: none; filter: saturate(0.85); }
.kx-btn.is-busy::after {
  content: ""; position: absolute; inset-inline: 0; inset-block-end: 0; height: 3px;
  background: currentColor; opacity: 0.55; transform-origin: left center;
  animation: kx-load 1.1s var(--kx-ease) infinite;
}
html[dir="rtl"] .kx-btn.is-busy::after { transform-origin: right center; }
.kx-root .btn img { height: 18px; width: 18px; }

/* "or" divider + alternative sign-in methods */
.kx-alt { display: grid; gap: 10px; margin-block-start: 8px; }
.kx-or { display: flex; align-items: center; gap: 14px; margin: 14px 0 6px; color: var(--c-muted); font-size: 13px; }
.kx-or::before, .kx-or::after { content: ""; flex: 1; height: 1px; background: var(--c-line); }

.kx-switch { margin-block-start: 22px; text-align: center; font-size: 14px; color: var(--c-muted); }
.kx-switch .kx-link, .kx-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.kx-back { margin-block: -10px; }
html[dir="rtl"] .kx-flip { transform: scaleX(-1); }

/* inline messages (replaces Frappe's modal dialogs on this page) */
.kx-alert {
  display: flex; align-items: flex-start; gap: 10px;
  margin-block-end: 18px; padding: 12px 14px;
  border: 1px solid var(--kx-err-line); border-radius: 12px;
  background: var(--kx-err-bg); color: var(--kx-err-ink);
  font-size: 14px; line-height: 1.45; font-weight: 500;
}
.kx-alert .kx-ico { flex: none; margin-block-start: 1px; }
.kx-alert[data-tone="ok"] { border-color: var(--kx-ok-line); background: var(--kx-ok-bg); color: var(--kx-ok-ink); }
.invalid-login { animation: kx-shake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97); }

/* 2FA step, injected by Frappe's login.js */
#twofactor_div .page-card-head { display: none; }
#twofactor_div .text-muted { color: var(--c-muted); font-size: 14px; }
#twofactor_div .form-control { text-align: center; letter-spacing: 0.3em; font-variant-numeric: tabular-nums; direction: ltr; }
#twofactor_div #otp_div { margin-block-end: 14px; }

.kx-noscript {
  margin-block-end: 16px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--kx-err-line); background: var(--kx-err-bg); color: var(--kx-err-ink); font-size: 14px;
}
.kx-foot { padding-block-start: 22px; font-size: 13px; color: var(--c-muted); text-align: center; }
.kx-foot p { max-width: 34ch; margin-inline: auto; text-wrap: balance; line-height: 1.5; }

/* ---------- 7. Views other than sign-in start hidden (login.js toggles them) ---------- */
.for-forgot, .for-signup, .for-login-with-email-link { display: none; }

/* ---------- 8. Motion ---------- */
@keyframes kx-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes kx-load { 0% { transform: scaleX(0.05); } 60% { transform: scaleX(1); opacity: 0.55; } 100% { transform: scaleX(1); opacity: 0.1; } }
@keyframes kx-shake {
  10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); }
}
@keyframes kx-brand-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.kx-brand-top, .kx-tagline, .kx-brand-foot { animation: kx-brand-in 0.7s var(--kx-ease) both; }
.kx-tagline { animation-delay: 0.08s; }
.kx-brand-foot { animation-delay: 0.16s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .kx-btn.is-busy::after { transform: none; opacity: 0.4; }
  .kx-halftone { transition: none; }
}

/* ---------- 9. Desktop: split screen ---------- */
@media (min-width: 900px) {
  .kx-root {
    grid-template-columns: minmax(380px, 5fr) minmax(0, 6fr);
    grid-template-rows: minmax(100vh, auto);
    grid-template-rows: minmax(100dvh, auto);
  }
  .kx-brand {
    padding: clamp(36px, 4.6vw, 72px);
    min-height: 100dvh;
    justify-content: flex-start;
    border-inline-end: 1px solid color-mix(in srgb, var(--kx-panel-ink) 8%, transparent);
  }
  .kx-root[data-has-photo] .kx-brand::before { background-image: var(--kx-photo); }
  .kx-brand-top { min-height: 0; }
  .kx-platform img { height: clamp(124px, 16vh, 156px); }

  .kx-workspace { display: block; margin-block-start: auto; }
  .kx-ws-label {
    display: flex; align-items: center; gap: 12px;
    margin-block-end: 20px;
    color: var(--kx-panel-muted);
    font-size: 12px; font-weight: 700; line-height: 1; letter-spacing: 0.16em; text-transform: uppercase;
  }
  .kx-ws-label::before { content: ""; width: 32px; height: 2px; background: var(--kx-ws-on-panel); }
  html[data-lang="ar"] .kx-ws-label { letter-spacing: 0; text-transform: none; font-size: 13px; }

  .kx-wordmark { font-size: clamp(34px, 3.5vw, 54px); padding-block-end: 16px; }
  .kx-logo { max-height: 68px; max-width: 320px; }
  .kx-tagline {
    display: block;
    margin-block-start: 20px;
    max-width: 26em;
    color: var(--kx-panel-muted);
    font-size: clamp(16px, 1.35vw, 19px); font-weight: 500; line-height: 1.55;
    text-wrap: balance;
  }
  html[data-lang="ar"] .kx-tagline { font-family: var(--kx-font-ar); line-height: 1.8; }

  .kx-brand-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
    margin-block-start: clamp(28px, 4vh, 44px); padding-block-start: 18px;
    border-block-start: 1px solid color-mix(in srgb, var(--kx-panel-ink) 16%, transparent);
    color: var(--kx-panel-muted);
    font-size: 13px; font-weight: 500; letter-spacing: 0.04em;
  }
  html[data-lang="ar"] .kx-brand-foot { letter-spacing: 0; }
  .kx-wedge { display: inline-flex; gap: 3px; flex: none; }
  .kx-wedge i { display: block; width: 14px; height: 14px; background: var(--kx-ws-on-panel); opacity: calc(0.14 + var(--i) * 0.11); }

  .kx-reg {
    display: block; position: absolute; z-index: 1; pointer-events: none;
    inset-block-start: clamp(36px, 4.6vw, 72px); inset-inline-end: clamp(28px, 3.4vw, 56px);
    width: 30px; height: 30px; border-radius: 50%;
    border: 1px solid var(--kx-panel-dot); color: var(--kx-panel-dot); opacity: 0.55;
    background:
      linear-gradient(currentColor, currentColor) center / 1px 46px no-repeat,
      linear-gradient(currentColor, currentColor) center / 46px 1px no-repeat;
  }

  .kx-main {
    position: relative;
    padding: clamp(28px, 4vw, 64px);
    margin-block-start: 0;
    justify-content: center;
  }
  .kx-controls { position: absolute; inset-block-start: 24px; inset-inline-end: 28px; color: var(--c-ink); }
  .kx-ctl { background: transparent; border-color: var(--c-line-strong); }
  .kx-ctl:hover { background: var(--c-field); }
  .kx-sheet { margin-block: auto; padding: 38px 38px 30px; border-radius: 6px; background: var(--c-surface); }
  .kx-sheet::before { /* crop marks */
    content: ""; position: absolute; inset: -16px; pointer-events: none; opacity: 0.9;
    --m: var(--c-mark);
    background:
      linear-gradient(var(--m), var(--m)) 0 16px / 11px 1px no-repeat,
      linear-gradient(var(--m), var(--m)) 16px 0 / 1px 11px no-repeat,
      linear-gradient(var(--m), var(--m)) right 0 top 16px / 11px 1px no-repeat,
      linear-gradient(var(--m), var(--m)) right 16px top 0 / 1px 11px no-repeat,
      linear-gradient(var(--m), var(--m)) left 0 bottom 16px / 11px 1px no-repeat,
      linear-gradient(var(--m), var(--m)) left 16px bottom 0 / 1px 11px no-repeat,
      linear-gradient(var(--m), var(--m)) right 0 bottom 16px / 11px 1px no-repeat,
      linear-gradient(var(--m), var(--m)) right 16px bottom 0 / 1px 11px no-repeat;
  }
  .kx-title { font-size: 30px; }
  .kx-foot { padding-block-start: 28px; }
}

@media (min-width: 600px) and (max-width: 899px) {
  .kx-main { padding-inline: 24px; }
  .kx-sheet { margin-block: auto; padding: 32px 32px 26px; }
  .kx-brand { padding-inline: 32px; }
  .kx-controls { inset-inline-end: 28px; }
}

@media (max-width: 380px) {
  .kx-sheet { padding: 22px 16px 18px; }
  .kx-title { font-size: 23px; }
}

@media (forced-colors: active) {
  .kx-input, .kx-btn, .kx-ctl { border: 1px solid ButtonText; }
  .kx-btn.is-busy::after { background: ButtonText; }
}
