:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-muted: #eef2f7;
  --text: #172033;
  --muted: #667085;
  --line: #d7dee8;
  --primary: #155eef;
  --primary-hover: #004eeb;
  --success: #12805c;
  --warning: #b54708;
  --danger: #c4320a;
  --coral: #e11d48;
  --shadow: 0 18px 48px rgba(23, 32, 51, 0.1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
html { min-width: 320px; background: var(--bg); }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0;
}
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { width: 20px; height: 20px; stroke-width: 2; flex: 0 0 auto; }

.site-header {
  min-height: 68px;
  padding: 10px clamp(18px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 750; font-size: 20px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; color: #fff; background: var(--primary); border-radius: 8px; }
.site-nav { display: flex; align-items: center; gap: 22px; font-weight: 600; }
.site-nav > a:not(.button) { color: var(--text); }
.inline-form { margin: 0; }

.page-shell { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 48px 0 72px; }
.button {
  min-height: 44px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 700;
  text-align: center;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}
.button:hover { text-decoration: none; transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:disabled { color: #98a2b3; border-color: var(--line); background: #f2f4f7; cursor: default; transform: none; }
.button-primary { color: #fff; background: var(--primary); }
.button-primary:hover { color: #fff; background: var(--primary-hover); }
.button-secondary { color: var(--text); border-color: var(--line); background: var(--surface); }
.button-secondary:hover { color: var(--primary); border-color: #9bb9ff; background: #f8faff; }
.button-danger { color: #fff; border-color: #b42318; background: var(--danger); }
.button-danger:hover { color: #fff; border-color: #912018; background: #a62a0a; }
.button-danger:disabled { color: #98a2b3; border-color: var(--line); background: #f2f4f7; }
.button-quiet { min-height: 38px; padding: 7px 10px; color: var(--muted); background: transparent; }
.button-small { min-height: 38px; padding: 7px 12px; }
.button-full { width: 100%; }
.icon-button {
  width: 42px;
  height: 42px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
}
.icon-button:hover { color: var(--primary); border-color: #9bb9ff; }

.flash-stack { display: grid; gap: 10px; margin-bottom: 24px; }
.flash { min-height: 46px; padding: 11px 14px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.flash-success { color: #086b4c; border-color: #9fdbc6; background: #effaf6; }
.flash-danger { color: #a72a09; border-color: #f8b4a2; background: #fff4f1; }
.flash-warning { color: #8a4700; border-color: #f6ca87; background: #fff8e8; }
.flash-info { color: #175cd3; border-color: #b2ccff; background: #eff4ff; }

.home-page { padding-top: 58px; }
.home-intro { min-height: 520px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr); align-items: center; gap: clamp(40px, 7vw, 96px); }
.home-copy { max-width: 680px; }
.eyebrow { display: block; margin-bottom: 10px; color: var(--primary); font-size: 13px; font-weight: 800; text-transform: uppercase; }
.home-copy h1, .dashboard-header h1 { margin: 0; font-size: clamp(36px, 5vw, 62px); line-height: 1.06; font-weight: 790; }
.home-copy > p { max-width: 620px; margin: 22px 0 28px; color: var(--muted); font-size: 19px; }
.quick-register { max-width: 610px; }
.quick-register > label { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 700; }
.input-action { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.form-note { margin: 10px 0 0 !important; font-size: 14px !important; }
.product-preview { padding: 28px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.preview-person { display: flex; align-items: center; gap: 16px; }
.preview-person strong, .preview-person span { display: block; }
.preview-person strong { font-size: 21px; }
.preview-person span { margin-top: 3px; color: var(--muted); }
.preview-avatar { width: 64px; height: 64px; display: grid; place-items: center; color: var(--primary); border: 1px solid #c8d7ff; border-radius: 8px; background: #edf3ff; }
.preview-avatar svg { width: 34px; height: 34px; }
.product-preview > p { margin: 26px 0; color: #344054; }
.preview-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.preview-actions span { min-height: 46px; padding: 10px; display: flex; align-items: center; justify-content: center; gap: 8px; color: #fff; border-radius: 7px; background: var(--primary); font-weight: 700; }
.preview-actions span:last-child { background: var(--success); }
.home-features { margin-top: 42px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.home-features > div { min-height: 126px; padding: 24px; display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-content: center; }
.home-features > div + div { border-left: 1px solid var(--line); }
.home-features svg { grid-row: 1 / 3; color: var(--primary); }
.home-features strong { font-size: 17px; }
.home-features span { color: var(--muted); font-size: 14px; }

input, textarea, select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--text);
  border: 1px solid #b9c3d1;
  border-radius: 6px;
  outline: none;
  background: var(--surface);
}
textarea { min-height: 120px; resize: vertical; }
select { appearance: auto; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(21, 94, 239, 0.14); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid rgba(21, 94, 239, 0.28); outline-offset: 2px; }
label { color: #344054; font-size: 14px; font-weight: 700; }

.auth-page { min-height: calc(100vh - 69px); display: grid; place-items: center; padding-top: 32px; }
.auth-panel { width: min(440px, 100%); padding: 30px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.auth-icon { width: 48px; height: 48px; display: grid; place-items: center; color: var(--primary); border-radius: 8px; background: #edf3ff; }
.auth-icon-warning { color: var(--danger); background: #fff1ed; }
.auth-panel h1 { margin: 20px 0 8px; font-size: 28px; line-height: 1.2; }
.auth-panel > p { margin: 0 0 24px; color: var(--muted); }
.stack-form { display: grid; gap: 10px; }
.stack-form .button { margin-top: 8px; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.label-row a { font-size: 13px; font-weight: 600; }
.auth-switch { margin: 22px 0 0 !important; text-align: center; font-size: 14px; }
.auth-message { text-align: center; }
.auth-message .auth-icon { margin: 0 auto; }

.dashboard-header { margin-bottom: 34px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.dashboard-header h1 { font-size: 42px; }
.dashboard-header p { margin: 8px 0 0; color: var(--muted); }
.account-tabs { margin: -16px 0 34px; display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.account-tabs a { min-height: 46px; padding: 10px 14px; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); border-bottom: 3px solid transparent; font-weight: 700; }
.account-tabs a:hover { color: var(--primary); text-decoration: none; }
.account-tabs a[aria-current="page"] { color: var(--primary); border-bottom-color: var(--primary); }
.admin-subtabs { margin: -18px 0 30px; padding: 4px; display: inline-flex; gap: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-muted); }
.admin-subtabs a { min-height: 40px; padding: 8px 13px; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); border-radius: 6px; font-size: 14px; font-weight: 750; }
.admin-subtabs a:hover { color: var(--primary); text-decoration: none; }
.admin-subtabs a[aria-current="page"] { color: var(--primary); background: var(--surface); box-shadow: 0 1px 3px rgba(23, 32, 51, 0.1); }
.admin-edit-banner { margin-bottom: 26px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #175cd3; border: 1px solid #b2ccff; border-radius: 8px; background: #eff4ff; }
.admin-edit-banner > span { display: flex; align-items: center; gap: 10px; }
.admin-edit-banner .button { flex: 0 0 auto; }
.dashboard-layout { display: grid; grid-template-columns: minmax(0, 1fr) 410px; gap: 32px; align-items: start; }
.profile-editor { min-width: 0; display: grid; gap: 22px; }
.editor-section { padding: 26px 0 30px; border-top: 1px solid var(--line); }
.editor-section:first-child { border-top: 0; padding-top: 0; }
.section-heading { margin-bottom: 22px; display: flex; align-items: flex-start; gap: 12px; }
.section-heading > svg { margin-top: 2px; color: var(--primary); }
.section-heading h2, .tool-heading h2 { margin: 0; font-size: 21px; }
.section-heading p, .tool-heading p { margin: 3px 0 0; color: var(--muted); font-size: 14px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { min-width: 0; display: grid; gap: 7px; }
.field-wide { grid-column: 1 / -1; }
.field-note { color: var(--muted); font-size: 12px; line-height: 1.4; }
.counter { justify-self: end; color: var(--muted); font-size: 12px; }
.rich-editor-shell { overflow: hidden; border: 1px solid #b9c3d1; border-radius: 6px; background: var(--surface); }
.rich-editor-shell:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(21, 94, 239, 0.14); }
.rich-toolbar { min-height: 44px; padding: 5px 7px; display: flex; flex-wrap: wrap; align-items: center; gap: 3px; border-bottom: 1px solid var(--line); background: var(--surface-muted); }
.rich-toolbar button { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; color: var(--text); border: 1px solid transparent; border-radius: 6px; background: transparent; cursor: pointer; }
.rich-toolbar button:hover { color: var(--primary); border-color: #b2ccff; background: #fff; }
.rich-toolbar button svg { width: 18px; height: 18px; }
.rich-color-tool { width: 34px; height: 34px; position: relative; display: grid; place-items: center; color: var(--text); border: 1px solid transparent; border-radius: 6px; cursor: pointer; }
.rich-color-tool:hover, .rich-color-tool:focus-within { color: var(--primary); border-color: #b2ccff; background: #fff; }
.rich-color-tool > svg { width: 18px; height: 18px; pointer-events: none; }
.rich-color-tool input { width: 100%; height: 100%; position: absolute; inset: 0; padding: 0; opacity: 0; cursor: pointer; }
.rich-select-tool select { width: auto; min-width: 112px; min-height: 34px; padding: 4px 28px 4px 8px; border-color: transparent; background-color: transparent; box-shadow: none; font-size: 12px; }
.rich-select-tool select:hover, .rich-select-tool select:focus { border-color: #b2ccff; background-color: #fff; }
.rich-size-tool select { min-width: 62px; }
.toolbar-separator { width: 1px; height: 24px; margin: 0 4px; background: var(--line); }
.rich-editor { min-height: 150px; max-height: 360px; padding: 13px; overflow-y: auto; outline: none; white-space: pre-wrap; overflow-wrap: anywhere; }
.rich-editor:empty::before { color: #98a2b3; content: attr(data-placeholder); pointer-events: none; }
.rich-editor p, .rich-editor div { margin: 0 0 10px; }
.rich-editor p:last-child, .rich-editor div:last-child { margin-bottom: 0; }
.rich-editor ul, .rich-editor ol { margin: 8px 0; padding-left: 24px; }
.rich-editor a { text-decoration: underline; }
.rich-editor [data-about-font="serif"], .card-about [data-about-font="serif"] { font-family: Georgia, "Times New Roman", serif; }
.rich-editor [data-about-font="mono"], .card-about [data-about-font="mono"] { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.rich-editor [data-about-font^="asset:"], .card-about [data-about-font^="asset:"] { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.rich-editor [data-about-size="small"], .card-about [data-about-size="small"] { font-size: 14px; }
.rich-editor [data-about-size="normal"], .card-about [data-about-size="normal"] { font-size: 16px; }
.rich-editor [data-about-size="large"], .card-about [data-about-size="large"] { font-size: 20px; }
.rich-editor [data-about-size="xlarge"], .card-about [data-about-size="xlarge"] { font-size: 24px; }
.rich-editor [data-about-align="left"], .card-about [data-about-align="left"] { text-align: left; }
.rich-editor [data-about-align="center"], .card-about [data-about-align="center"] { text-align: center; }
.rich-editor [data-about-align="right"], .card-about [data-about-align="right"] { text-align: right; }
.rich-editor [data-about-align="justify"], .card-about [data-about-align="justify"] { text-align: justify; }
.avatar-field { margin-bottom: 22px; display: flex; align-items: center; gap: 18px; }
.avatar-preview { width: 88px; height: 88px; display: grid; place-items: center; overflow: hidden; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; background: var(--surface-muted); }
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-preview svg { width: 38px; height: 38px; }
.avatar-field p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.theme-control { display: grid; grid-template-columns: repeat(3, minmax(0, 180px)); gap: 10px; }
.theme-control input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.theme-control span { min-height: 48px; padding: 10px 14px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); cursor: pointer; }
.theme-control input:checked + span { color: var(--primary); border-color: var(--primary); background: #edf3ff; box-shadow: 0 0 0 2px rgba(21, 94, 239, 0.12); }
.custom-theme-panel { margin-top: 18px; padding: 22px; display: grid; gap: 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.appearance-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.appearance-group legend { margin-bottom: 9px; padding: 0; color: #344054; font-size: 14px; font-weight: 750; }
.appearance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.segmented-control { display: grid; grid-template-columns: repeat(2, minmax(0, 180px)); gap: 8px; }
.segmented-control-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.segmented-control input, .background-option > input[type="radio"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.segmented-control span { min-height: 44px; padding: 9px 12px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-muted); cursor: pointer; font-size: 14px; font-weight: 700; }
.segmented-control input:checked + span { color: var(--primary); border-color: var(--primary); background: #edf3ff; box-shadow: 0 0 0 2px rgba(21, 94, 239, 0.1); }
.segmented-control input:focus-visible + span, .theme-control input:focus-visible + span, .background-option > input:focus-visible ~ .background-thumb { outline: 3px solid rgba(21, 94, 239, 0.24); outline-offset: 2px; }
.color-field { min-height: 46px; padding: 6px 10px; display: flex; align-items: center; gap: 10px; border: 1px solid #b9c3d1; border-radius: 6px; background: var(--surface); }
.color-field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(21, 94, 239, 0.14); }
.color-field input[type="color"] { width: 40px; min-height: 32px; padding: 0; border: 0; border-radius: 5px; box-shadow: none; cursor: pointer; }
.color-field output { color: var(--muted); font-family: "SFMono-Regular", Consolas, monospace; font-size: 13px; }
.field-help { margin: -3px 0 12px; color: var(--muted); font-size: 13px; }
.background-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.background-option { min-width: 0; position: relative; display: grid; align-content: start; gap: 7px; color: var(--text); cursor: pointer; }
.background-option-wrap { min-width: 0; position: relative; }
.background-option-wrap > .background-option { height: 100%; }
.background-delete-button { width: 34px; height: 34px; position: absolute; top: 7px; right: 7px; z-index: 5; display: grid; place-items: center; color: #fff; border: 1px solid rgba(255, 255, 255, 0.72); border-radius: 7px; background: rgba(180, 35, 24, 0.92); box-shadow: 0 3px 10px rgba(23, 32, 51, 0.24); cursor: pointer; }
.background-delete-button:hover { background: #912018; }
.background-delete-button svg { width: 17px; height: 17px; }
.background-thumb { aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; color: var(--muted); border: 2px solid var(--line); border-radius: 7px; background: var(--surface-muted); }
.background-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.background-option strong { overflow: hidden; color: var(--muted); font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.background-option > input:checked ~ .background-thumb { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(21, 94, 239, 0.13); }
.background-option > input:checked ~ strong { color: var(--primary); }
.background-option-none .background-thumb, .background-option-upload .background-thumb { border-style: dashed; }
.background-upload-trigger { min-width: 0; display: grid; align-content: start; gap: 7px; cursor: pointer; }
.background-upload-trigger strong { overflow: hidden; color: var(--muted); font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.background-option-upload > input[type="radio"]:checked ~ .background-upload-trigger .background-thumb { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(21, 94, 239, 0.13); }
.background-option-upload > input[type="radio"]:checked ~ .background-upload-trigger strong { color: var(--primary); }
.background-option-upload .background-upload-file { width: 100%; height: 100%; position: absolute; inset: 0; z-index: 3; padding: 0; opacity: 0; cursor: pointer; pointer-events: auto; }
.background-option-upload .background-upload-file:focus-visible ~ .background-upload-trigger .background-thumb { outline: 3px solid rgba(21, 94, 239, 0.24); outline-offset: 2px; }
.background-adjustment { margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-muted); }
.background-adjustment[hidden] { display: none; }
.background-adjustment-heading { margin-bottom: 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.background-adjustment-heading strong { display: block; font-size: 14px; }
.background-adjustment-heading p, .background-adjustment-body > p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.background-adjustment-body { display: grid; grid-template-columns: minmax(150px, 220px) minmax(160px, 1fr); align-items: center; gap: 18px; }
.background-position-stage { width: min(100%, 220px); aspect-ratio: 9 / 14; position: relative; isolation: isolate; overflow: hidden; border: 2px solid var(--line); border-radius: 8px; background: #fff; cursor: grab; touch-action: none; user-select: none; }
.background-position-stage:focus-visible { outline: 3px solid rgba(21, 94, 239, 0.26); outline-offset: 3px; }
.background-position-stage.is-dragging { cursor: grabbing; }
.background-position-layer { position: absolute; inset: -35%; z-index: 0; pointer-events: none; transform-origin: center; }
[data-free-background-image] { display: none; position: absolute; height: auto; max-width: none; pointer-events: none; user-select: none; }
.background-position-reticle { width: 34px; height: 34px; position: absolute; top: 50%; left: 50%; z-index: 1; display: grid; place-items: center; color: #fff; border: 1px solid rgba(255, 255, 255, 0.78); border-radius: 50%; background: rgba(16, 24, 40, 0.48); box-shadow: 0 3px 12px rgba(16, 24, 40, 0.3); transform: translate(-50%, -50%); pointer-events: none; }
.background-position-reticle svg { width: 18px; height: 18px; }
.file-picker { display: flex; align-items: center; gap: 12px; }
.file-picker > input[type="file"] { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; opacity: 0; pointer-events: none; }
.file-picker > span { min-width: 0; overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.range-grid { padding-top: 2px; }
.range-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.background-numeric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.range-field input[type="range"] { min-height: 26px; padding: 0; border: 0; box-shadow: none; accent-color: var(--primary); }
.range-field output { color: var(--primary); font-size: 13px; font-weight: 750; }
.numeric-input { min-width: 88px; min-height: 38px; display: grid; grid-template-columns: minmax(54px, 1fr) auto; align-items: center; overflow: hidden; color: var(--muted); border: 1px solid #b9c3d1; border-radius: 6px; background: var(--surface); font-size: 13px; font-weight: 700; }
.numeric-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(21, 94, 239, 0.14); }
.numeric-input input { min-height: 36px; padding: 6px 3px 6px 9px; border: 0; border-radius: 0; box-shadow: none; background: transparent; text-align: right; }
.numeric-input input:focus { border: 0; box-shadow: none; }
.numeric-input > span { padding: 0 9px 0 3px; }
.placement-help { margin: 10px 0 0; }
.segmented-control-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.appearance-divider { height: 1px; margin: 2px 0; background: var(--line); }
.page-background-color-field { width: min(100%, 300px); margin-bottom: 16px; }
.page-background-adjustment .background-adjustment-body { grid-template-columns: minmax(260px, 360px) minmax(160px, 1fr); }
.page-background-position-stage { width: min(100%, 360px); aspect-ratio: 16 / 10; background: #f4f6f9; }
.page-background-card-silhouette { width: 24%; aspect-ratio: 9 / 14; position: absolute; top: 50%; left: 50%; z-index: 2; display: grid; place-items: center; color: rgba(23, 32, 51, 0.72); border: 2px solid rgba(23, 32, 51, 0.62); border-radius: 5px; background: rgba(255, 255, 255, 0.82); box-shadow: 0 8px 24px rgba(23, 32, 51, 0.2); transform: translate(-50%, -50%); pointer-events: none; }
.page-background-card-silhouette svg { width: 25%; height: 25%; }
.page-background-position-stage .background-position-reticle { z-index: 3; }
.detached-form { display: none; }
.editor-actions { padding: 12px; display: grid; grid-template-columns: auto minmax(220px, 1fr); gap: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.button-reset { min-width: 132px; }
.preview-column { position: sticky; top: 24px; display: grid; gap: 18px; }
.preview-tool, .share-tool, .password-tool, .danger-tool { padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.tool-heading { margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.phone-frame { width: min(100%, 430px); aspect-ratio: 430 / 669; margin: 8px auto; position: relative; overflow: hidden; border-radius: 8px; background: #fff; box-shadow: 0 0 0 8px #202632; }
.phone-frame iframe { width: 430px; height: 669px; position: absolute; inset: 0 auto auto 0; border: 0; transform: scale(var(--card-preview-scale, 1)); transform-origin: top left; }
.copy-row { display: grid; grid-template-columns: minmax(0, 1fr) 42px; gap: 8px; }
.copy-row input { min-width: 0; color: var(--muted); font-size: 13px; }
.qr-row { margin-top: 16px; display: grid; grid-template-columns: 104px 1fr; align-items: center; gap: 16px; }
.qr-row img { width: 104px; height: 104px; border: 1px solid var(--line); }
.password-tool summary, .danger-tool summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; font-weight: 700; list-style: none; }
.password-tool summary::-webkit-details-marker, .danger-tool summary::-webkit-details-marker { display: none; }
.password-tool summary span, .danger-tool summary span { display: flex; align-items: center; gap: 9px; }
.password-tool[open] summary > svg, .danger-tool[open] summary > svg { transform: rotate(180deg); }
.danger-tool { border-color: #f1b4aa; }
.danger-tool summary { color: #b42318; }
.danger-tool-body { margin-top: 16px; padding-top: 15px; border-top: 1px solid #f3c5bd; }
.danger-tool-body > p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.danger-tool code { padding: 2px 5px; color: #912018; border-radius: 4px; background: #fff0ed; font-family: "SFMono-Regular", Consolas, monospace; }
.danger-final-note { color: #b42318 !important; font-weight: 650; }
.compact-form { margin-top: 18px; }

.admin-header { align-items: center; }
.admin-page { width: min(1320px, calc(100% - 36px)); }
.admin-section { padding: 24px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.admin-section-heading { margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.admin-section-heading h2 { margin: 0; font-size: 22px; }
.admin-section-heading p { margin: 3px 0 0; color: var(--muted); font-size: 14px; }
.admin-section-heading > svg { width: 26px; height: 26px; color: var(--primary); }
.admin-search { width: min(360px, 100%); position: relative; }
.admin-search > svg { width: 18px; height: 18px; position: absolute; top: 14px; left: 13px; z-index: 1; color: var(--muted); }
.admin-search input { padding-left: 40px; font-weight: 400; }
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.admin-table { width: 100%; min-width: 900px; border-collapse: collapse; }
.admin-table th { padding: 11px 14px; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--surface-muted); font-size: 12px; text-align: left; text-transform: uppercase; }
.admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: #f8faff; }
.admin-table td:first-child { width: 25%; }
.admin-table td:nth-child(2) { width: 42%; }
.admin-table strong, .admin-user-email { display: block; overflow-wrap: anywhere; }
.admin-user-email { margin-top: 3px; color: var(--muted); font-size: 13px; }
.admin-link-cell { min-width: 0; display: flex; align-items: center; gap: 8px; }
.admin-link-cell > a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-button-small { width: 36px; height: 36px; flex: 0 0 auto; }
.icon-button-small svg { width: 17px; height: 17px; }
.admin-qr-cell { display: flex; align-items: center; gap: 10px; }
.admin-qr-cell img { width: 64px; height: 64px; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.admin-row-actions { text-align: right; }
.admin-search-empty { margin: 18px 0 0; color: var(--muted); text-align: center; }
.admin-empty-row td { padding: 34px; color: var(--muted); text-align: center; }
.admin-assets-grid { margin-top: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.asset-upload-form { display: grid; gap: 14px; }
.asset-upload-form > .button { justify-self: start; }
.asset-summary-list { margin-top: 20px; padding-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--line); }
.asset-summary-list span { padding: 6px 9px; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; background: var(--surface-muted); font-size: 12px; }
.asset-summary-list svg { width: 15px; height: 15px; }
.contact-catalog { margin-top: 22px; }
.contact-catalog-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr); gap: 22px; align-items: start; }
.contact-field-list { min-width: 0; display: grid; gap: 12px; }
.contact-field-card { position: relative; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); transition: border-color 150ms ease, box-shadow 150ms ease, opacity 150ms ease; }
.contact-field-card.is-inactive { opacity: 0.68; background: var(--surface-muted); }
.contact-field-card.is-dragging { opacity: 0.42; }
.contact-field-card.is-drop-before::before, .contact-field-card.is-drop-after::after { height: 3px; position: absolute; right: 0; left: 0; z-index: 5; border-radius: 4px; background: var(--primary); content: ""; }
.contact-field-card.is-drop-before::before { top: -8px; }
.contact-field-card.is-drop-after::after { bottom: -8px; }
.contact-field-summary { display: grid; grid-template-columns: 32px 42px minmax(0, 1fr); align-items: center; gap: 10px; }
.contact-drag-handle { width: 32px; height: 38px; padding: 0; display: grid; place-items: center; color: var(--muted); border: 0; border-radius: 6px; background: transparent; cursor: grab; }
.contact-drag-handle:hover, .contact-drag-handle:focus-visible { color: var(--primary); background: #edf3ff; }
.contact-drag-handle:active { cursor: grabbing; }
.contact-drag-handle svg { width: 19px; height: 19px; }
.contact-field-icon { width: 42px; height: 42px; display: grid; place-items: center; overflow: hidden; color: var(--primary); border: 1px solid #c8d7ff; border-radius: 8px; background: #edf3ff; }
.contact-field-icon img { width: 24px; height: 24px; object-fit: contain; }
.contact-field-icon svg { width: 22px; height: 22px; }
.contact-field-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.contact-field-summary p, .contact-field-note { margin: 3px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.status-badge { padding: 2px 7px; color: #667085; border-radius: 999px; background: #eef1f5; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.status-badge.is-active { color: #087653; background: #e8f8f2; }
.contact-field-edit { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.contact-field-edit summary { display: flex; align-items: center; justify-content: space-between; color: var(--primary); cursor: pointer; font-size: 13px; font-weight: 750; list-style: none; }
.contact-field-edit summary::-webkit-details-marker { display: none; }
.contact-field-edit summary span { display: flex; align-items: center; gap: 7px; }
.contact-field-edit summary svg { width: 17px; height: 17px; }
.contact-field-edit[open] summary > svg { transform: rotate(180deg); }
.contact-field-form { display: grid; gap: 14px; }
.inline-check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 600; }
.inline-check input { width: 16px; height: 16px; min-height: 0; padding: 0; accent-color: var(--primary); }
.contact-field-edit .contact-field-form { margin-top: 14px; }
.contact-field-actions { margin-top: 14px; display: flex; align-items: center; gap: 7px; }
.contact-field-actions form { margin: 0; }
.contact-field-toggle { margin-left: auto !important; }
.contact-field-create { position: sticky; top: 24px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-muted); }
.contact-field-create-heading { margin-bottom: 18px; display: flex; align-items: center; gap: 11px; }
.contact-field-create-heading h3 { margin: 0; font-size: 18px; }
.contact-field-create-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.file-picker-compact { align-items: flex-start; flex-direction: column; gap: 7px; }
.admin-empty-panel { margin: 0; padding: 28px; color: var(--muted); border: 1px dashed var(--line); border-radius: 8px; text-align: center; }

.card-page { min-height: 100vh; padding: 24px; position: relative; isolation: isolate; overflow-x: hidden; display: grid; place-items: start center; }
.card-theme-light { --card-bg: #ffffff; --card-text: #172033; --card-muted: #667085; --card-line: #dde3eb; --card-soft: #f2f5f8; --card-action: #155eef; }
.card-theme-dark { --card-bg: #171b22; --card-text: #f7f8fa; --card-muted: #aab4c3; --card-line: #343b46; --card-soft: #232933; --card-action: #4f83ff; background: #0f1217; }
.page-background-layer { position: fixed; inset: -35%; z-index: 0; pointer-events: none; transform-origin: center; }
.public-card { width: min(100%, 430px); height: 669px; min-height: 669px; position: relative; z-index: 1; isolation: isolate; overflow: hidden; padding: 0; color: var(--card-text); border: 1px solid var(--card-line); border-radius: 8px; background: var(--card-bg); box-shadow: 0 20px 60px rgba(15, 18, 23, 0.16); font-family: var(--card-font, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif); }
.card-background-layer { position: absolute; inset: -35%; z-index: 0; pointer-events: none; transform-origin: center; }
.public-card > :not(.card-background-layer) { position: relative; z-index: 1; }
.public-card-scroll { height: 100%; padding: 24px; overflow-x: hidden; overflow-y: auto; scrollbar-gutter: stable; }
.public-card.is-live-theme-preview::before { content: none !important; }
.public-card.is-live-theme-preview > .card-background-layer { position: absolute !important; z-index: 0 !important; }
.card-toolbar { min-height: 42px; display: flex; align-items: center; justify-content: space-between; }
.mini-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--card-muted); font-size: 13px; font-weight: 750; }
.mini-brand svg { width: 17px; height: 17px; }
.card-icon-button { color: var(--card-text); border-color: var(--card-line); background: var(--card-soft); }
.card-identity { padding: 32px 0 24px; text-align: center; }
.public-avatar { width: 116px; height: 116px; margin: 0 auto 20px; display: grid; place-items: center; overflow: hidden; color: var(--card-muted); border: 1px solid var(--card-line); border-radius: 8px; background: var(--card-soft); }
.public-avatar img { width: 100%; height: 100%; object-fit: cover; }
.public-avatar svg { width: 52px; height: 52px; }
.card-identity h1 { max-width: 100%; margin: 0; overflow-wrap: anywhere; font-size: 30px; line-height: 1.18; }
.card-position { margin: 7px 0 0; color: var(--card-muted); font-size: 17px; overflow-wrap: anywhere; }
.primary-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.primary-actions a { min-height: 52px; padding: 10px; display: flex; align-items: center; justify-content: center; gap: 8px; color: #fff; border-radius: 7px; background: var(--card-action); font-weight: 750; }
.primary-actions a:last-child { background: #12805c; }
.primary-actions a:hover { text-decoration: none; filter: brightness(0.95); }
.primary-actions img, .primary-actions svg { width: 21px; height: 21px; flex: 0 0 auto; object-fit: contain; }
.primary-actions span { min-width: 0; overflow-wrap: anywhere; font-size: 13px; line-height: 1.25; text-align: center; }
.card-about { margin: 24px 0 0; padding: 22px 0; color: var(--card-text); border-top: 1px solid var(--card-line); border-bottom: 1px solid var(--card-line); overflow-wrap: anywhere; }
.card-about p, .card-about div { margin: 0 0 12px; }
.card-about p:last-child, .card-about div:last-child { margin-bottom: 0; }
.card-about ul, .card-about ol { margin: 10px 0; padding-left: 24px; }
.card-about li + li { margin-top: 5px; }
.card-about a { color: var(--card-action); text-decoration: underline; }

.crop-dialog { width: min(560px, calc(100% - 28px)); max-height: calc(100vh - 28px); overflow-y: auto; padding: 22px; color: var(--text); border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 24px 80px rgba(16, 24, 40, 0.28); }
.crop-dialog::backdrop { background: rgba(16, 24, 40, 0.64); }
.crop-dialog-header { margin-bottom: 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.crop-dialog-header .eyebrow { margin-bottom: 3px; }
.crop-dialog-header h2 { margin: 0; font-size: 24px; }
.crop-dialog-header p { max-width: 420px; margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.crop-stage { width: min(100%, 460px); aspect-ratio: 1; margin: 0 auto; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #111827; }
.crop-stage canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.crop-stage canvas.is-dragging { cursor: grabbing; }
.crop-zoom { margin: 18px auto; display: grid; grid-template-columns: 22px minmax(0, 1fr) 48px 22px; align-items: center; gap: 10px; }
.crop-zoom input { min-height: 24px; padding: 0; border: 0; box-shadow: none; }
.crop-zoom svg { width: 20px; height: 20px; color: var(--muted); }
.crop-zoom output { color: var(--primary); font-size: 12px; font-weight: 750; text-align: right; }
.crop-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.social-list { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.social-list a { min-width: 0; min-height: 48px; padding: 9px 12px; display: grid; grid-template-columns: 24px minmax(0, 1fr) 18px; align-items: center; gap: 9px; color: var(--card-text); border: 1px solid var(--card-line); border-radius: 7px; background: var(--card-soft); font-weight: 650; }
.social-list a:hover { border-color: var(--card-action); text-decoration: none; }
.social-list img { width: 24px; height: 24px; }
.social-list svg { width: 17px; height: 17px; color: var(--card-muted); }
.social-list .contact-leading-icon { width: 24px; height: 24px; color: var(--card-text); }
.social-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-footer-actions { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.card-footer-actions .button { color: var(--card-text); border-color: var(--card-line); background: var(--card-soft); }
.card-footer-actions .card-save-button { color: #fff; border-color: var(--card-action); background: var(--card-action); }

@media (max-width: 960px) {
  .home-intro { grid-template-columns: 1fr; min-height: auto; }
  .home-copy { max-width: 760px; }
  .product-preview { max-width: 620px; }
  .dashboard-layout { grid-template-columns: 1fr; }
  .preview-column { position: static; grid-template-columns: 1fr 1fr; align-items: start; }
  .preview-tool { grid-row: span 2; }
  .admin-assets-grid { grid-template-columns: 1fr; }
  .contact-catalog-layout { grid-template-columns: 1fr; }
  .contact-field-create { position: static; }
}

@media (max-width: 680px) {
  .site-header { min-height: 60px; padding: 9px 15px; }
  .brand { font-size: 18px; }
  .brand-mark { width: 34px; height: 34px; }
  .site-nav { gap: 10px; }
  .site-nav > a:not(.button) { display: none; }
  .button-quiet span { display: none; }
  .page-shell { width: min(100% - 28px, 1180px); padding: 30px 0 54px; }
  .home-page { padding-top: 36px; }
  .home-intro { gap: 36px; }
  .home-copy h1 { font-size: 39px; }
  .home-copy > p { font-size: 17px; }
  .input-action { grid-template-columns: 1fr; }
  .product-preview { padding: 20px; }
  .home-features { grid-template-columns: 1fr; }
  .home-features > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .auth-panel { padding: 24px 20px; box-shadow: none; }
  .dashboard-header { align-items: flex-start; flex-direction: column; }
  .dashboard-header h1 { font-size: 34px; }
  .dashboard-header .button { width: 100%; }
  .account-tabs { margin-top: -8px; overflow-x: auto; }
  .account-tabs a { flex: 1 0 auto; justify-content: center; }
  .admin-subtabs { width: 100%; margin-top: -18px; display: flex; overflow-x: auto; }
  .admin-subtabs a { flex: 1 0 auto; justify-content: center; }
  .admin-edit-banner { align-items: stretch; flex-direction: column; }
  .admin-edit-banner > span { align-items: flex-start; }
  .admin-edit-banner .button { width: 100%; }
  .field-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .avatar-field { align-items: flex-start; }
  .editor-actions { grid-template-columns: 1fr; }
  .button-reset { min-width: 0; }
  .theme-control { grid-template-columns: 1fr 1fr; }
  .theme-control label:last-child { grid-column: 1 / -1; }
  .custom-theme-panel { padding: 16px; }
  .appearance-grid { grid-template-columns: 1fr; }
  .range-grid-three { grid-template-columns: 1fr; }
  .background-numeric-grid { grid-template-columns: 1fr; }
  .segmented-control-three { grid-template-columns: 1fr; }
  .segmented-control-four { grid-template-columns: 1fr 1fr; }
  .background-gallery { grid-template-columns: 1fr 1fr; }
  .background-adjustment-heading { align-items: stretch; flex-direction: column; }
  .background-adjustment-heading .button { width: 100%; }
  .background-adjustment-body { grid-template-columns: 1fr; }
  .background-position-stage { width: min(100%, 240px); margin: 0 auto; }
  .page-background-position-stage { width: min(100%, 360px); }
  .file-picker { align-items: flex-start; flex-direction: column; }
  .file-picker .button { width: 100%; }
  .preview-column { grid-template-columns: 1fr; }
  .preview-tool { grid-row: auto; }
  .card-identity h1 { font-size: 27px; }
  .social-list { grid-template-columns: 1fr; }
  .card-footer-actions { grid-template-columns: 1fr; }
  .crop-dialog { padding: 16px; }
  .crop-stage { width: min(100%, 460px, calc(100dvh - 290px)); }
  .admin-section { padding: 16px; }
  .admin-section-heading { align-items: stretch; flex-direction: column; }
  .admin-search { width: 100%; }
  .admin-table-wrap { overflow: visible; border: 0; }
  .admin-table, .admin-table tbody { min-width: 0; display: block; }
  .admin-table thead { display: none; }
  .admin-table tr { margin-bottom: 12px; padding: 14px; display: grid; gap: 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
  .admin-table td, .admin-table td:first-child, .admin-table td:nth-child(2) { width: auto; padding: 0; display: grid; gap: 6px; border: 0; }
  .admin-table td::before { color: var(--muted); content: attr(data-label); font-size: 11px; font-weight: 750; text-transform: uppercase; }
  .admin-table tbody tr:hover { background: var(--surface); }
  .admin-link-cell > a { white-space: normal; overflow-wrap: anywhere; }
  .admin-row-actions { text-align: left; }
  .admin-row-actions .button { width: 100%; }
  .admin-empty-row td::before { display: none; }
  .admin-header .button { width: 100%; }
  .asset-upload-form > .button { width: 100%; }
  .contact-field-summary { grid-template-columns: 30px 38px minmax(0, 1fr); }
  .contact-field-icon { width: 38px; height: 38px; }
  .contact-field-actions { flex-wrap: wrap; }
  .contact-field-toggle { flex: 1 1 100%; margin-left: 0 !important; }
  .contact-field-toggle .button { width: 100%; }
  .rich-toolbar { max-height: 150px; overflow-y: auto; }
  .toolbar-separator { margin: 0 2px; }
}

@media (max-width: 640px) {
  .card-page { padding: 0; place-items: start stretch; }
  .page-background-layer { display: none; }
  .public-card { width: 100%; height: auto; min-height: 100vh; border: 0; border-radius: 0; box-shadow: none; }
  .public-card-scroll { height: auto; min-height: 100vh; padding: 20px; overflow: visible; scrollbar-gutter: auto; }
  .card-page.card-embedded-preview { place-items: start stretch; }
  .card-embedded-preview .public-card { width: 430px; height: 669px; min-height: 669px; border: 1px solid var(--card-line); border-radius: 8px; box-shadow: 0 20px 60px rgba(15, 18, 23, 0.16); }
  .card-embedded-preview .public-card-scroll { height: 100%; min-height: 0; padding: 24px; overflow-x: hidden; overflow-y: auto; scrollbar-gutter: stable; }
}

@media (max-width: 390px) {
  .site-nav .button-small { padding: 7px 9px; font-size: 13px; }
  .preview-actions { grid-template-columns: 1fr; }
  .primary-actions { grid-template-columns: 1fr; }
  .qr-row { grid-template-columns: 88px 1fr; }
  .qr-row img { width: 88px; height: 88px; }
}

/* The embedded card has a fixed 430px viewport, but must keep the same card
   layout as the 430px card shown inside a wide desktop page. */
.card-embedded-preview .card-identity h1 { font-size: 30px; }
.card-embedded-preview .social-list,
.card-embedded-preview .card-footer-actions { grid-template-columns: 1fr 1fr; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
