/*
 * Shared application styles.
 * No external assets, inline-style dependencies, or font downloads.
 */

:root {
  color-scheme: light;
  --editor-bg: #f3f6fa;
  --editor-surface: #ffffff;
  --editor-surface-subtle: #f7f9fc;
  --editor-ink: #13213a;
  --editor-muted: #52627a;
  --editor-border: #d8e0eb;
  --editor-border-strong: #aebbd0;
  --editor-primary: #2457d6;
  --editor-primary-hover: #1747bd;
  --editor-primary-soft: #e8efff;
  --editor-danger: #b4232d;
  --editor-danger-soft: #fff0f1;
  --editor-warning: #8a5300;
  --editor-warning-soft: #fff5d9;
  --editor-success: #126a43;
  --editor-success-soft: #e8f7ef;
  --editor-protected: #6e3bc7;
  --editor-protected-soft: #f1ebff;
  --editor-focus: #004bc3;
  --editor-nav: #101d35;
  --editor-nav-muted: #b8c3d8;
  --editor-shadow: 0 0.75rem 2.5rem rgb(24 42 77 / 0.1);
  --editor-radius-sm: 0.5rem;
  --editor-radius: 0.75rem;
  --editor-radius-lg: 1.125rem;

  --theme-bg: #f4f7fb;
  --theme-bg-gradient: none;
  --theme-overlay: #000000;
  --theme-overlay-opacity: 0;
  --theme-text: #14213d;
  --theme-text-muted: #4a5872;
  --theme-accent: #275ddb;
  --theme-focus: #0b57d0;
  --theme-surface: #ffffff;
  --theme-surface-hover: #f8faff;
  --theme-border: #d9e1ec;
  --theme-font-body: system-ui, -apple-system, "Segoe UI", sans-serif;
  --theme-font-heading: system-ui, -apple-system, "Segoe UI", sans-serif;
  --theme-title-size: clamp(2rem, 6vw, 3.5rem);
  --theme-subtitle-size: clamp(1rem, 2vw, 1.2rem);
  --theme-line-height: 1.5;
  --theme-content-max: 48rem;
  --theme-page-gutter: clamp(1rem, 4vw, 2rem);
  --theme-block-gap: 1rem;
  --theme-tile-gap: 0.875rem;
  --theme-avatar-size: 7rem;
  --theme-avatar-border-width: 0.1875rem;
  --theme-avatar-border: #ffffff;
  --theme-tile-min-height: 3.75rem;
  --theme-tile-padding-x: 1.125rem;
  --theme-tile-padding-y: 0.875rem;
  --theme-tile-radius: 1.125rem;
  --theme-tile-border-width: 0.0625rem;
  --theme-tile-shadow: 0 0.5rem 1.5rem rgb(20 33 61 / 0.1);
  --theme-section-gap: 0.75rem;
  --theme-section-radius: 1rem;
  --theme-section-icon-size: 1.25rem;
  --theme-focus-width: 0.1875rem;
  --theme-focus-offset: 0.1875rem;
  --theme-motion-duration: 180ms;
  --theme-entry-duration: 320ms;
  --theme-hover-lift: -2px;
  --theme-hover-shift: 3px;
  --theme-motion-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --theme-splash-button-bg: #275ddb;
  --theme-splash-button-text: #ffffff;
  --theme-splash-button-radius: 999px;
  --theme-lock-bg: #f4f7fb;
  --theme-lock-surface: #ffffff;
  --theme-lock-text: #14213d;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 20rem;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  color: var(--editor-ink);
  background: var(--editor-bg);
}

img,
picture,
canvas {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

a {
  color: var(--editor-primary);
  text-underline-offset: 0.18em;
}

h1,
h2,
h3,
p {
  margin-block-start: 0;
}

h1,
h2,
h3 {
  line-height: 1.18;
}

hr {
  border: 0;
  border-top: 1px solid var(--editor-border);
  margin: 1.5rem 0;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 10000;
  inset: 0.5rem auto auto 0.5rem;
  padding: 0.75rem 1rem;
  color: #ffffff;
  background: #001f5c;
  border-radius: 0.5rem;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid var(--editor-focus);
  outline-offset: 3px;
}

.eyebrow {
  margin-bottom: 0.25rem;
  color: var(--editor-primary);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-mark,
.system-mark {
  display: inline-grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border-radius: 0.75rem;
  color: #ffffff;
  background: var(--editor-primary);
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.button,
.icon-button,
.file-button {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--editor-radius-sm);
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.button:not(:disabled):active {
  transform: translateY(1px);
}

.button--primary {
  color: #ffffff;
  background: var(--editor-primary);
}

.button--primary:hover {
  background: var(--editor-primary-hover);
}

.button--secondary {
  color: var(--editor-ink);
  background: var(--editor-surface);
  border-color: var(--editor-border-strong);
}

.button--secondary:hover,
.button--quiet:hover {
  background: var(--editor-surface-subtle);
  border-color: var(--editor-primary);
}

.button--quiet,
.button--ghost {
  color: var(--editor-ink);
  background: transparent;
  border-color: transparent;
}

.button--ghost {
  color: #ffffff;
  border-color: rgb(255 255 255 / 0.25);
}

.button--warning {
  color: #4f2d00;
  background: #ffd66b;
}

.button--danger {
  color: #ffffff;
  background: var(--editor-danger);
}

.button--danger-quiet {
  color: var(--editor-danger);
  background: transparent;
}

.button--full {
  width: 100%;
}

.icon-button {
  width: 2.75rem;
  padding: 0;
  color: var(--editor-ink);
  background: var(--editor-surface);
  border-color: var(--editor-border);
}

.button-group,
.form-actions,
.dialog__actions,
.table-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.form-actions,
.dialog__actions {
  justify-content: flex-end;
  margin-top: 1.25rem;
}

.stack-form {
  display: grid;
  gap: 1rem;
}

.form-grid,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.field {
  min-width: 0;
}

.field--wide {
  grid-column: 1 / -1;
}

.field label,
.field-label,
fieldset > legend {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--editor-ink);
  font-weight: 750;
}

.field input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]),
.field select,
.field textarea,
.stack-form input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]),
.stack-form select,
.stack-form textarea,
.filter-bar input,
.filter-bar select {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.65rem 0.75rem;
  color: var(--editor-ink);
  background: #ffffff;
  border: 1px solid var(--editor-border-strong);
  border-radius: var(--editor-radius-sm);
}

textarea {
  resize: vertical;
}

input[aria-invalid="true"],
textarea[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--editor-danger) !important;
  box-shadow: 0 0 0 1px var(--editor-danger);
}

.field-help,
.field-error {
  margin: 0.35rem 0 0;
  color: var(--editor-muted);
  font-size: 0.86rem;
}

.field-error {
  color: var(--editor-danger);
  font-weight: 650;
}

.input-affix {
  display: flex;
  align-items: stretch;
}

.input-affix input {
  min-width: 0;
  border-radius: var(--editor-radius-sm) 0 0 var(--editor-radius-sm) !important;
}

.input-affix span {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.7rem;
  color: var(--editor-muted);
  background: var(--editor-surface-subtle);
  border: 1px solid var(--editor-border-strong);
  border-left: 0;
  border-radius: 0 var(--editor-radius-sm) var(--editor-radius-sm) 0;
}

fieldset {
  min-width: 0;
  padding: 0;
  border: 0;
}

.choice-fieldset,
.setup-fieldset {
  padding: 1rem;
  border: 1px solid var(--editor-border);
  border-radius: var(--editor-radius);
}

.setup-fieldset {
  display: grid;
  gap: 0.75rem;
}

.segmented-control {
  display: inline-flex;
  flex-wrap: wrap;
  padding: 0.2rem;
  background: #eaf0f8;
  border-radius: 0.65rem;
}

.segmented-control label {
  position: relative;
  margin: 0;
}

.segmented-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-control span {
  display: inline-flex;
  min-height: 2.35rem;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.75rem;
  border: 2px solid transparent;
  border-radius: 0.5rem;
  color: var(--editor-muted);
  font-weight: 700;
  cursor: pointer;
}

.segmented-control input:checked + span {
  color: var(--editor-primary);
  background: #ffffff;
  box-shadow: 0 1px 5px rgb(20 40 80 / 0.12);
}

.segmented-control input:focus-visible + span {
  border-color: var(--editor-focus);
}

.segmented-control--compact span {
  min-height: 2rem;
  padding: 0.3rem 0.5rem;
  font-size: 0.78rem;
}

.radio-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.radio-card,
.switch-row,
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
}

.radio-card {
  position: relative;
  padding: 1rem;
  border: 1px solid var(--editor-border-strong);
  border-radius: var(--editor-radius);
  cursor: pointer;
}

.radio-card:has(input:checked) {
  border-color: var(--editor-primary);
  box-shadow: 0 0 0 2px var(--editor-primary-soft);
}

.radio-card:has(input:focus-visible),
.theme-preset-card:has(input:focus-visible),
label.file-button:has(+ input:focus-visible) {
  outline: 3px solid var(--editor-focus);
  outline-offset: 3px;
}

.radio-card strong,
.radio-card small,
.switch-row strong,
.switch-row small,
.check-row strong,
.check-row small {
  display: block;
}

.radio-card small,
.switch-row small,
.check-row small {
  margin-top: 0.2rem;
  color: var(--editor-muted);
  font-weight: 450;
}

.switch-row,
.check-row {
  min-height: 2.75rem;
  padding: 0.75rem;
  border: 1px solid var(--editor-border);
  border-radius: var(--editor-radius);
  cursor: pointer;
}

.switch-row input,
.check-row input {
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
  margin-top: 0.15rem;
  accent-color: var(--editor-primary);
}

.check-row--compact {
  min-height: auto;
  padding: 0.4rem 0;
  border: 0;
}

.color-field > div,
.range-field > div {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.color-field input[type="color"] {
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  padding: 0.15rem;
  border: 1px solid var(--editor-border-strong);
  border-radius: var(--editor-radius-sm);
  background: #ffffff;
}

.range-field input[type="range"] {
  width: 100%;
  min-width: 7rem;
  accent-color: var(--editor-primary);
}

.range-field input[type="number"] {
  width: 5.25rem !important;
  flex: 0 0 auto;
}

.error-summary,
.flash,
.callout,
.persistent-warning,
.job-status {
  padding: 1rem;
  border: 1px solid;
  border-radius: var(--editor-radius);
}

.error-summary {
  margin-bottom: 1rem;
  color: #6f141c;
  background: var(--editor-danger-soft);
  border-color: #e5a2a8;
}

.error-summary__title {
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.error-summary ul {
  margin: 0;
  padding-left: 1.25rem;
}

.error-summary a {
  color: inherit;
}

.flash-stack {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.flash {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  background: var(--editor-surface);
  border-color: var(--editor-border);
}

.flash--success,
.callout--success {
  color: #0a5534;
  background: var(--editor-success-soft);
  border-color: #9bd8ba;
}

.flash--error,
.callout--error {
  color: #6f141c;
  background: var(--editor-danger-soft);
  border-color: #e5a2a8;
}

.flash--warning,
.callout--warning {
  color: #5f3900;
  background: var(--editor-warning-soft);
  border-color: #dfbf72;
}

.flash__text,
.callout {
  margin: 0;
}

/* Authentication and setup */

.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 1rem;
  background:
    radial-gradient(circle at 12% 10%, rgb(36 87 214 / 0.16), transparent 28rem),
    linear-gradient(150deg, #eef3fb, #f8fafc 48%, #edf1f8);
}

.auth-shell {
  width: min(100%, 34rem);
}

.auth-card,
.setup-panel,
.setup-complete {
  padding: clamp(1.25rem, 4vw, 2.25rem);
  background: var(--editor-surface);
  border: 1px solid var(--editor-border);
  border-radius: var(--editor-radius-lg);
  box-shadow: var(--editor-shadow);
}

.auth-card__header {
  margin-bottom: 1.5rem;
}

.auth-card__header .brand-mark {
  margin-bottom: 1.25rem;
}

.auth-card__header h1 {
  margin-bottom: 0.55rem;
  font-size: clamp(1.7rem, 5vw, 2.25rem);
}

.auth-card__header p:last-child,
.setup-panel > p {
  color: var(--editor-muted);
}

.question-fields,
.backup-code-fields {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  background: var(--editor-surface-subtle);
  border: 1px solid var(--editor-border);
  border-radius: var(--editor-radius);
}

.setup-page {
  align-items: start;
}

.setup-shell {
  width: min(100%, 62rem);
  margin: 2rem auto;
}

.setup-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.setup-header h1 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
}

.setup-progress ol {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  padding: 0;
  margin: 0 0 1rem;
  list-style: none;
}

.setup-progress__step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  color: var(--editor-muted);
  background: rgb(255 255 255 / 0.72);
  border: 1px solid var(--editor-border);
  border-radius: var(--editor-radius);
}

.setup-progress__step > span:first-child {
  display: grid;
  width: 1.75rem;
  height: 1.75rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #e7edf7;
  font-size: 0.8rem;
  font-weight: 800;
}

.setup-progress__step--current {
  color: var(--editor-primary);
  border-color: var(--editor-primary);
}

.setup-progress__step--complete > span:first-child {
  color: #ffffff;
  background: var(--editor-success);
}

.totp-setup {
  display: grid;
  grid-template-columns: minmax(12rem, 15rem) 1fr;
  gap: 1.5rem;
  align-items: center;
}

.totp-setup__qr {
  padding: 0.75rem;
  background: #ffffff;
  border: 1px solid var(--editor-border);
  border-radius: var(--editor-radius);
}

.secret-display {
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem;
  background: #eef2f7;
  border-radius: var(--editor-radius-sm);
}

.secret-display code {
  overflow-wrap: anywhere;
  font-size: 1rem;
  font-weight: 750;
}

.setup-complete {
  text-align: center;
}

.confirmation-page {
  width: min(100%, 42rem);
  margin: 1rem auto;
}

.confirmation-consequences {
  padding-left: 1.25rem;
  color: var(--editor-muted);
}

.success-mark {
  display: grid;
  width: 4rem;
  height: 4rem;
  place-items: center;
  margin: 0 auto 1rem;
  color: #ffffff;
  background: var(--editor-success);
  border-radius: 50%;
  font-size: 2rem;
}

/* Public pages */

.public-page {
  position: relative;
  min-height: 100vh;
  color: var(--theme-text);
  background-color: var(--theme-bg);
  background-image: var(--theme-bg-gradient);
  background-position: var(--theme-bg-position, center);
  background-size: var(--theme-bg-size, cover);
  font-family: var(--theme-font-body);
  line-height: var(--theme-line-height);
  isolation: isolate;
}

.public-background {
  position: fixed;
  z-index: -2;
  inset: 0;
  background: inherit;
}

.public-background::after {
  position: absolute;
  inset: 0;
  background: var(--theme-overlay);
  content: "";
  opacity: var(--theme-overlay-opacity);
  pointer-events: none;
}

.profile-shell {
  width: min(100%, calc(var(--theme-content-max) + 2 * var(--theme-page-gutter)));
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(2rem, 7vh, 5rem) var(--theme-page-gutter);
}

.profile-header {
  max-width: 50rem;
  margin: 0 auto clamp(1.75rem, 5vw, 3rem);
  text-align: center;
}

.profile-avatar {
  width: var(--theme-avatar-size);
  height: var(--theme-avatar-size);
  margin: 0 auto 1.15rem;
  object-fit: cover;
  border: var(--theme-avatar-border-width) solid var(--theme-avatar-border);
  border-radius: 50%;
  box-shadow: var(--theme-tile-shadow);
}

.profile-header h1 {
  margin-bottom: 0.55rem;
  font-family: var(--theme-font-heading);
  font-size: var(--theme-title-size);
  overflow-wrap: anywhere;
}

.profile-subtitle {
  margin: 0;
  color: var(--theme-text-muted);
  font-size: var(--theme-subtitle-size);
  overflow-wrap: anywhere;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--theme-tile-gap);
}

.profile-grid--root {
  align-items: start;
}

.profile-link {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: var(--theme-tile-min-height);
  align-items: center;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.9rem;
  overflow: clip;
  padding: var(--theme-tile-padding-y) var(--theme-tile-padding-x);
  color: var(--theme-text);
  background: var(--theme-surface);
  border: var(--theme-tile-border-width) solid var(--theme-border);
  border-radius: var(--theme-tile-radius);
  box-shadow: var(--theme-tile-shadow);
  text-decoration: none;
  transition:
    transform var(--theme-motion-duration) var(--theme-motion-ease),
    box-shadow var(--theme-motion-duration) var(--theme-motion-ease),
    background-color var(--theme-motion-duration) var(--theme-motion-ease);
}

.profile-link:hover {
  background: var(--theme-surface-hover);
  transform: var(--theme-hover-transform, translateY(-2px));
}

.profile-link:focus-visible,
.profile-section__summary:focus-visible {
  outline: var(--theme-focus-width) solid var(--theme-focus);
  outline-offset: var(--theme-focus-offset);
}

.profile-link__content,
.profile-link__title,
.profile-link__description {
  min-width: 0;
}

.profile-link__title {
  display: block;
  font-weight: 780;
  overflow-wrap: anywhere;
}

.profile-link__description {
  display: block;
  margin-top: 0.2rem;
  color: var(--theme-text-muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.profile-link__media {
  overflow: hidden;
  border-radius: max(0px, calc(var(--theme-tile-radius) - 0.4rem));
}

.profile-link__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-link--image-left,
.profile-link--image-right {
  grid-template-columns: 3.5rem minmax(0, 1fr);
}

.profile-link--image-right {
  grid-template-columns: minmax(0, 1fr) 3.5rem;
}

.profile-link--image-right .profile-link__media {
  grid-column: 2;
  grid-row: 1;
}

.profile-link--image-right .profile-link__content {
  grid-column: 1;
  grid-row: 1;
}

.profile-link--image-left .profile-link__media,
.profile-link--image-right .profile-link__media {
  width: 3.5rem;
  height: 3.5rem;
}

.profile-link--image-top,
.profile-link--image-with-text {
  padding: 0;
}

.profile-link--image-top .profile-link__media,
.profile-link--image-with-text .profile-link__media {
  aspect-ratio: 16 / 9;
  border-radius: 0;
}

.profile-link--image-top .profile-link__content,
.profile-link--image-with-text .profile-link__content {
  padding: 0 var(--theme-tile-padding-x) var(--theme-tile-padding-y);
}

.profile-link--image-background {
  min-height: 9rem;
  color: #ffffff;
  background: #111827;
}

.profile-link--image-background .profile-link__media {
  position: absolute;
  z-index: 0;
  inset: 0;
  border-radius: 0;
}

.profile-link--image-background .profile-link__media::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgb(0 0 0 / 0.8));
  content: "";
}

.profile-link--image-background .profile-link__content {
  z-index: 1;
  align-self: end;
}

.profile-link--image-background .profile-link__description {
  color: #f3f4f6;
}

.profile-link--image-only {
  min-height: 8rem;
  padding: 0;
}

.profile-link--image-only .profile-link__media {
  position: absolute;
  inset: 0;
  border-radius: 0;
}

.profile-link--image-only .profile-link__description {
  display: none;
}

.profile-section {
  min-width: 0;
  grid-column: 1 / -1;
  color: var(--theme-text);
  border-radius: var(--theme-section-radius);
}

.profile-section__summary,
.profile-section__header {
  padding: 0.75rem 0.25rem;
}

.profile-section__summary {
  display: flex;
  min-height: 3rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  list-style: none;
  cursor: pointer;
}

.profile-section__summary::-webkit-details-marker {
  display: none;
}

.profile-section__title {
  display: block;
  margin: 0;
  font-family: var(--theme-font-heading);
  font-size: 1.2rem;
  font-weight: 800;
}

.profile-section__subtitle {
  display: block;
  margin: 0.2rem 0 0;
  color: var(--theme-text-muted);
  font-size: 0.92rem;
}

.profile-section__chevron {
  width: 0.75rem;
  height: 0.75rem;
  flex: 0 0 auto;
  border-right: 0.15rem solid currentColor;
  border-bottom: 0.15rem solid currentColor;
  transform: rotate(45deg);
  transition: transform var(--theme-motion-duration) var(--theme-motion-ease);
}

.profile-section[open] .profile-section__chevron {
  transform: rotate(225deg);
}

.profile-section__body {
  padding-top: var(--theme-section-gap);
}

.layout-single .profile-grid--root,
.layout-single .profile-section__body {
  grid-template-columns: minmax(0, 1fr);
}

.layout-single .profile-link--normal {
  width: min(100%, 40rem);
  justify-self: center;
}

.layout-single .profile-link--wide {
  width: min(100%, 52.5rem);
  justify-self: center;
}

.layout-single .profile-link--full {
  width: 100%;
}

.gate-shell,
.splash-shell,
.system-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}

.lock-page {
  color: var(--theme-lock-text);
  background: var(--theme-lock-bg);
}

.gate-card,
.system-card {
  width: min(100%, 29rem);
  padding: clamp(1.25rem, 5vw, 2.25rem);
  text-align: center;
  background: var(--theme-lock-surface);
  border: 1px solid var(--theme-border);
  border-radius: max(1rem, var(--theme-tile-radius));
  box-shadow: var(--theme-tile-shadow);
}

.gate-avatar {
  width: 6rem;
  height: 6rem;
  margin: 0 auto 1rem;
  object-fit: cover;
  border-radius: 50%;
}

.gate-eyebrow,
.system-code {
  margin-bottom: 0.35rem;
  color: var(--theme-text-muted);
  font-weight: 750;
}

.gate-card .stack-form {
  margin-top: 1.25rem;
  text-align: left;
}

.rate-limit {
  color: #7a4200;
  font-weight: 650;
}

.splash-page {
  background: var(--theme-bg);
}

.splash-card {
  width: min(100%, 52rem);
  text-align: center;
}

.splash-media {
  overflow: hidden;
  margin-bottom: 1.25rem;
  border-radius: max(0.75rem, var(--theme-tile-radius));
  box-shadow: var(--theme-tile-shadow);
}

.splash-media img {
  width: 100%;
  max-height: min(70vh, 48rem);
  object-fit: cover;
}

.splash-button {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.5rem;
  color: var(--theme-splash-button-text);
  background: var(--theme-splash-button-bg);
  border: 0;
  border-radius: var(--theme-splash-button-radius);
  font-weight: 800;
}

.splash-button:focus-visible {
  outline: var(--theme-focus-width) solid var(--theme-focus);
  outline-offset: var(--theme-focus-offset);
}

.system-page {
  color: #17243a;
  background:
    radial-gradient(circle at 80% 15%, rgb(36 87 214 / 0.15), transparent 24rem),
    #f4f7fb;
}

.system-card {
  border-color: #d8e0eb;
}

.system-card .system-mark {
  margin-bottom: 1.25rem;
}

/* Editor shell */

.editor-page {
  min-height: 100vh;
  background: var(--editor-bg);
}

.editor-nav {
  position: fixed;
  z-index: 100;
  inset: 0 auto 0 0;
  display: flex;
  width: 15rem;
  flex-direction: column;
  color: #ffffff;
  background: var(--editor-nav);
}

.editor-nav__brand {
  padding: 1.25rem;
}

.editor-nav__brand a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
}

.editor-nav__brand-text {
  white-space: nowrap;
}

.editor-nav__nav {
  flex: 1;
  padding: 0 0.75rem;
}

.editor-nav__nav ul {
  display: grid;
  gap: 0.25rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.editor-nav__link {
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  color: var(--editor-nav-muted);
  border-radius: var(--editor-radius-sm);
  font-weight: 700;
  text-decoration: none;
}

.editor-nav__link:hover,
.editor-nav__link.is-current {
  color: #ffffff;
  background: rgb(255 255 255 / 0.1);
}

.nav-icon {
  display: inline-grid;
  width: 1.5rem;
  place-items: center;
  font-size: 1.1rem;
}

.editor-nav__footer {
  padding: 1rem;
  border-top: 1px solid rgb(255 255 255 / 0.12);
}

.editor-nav__admin {
  color: var(--editor-nav-muted);
  font-size: 0.82rem;
}

.editor-workspace {
  min-width: 0;
  margin-left: 15rem;
}

.editor-topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  min-height: 4.75rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem clamp(1rem, 3vw, 2rem);
  background: rgb(255 255 255 / 0.94);
  border-bottom: 1px solid var(--editor-border);
  backdrop-filter: blur(12px);
}

.editor-topbar__menu {
  display: none;
}

.editor-topbar__titles h1 {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
}

.session-clock {
  margin: 0;
  color: var(--editor-muted);
  font-size: 0.82rem;
}

.session-clock.is-expiring {
  color: var(--editor-danger);
  font-weight: 750;
}

.editor-main {
  width: min(100%, 90rem);
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2rem);
}

.page-actions,
.dashboard-hero,
.section-heading,
.panel-heading,
.profile-editor__header,
.profile-editor__status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.page-actions,
.dashboard-hero {
  margin-bottom: 1.5rem;
}

.page-actions h2,
.dashboard-hero h2,
.section-heading h2,
.panel-heading h2 {
  margin-bottom: 0.4rem;
}

.page-actions p:last-child,
.dashboard-hero p:last-child {
  max-width: 48rem;
  margin-bottom: 0;
  color: var(--editor-muted);
}

.persistent-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  color: #5f3900;
  background: var(--editor-warning-soft);
  border-color: #dfbf72;
}

.persistent-warning--danger {
  color: #6f141c;
  background: var(--editor-danger-soft);
  border-color: #e5a2a8;
}

.persistent-warning h2 {
  margin-bottom: 0.3rem;
  font-size: 1.05rem;
}

.persistent-warning p {
  margin: 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.metric-grid--compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1rem;
}

.metric-card,
.admin-profile-card,
.editor-panel,
.warning-panel,
.security-card {
  background: var(--editor-surface);
  border: 1px solid var(--editor-border);
  border-radius: var(--editor-radius-lg);
  box-shadow: 0 0.3rem 1.2rem rgb(24 42 77 / 0.05);
}

.metric-card {
  display: grid;
  gap: 0.15rem;
  padding: 1rem;
}

.metric-card span,
.metric-card small {
  color: var(--editor-muted);
}

.metric-card strong {
  font-size: 1.6rem;
}

.warning-panel {
  margin-bottom: 1rem;
  padding: 1rem;
}

.warning-panel h2 {
  font-size: 1.1rem;
}

.warning-panel ul {
  display: grid;
  gap: 0.75rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.warning-panel li {
  display: flex;
  gap: 0.75rem;
}

.warning-panel__icon {
  display: grid;
  width: 1.6rem;
  height: 1.6rem;
  flex: 0 0 auto;
  place-items: center;
  color: #4f2d00;
  background: #ffd66b;
  border-radius: 50%;
  font-weight: 900;
}

.warning-panel p {
  margin: 0.15rem 0;
  color: var(--editor-muted);
}

.dashboard-section {
  margin-top: 2rem;
}

.section-heading {
  margin-bottom: 1rem;
}

.profile-card-grid,
.security-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.admin-profile-card,
.security-card {
  padding: 1rem;
}

.admin-profile-card > header,
.security-card > header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.admin-profile-card h3,
.security-card h3 {
  margin: 0;
}

.admin-profile-card footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.admin-profile-card img,
.avatar-placeholder {
  width: 3.5rem;
  height: 3.5rem;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-placeholder {
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--editor-primary);
  font-weight: 850;
}

.profile-url,
.table-subline {
  display: block;
  color: var(--editor-muted);
  font-size: 0.83rem;
  overflow-wrap: anywhere;
}

.status-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.status-badge {
  display: inline-flex;
  min-height: 1.65rem;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.status-badge--primary {
  color: #173d99;
  background: var(--editor-primary-soft);
  border-color: #b7c9fa;
}

.status-badge--success {
  color: #0a5534;
  background: var(--editor-success-soft);
  border-color: #9bd8ba;
}

.status-badge--warning {
  color: #5f3900;
  background: var(--editor-warning-soft);
  border-color: #dfbf72;
}

.status-badge--protected {
  color: #53299a;
  background: var(--editor-protected-soft);
  border-color: #cbb5f5;
}

.status-badge--danger,
.status-badge--error {
  color: #6f141c;
  background: var(--editor-danger-soft);
  border-color: #e5a2a8;
}

.status-badge--neutral {
  color: #42526a;
  background: #eef2f7;
  border-color: #d3dbe7;
}

.profile-card__facts,
.settings-list,
.confirmation-list,
.security-card dl {
  display: grid;
  gap: 0;
  margin: 0.75rem 0 0;
}

.profile-card__facts > div,
.settings-list > div,
.confirmation-list > div,
.security-card dl > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--editor-border);
}

.profile-card__facts dt,
.settings-list dt,
.confirmation-list dt,
.security-card dt {
  color: var(--editor-muted);
}

.profile-card__facts dd,
.settings-list dd,
.confirmation-list dd,
.security-card dd {
  margin: 0;
  text-align: right;
  font-weight: 650;
}

.empty-state {
  padding: clamp(2rem, 6vw, 4rem);
  text-align: center;
  background: var(--editor-surface);
  border: 1px dashed var(--editor-border-strong);
  border-radius: var(--editor-radius-lg);
}

.empty-state__mark {
  display: grid;
  width: 3.5rem;
  height: 3.5rem;
  place-items: center;
  margin: 0 auto 0.75rem;
  color: var(--editor-primary);
  background: var(--editor-primary-soft);
  border-radius: 50%;
  font-size: 1.75rem;
}

.filter-bar {
  display: flex;
  align-items: end;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--editor-surface);
  border: 1px solid var(--editor-border);
  border-radius: var(--editor-radius);
}

.field--compact {
  flex: 1 1 14rem;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  background: var(--editor-surface);
  border: 1px solid var(--editor-border);
  border-radius: var(--editor-radius);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table caption {
  padding: 1rem;
  text-align: left;
  font-size: 1.05rem;
  font-weight: 800;
}

.data-table th,
.data-table td {
  padding: 0.8rem;
  vertical-align: top;
  border-bottom: 1px solid var(--editor-border);
}

.data-table thead th {
  color: var(--editor-muted);
  background: var(--editor-surface-subtle);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.data-table tbody tr:last-child > * {
  border-bottom: 0;
}

.table-actions a {
  font-weight: 650;
}

.danger-link {
  color: var(--editor-danger);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

/* Profile editor */

.profile-editor {
  padding: 1rem clamp(0.75rem, 2vw, 1.5rem) 2rem;
}

.profile-editor__header {
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--editor-surface);
  border: 1px solid var(--editor-border);
  border-radius: var(--editor-radius);
}

.profile-editor__identity {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.profile-editor__identity h2 {
  margin: 0;
  font-size: 1.15rem;
}

.profile-editor__identity p {
  margin: 0;
  color: var(--editor-muted);
  font-size: 0.82rem;
}

.back-link {
  font-weight: 700;
}

.profile-editor__status {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.profile-editor__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.save-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--editor-muted);
  font-size: 0.78rem;
}

.save-indicator__dot {
  width: 0.55rem;
  height: 0.55rem;
  background: var(--editor-success);
  border-radius: 50%;
}

.save-indicator.is-saving .save-indicator__dot {
  background: var(--editor-warning);
  animation: pulse 900ms infinite alternate;
}

.save-indicator.is-error {
  color: var(--editor-danger);
}

.save-indicator.is-error .save-indicator__dot {
  background: var(--editor-danger);
}

.profile-tabs {
  display: flex;
  gap: 0.15rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  padding: 0 0.25rem;
  background: var(--editor-surface);
  border: 1px solid var(--editor-border);
  border-radius: var(--editor-radius);
  scrollbar-width: thin;
}

.profile-tabs a {
  display: inline-flex;
  min-height: 2.9rem;
  align-items: center;
  padding: 0.65rem 0.8rem;
  color: var(--editor-muted);
  border-bottom: 3px solid transparent;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.profile-tabs a[aria-current="page"] {
  color: var(--editor-primary);
  border-bottom-color: var(--editor-primary);
}

.profile-editor__layout {
  display: grid;
  grid-template-columns: minmax(28rem, 34rem) minmax(28rem, 1fr);
  gap: 1rem;
  align-items: start;
}

.profile-editor__form-column {
  display: grid;
  min-width: 0;
  gap: 1rem;
}

.editor-panel {
  padding: clamp(1rem, 2vw, 1.4rem);
}

.panel-heading {
  margin-bottom: 1rem;
}

.settings-group {
  border-top: 1px solid var(--editor-border);
}

.settings-group > summary {
  padding: 1rem 0;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
}

.settings-group > .settings-grid {
  padding-bottom: 1.25rem;
}

.media-field {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.media-field__preview {
  width: 6rem;
  height: 6rem;
  flex: 0 0 auto;
  object-fit: cover;
  background: #e7edf5;
  border: 1px solid var(--editor-border);
}

.media-field__preview--round {
  border-radius: 50%;
}

.media-field__preview--landscape {
  width: 10rem;
  aspect-ratio: 16 / 9;
  height: auto;
  border-radius: var(--editor-radius-sm);
}

.media-field--large {
  align-items: flex-start;
}

.theme-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.theme-preset-card {
  position: relative;
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--editor-border-strong);
  border-radius: var(--editor-radius);
  cursor: pointer;
}

.theme-preset-card:has(input:checked) {
  border-color: var(--editor-primary);
  box-shadow: 0 0 0 2px var(--editor-primary-soft);
}

.theme-preset-card > input {
  position: absolute;
  inset: 0.5rem auto auto 0.5rem;
  width: 1rem;
  height: 1rem;
  accent-color: var(--editor-primary);
}

.theme-preset-card__sample {
  display: grid;
  height: 4rem;
  align-content: center;
  gap: 0.3rem;
  padding: 0.5rem;
  overflow: hidden;
  border-radius: 0.55rem;
}

.theme-preset-card__sample i {
  display: block;
  height: 0.45rem;
  border-radius: 999px;
}

.theme-preset-card strong,
.theme-preset-card small {
  display: block;
}

.theme-preset-card small {
  color: var(--editor-muted);
}

.contrast-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1rem;
  background: var(--editor-surface-subtle);
  border: 1px solid var(--editor-border);
  border-radius: var(--editor-radius);
}

.contrast-panel h3,
.contrast-panel p {
  margin-bottom: 0.2rem;
}

.social-preview {
  max-width: 32rem;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--editor-border);
  border-radius: var(--editor-radius);
}

.social-preview img {
  width: 100%;
  aspect-ratio: 1.91 / 1;
  object-fit: cover;
}

.social-preview div {
  padding: 0.8rem;
}

.social-preview small,
.social-preview strong {
  display: block;
}

.social-preview p {
  margin: 0.25rem 0 0;
  color: var(--editor-muted);
}

.composer-toolbar {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.composer-list {
  display: grid;
  gap: 0.65rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.composer-list--nested {
  min-height: 3.5rem;
  margin: 0 0.75rem 0.75rem 2.75rem;
  padding: 0.65rem;
  background: #f2f5fa;
  border: 1px dashed var(--editor-border-strong);
  border-radius: var(--editor-radius);
}

.composer-item {
  min-width: 0;
}

.composer-card {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.7rem;
  background: #ffffff;
  border: 1px solid var(--editor-border);
  border-radius: var(--editor-radius);
}

.composer-card--section {
  background: #f7f3ff;
  border-color: #d5c5f3;
}

.composer-card__heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.composer-card h3 {
  margin: 0;
  font-size: 0.95rem;
}

.composer-card p {
  margin: 0.15rem 0;
  color: var(--editor-muted);
  font-size: 0.82rem;
}

.item-kind {
  color: var(--editor-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.composer-card__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.15rem;
}

.composer-card__actions .button {
  min-height: 2.35rem;
  padding: 0.4rem 0.5rem;
  font-size: 0.75rem;
}

.drag-handle {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  color: var(--editor-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--editor-radius-sm);
  cursor: grab;
  touch-action: none;
}

.drag-handle:active,
.drag-handle[aria-pressed="true"] {
  cursor: grabbing;
  color: var(--editor-primary);
  background: var(--editor-primary-soft);
}

.composer-item.is-dragging > .composer-card {
  border-color: var(--editor-primary);
  box-shadow: 0 0 0 3px var(--editor-primary-soft), var(--editor-shadow);
}

.composer-list.is-drop-target {
  border-color: var(--editor-primary);
  background: var(--editor-primary-soft);
}

.composer-empty {
  padding: 0.8rem;
  color: var(--editor-muted);
  text-align: center;
  border: 1px dashed var(--editor-border-strong);
  border-radius: var(--editor-radius-sm);
}

.composer-list:has(> .composer-item) > .composer-empty {
  display: none;
}

.draft-preview {
  position: sticky;
  top: 5.75rem;
  min-width: 0;
  height: calc(100vh - 6.75rem);
  overflow: hidden;
  background: #202a3b;
  border: 1px solid #34425b;
  border-radius: var(--editor-radius-lg);
  box-shadow: var(--editor-shadow);
}

.preview-toolbar {
  display: flex;
  min-height: 3.5rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem;
  overflow-x: auto;
  color: #ffffff;
  background: #172134;
  border-bottom: 1px solid #34425b;
}

.preview-toolbar .segmented-control {
  background: #28364d;
}

.preview-toolbar .segmented-control span {
  color: #cfdaed;
}

.preview-toolbar .segmented-control input:checked + span {
  color: #ffffff;
  background: #445676;
}

.preview-toolbar .icon-button {
  flex: 0 0 auto;
  color: #ffffff;
  background: #28364d;
  border-color: #52637f;
}

.preview-stage {
  position: relative;
  height: calc(100% - 3.5rem);
  overflow: auto;
}

.preview-stage iframe {
  position: absolute;
  top: 1.25rem;
  left: 50%;
  display: block;
  background: #ffffff;
  border: 0;
  border-radius: 0.75rem;
  box-shadow: 0 1rem 3rem rgb(0 0 0 / 0.34);
  transform-origin: top center;
}

.preview-stage--mobile iframe {
  width: 390px;
  height: 844px;
  transform: translateX(-50%) scale(0.72);
}

.preview-stage--tablet iframe {
  width: 768px;
  height: 1024px;
  transform: translateX(-50%) scale(0.54);
}

.preview-stage--desktop iframe {
  width: 1440px;
  height: 900px;
  transform: translateX(-50%) scale(0.39);
}

.preview-toggle {
  display: none;
}

.preview-close {
  display: none;
}

/* Dialogs and crop */

.dialog {
  width: min(calc(100% - 2rem), 36rem);
  max-height: calc(100dvh - 2rem);
  padding: 0;
  overflow: auto;
  color: var(--editor-ink);
  background: transparent;
  border: 0;
  border-radius: var(--editor-radius-lg);
  box-shadow: var(--editor-shadow);
}

.dialog::backdrop {
  background: rgb(7 16 34 / 0.66);
  backdrop-filter: blur(2px);
}

.dialog__body {
  position: relative;
  padding: clamp(1rem, 4vw, 1.6rem);
  background: #ffffff;
}

.dialog__body--wide {
  width: min(100%, 50rem);
}

.dialog:has(.dialog__body--wide) {
  width: min(calc(100% - 2rem), 50rem);
}

.dialog__close {
  position: absolute;
  inset: 0.75rem 0.75rem auto auto;
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  color: var(--editor-ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--editor-radius-sm);
  font-size: 1.5rem;
}

.crop-layout {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) minmax(14rem, 0.7fr);
  gap: 1rem;
}

.crop-canvas-shell {
  display: grid;
  min-height: 20rem;
  place-items: center;
  padding: 1rem;
  overflow: auto;
  background:
    linear-gradient(45deg, #dfe5ee 25%, transparent 25%),
    linear-gradient(-45deg, #dfe5ee 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #dfe5ee 75%),
    linear-gradient(-45deg, transparent 75%, #dfe5ee 75%),
    #f6f8fb;
  background-position: 0 0, 0 0.5rem, 0.5rem -0.5rem, -0.5rem 0;
  background-size: 1rem 1rem;
  border-radius: var(--editor-radius);
}

.crop-canvas-shell canvas {
  width: min(100%, 32rem);
  height: auto;
  box-shadow: 0 0.5rem 1.5rem rgb(20 33 61 / 0.25);
}

.crop-controls {
  display: grid;
  align-content: start;
  gap: 1rem;
}

/* Backup, security and statistics */

.job-status {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  background: var(--editor-primary-soft);
  border-color: #b7c9fa;
}

.job-status h2,
.job-status p {
  margin: 0;
}

.spinner {
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  border: 0.22rem solid #b7c9fa;
  border-top-color: var(--editor-primary);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.security-tabs {
  width: fit-content;
}

.security-card__mark {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  place-items: center;
  color: var(--editor-primary);
  background: var(--editor-primary-soft);
  border-radius: 0.75rem;
  font-size: 1.3rem;
}

.chart-shell {
  margin-top: 1rem;
}

.bar-chart {
  display: flex;
  height: 10rem;
  align-items: end;
  gap: 0.25rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--editor-surface-subtle);
  border: 1px solid var(--editor-border);
  border-radius: var(--editor-radius);
}

.bar-chart span {
  min-width: 0.35rem;
  flex: 1;
  background: var(--editor-primary);
  border-radius: 0.2rem 0.2rem 0 0;
}

.bar-chart .bar-0 { height: 0; }
.bar-chart .bar-1 { height: 10%; }
.bar-chart .bar-2 { height: 20%; }
.bar-chart .bar-3 { height: 30%; }
.bar-chart .bar-4 { height: 40%; }
.bar-chart .bar-5 { height: 50%; }
.bar-chart .bar-6 { height: 60%; }
.bar-chart .bar-7 { height: 70%; }
.bar-chart .bar-8 { height: 80%; }
.bar-chart .bar-9 { height: 90%; }
.bar-chart .bar-10 { height: 100%; }

.navigation-scrim {
  position: fixed;
  z-index: 90;
  inset: 0;
  background: rgb(7 16 34 / 0.6);
}

@keyframes pulse {
  to { opacity: 0.35; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (min-width: 40rem) {
  .layout-grid .profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .layout-grid .profile-link--wide,
  .layout-grid .profile-link--full {
    grid-column: 1 / -1;
  }
}

@media (min-width: 64rem) {
  .layout-grid.columns-3 .profile-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .layout-grid.columns-3 .profile-link--wide {
    grid-column: span 2;
  }

  .layout-grid.columns-3 .profile-link--full {
    grid-column: 1 / -1;
  }
}

@media (max-width: 74rem) {
  .editor-nav {
    width: 4.75rem;
  }

  .editor-nav__brand {
    padding: 1rem;
  }

  .editor-nav__brand-text,
  .editor-nav__link span:last-child,
  .editor-nav__footer {
    display: none;
  }

  .editor-nav__link {
    justify-content: center;
    padding-inline: 0;
  }

  .editor-workspace {
    margin-left: 4.75rem;
  }

  .profile-editor__layout {
    grid-template-columns: minmax(26rem, 1fr);
  }

  .draft-preview {
    position: fixed;
    z-index: 80;
    inset: 0 0 0 4.75rem;
    height: auto;
    border-radius: 0;
    transform: translateX(105%);
    transition: transform 180ms ease;
  }

  .draft-preview.is-open {
    transform: translateX(0);
  }

  .preview-toggle {
    display: inline-flex;
  }

  .preview-close {
    display: inline-flex;
  }

  .no-js .draft-preview {
    position: relative;
    inset: auto;
    height: 60rem;
    margin-top: 1rem;
    transform: none;
  }
}

@media (max-width: 52rem) {
  .metric-grid,
  .metric-grid--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-card-grid,
  .security-card-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-actions,
  .dashboard-hero,
  .panel-heading,
  .profile-editor__header,
  .profile-editor__status,
  .persistent-warning {
    align-items: stretch;
    flex-direction: column;
  }

  .responsive-table,
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table th,
  .responsive-table td {
    display: block;
  }

  .responsive-table thead {
    display: none;
  }

  .responsive-table tr {
    padding: 0.75rem;
    border-bottom: 1px solid var(--editor-border);
  }

  .responsive-table tr:last-child {
    border-bottom: 0;
  }

  .responsive-table th,
  .responsive-table td {
    padding: 0.45rem 0;
    border: 0;
  }

  .responsive-table [data-label]::before {
    display: block;
    margin-bottom: 0.1rem;
    color: var(--editor-muted);
    content: attr(data-label);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .form-grid,
  .settings-grid,
  .theme-preset-grid,
  .crop-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .composer-card {
    grid-template-columns: 2.75rem minmax(0, 1fr);
  }

  .composer-card__actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-left: 3.45rem;
  }

  .totp-setup {
    grid-template-columns: minmax(0, 1fr);
  }

  .totp-setup__qr {
    width: min(100%, 16rem);
  }
}

@media (max-width: 44rem) {
  .editor-nav {
    width: min(18rem, calc(100vw - 3rem));
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .editor-nav.is-open {
    transform: translateX(0);
  }

  .editor-nav__brand-text,
  .editor-nav__link span:last-child,
  .editor-nav__footer {
    display: block;
  }

  .editor-nav__link {
    justify-content: flex-start;
    padding-inline: 0.8rem;
  }

  .editor-workspace {
    margin-left: 0;
  }

  .editor-topbar__menu {
    display: inline-flex;
  }

  .editor-topbar {
    min-height: 4rem;
  }

  .session-clock {
    display: none;
  }

  .editor-main,
  .profile-editor {
    padding: 0.75rem;
  }

  .draft-preview {
    inset: 0;
  }

  .preview-stage iframe {
    top: 0.75rem;
  }

  .preview-stage--mobile iframe {
    transform: translateX(-50%) scale(0.78);
  }

  .preview-stage--tablet iframe {
    transform: translateX(-50%) scale(0.42);
  }

  .preview-stage--desktop iframe {
    transform: translateX(-50%) scale(0.23);
  }

  .setup-progress ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .dialog {
    width: 100%;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  .dialog:has(.dialog__body--wide) {
    width: 100%;
  }

  .dialog__body {
    min-height: 100dvh;
  }

  .no-js .editor-nav {
    position: relative;
    width: 100%;
    transform: none;
  }

  .no-js .editor-nav__brand-text,
  .no-js .editor-nav__link span:last-child,
  .no-js .editor-nav__footer {
    display: block;
  }

  .no-js .editor-nav__link {
    justify-content: flex-start;
    padding-inline: 0.8rem;
  }

  .no-js .editor-topbar__menu {
    display: none;
  }

  .no-js .draft-preview {
    inset: auto;
  }
}

@media (max-width: 30rem) {
  .metric-grid,
  .metric-grid--compact,
  .radio-card-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-link--image-left,
  .profile-link--image-right {
    grid-template-columns: 3rem minmax(0, 1fr);
  }

  .profile-link--image-right {
    grid-template-columns: minmax(0, 1fr) 3rem;
  }

  .profile-link--image-left .profile-link__media,
  .profile-link--image-right .profile-link__media {
    width: 3rem;
    height: 3rem;
  }

  .setup-progress__step {
    font-size: 0.8rem;
  }

  .media-field {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .profile-link:hover {
    transform: none;
  }
}

@media (forced-colors: active) {
  .status-badge,
  .button,
  .radio-card,
  .switch-row,
  .check-row,
  .profile-link,
  .editor-panel {
    border: 1px solid CanvasText;
  }

  .save-indicator__dot,
  .warning-panel__icon {
    forced-color-adjust: none;
  }
}

.js .no-js-only {
  display: none !important;
}

.no-js .js-only {
  display: none !important;
}
