.account {
  padding-block: clamp(32px, 8vw, 88px);
}

.account [hidden] { display: none; }

.account-card {
  width: min(100%, 530px);
  margin-inline: auto;
  padding: clamp(22px, 5vw, 42px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--bg-soft);
  box-shadow: var(--shadow);
}

.account-card.is-signed-in { width: min(100%, 760px); }

.account-card:not(.is-signed-in) {
  width: min(100%, 424px);
  padding: clamp(16px, 4vw, 32px);
}

.account-card:not(.is-signed-in) h1 { text-align: center; }

.feedback-card:not(.is-signed-in) { width: min(100%, 580px); }
.feedback-card:not(.is-signed-in) h1 { text-align: start; }
.feedback-card .account-fields textarea {
  font-family: inherit;
  resize: vertical;
}

.account-auth-intro {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}

.account-auth-fields {
  display: grid;
  min-inline-size: 0;
  gap: 16px;
  padding: 0;
  margin: 22px 0 0;
  border: 0;
}

.account-auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}

.account-auth-tabs button {
  min-height: 44px;
  padding: 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

.account-auth-tabs button[aria-selected="true"] {
  background: var(--surface-2);
  color: var(--text);
}

.account-auth-tabs button:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: -2px;
}

.account-card h1 {
  margin: 0 0 14px;
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.1;
  letter-spacing: -.04em;
}

.account-status, .account-card small, .account-terms, #account-profile-email {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.account-status:empty { display: none; }
.account-status[data-error] { color: #ffb6bf; }

.account-fields {
  min-inline-size: 0;
  display: grid;
  justify-items: start;
  gap: 16px;
  padding: 0;
  margin: 22px 0 0;
  border: 0;
}

.account-email-fields { margin-top: 0; }
.account-email-fields .button.primary { width: 100%; }

.account-fields label {
  display: grid;
  width: 100%;
  gap: 6px;
  font-size: 14px;
}

.account-fields input:not([type="checkbox"]), .account-fields textarea {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 16px;
}

.account-fields :focus-visible, .account-link:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 3px;
}

.account-fields :disabled, .account button:disabled { opacity: .6; cursor: default; }

.account-actions { display: flex; flex-wrap: wrap; gap: 4px 18px; }

.account-link {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.account-terms { margin: 0; }

.account-vk-options { width: min(100%, 360px); margin-inline: auto; }

.account-identity {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding-block: 12px;
}

.account-avatar {
  flex: 0 0 64px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--accent-soft);
  font-size: 24px;
  font-weight: 750;
}

.account-avatar img { object-fit: cover; }
.account-identity-copy { flex: 1 1 120px; min-width: 0; overflow-wrap: anywhere; }
.account-identity-copy span { display: block; }
.account-fields .account-checkbox { grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 8px; }
.account-checkbox input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent-soft); }
.account-checkbox small { display: block; margin-top: 4px; }
#account-settings { max-width: 500px; }
#account-avatar-form { border-top: 1px solid var(--line); margin-top: 24px; }

#account-library, #account-settings { margin-top: 22px; }

.account-card h2 {
  margin: 0 0 12px;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -.025em;
}

.account-shelves {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 3px 3px 0;
  border-bottom: 1px solid var(--line);
}

.account-shelves button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.account-shelves button[aria-pressed="true"] {
  border-bottom-color: var(--accent-soft);
  color: var(--accent-soft);
}

.account-shelves button:focus-visible, .account-show-actions:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: -2px;
}

.account-show-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.account-show {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding-block: 14px;
  border-bottom: 1px solid var(--line);
}

.account-show:last-child { border-bottom: 0; }

.account-show-poster {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface);
}

.account-show-title {
  display: inline-block;
  color: var(--text);
  font-weight: 750;
  line-height: 1.3;
  text-decoration: none;
  overflow-wrap: anywhere;
}

a.account-show-title:hover { text-decoration: underline; }

.account-show-meta, .account-show-progress { margin: 5px 0 0; font-size: 13px; line-height: 1.4; }
.account-show-meta { color: var(--muted); }
.account-show-progress { color: var(--accent-soft); }

.account-show-actions {
  max-width: 145px;
  min-height: 44px;
  padding: 4px 7px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}

@media (max-width: 520px) {
  .account-show { grid-template-columns: 54px minmax(0, 1fr); gap: 6px 12px; }
  .account-show-poster { grid-row: span 2; align-self: start; }
  .account-show-actions { grid-column: 2; justify-self: start; }
}
