.account-page {
  --account-muted: #595766;
  --account-line: #e9e7ee;
  --account-soft: #f3f2f7;
  --account-red: #c91d3a;
  width: min(100%, 872px);
  margin-inline: auto;
  padding: 16px clamp(15px, 4.8vw, 40px) 38px;
}

.account-page [hidden], [data-account-private][hidden], [data-account-reconciliation][hidden] { display: none; }
.account-page svg { flex: none; }
.account-heading { min-width: 0; }
.account-heading h1 {
  margin: 0;
  font-size: clamp(29px, 6.2vw, 47px);
  line-height: 1.1;
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
}
.account-heading p { max-width: 49ch; margin: 9px 0 0; color: var(--account-muted); line-height: 1.48; }
.account-back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: -9px 0 7px; color: #4a4560; font-size: 14px; font-weight: 650; text-decoration: none; }
.account-back svg { width: 17px; height: 17px; }
.account-overview { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.account-overview > * { min-width: 0; }

.account-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 13px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.28;
  overflow-wrap: anywhere;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.account-button svg { width: 17px; height: 17px; }
.account-button-primary { color: #fff; background: var(--account-red); }
.account-button-quiet { background: #fff; border-color: #dedce6; color: #211d2b; }
.account-button-text { color: #47415c; background: transparent; padding-inline: 3px; }

.account-identity { display: flex; align-items: center; gap: 11px; max-width: 100%; padding: 7px 13px 7px 7px; border-radius: 17px; background: var(--account-soft); }
.account-identity > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.account-identity strong, .account-identity small { display: block; }
.account-identity strong { font-size: 14px; }
.account-identity small { margin-top: 2px; color: var(--account-muted); font-size: 12px; }
.account-avatar { flex: none; display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; color: #6e2440; background: #f8dbe2; font-weight: 760; }
.account-avatar svg { width: 20px; height: 20px; }
.account-sign-out { padding: 4px 0; border: 0; color: #514566; background: transparent; font-size: 12px; text-decoration: underline; cursor: pointer; }
.account-collection { margin-top: clamp(22px, 5vw, 40px); }
.account-section-heading { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.account-section-heading h2, .account-panel h2, .account-submit h2 { margin: 0; font-size: clamp(19px, 4vw, 23px); line-height: 1.18; letter-spacing: -.025em; overflow-wrap: anywhere; }
.account-empty { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: clamp(16px, 4vw, 26px); background: var(--account-soft); border-radius: 19px; }
.account-empty h3, .account-empty p { margin: 0; }
.account-empty h3 { font-size: 17px; }
.account-empty p { max-width: 46ch; margin-top: 5px; color: var(--account-muted); font-size: 14px; line-height: 1.38; }
.account-empty-icon, .account-guest-icon { display: grid; width: 49px; height: 49px; place-items: center; border-radius: 15px; color: #493c59; background: #e8e4ee; }
.account-empty-icon svg, .account-guest-icon svg { width: 25px; height: 25px; }
.account-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: stretch; gap: 11px; }
.account-listing { display: grid; grid-template-columns: clamp(72px, 14vw, 102px) minmax(0,1fr); gap: 12px; min-width: 0; padding: 10px; border: 1px solid var(--account-line); border-radius: 16px; }
.account-listing-cover { display: grid; min-height: 94px; aspect-ratio: 4/5; place-items: center; align-self: start; overflow: hidden; border-radius: 11px; background: var(--account-soft); color: #716981; }
.account-listing-cover img { width: 100%; height: 100%; object-fit: cover; }
.account-listing-cover svg { width: 24px; height: 24px; }
.account-listing-meta { display: flex; align-items: center; min-height: 24px; }
.account-listing h3, .account-listing p { margin: 5px 0 0; overflow-wrap: anywhere; }
.account-listing h3 { font-size: 17px; line-height: 1.2; }
.account-listing p { color: var(--account-muted); font-size: 13px; line-height: 1.35; }
.account-listing-actions { display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; margin-top: 6px; }
.account-listing-actions .account-button { min-height: 38px; padding: 7px; border-radius: 9px; font-size: 13px; }
.account-badge { display: inline-flex; align-items: center; gap: 5px; width: fit-content; padding: 5px 8px; border-radius: 7px; color: #545063; background: #eceaf2; font-size: 11px; font-weight: 740; line-height: 1.2; }
.account-badge::before { content: ''; width: 6px; height: 6px; flex: none; border-radius: 50%; background: currentColor; }
.account-badge[data-account-status='submitted'] { color: #775115; background: #fff3d9; }
.account-badge[data-account-status='published'] { color: #246145; background: #e3f4e9; }
.account-badge:is([data-account-status='hidden'], [data-account-status='expired']) { color: #8b2941; background: #f9e4eb; }

.account-guest { display: grid; gap: 16px; width: min(100%, 550px); margin: clamp(8px, 6vh, 55px) auto; padding: clamp(18px, 5vw, 33px); border: 1px solid var(--account-line); border-radius: 20px; background: #faf9fc; }
.account-guest .account-heading h1 { font-size: clamp(29px, 6vw, 40px); }
.account-guest-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.account-guest-actions p, .account-login-status { width: 100%; margin: 0; color: var(--account-muted); font-size: 14px; line-height: 1.4; }
.account-guest [data-account-login-retry] { justify-self: start; }
.account-message { display: flex; align-items: center; gap: 7px; margin: 14px 0 0; padding: 12px; border-radius: 12px; font-size: 14px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.account-message svg { width: 19px; height: 19px; }
.account-message-ok { color: #245640; background: #e6f4ec; }
.account-message-error { color: #95243e; background: #fdebf0; }

.account-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(214px, 29%); gap: 15px; align-items: start; margin-top: 19px; }
.account-editor-main { min-width: 0; display: grid; gap: 15px; }
.account-panel, .account-submit { min-width: 0; padding: clamp(14px, 2.8vw, 22px); border: 1px solid var(--account-line); border-radius: 17px; }
.account-panel h2 { margin-bottom: 17px; }
.account-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.account-field { display: grid; align-content: start; gap: 7px; min-width: 0; }
.account-field-wide { grid-column: 1 / -1; }
.account-field > label, .account-type legend, .spoken-languages legend { color: #262333; font-size: 15px; font-weight: 680; line-height: 1.3; overflow-wrap: anywhere; }
.account-field :is(input:not([type='checkbox'], [type='file']), textarea, select), .account-ai-edit :is(input, textarea) {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid #e2dfeb;
  border-radius: 11px;
  background: #f7f6fa;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
}
.account-field :is(input, textarea, select):focus, .account-ai-edit :is(input, textarea):focus { background: #fff; }
.account-field textarea, .account-ai-edit textarea { resize: vertical; }
.account-field select { text-overflow: ellipsis; }
.account-field :is(input, textarea)::placeholder { color: #6b677a; }
.account-field [aria-invalid='true'] { border-color: #b62142; }
.account-field small { color: var(--account-muted); font-size: 13px; line-height: 1.42; overflow-wrap: anywhere; }
.account-contact-panel h2 { margin-bottom: 7px; }
.account-contact-note { margin: 0 0 17px; color: var(--account-muted); font-size: 14px; line-height: 1.45; }
.account-field .account-field-error { color: #95243e; padding: 3px 0; font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
.spoken-languages { margin: 0; padding: 0; border: 0; }
.spoken-languages legend { margin-bottom: 8px; padding: 0; }
.spoken-language-options { display: flex; flex-wrap: wrap; gap: 7px; }
.spoken-language-options label {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px;
  border: 1px solid #e0dce9; border-radius: 12px; background: #f7f6fa; color: #3e354a; font-size: 15px; font-weight: 650; cursor: pointer;
}
.spoken-language-options label:has(input:checked) { border-color: #dc9baa; background: #fbeaf0; color: #86213d; }
.spoken-language-options input { width: 17px; height: 17px; margin: 0; accent-color: var(--account-red); }
.account-choice-field [data-choice-ui]:not([hidden]) { display: grid; gap: 9px; min-width: 0; }
.account-choice-items { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 7px; min-width: 0; }
.account-choice-items:empty { display: none; }
.account-choice-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #e0dce9;
  border-radius: 12px;
  background: #f7f6fa;
  color: #3e354a;
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-align: left;
  cursor: pointer;
}
.account-choice-chip::before {
  flex: none;
  width: 11px;
  height: 11px;
  border: 1px solid #9790a4;
  border-radius: 50%;
  content: '';
}
.account-choice-chip[aria-pressed='true'] { border-color: #dc9baa; background: #fbeaf0; color: #86213d; }
.account-choice-chip[aria-pressed='true']::before {
  width: 10px;
  height: 6px;
  border: solid currentColor;
  border-width: 0 0 2px 2px;
  border-radius: 0;
  transform: rotate(-45deg);
}
.account-choice-add { min-width: 0; }
.account-choice-add summary { width: fit-content; min-height: 44px; padding: 12px 2px 9px; color: #5b3957; font-size: 14px; font-weight: 650; cursor: pointer; }
.account-choice-add-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; gap: 7px; margin-bottom: 2px; }
.account-choice-add-row .account-button { min-height: 48px; }
.account-type { min-width: 0; margin: 0 0 16px; padding: 0; border: 0; }
.account-type legend { margin-bottom: 8px; }
.account-type-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.account-type-options label { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'icon radio' 'text text'; align-content: start; align-items: center; gap: 8px; min-width: 0; min-height: 94px; padding: 10px; border: 1px solid #e2dfeb; border-radius: 11px; cursor: pointer; }
.account-type-options label:has(input:checked) { border-color: #ce7188; background: #fdf1f4; }
.account-type-options input { grid-area: radio; width: 18px; height: 18px; flex: none; margin: 0; accent-color: var(--account-red); }
.account-type-icon { grid-area: icon; display: grid; align-items: center; color: #624963; }
.account-type-icon svg { width: 19px; height: 19px; }
.account-type-options span:last-child { grid-area: text; min-width: 0; overflow-wrap: anywhere; }
.account-type-options strong, .account-type-options small { display: block; }
.account-type-options strong { font-size: 15px; }
.account-type-options small { margin-top: 2px; color: var(--account-muted); font-size: 12px; line-height: 1.35; }
.account-type-details { min-width: 0; margin: 0; padding: 0; border: 0; }

.account-photo-grid { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 15px; }
.account-photo-field { gap: 8px; }
.account-photo-preview { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.account-photo-thumb { display: grid; width: 65px; aspect-ratio: 1; place-items: center; overflow: hidden; border-radius: 9px; background: var(--account-soft); color: #645773; }
.account-photo-field:first-child .account-photo-thumb { width: clamp(72px, 12vw, 96px); }
.account-photo-thumb svg { width: 22px; height: 22px; }
.account-photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.account-photo-unit { position: relative; }
.account-photo-remove {
  position: absolute;
  inset-block-start: 0;
  inset-inline-end: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 12px, #21182940 13px, transparent 14px);
  color: #33273b;
  font: 650 22px/1 var(--brand-font);
  cursor: pointer;
}
.account-photo-remove:hover { color: var(--account-red); }
.account-photo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 7px; }
.account-file-label { position: relative; }
.account-file-label:focus-within { outline: 2px solid var(--purple); outline-offset: 3px; }
.account-photo-actions .account-button { min-height: 46px; padding: 10px; font-size: 14px; }
.account-photo-field:has([type='file']:focus-visible) > label { color: var(--account-red); }

.account-editor-aside { position: sticky; top: calc(var(--header-height) + 10px); min-width: 0; }
.account-submit { background: var(--account-soft); }
.account-submit h2 { margin-top: 9px; font-size: clamp(17px, 3vw, 21px); }
.account-submit p, .account-privacy { margin: 7px 0 0; color: var(--account-muted); font-size: 13px; line-height: 1.42; overflow-wrap: anywhere; }
.account-submit-actions { display: grid; gap: 6px; margin-top: 12px; }
.account-submit .account-preview-saves { margin-top: 8px; font-size: 12px; }
.account-preview-heading { padding-bottom: 2px; }
.account-preview-overview { align-items: flex-end; }
.account-preview-overview .account-heading h1 { font-size: clamp(27px, 5.6vw, 41px); }
.account-preview-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.account-preview-actions p { flex-basis: 100%; margin: 0; color: var(--account-muted); font-size: 12px; }

.account-ai-action { grid-column: 1 / -1; margin-top: 15px; padding: 12px; border: 1px solid #f0d9e1; border-radius: 13px; background: #fcf2f5; }
.account-ai-start { min-height: 48px; border-color: #e7b8c5; color: #8f2440; font-size: 15px; }
.account-ai-action > p { margin: 8px 0 0; color: var(--account-muted); font-size: 14px; line-height: 1.42; overflow-wrap: anywhere; }
.account-ai-action > .account-ai-status:empty { margin: 0; }
.account-ai-status[data-error], .account-ai-footer [data-account-ai-feedback][data-error] { color: #95243e; }
.account-ai-dialog button:disabled, .account-ai-start:disabled { cursor: default; opacity: .65; }

.account-translation-panel { display: grid; gap: 9px; }
.account-translation-panel h2 { margin-bottom: 4px; }
.account-translation-panel > p { margin: 0 0 5px; color: var(--account-muted); font-size: 14px; line-height: 1.42; }
.account-translation { min-width: 0; border: 1px solid #e2dfeb; border-radius: 11px; }
.account-translation summary { min-height: 48px; padding: 13px 12px; font-size: 16px; font-weight: 690; line-height: 1.36; overflow-wrap: anywhere; cursor: pointer; }
.account-translation[open] summary { border-radius: 10px 10px 0 0; background: var(--account-soft); }
.account-translation-fields { min-width: 0; margin: 0; padding: 12px; border: 0; }

.account-ai-dialog {
  width: min(740px, calc(100% - 26px));
  max-width: none;
  max-height: min(850px, calc(100vh - 28px));
  max-height: min(850px, calc(100dvh - 28px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--account-line);
  border-radius: 19px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 14px 54px #2b203a38;
}
.account-ai-dialog[open] { display: flex; flex-direction: column; }
.account-ai-dialog::backdrop { background: #231b33a3; }
.account-ai-header { flex: none; padding: clamp(14px, 3.6vw, 23px) clamp(13px, 3.6vw, 23px) 0; border-bottom: 1px solid var(--account-line); }
.account-ai-header h2 { margin: 0; font-size: clamp(23px, 4.8vw, 30px); line-height: 1.16; letter-spacing: -.025em; overflow-wrap: anywhere; }
.account-ai-header p { margin: 6px 0 0; color: var(--account-muted); font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.account-ai-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin-top: 12px; }
.account-ai-tabs button { min-width: 0; min-height: 48px; padding: 6px 3px; border: 0; border-bottom: 3px solid transparent; background: none; font-size: 15px; font-weight: 690; line-height: 1.2; overflow-wrap: anywhere; cursor: pointer; }
.account-ai-tabs button[aria-selected='true'] { border-color: var(--account-red); color: #93223e; }
.account-ai-body { flex: 1; min-height: 0; padding: clamp(12px, 3.5vw, 21px); overflow-y: auto; overscroll-behavior: contain; }
.account-ai-notes { margin-bottom: 13px; padding: 12px; border: 1px solid #eee2d0; border-radius: 10px; background: #fcf7ef; color: #6f502a; font-size: 14px; line-height: 1.42; overflow-wrap: anywhere; }
.account-ai-notes ul { margin: 5px 0 0; padding-inline-start: 21px; }
.account-ai-fields { display: grid; gap: 11px; }
.account-ai-fields > p { margin: 0; color: var(--account-muted); font-size: 15px; line-height: 1.4; }
.account-ai-suggestion { min-width: 0; padding: 11px; border: 1px solid #e5e0eb; border-radius: 12px; }
.account-ai-suggestion:has(.account-ai-check input:checked) { border-color: #dfabb9; }
.account-ai-check { display: flex; align-items: center; gap: 9px; min-height: 38px; margin-bottom: 4px; font-size: 16px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; cursor: pointer; }
.account-ai-check input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--account-red); }
.account-ai-comparison { display: grid; gap: 9px; }
.account-ai-comparison:has(.account-ai-before) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.account-ai-before, .account-ai-edit { display: grid; align-content: start; gap: 5px; min-width: 0; margin: 0; color: var(--account-muted); font-size: 13px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.account-ai-before p { max-height: 12rem; margin: 0; padding: 10px; overflow: auto; border-radius: 10px; background: #f0eef5; color: var(--ink); font-size: 15px; font-weight: 400; white-space: pre-wrap; }
.account-ai-edit :is(input, textarea) { background: #f9f7fb; }
.account-ai-edit textarea { min-height: 78px; }
.account-ai-footer { display: flex; flex: none; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 11px clamp(13px, 3.6vw, 23px); border-top: 1px solid var(--account-line); background: #fbfafc; }
.account-ai-footer [data-account-ai-feedback] { min-width: 0; margin: 0; color: var(--account-muted); font-size: 14px; line-height: 1.42; overflow-wrap: anywhere; }
.account-ai-footer-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.account-ai-footer-actions .account-button { min-height: 48px; font-size: 15px; }

@media (hover: hover) {
  .account-button-primary:hover { background: #b41934; }
  .account-button-quiet:hover { border-color: #c3bed2; background: #faf9fc; }
  .account-ai-start:hover { border-color: #cf8498; background: #fdf6f8; }
  .account-choice-chip:hover { border-color: #c58096; }
  .account-button-text:hover, .account-back:hover { text-decoration: underline; }
}

@media (max-width: 690px) {
  .account-editor { grid-template-columns: minmax(0, 1fr); }
  .account-editor-aside { position: static; }
  .account-submit-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .account-submit-actions .account-button-primary { grid-column: 1 / -1; }
  .account-list { grid-template-columns: minmax(0,1fr); }
  .account-empty { grid-template-columns: auto minmax(0, 1fr); }
  .account-empty .account-button { grid-column: 2; justify-self: start; }
}

@media (max-width: 640px) {
  .account-editor-page { padding-inline: clamp(11px, 3.8vw, 22px); }
  .account-editor-main { gap: 14px; }
  .account-field-grid, .account-photo-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .account-panel, .account-submit { padding: clamp(14px, 3.8vw, 20px); }
  .account-field :is(input:not([type='checkbox'], [type='file']), textarea, select), .account-ai-edit :is(input, textarea) { min-height: 52px; padding: 13px; }
  .account-field textarea { min-height: 100px; }
  .account-field textarea[rows='4'] { min-height: 126px; }
  .account-photo-field:first-child .account-photo-thumb { width: 104px; }
  .account-photo-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .account-photo-actions .account-button, .account-submit-actions .account-button, .account-ai-start { min-height: 52px; padding: 11px 13px; font-size: 16px; }
  .account-photo-remove { width: 44px; height: 44px; }
  .account-submit p { font-size: 14px; }
  .account-submit-actions { gap: 8px; }
  .account-ai-action { padding: 10px; }
  .account-ai-start { width: 100%; }
  .account-translation summary { min-height: 52px; }
  .account-ai-comparison:has(.account-ai-before) { grid-template-columns: minmax(0, 1fr); }
  .account-ai-before p { max-height: 9rem; }
  .account-ai-edit textarea { min-height: 100px; }
  .account-ai-tabs button { min-height: 52px; }
  .account-ai-check { min-height: 44px; }
  .account-ai-footer-actions .account-button { min-height: 52px; }
}

@media (max-width: 520px) {
  .account-type-options, .account-submit-actions { grid-template-columns: minmax(0, 1fr); }
  .account-type-options label { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: 'icon text radio'; align-content: center; min-height: 57px; padding-inline: 12px; }
  .account-photo-field + .account-photo-field { padding-top: 14px; border-top: 1px solid var(--account-line); }
  .account-ai-dialog { width: calc(100% - 16px); }
  .account-ai-footer-actions { width: 100%; }
  .account-ai-footer-actions .account-button { flex: 1 1 100%; }
}

@media (max-width: 405px) {
  .account-overview { gap: 12px; }
  .account-choice-add-row { grid-template-columns: minmax(0, 1fr); }
}

@media (max-height: 440px) {
  .account-ai-dialog[open] { display: block; overflow-y: auto; overscroll-behavior: contain; }
  .account-ai-dialog .account-ai-body { overflow: visible; }
}
