@font-face {
  font-family: Inter;
  src: url("assets/rpalab-inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: Inter;
  src: url("assets/rpalab-inter-cyrillic.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
:root {
  color-scheme: dark;
  font-family: Inter, system-ui, sans-serif;
  --bg: #0a0a0a;
  --panel: #111;
  --panel-inner: #141414;
  --edge: #262626;
  --control-edge: #3b3b40;
  --text: #e8e8e8;
  --muted: #a3a3a7;
  --accent: #a5b4fc;
  --rgb: 165, 180, 252;
  --accent-ink: #0c111b;
  --accent-edge: rgba(var(--rgb), .36);
  --accent-wash: rgba(var(--rgb), .09);
  --accent-hover: rgba(var(--rgb), .16);
  --green: #95f2dc;
  --radius: 16px;
  --ease-out: cubic-bezier(.2,.7,.2,1);
  --gutter: clamp(14px, 2.35vw, 36px);
  --visible-header-height: max(0px, calc(var(--header-height, 92px) - var(--header-hide-distance, 0px)));
  scroll-padding-top: var(--visible-header-height);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  min-height: 100vh;
  margin: 0;
  isolation: isolate;
  background: radial-gradient(ellipse at 92% 0%, color-mix(in srgb, var(--accent) 6%, #0c0d19), transparent 45%) top center / 100% clamp(26rem, 85vh, 56rem) no-repeat var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
html { scrollbar-color: #454545 var(--bg); }
button, input, textarea, select { font: inherit; color: inherit; }
button, select, summary { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
.icon-library { position: absolute; width: 0; height: 0; }
.icon {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.65;
  stroke-linecap: round; stroke-linejoin: round;
  vertical-align: middle;
}
.skip {
  position: fixed; top: 10px; left: 12px; z-index: 30;
  padding: 8px 12px; border-radius: 6px;
  background: var(--panel); transform: translateY(-160%);
}
.skip:focus { transform: none; }

.nav-item {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 41px; padding: 5px 13px; border: 1px solid transparent;
  border-radius: 8px; background: transparent; color: #bcbccd;
  font-size: 14px; font-weight: 550; line-height: 1.15; text-align: center;
  transition: color .15s, background-color .15s, border-color .15s;
}
.nav-item:hover { color: var(--accent); }
.nav-item[aria-current] {
  border-color: var(--accent-edge);
  background: color-mix(in srgb, var(--accent) 12%, #101116);
  box-shadow: inset 0 -2px 0 var(--accent);
  color: var(--accent);
}
.nav-item .icon { width: 17px; height: 17px; }
.help-picker { position: relative; z-index: 4; }
.help-picker summary { list-style: none; }
.help-picker summary::-webkit-details-marker { display: none; }
.help-picker .theme { background: transparent; border-color: transparent; }
.help-picker[open] .theme, .help-picker:has([aria-current]) .theme { color: var(--accent); }
.help-menu {
  position: absolute; inset: calc(100% + 7px) 0 auto auto; z-index: 1;
  width: max-content; max-width: calc(100vw - 35px); padding: 6px;
  border: 1px solid #353541; border-radius: 12px; background: #171719; box-shadow: 0 12px 36px #000b;
}
.help-menu .nav-item { justify-content: flex-start; }
.generator-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.help-picker .theme {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 5px 8px;
  border-radius: 7px; color: var(--muted); font-size: 12px;
}
.help-picker .theme:hover { color: var(--accent); }
.help-picker .theme .icon { width: 16px; height: 16px; }

.workspace { max-width: 1260px; margin: 0 auto; padding: 21px var(--gutter) 60px; }
[data-persona-layout="column"] .workspace { max-width: 1573px; }
.workspace:has(> #generator:not([hidden])) { padding-block-start: 4px; }
@media (min-width: 1160px) {
  .workspace:has(> #generator:not([hidden])) {
    margin-block-start: calc(-.65 * var(--site-header-unit) - 5px);
    padding-block-start: 0;
  }
}
.page-head { margin-bottom: 18px; }
.page-head h1 {
  display: flex; align-items: center; gap: 12px;
  font-size: clamp(25px, 3vw, 34px); font-weight: 760; line-height: 1.12; letter-spacing: -.046em;
}
.page-head h1 .icon { width: .8em; height: .8em; color: var(--accent); }
.page-head p { margin-top: 7px; color: var(--muted); font-size: 14px; }
.result { display: grid; grid-template-columns: minmax(0,1fr); gap: 17px; min-width: 0; }
.panel {
  border: 1px solid var(--edge); border-radius: var(--radius); background: var(--panel);
  box-shadow: 0 5px 20px #0003;
}
.sub-head { display: flex; align-items: center; gap: 11px; }
.sub-head h2, .api-panel h2 {
  font-size: 16px; font-weight: 680; letter-spacing: -.026em;
}
.sub-head p, .api-panel p { margin-top: 2px; color: var(--muted); font-size: 13px; }
.section-icon, .mail-symbol {
  display: grid; place-items: center; flex: none;
  width: 36px; height: 36px; border: 1px solid var(--accent-edge); border-radius: 9px;
  background: var(--accent-wash); color: var(--accent);
}
.generation-bar {
  position: relative; z-index: 4;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 12px; padding: 8px 12px;
  border-color: var(--accent-edge); background: #141416;
}
.generation-context { display: flex; align-items: center; flex: 1; min-width: 0; }
.generation-saved { flex: none; margin-inline-start: auto; }
.generation-item { position: relative; min-width: 0; flex: 0 1 auto; }
.generation-item:not(:first-child) { border-inline-start: 1px solid var(--edge); }
#country-editor { position: relative; width: clamp(160px, 17vw, 245px); }
.context-label { color: var(--muted); font-size: 11px; font-weight: 600; }
.generation-control {
  display: grid; grid-template: "label icon" auto "value icon" auto / minmax(0,1fr) auto;
  align-items: center; gap: 2px 9px; min-height: 44px; padding: 3px 12px;
  list-style: none; border-radius: 6px; cursor: pointer;
}
.generation-control::-webkit-details-marker { display: none; }
.generation-control:hover, .generation-editor[open] .generation-control { background: var(--accent-wash); }
.generation-control .context-label { grid-area: label; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.generation-control .icon { grid-area: icon; width: 13px; height: 13px; color: var(--muted); }
.generation-editor[open] .generation-control .icon { rotate: 180deg; }
.generation-value {
  grid-area: value; display: block; min-width: 0; color: var(--accent);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px;
}
#background-editor { flex-basis: clamp(138px, 14vw, 215px); }
.age-editor { min-width: 121px; }
.generation-popover {
  position: absolute; z-index: 6; inset-block-start: calc(100% + 9px); inset-inline-start: 0;
  width: min(330px, calc(100vw - 42px)); max-height: min(390px, 62dvh); overflow: auto;
  padding: 13px; border: 1px solid var(--accent-edge); border-radius: 12px;
  background: var(--panel); box-shadow: 0 8px 26px #0009;
}
.generation-popover.config-options { width: min(210px, calc(100vw - 42px)); padding: 5px; }
:is(#city-editor, #career-editor) .config-options { inset-inline: auto 0; }
#career-editor .config-options { width: min(260px, calc(100vw - 42px)); }
.config-option {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; min-height: 39px; padding: 5px 9px; border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--text); text-align: start; font-size: 13px;
}
.config-option:hover, .config-option[aria-pressed="true"] {
  border-color: var(--accent-edge); background: var(--accent-wash); color: var(--accent);
}
.config-option .icon { width: 15px; height: 15px; visibility: hidden; }
.config-option[aria-pressed="true"] .icon { visibility: visible; }
.name-style-example { display: block; color: var(--muted); font-size: 11px; }
.generate-short, #country-short { display: none; }
.profile, .details-panel { scroll-margin-top: 8px; }
.field-row :is(input,button) { scroll-margin-top: 100px; }
.control, .age-inputs label { display: grid; gap: 6px; min-width: 0; }
.control > span:first-child, legend { color: #dedee3; font-size: 13px; font-weight: 620; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 7px; padding: 0; }
input:not([type=radio],[type=checkbox],[type=file],[type=range]), select, textarea {
  width: 100%; min-width: 0; min-height: 40px; padding: 8px 10px;
  border: 1px solid var(--control-edge); border-radius: 8px; background: #0e0e10;
  color: var(--text); font-size: 13px; line-height: 1.35;
}
input:not([type=radio],[type=checkbox],[type=file],[type=range]):focus-visible, select:focus-visible, textarea:focus-visible {
  border-color: var(--accent); outline: 2px solid var(--accent-edge); outline-offset: 0;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
select {
  appearance: none; padding-right: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23aaaab0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
}
textarea { resize: vertical; }
.country-summary { display: flex; align-items: center; gap: 6px; }
.country-summary > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.country-summary .country-flag { flex: none; }
.country-flag { width: 18px; height: 12px; object-fit: contain; border-radius: 2px; }
.language-panel.country-panel {
  inset-inline: 0 auto; width: min(318px, calc(100vw - 40px)); z-index: 6;
  max-height: none; overflow: hidden; gap: 6px; padding: 8px;
}
.country-search { position: relative; }
.country-search .icon {
  position: absolute; inset-inline-start: 10px; inset-block-start: 50%; translate: 0 -50%;
  width: 15px; height: 15px; color: var(--muted); pointer-events: none;
}
#country-search { padding-inline-start: 32px; background: var(--panel); }
.country-options {
  max-height: min(272px, 44dvh); overflow-y: auto; overscroll-behavior-y: contain; padding-inline-end: 4px;
  scrollbar-width: thin; scrollbar-color: var(--accent-edge) transparent;
}
.country-options::before { content: none; }
.language-options.country-options a {
  text-decoration: none; line-height: 1.25; padding-inline: 8px; border: 1px solid transparent;
}
.country-options a[aria-current="true"] { background: var(--accent-wash); border-color: var(--accent-edge); }
.country-options a[hidden] { display: none; }
.country-option-code {
  flex: none; margin-inline-start: auto; color: var(--muted); font-size: 11px; font-weight: 600;
}
.country-empty { margin: 0; padding: 8px; color: var(--muted); font-size: 13px; }
.segmented {
  display: flex; gap: 3px; padding: 3px; border: 1px solid var(--control-edge);
  border-radius: 9px; background: #0e0e10;
}
.segmented label { position: relative; flex: 1; min-width: 0; cursor: pointer; }
.segmented input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.segmented span {
  display: grid; place-items: center; min-height: 32px; padding: 3px 4px;
  border: 1px solid transparent; border-radius: 6px; text-align: center;
  color: var(--muted); font-size: 12px; font-weight: 610;
}
.segmented label:hover span { color: var(--text); }
.segmented input:checked + span { border-color: var(--accent-edge); background: var(--accent-wash); color: var(--accent); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.age-inputs, .name-inputs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.age-control { margin-top: 8px; }
.age-slider { position: relative; height: 30px; margin: 0 9px 3px; }
.slider-track {
  position: absolute; inset: 50% 0 auto; height: 5px;
  border-radius: 4px; transform: translateY(-50%); background: #343439;
}
.dual-slider .slider-track {
  background: linear-gradient(90deg,#343439 var(--slider-start,7%),var(--accent) var(--slider-start,7%) var(--slider-end,27%),#343439 var(--slider-end,27%));
}
.age-slider input[type=range] {
  appearance: none; position: absolute; inset: 0 -10px; width: calc(100% + 20px);
  height: 100%; margin: 0; background: transparent;
}
.age-slider input[type=range]::-webkit-slider-runnable-track { appearance: none; height: 5px; background: transparent; }
.age-slider input[type=range]::-moz-range-track { height: 5px; background: transparent; }
.age-slider input[type=range]::-webkit-slider-thumb {
  appearance: none; width: 20px; height: 20px; margin-top: -7.5px;
  border: 2px solid var(--accent); border-radius: 50%; background: #16161b;
  box-shadow: inset 0 0 0 3px #16161b, inset 0 0 0 12px var(--accent);
  cursor: grab; pointer-events: auto;
}
.age-slider input[type=range]::-moz-range-thumb {
  box-sizing: border-box; width: 20px; height: 20px;
  border: 2px solid var(--accent); border-radius: 50%; background: #16161b;
  box-shadow: inset 0 0 0 3px #16161b, inset 0 0 0 12px var(--accent);
  cursor: grab; pointer-events: auto;
}
.age-slider input[type=range]:focus-visible { z-index: 1; }
.dual-slider input[type=range] { pointer-events: none; }
.age-inputs label > span, .exact-input > span { color: var(--muted); font-size: 12px; }
.exact-input { display: flex; align-items: center; gap: 10px; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 7px 12px; border: 1px solid transparent; border-radius: 8px;
  font-size: 13px; font-weight: 650; line-height: 1.25; white-space: nowrap;
  transition: color .15s, background-color .15s, border-color .15s;
}
.button .icon { width: 16px; height: 16px; }
.button.secondary { border-color: var(--control-edge); background: #171719; color: var(--text); }
.button.secondary:not(:disabled):hover { border-color: var(--accent-edge); background: var(--accent-wash); color: var(--accent); }
.button.quiet { background: transparent; border-color: transparent; color: #bdbdc4; }
.button.quiet:hover { color: var(--accent); background: var(--accent-wash); }
.button.primary { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.button.primary:not(:disabled):hover { background: color-mix(in srgb, var(--accent) 82%, white); }
.button:disabled { opacity: .55; }
.generate { min-height: 44px; }
@media (max-width: 940px) {
  .site-header .top-nav { flex-wrap: wrap; }
  .site-header .top::before { bottom: -4px; }
}
.form-error { margin-top: 10px; color: #ffadbc; font-size: 13px; }
.icon-button {
  display: grid; place-items: center; flex: none;
  width: 38px; height: 38px; padding: 0; border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: #acacb1;
}
.icon-button .icon { width: 17px; height: 17px; }
.icon-button:not(:disabled):hover { border-color: var(--accent-edge); background: var(--accent-wash); color: var(--accent); }
.icon-button:disabled { opacity: .52; }

.profile {
  border-color: color-mix(in srgb, var(--accent) 24%, var(--edge));
  background: radial-gradient(ellipse at 0 0,rgba(var(--rgb),.10),transparent 68%),var(--panel);
}
.profile-main { padding: 16px; }
.identity { display: flex; align-items: center; gap: 13px; min-width: 0; margin-bottom: 13px; }
.profile-avatar-link { display: block; flex: none; padding: 0; border: 0; border-radius: 12px; background: transparent; }
.avatar {
  display: grid; place-items: center; flex: none; width: 76px; height: 76px;
  overflow: hidden; border: 1px solid var(--accent-edge); border-radius: 12px;
  background: var(--accent-wash); color: var(--accent); font-size: 27px; font-weight: 680;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-link:hover .avatar { border-color: var(--accent); }
:root:not([data-layout-preview]) #profile .identity { flex-direction: column; align-items: stretch; }
:root:not([data-layout-preview]) #profile-photo { width: 100%; }
:root:not([data-layout-preview]) #avatar {
  position: relative;
  width: 100%; height: auto; max-height: min(480px, 75svh);
  aspect-ratio: 1;
}
:root:not([data-layout-preview]) #avatar img { position: absolute; inset: 0; object-position: center 25%; }
.identity-copy { min-width: 0; }
.identity-copy h2 {
  overflow-wrap: anywhere;
  font-size: clamp(22px,2.3vw,31px); line-height: 1.1; font-weight: 740; letter-spacing: -.044em;
}
.identity-copy p { margin-top: 5px; color: var(--muted); font-size: 13px; }
.profile-name-line { display: flex; align-items: center; gap: 4px; min-width: 0; }
.profile-name-parts { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1px .24em; min-width: 0; }
.profile-name-parts .editable-value { max-width: 100%; overflow-wrap: anywhere; letter-spacing: inherit; }
.profile-name-parts .inline-editor { flex: 1 1 100%; }
#profile-meta .inline-editor { display: inline-block; width: min(100%, 12ch); vertical-align: middle; }
.identity-copy .inline-edit-error { display: block; }
.profile-primary { margin-top: 10px; }
.profile-primary .generate, .profile-save { width: 100%; }
.profile-footer { display: flex; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--edge); }
.profile-save.secondary .icon { color: var(--accent); }
.profile-email {
  display: flex; align-items: center; gap: 8px; padding: 5px 7px;
  border: 1px solid var(--edge); border-radius: 10px; background: #0d0d0f;
}
.profile-contacts { display: grid; gap: 6px; }
.mail-symbol { width: 33px; height: 33px; margin-inline-end: 2px; }
.mail-symbol .icon { width: 16px; height: 16px; }
.profile-email > div:first-of-type { min-width: 0; margin-inline-end: 4px; line-height: 1.35; }
.email-label { display: block; color: var(--muted); font-size: 11px; }
.profile-contact-value { display: block; max-width: 100%; overflow-wrap: anywhere; color: var(--accent); font-size: 13px; font-weight: 630; }

.details-toolbar {
  display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 3px 8px; border-radius: 15px 15px 0 0;
  border-bottom: 1px solid var(--edge); background: #121214;
}
.tabs { display: flex; gap: 3px; padding: 5px 8px 0; }
.profile-view-menu { display: flex; gap: 3px; align-items: stretch; min-width: 0; padding: 5px 8px 0; }
.profile-view-menu .tabs { min-width: 0; padding: 0; }
.studio-view-menu { width: fit-content; max-width: 100%; margin-bottom: 14px; padding: 4px 5px 0; border-bottom: 1px solid var(--edge); }
.tab {
  display: flex; min-width: 0; justify-content: center; align-items: center; gap: 7px;
  min-height: 43px; padding: 5px 13px; border: 1px solid transparent; border-bottom-width: 2px;
  border-radius: 7px 7px 0 0; background: transparent;
  color: var(--muted); white-space: nowrap; font-size: 13px; font-weight: 610;
}
.tab .icon { width: 16px; height: 16px; }
.tab:hover { color: var(--accent); }
.tab[aria-selected="true"], .profile-view-menu .tab[aria-current="page"] {
  border-color: var(--accent-edge); border-bottom-color: var(--accent);
  color: var(--accent); background: var(--accent-wash);
}
.tab:focus-visible { outline-offset: -3px; }
.batch-actions { display: flex; flex: none; flex-wrap: wrap; align-items: center; gap: 5px; margin-inline-start: auto; padding: 3px 8px; }
.batch-button { gap: 6px; }
.batch-button:not(:disabled) { border-color: var(--accent-edge); background: var(--accent-wash); color: var(--accent); }
.selection-count { min-width: 21px; padding: 2px 5px; border-radius: 5px; background: var(--accent-wash); color: var(--accent); font-size: 11px; text-align: center; }
.field-table { display: grid; gap: 12px; padding: 10px 15px 14px; }
.persona-accounts { display: grid; gap: 14px; padding: clamp(12px, 2vw, 20px); min-width: 0; }
.persona-accounts > h2 { font-size: 19px; }
.persona-accounts > .button { justify-self: start; }
.account-vault-status:empty, .credential-editor:empty { display: none; }
.account-vault-status { color: var(--green); }
.account-vault-status.is-error { color: #fca5a5; }
.credential-unlock, .credential-form { display: grid; gap: 14px; }
.credential-unlock { max-width: 390px; }
.credential-unlock .button { justify-self: start; }
.credential-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.credential-toolbar > input[type="search"] { flex: 1 1 220px; min-width: 0; }
.credential-form, .credential-card { padding: 14px; border: 1px solid var(--edge); border-radius: 12px; background: var(--panel-inner); }
.credential-form { border-color: var(--accent-edge); }
.credential-grid, .credential-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 10px 12px; }
.credential-grid textarea { resize: vertical; }
.credential-password, .credential-avatar-field, .credential-extra { display: flex; gap: 8px; align-items: end; min-width: 0; }
.credential-password { grid-column: 1 / -1; }
.credential-password > .control, .credential-avatar-field > .control, .credential-extra input { flex: 1; min-width: 0; }
.credential-more { border-top: 1px solid var(--edge); padding-top: 10px; }
.credential-more[open] summary { margin-bottom: 10px; }
.credential-extras, .credential-list { display: grid; gap: 8px; }
.credential-extra { margin-top: 8px; }
.credential-more > .button { margin-top: 8px; }
.credential-identity { display: flex; gap: 10px; align-items: center; min-width: 0; }
.credential-titles { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.credential-titles h3 { font-size: 15px; }
.credential-avatar { display: grid; place-items: center; width: 37px; height: 37px; flex: none; overflow: hidden; border-radius: 10px; border: 1px solid var(--accent-edge); background: var(--accent-wash); color: var(--accent); font-weight: 700; }
.credential-avatar img { width: 100%; height: 100%; object-fit: cover; }
.credential-fields { margin: 12px 0 0; }
.credential-fields > div, .credential-fields dd { min-width: 0; margin: 0; }
.credential-fields dt { font-size: 12px; }
.credential-value { display: flex; width: 100%; justify-content: space-between; gap: 10px; text-align: start; overflow-wrap: anywhere; padding-inline: 0; }
.credential-value:hover { color: var(--accent); }
.credential-note { margin-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.credential-empty { padding: 12px 0; }
.credential-paging, .credential-confirm { margin-top: 8px; }
@media (max-width: 520px) {
  .credential-password { flex-wrap: wrap; }
  .credential-password > .control { flex-basis: 100%; }
  :is(#tabs, #saved-tabs) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.field-section, .section-fields { min-width: 0; }
.field-section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 37px; padding: 1px 4px; border-bottom: 1px solid var(--edge);
}
.field-section-title {
  display: flex; align-items: center; gap: 7px; min-width: 0;
  font-size: 13px; font-weight: 650; line-height: 1.25;
}
.field-section-title .icon { width: 15px; height: 15px; color: var(--accent); }
.section-actions { display: flex; flex: none; gap: 3px; }
.section-actions .icon-button {
  width: 36px; height: 32px;
}
.section-actions .icon { width: 15px; height: 15px; }
.section-actions .section-select { border-color: var(--edge); }
.section-actions .section-select:is(:hover, [aria-pressed="true"]) {
  color: var(--accent); border-color: var(--accent-edge); background: var(--accent-wash);
}
.field-row {
  display: grid; grid-template-columns: minmax(116px, 230px) minmax(0, 1fr);
  align-items: center; gap: 12px; min-height: 44px; padding: 2px 0; font-size: 14px;
}
.field-row + .field-row { border-top: 1px solid var(--edge); }
.field-row:has(input[data-select-field]:checked) .field-label { color: var(--accent); }
.field-row.highlight { animation: highlight 1.05s ease-out; }
@keyframes highlight { from { background: var(--accent-hover); } to { } }
.field-label {
  display: flex; align-items: center; align-self: stretch; gap: 9px;
  min-width: 0; min-height: 40px; padding: 3px 4px; color: var(--muted);
}
.field-label span { overflow-wrap: anywhere; }
.field-label input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.field-label input:disabled { visibility: hidden; }
.field-table:not(.is-selecting) .field-label input[data-select-field] { display: none; }
.field-table.is-selecting .field-label:has(input:enabled) { cursor: pointer; }
.field-data { display: flex; align-items: center; min-width: 0; gap: 6px; }
.field-value-group { display: flex; flex: 1; align-items: center; min-width: 0; gap: 6px; }
.field-controls {
  display: flex; flex: none; margin-inline-start: auto;
  border: 1px solid var(--edge); border-radius: 7px;
}
:is(.field-controls .icon-button, .field-value-group > .copy-field) { width: 31px; height: 30px; border-radius: 5px; }
.field-controls .icon-button + .icon-button { border-inline-start-color: var(--edge); }
:is(.field-controls, .field-value-group) .icon { width: 15px; height: 15px; }
:is(.field-controls, .field-value-group) .copy-field { color: var(--accent); }
.field-value-group > .copy-field { border-color: var(--edge); }
.field-controls .format-field:not(:disabled) { color: var(--accent); }
.lock-toggle[aria-pressed="true"] { color: var(--accent); background: var(--accent-wash); }
.section-actions .lock-toggle[aria-pressed="mixed"] { color: var(--accent); border-color: var(--accent-edge); }
.field-locked .field-label { color: var(--accent); }
.field-value { min-width: 0; color: var(--text); font-weight: 530; overflow-wrap: anywhere; }
.custom-field-edit {
  display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.4fr) auto;
  gap: 6px; align-items: start; padding: 4px;
}
.custom-field-edit + .custom-field-edit { border-top: 1px solid var(--edge); }
.custom-field-edit :is(input, textarea) {
  box-sizing: border-box; width: 100%; min-width: 0; min-height: 33px; padding: 6px 8px;
  border: 1px solid var(--edge); border-radius: 6px; background: var(--panel-inner); color: var(--text); font: inherit;
}
.custom-field-edit :is(input, textarea):focus { border-color: var(--accent-edge); }
.custom-field-edit :is(input, textarea)::placeholder { color: var(--muted); opacity: 1; }
.custom-field-edit textarea { resize: vertical; }
.custom-field-edit .icon-button, .custom-fields .field-section-head .icon-button { width: 33px; height: 33px; }
.custom-fields .field-section-head .icon-button { color: var(--accent); }
.custom-fields .field-label, .custom-field-value { overflow-wrap: anywhere; white-space: pre-wrap; }
.language-value { white-space: pre-line; }
.editable-value {
  border: 0; background: transparent; padding: 0;
  text-align: start; text-decoration: underline dotted transparent; text-underline-offset: 4px;
}
.editable-value:hover, .editable-value:focus-visible { color: var(--accent); text-decoration-color: currentColor; }
.field-value.editable-value { min-height: 24px; }
.inline-editor { position: relative; flex: 1; min-width: 0; max-width: 460px; }
.profile-email > div:first-of-type:has(.inline-editor) { flex: 1; }
.inline-editor .inline-edit-input {
  display: block; min-height: 30px; padding: 3px 6px; border-radius: 5px;
  border-color: var(--accent-edge); background: var(--panel-inner); font: inherit;
  outline: 0; line-height: 1.4;
}
.inline-editor textarea.inline-edit-input { resize: vertical; }
.inline-editor .inline-edit-input[aria-invalid="true"] { border-color: #ffadbc; }
.inline-edit-error { margin-top: 3px; color: #ffadbc; font-size: 12px; overflow-wrap: anywhere; }
.inline-edit-choices {
  position: absolute; z-index: 2; inset: calc(100% + 3px) auto auto 0;
  width: min(220px,100%); max-height: 182px; overflow: auto;
  padding: 3px; border: 1px solid var(--accent-edge); border-radius: 7px;
  background: var(--panel); box-shadow: 0 4px 16px #0008;
}
.inline-edit-choices.opens-up { inset-block: auto calc(100% + 3px); }
.inline-edit-option {
  display: block; width: 100%; padding: 4px 6px; border: 0; border-radius: 4px;
  background: transparent; color: var(--text); text-align: start; font-size: 13px; overflow-wrap: anywhere;
}
.inline-edit-option:hover, .inline-edit-option:focus-visible, .inline-edit-option[aria-selected="true"] {
  color: var(--accent); background: var(--accent-wash); outline-offset: -2px;
}

:is(html:not([data-layout-preview]), [data-section-layout="band"]) .field-section-head {
  background: var(--accent-wash); border: 0; border-radius: 6px; padding-inline: 8px;
}
:is(html:not([data-layout-preview]), [data-section-layout="band"]) .field-row { padding-inline: 5px; }
@media (min-width: 651px) and (pointer:fine) {
  :is(html:not([data-layout-preview]), [data-section-layout="dense"]) .field-table { gap: 6px; }
  :is(html:not([data-layout-preview]), [data-section-layout="dense"]) .field-row { min-height: 35px; font-size: 13px; }
  :is(html:not([data-layout-preview]), [data-section-layout="dense"]) .field-label { min-height: 31px; }
  :is(html:not([data-layout-preview]), [data-section-layout="dense"]) .field-row :is(.field-controls .icon-button, .field-value-group > .copy-field) { width: 27px; height: 26px; }
}

.saved-toolbar {
  display: grid; grid-template-columns: minmax(12rem, 1.35fr) repeat(2, minmax(8rem, .75fr)) minmax(9rem, 1fr) minmax(8rem, .8fr);
  gap: 10px 12px; margin-bottom: 12px; padding: 12px;
}
.saved-filter { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: 12px; }
.saved-search-control, .saved-select { position: relative; min-width: 0; }
.saved-search-control .icon, .saved-select .icon {
  position: absolute; inset: 50% auto auto 10px; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--muted); pointer-events: none;
}
.saved-search-control input[type=search] { padding-inline-start: 32px; }
.saved-select .icon { inset-inline: auto 9px; width: 12px; height: 12px; }
.saved-select select { appearance: none; padding-inline-end: 26px; }
.saved-filter-status {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 24px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums;
}
.saved-filter-status .button { min-height: 27px; padding-block: 2px; font-size: 12px; }
.saved-list { display: grid; gap: 9px; }
.saved-row {
  display: grid; grid-template-columns: minmax(240px, 1.15fr) minmax(200px, .9fr) minmax(165px, 1.05fr);
  align-items: start; gap: 16px; min-width: 0; padding: 12px;
  background: linear-gradient(115deg,var(--accent-wash),transparent 65%),var(--panel);
}
.saved-row:hover, .saved-row:focus-within { border-color: var(--accent-edge); }
.saved-row-identity { display: flex; align-items: flex-start; gap: 13px; min-width: 0; }
.saved-row .saved-row-avatar { width: clamp(67px,8vw,96px); height: auto; aspect-ratio: 4 / 5; border-radius: 9px; font-size: 23px; }
.saved-row-heading { min-width: 0; overflow-wrap: anywhere; }
.saved-row h2 { font-size: 17px; font-weight: 720; line-height: 1.2; letter-spacing: -.025em; }
.saved-row h2 a:hover { color: var(--accent); text-decoration: underline; }
.saved-row-meta, .saved-row-country { color: var(--muted); font-size: 12px; margin-top: 4px; }
.saved-row-country { display: flex; align-items: center; gap: 6px; }
.saved-row-role { margin-top: 5px; font-size: 13px; }
.saved-row-fields, .saved-note { border-inline-start: 1px solid var(--edge); padding-inline-start: 14px; min-width: 0; }
.saved-row-fields { display: grid; gap: 5px; margin: 0; }
.saved-row-fields > div { display: grid; grid-template-columns: 59px minmax(0, 1fr); gap: 7px; align-items: baseline; }
.saved-row-fields dd { margin: 0; min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
.saved-field-label { color: var(--muted); font-size: 12px; }
.saved-copy-value, .saved-note-value {
  padding: 0; border: 0; background: none; text-align: start; color: inherit; overflow-wrap: anywhere;
}
.saved-copy-value .icon { display: inline; width: 13px; height: 13px; margin-inline-start: 5px; vertical-align: -.13em; color: var(--muted); }
.saved-copy-value:hover, .saved-copy-value:hover .icon, .saved-note-value:hover { color: var(--accent); }
.saved-note { display: grid; gap: 4px; }
.saved-note-value, .saved-note-input { width: 100%; min-height: 54px; padding: 7px 8px; border: 1px solid var(--edge); border-radius: 7px; font-size: 13px; }
.saved-note-value { white-space: pre-wrap; }
.saved-note-value.is-empty { color: var(--muted); }
.saved-note-input { resize: vertical; min-height: 58px; }
@media (max-width: 920px) {
  .saved-toolbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .saved-search { grid-column: span 2; }
  .saved-row { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 10px; }
  .saved-note { grid-column: 1 / -1; border-inline-start: 0; border-top: 1px solid var(--edge); padding: 8px 0 0; }
}
@media (max-width: 510px) {
  .saved-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .saved-row { grid-template-columns: minmax(0, 1fr); }
  .saved-row-fields { border-inline-start: 0; border-top: 1px solid var(--edge); padding: 8px 0 0; }
}
.saved-empty {
  display: grid; justify-items: center; align-content: center; gap: 10px;
  min-height: 255px; padding: 24px; text-align: center;
}
.saved-empty h2 { font-size: 18px; letter-spacing: -.02em; }
.saved-empty p { color: var(--muted); font-size: 13px; }
.saved-empty p:empty { display: none; }
.saved-empty .button { margin-top: 4px; }
.saved-detail-head h1 { overflow-wrap: anywhere; }
.saved-back {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px;
  margin-bottom: 6px; color: var(--accent); font-size: 13px;
}
.saved-back:hover { text-decoration: underline; text-underline-offset: 3px; }
.saved-back .icon { width: 15px; height: 15px; rotate: 180deg; }
.saved-detail .details-panel { scroll-margin-top: 8px; }
.saved-detail .saved-summary { top: 12px; padding: 14px; }
.saved-summary-heading { font-size: 14px; font-weight: 660; margin-bottom: 9px; }
.saved-portrait {
  position: relative; display: grid; place-items: center; width: 100%; max-height: 285px; aspect-ratio: 1.25;
  border: 1px solid var(--accent-edge); border-radius: 9px; overflow: hidden; padding: 0;
  background: var(--accent-wash); color: var(--accent); font-size: 37px; font-weight: 660;
}
.saved-portrait img, .saved-photos img { display: block; width: 100%; height: 100%; object-fit: cover; }
.saved-portrait img { position: absolute; inset: 0; object-position: center 38%; }
.saved-photos { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; margin-top: 8px; }
.saved-photos:empty { display: none; }
.saved-photos .photo-select { border: 1px solid var(--edge); border-radius: 7px; overflow: hidden; }
.saved-photos .photo-select:hover { border-color: var(--accent-edge); }
.saved-summary-actions { display: flex; justify-content: space-between; gap: 5px; margin-top: 12px; }
.saved-delete:hover:not(:disabled), .button.danger-button { color: #ffb6bf; border-color: #7d3841; background: #451d26; }
.saved-confirm { width: min(420px,calc(100vw - 30px)); padding: 17px; color: var(--text); }
.saved-confirm::backdrop { background: #000a; }
.saved-confirm h2 { font-size: 18px; }
.saved-confirm p { margin-top: 7px; overflow-wrap: anywhere; }
.saved-confirm p:not(.form-error) { color: var(--muted); font-size: 13px; }
.saved-confirm .action-row { justify-content: flex-end; margin-top: 13px; }

.sub-layout, .plan-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; align-items: start; }
.sub-panel { min-width: 0; padding: 20px; }
.sub-head { margin-bottom: 17px; }
.studio-heading { display: flex; align-items: center; gap: 18px; }
.photo-provider { margin-bottom: 12px; padding: 10px 12px; }
.photo-provider > summary { cursor: pointer; font-weight: 650; }
#photo-key-saved { margin-inline-start: .75rem; color: var(--accent); font-size: 12px; font-weight: 500; }
#photo-key-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-top: 10px; }
#photo-key-form .control { flex: 1 1 255px; max-width: 420px; }
#photo-api-key-hint { margin: 0; color: var(--muted); font-size: 12px; }
#photo-key-actions { flex-basis: 100%; }
#photo-key-status { flex-basis: 100%; margin: 0; }
.photo-nav { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--edge); border-radius: 9px; background: var(--panel); }
.photo-nav .button[aria-current] { border-color: var(--accent-edge); color: var(--accent); background: var(--accent-wash); }
.media-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.gallery { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-bottom: 14px; }
.simple-photo-result .gallery-item:only-child { grid-column: 1 / -1; }
.simple-photo-result .gallery-item:only-child .photo-select { aspect-ratio: auto; }
.simple-photo-result .gallery-item:only-child img { display: block; width: 100%; max-height: 65vh; object-fit: contain; }
.gallery-item {
  min-width: 0; overflow: hidden;
  border: 1px solid var(--control-edge); border-radius: 10px; background: #161616;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-select { position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; background: none; }
.photo-select:focus-visible { outline-offset: -4px; }
.gallery-item.is-profile-photo { border-color: var(--accent-edge); }
.photo-expand { position: absolute; bottom: 6px; right: 6px; display: grid; place-items: center; width: 27px; height: 27px; border-radius: 6px; color: #fff; background: #111d; }
.photo-expand .icon { width: 14px; height: 14px; }
.photo-card-actions { display: flex; min-height: 41px; align-items: center; justify-content: space-between; gap: 2px; padding: 0 3px; }
.simple-photo-result .photo-card-actions { justify-content: flex-end; gap: 4px; }
.photo-card-actions .photo-download { min-height: 30px; padding: 4px 7px; }
.photo-card-actions .simple-photo-reference { min-height: 30px; padding: 4px; font-size: 11px; white-space: normal; }
.photo-card-actions .use-photo-reference { flex: 0 0 28px; min-width: 28px; }
.photo-card-actions .use-photo-reference .icon { width: 15px; height: 15px; }
.photo-model-name { padding: 6px 8px 0; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
#gallery { grid-template-columns: repeat(auto-fill, minmax(min(100%, 132px), 1fr)); }
#gallery .gallery-item { display: flex; flex-direction: column; }
#gallery .photo-select { flex: none; }
#gallery .photo-card-actions {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px; margin-top: auto; padding: 4px; justify-items: center;
}
#gallery :is(.photo-current, .set-profile-photo) {
  grid-column: 1 / -1; width: 100%; min-height: 36px; padding: 4px;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  font-size: 12px; text-align: center; white-space: normal;
}
.photo-current { color: var(--accent); font-weight: 650; }
.photo-current .icon { width: 14px; height: 14px; }
#gallery .use-photo-reference:last-child { grid-column: 1 / -1; }
.remove-photo .icon { width: 15px; height: 15px; }
.gallery-empty {
  grid-column: 1 / -1; display: grid; align-content: center; justify-items: center; gap: 8px;
  min-height: 145px; border: 1px dashed var(--control-edge); border-radius: 10px;
  color: var(--muted); font-size: 13px;
}
.gallery-empty .icon { width: 27px; height: 27px; color: var(--accent); }
.photo-dialog {
  max-width: calc(100vw - 24px); max-height: 90dvh; padding: 8px;
  border: 1px solid var(--control-edge); border-radius: 12px; background: var(--panel);
}
.photo-dialog::backdrop { background: #090909d9; }
.photo-dialog img { display: block; max-width: 100%; max-height: calc(90dvh - 72px); margin-inline: auto; border-radius: 7px; object-fit: contain; }
.photo-dialog form { position: absolute; top: 12px; right: 12px; }
.photo-dialog button { background: #111e; color: #fff; }
.photo-dialog-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 8px; }
#download-preview-photo { flex: none; width: fit-content; }
.photo-dialog-note { flex: 1 1 190px; max-width: 38ch; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.upload { position: relative; cursor: pointer; }
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.muted { color: var(--muted); }
.small { margin-top: 8px; font-size: 12px; }
.appearance-form { display: grid; gap: 12px; }
.studio-view .sub-layout { gap: 12px; }
.studio-view { min-width: 0; padding: 12px; }
.studio-heading h2 { display: flex; align-items: center; gap: 8px; font-size: 20px; }
.studio-view [data-photo-view="studio"] { grid-template-columns: minmax(0, 1fr); }
.studio-view .sub-panel { padding: 12px; }
.studio-view .sub-head { margin-bottom: 10px; }
.studio-view .appearance-form { gap: 7px; }
.studio-view .gallery-empty { min-height: 92px; }
.studio-view .control { gap: 3px; }
.studio-view .control :is(input:not([type=file]), select) { min-height: 33px; }
.studio-view .control textarea { padding-block: 6px; }
.photo-form-tabs {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px;
  padding: 3px; border: 1px solid var(--edge); border-radius: 9px; background: #0e0e10;
}
.photo-form-tabs .tab {
  min-height: 40px; justify-content: flex-start; padding: 5px 8px;
  border-radius: 6px; text-align: start; white-space: normal;
}
.photo-form-tabs .tab[aria-selected="true"] { border-bottom-color: var(--accent-edge); }
.photo-form-tabs .tab > span { min-width: 0; }
.photo-form-tabs small { display: block; color: var(--muted); font-size: 11px; line-height: 1.2; }
.photo-model-panel {
  display: grid; gap: 8px; min-width: 0; padding: 9px;
  border: 1px solid var(--edge); border-radius: 8px; background: #101013;
}
.photo-prices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.photo-prices button {
  display: grid; justify-items: start; gap: 2px; min-width: 0; padding: 4px 6px;
  border: 1px solid var(--control-edge); border-radius: 8px; background: var(--panel); color: var(--muted);
  font-size: 11px; line-height: 1.25; cursor: pointer;
}
.photo-prices strong { color: var(--text); font-size: 13px; white-space: nowrap; }
.photo-prices button[aria-pressed=true], .photo-prices button:hover { border-color: var(--accent-edge); background: var(--accent-wash); }
.photo-builder {
  display: grid; gap: 6px; min-width: 0; padding: 7px; border: 1px solid var(--edge); border-radius: 8px;
  container-type: inline-size;
}
.tabs.photo-builder-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; padding: 0; }
.photo-builder-tabs .tab { min-height: 32px; padding: 3px 5px; border: 1px solid var(--edge); border-radius: 7px; background: var(--panel); }
.photo-builder-tabs .tab .icon { display: block; width: 14px; height: 14px; }
.photo-builder-tabs .tab[aria-selected=true] { border-color: var(--accent-edge); background: var(--accent-wash); }
.photo-category-panel { display: grid; gap: 7px; min-width: 0; padding: 6px 0 0; border-top: 1px solid var(--edge); }
.photo-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 10px; }
.studio-view .photo-choices .control select { min-height: 36px; padding-block: 5px; text-overflow: ellipsis; }
.photo-choices select:hover { border-color: var(--accent-edge); }
.photo-scene-choice { display: grid; align-content: start; gap: 5px; min-width: 0; }
.photo-slider { display: grid; gap: 2px; min-width: 0; color: var(--muted); font-size: 12px; }
.photo-slider-label { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 5px; }
.photo-slider-label strong { color: var(--accent); font-size: 11px; font-weight: 650; }
.photo-slider input { width: 100%; min-width: 0; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.photo-builder-apply { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.photo-builder-apply p { flex: 1 1 185px; color: var(--muted); font-size: 12px; }
.photo-preset-locks { display: flex; flex-wrap: wrap; gap: 4px 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
.photo-preset-locks legend { margin-bottom: 3px; color: var(--muted); font-size: 12px; }
.photo-preset-locks label { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.photo-preset-locks input { margin: 0; accent-color: var(--accent); }
.photo-preset-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.photo-preset-actions .button { min-height: 32px; }
@container (max-width: 539px) {
  .tabs.photo-builder-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .photo-builder-tabs .tab .icon { display: none; }
}
@container (max-width: 275px) { .tabs.photo-builder-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 320px) { .photo-choices { grid-template-columns: minmax(0, 1fr); } }
@media (pointer: coarse) { .studio-view .photo-choices .control select { min-height: 44px; } }
.photo-status { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.photo-status:empty { display: none; }
.photo-status.is-error { color: #ff9ca7; }
.photo-rules {
  display: flex; align-items: flex-start; gap: 8px; padding: 9px 10px;
  border: 1px solid var(--edge); border-radius: 8px; background: var(--accent-wash);
  color: var(--muted); font-size: 12px;
}
.photo-rules .icon { width: 16px; height: 16px; color: var(--accent); }
#persona-reference-status { align-items: center; flex-wrap: wrap; }
#persona-reference-status img { width: 42px; height: 42px; object-fit: cover; border-radius: 5px; }
#persona-reference-status span { flex: 1; min-width: 120px; overflow-wrap: anywhere; }
#reset-photo-reference { padding-inline: 5px; }
@media (max-width: 767px) {
  [data-photo-view=gallery] > section:first-child { order: 2; }
}
.action-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.plan-grid { grid-template-columns: repeat(3,minmax(0,1fr)); align-items: stretch; }
.plan { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.plan h2, .research h2 { font-size: 19px; letter-spacing: -.028em; }
.plan p, .research p, .research li { color: var(--muted); font-size: 14px; }
.plan-status { margin-top: auto; color: var(--accent); font-size: 13px; }
.plan-status.available { color: var(--green); }
.api-panel { display: flex; align-items: center; gap: 12px; margin-top: 17px; }
.api-panel button { margin-inline-start: auto; }
.api-docs { display: grid; gap: 12px; max-width: 860px; }
.api-docs h2 { margin: 0 0 8px; font-size: 17px; }
.api-docs h3 { margin: 0; font-size: 14px; }
.api-docs p, .api-docs dd { color: var(--muted); line-height: 1.55; overflow-wrap: anywhere; }
.api-docs p { margin: 6px 0; }
.api-docs code { color: var(--accent); }
.api-method { margin-inline-end: 4px; font-weight: 700; }
.api-fields { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 12px 0; font-size: 13px; }
.api-fields dd { margin: 0; }
.api-example-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; margin: 14px 0 6px; }
.api-docs pre { max-width: 100%; overflow: auto; margin: 0; padding: 10px 12px; border: 1px solid var(--edge); border-radius: 8px; background: #0d0d0f; }
.research { display: grid; gap: 17px; max-width: 1000px; }
.research p, .research ul, .research ol, .research h3 { margin-top: 10px; }
.research ul, .research ol { margin-bottom: 0; padding-inline-start: 23px; }
.research li + li { margin-top: 7px; }
.research a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.research strong { color: var(--text); }
.research code { color: var(--accent); }
.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 27;
  max-width: calc(100vw - 40px); padding: 11px 16px;
  border: 1px solid var(--accent-edge); border-radius: 9px;
  background: #19191d; color: var(--text); box-shadow: 0 10px 30px #000a; font-size: 13px;
}
.rain-layer { display: none; }
@media (any-hover: hover) and (any-pointer: fine) {
  .rain-layer { display: block; position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity .24s ease-out; }
  #background-rain { z-index: -1; }
  #card-rain { z-index: 2; }
  .rain-active .rain-layer { opacity: 1; }
}
.cursor-fluid { position: fixed; z-index: 4; inset: 0; width: 100%; height: 100%; pointer-events: none; }
@media (max-width: 1090px) {
  .tab { padding-inline: 9px; }
}
@media (min-width: 820px) {
  [data-persona-layout="column"] .result { grid-template-columns: minmax(235px, min(23%, 300px)) minmax(0,1fr); gap: 13px; align-items: start; }
  [data-persona-layout="column"] .profile { position: sticky; top: calc(var(--visible-header-height) + 7px); }
  [data-persona-layout="column"] .identity { flex-direction: column; align-items: flex-start; gap: 12px; }
  [data-persona-layout="column"] .profile-main { padding: 20px 16px; }
  [data-persona-layout="column"] .profile .avatar { width: 100px; height: 112px; }
  [data-persona-layout="column"] .profile-email .mail-symbol { display: none; }
}
@media (max-width: 1199px) {
  [data-persona-country="AE"] #country-full { display: none; }
  [data-persona-country="AE"] #country-short { display: inline; }
}
@media (651px <= width <= 1000px) {
  .generation-context { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); }
  .generation-item:nth-child(4n+1) { border-inline-start: 0; }
  .age-editor { min-width: 0; }
  :is(#city-editor, #career-editor) .config-options { inset-inline: 0 auto; }
}
@media (max-width: 650px) {
  .header-tools { gap: 3px; }
  .theme { gap: 5px; padding-inline: 7px; font-size: 12px; }
  .theme .icon { width: 13px; height: 13px; }
  .nav-item { gap: 5px; min-height: 39px; padding-inline: 7px; font-size: 13px; }
  .nav-item .icon { width: 14px; height: 14px; }
  .workspace { padding-top: 12px; }
  .page-head { margin-bottom: 14px; }
  .page-head h1 { gap: 8px; }
  .page-head p { font-size: 13px; }
  .generation-bar { display: grid; grid-template-columns: minmax(0,1fr); margin-bottom: 10px; padding: 6px 8px; gap: 5px; }
  .generation-context { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .generation-item { position: static; }
  .generation-item:nth-child(odd) { border-inline-start: 0; }
  .generation-control { padding-inline: 6px; }
  .age-editor { min-width: 0; }
  .generation-popover { inset-inline-start: 8px; }
  .generation-popover.config-options, :is(#city-editor, #career-editor) .config-options { inset-inline: auto 8px; }
  .generate.button { gap: 5px; padding-inline: 8px; font-size: 12px; }
  .generate .icon { width: 14px; height: 14px; }
  .result { gap: 13px; }
  .profile-main, .field-table { padding-inline: 12px; }
  .avatar { width: 62px; height: 62px; }
  .identity { gap: 10px; }
  .identity-copy { flex: 1; }
  .profile-email .mail-symbol { display: none; }
  .profile-email > div:first-of-type { padding-inline-start: 4px; }
  .field-row { grid-template-columns: minmax(82px, .76fr) minmax(0,1.25fr); gap: 6px; font-size: 13px; }
  .field-data { gap: 2px; }
  .field-value-group { gap: 4px; }
  .field-label { gap: 7px; }
  .details-toolbar { display: grid; grid-template-columns: minmax(0,1fr); gap: 0; }
  .tabs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 2px; padding-inline: 5px; }
  .profile-view-menu { gap: 2px; padding-inline: 5px; }
  .profile-view-menu .tabs { flex: 1; }
  .studio-view-menu { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tab { gap: 4px; padding-inline: 4px; font-size: 12px; }
  .tab .icon { display: none; }
  .batch-actions { width: 100%; justify-content: flex-end; border-top: 1px solid var(--edge); }
  .studio-heading { flex-wrap: wrap; gap: 10px; }
  .sub-layout, .plan-grid { grid-template-columns: minmax(0,1fr); gap: 14px; }
  .sub-panel { padding: 15px; }
  .api-panel { flex-wrap: wrap; }
  .api-panel button { margin-inline-start: 0; }
  .action-row .button { white-space: normal; }
}
@media (365px <= width <= 650px) {
  .generation-context { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .generation-item:nth-child(odd):not(:first-child) { border-inline-start: 1px solid var(--edge); }
  .generation-item:nth-child(3n+1) { border-inline-start: 0; }
}
@media (651px <= width <= 1250px) {
  [data-resident-filter] .generation-context { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); }
  [data-resident-filter] .generation-item:nth-child(4n+1) { border-inline-start: 0; }
  [data-resident-filter] #country-editor { width: auto; }
  [data-resident-filter] #citizenship-editor .config-options { inset-inline: auto 0; }
}
@media (max-width: 650px) {
  [data-resident-filter] .generation-context { grid-template-columns: repeat(2,minmax(0,1fr)); }
  [data-resident-filter] #country-editor { grid-column: 1 / -1; }
  [data-resident-filter] .generation-item:nth-child(even) { border-inline-start: 0; }
  [data-resident-filter] .generation-item:nth-child(odd):not(:first-child) { border-inline-start: 1px solid var(--edge); }
  [data-resident-filter] :is(#citizenship-editor, #gender-editor, #career-editor) .generation-popover {
    inset-inline: auto 0;
  }
  [data-resident-filter] #city-editor .config-options { inset-inline: 0 auto; }
}
@media (max-width: 1000px) {
  #country-editor { width: auto; }
}
@media (max-width: 450px) {
  .saved-search { flex-basis: 100%; }
  .saved-sort span { display: none; }
  .saved-count { margin-inline-start: auto; }
  .saved-detail .saved-summary { max-width: 360px; }
  .saved-portrait { max-height: 180px; }
  .generation-popover { width: calc(100% - 16px); }
  :is(.field-controls .icon-button, .field-value-group > .copy-field) { width: 29px; }
  .field-row:has(.format-field) .field-data { flex-wrap: wrap; row-gap: 3px; }
  .field-row:has(.format-field) .field-value-group { flex-basis: 100%; }
  .gallery { gap: 6px; }
  .gallery[data-mode="gallery"] { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 370px) {
  .generate-full { display: none; }
  .generate-short { display: inline; }
}
@media (pointer:coarse) {
  .button, .nav-item, .tab, .segmented span, .field-label, .config-option { min-height: 44px; }
  .inline-edit-option { min-height: 37px; }
  .inline-editor .inline-edit-input { font-size: 16px; }
  .icon-button { width: 44px; height: 44px; }
  .field-controls .icon-button, .field-value-group > .copy-field, .section-actions .icon-button { min-height: 36px; }
  .accent-swatch { height: 44px; }
  .age-slider { height: 42px; }
}
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
