.account-main {
  width: min(100%, 1180px);
  margin: 0 auto;
  min-width: 0;
}

.account-loading {
  display: grid;
  min-height: 320px;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--muted);
}

.account-loader {
  width: 34px;
  height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: account-spin 800ms linear infinite;
}

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

.account-home-icon {
  grid-column: 1;
  grid-row: 1;
  display: inline-grid;
  place-content: center;
  justify-self: start;
  width: 44px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: inherit;
  text-decoration: none;
}

.account-home-icon span {
  display: block;
  width: 15px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
  transform-origin: left center;
}

.account-home-icon span:first-child {
  transform: translateY(4px) rotate(-28deg);
}

.account-home-icon span:last-child {
  transform: translateY(-4px) rotate(28deg);
}

.account-shell {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.account-image-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 120px;
  background: var(--surface-muted);
  color: var(--muted);
  padding: 16px;
  text-align: center;
}

.account-head {
  display: grid;
  gap: 14px;
  margin-bottom: 8px;
}

.account-head h1 {
  max-width: 920px;
  font-size: clamp(40px, 7vw, 82px);
  overflow-wrap: anywhere;
}

.account-head p,
.account-muted,
.form-hint,
.empty-copy {
  color: var(--muted);
  line-height: 1.55;
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.account-sidebar,
.account-panel,
.auth-panel,
.empty-box {
  border: 1px solid rgba(247, 245, 238, 0.12);
  background: rgba(45, 49, 51, 0.78);
  box-shadow: var(--shadow);
  min-width: 0;
}

.account-sidebar {
  position: sticky;
  top: 100px;
  display: grid;
  gap: 8px;
  padding: 14px;
}

.account-sidebar a,
.account-menu-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  border: 1px solid transparent;
  color: var(--ink);
  background: transparent;
  padding: 0 12px;
  text-align: left;
  text-decoration: none;
}

.account-sidebar a.is-active,
.account-menu-button:hover,
.account-sidebar a:hover {
  border-color: var(--line);
  background: rgba(247, 245, 238, 0.05);
}

.account-panel,
.auth-panel,
.empty-box {
  padding: clamp(20px, 4vw, 34px);
}

.auth-panel {
  display: grid;
  gap: 24px;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.role-card {
  display: grid;
  gap: 12px;
  min-height: 170px;
  border: 1px solid var(--line);
  background: rgba(247, 245, 238, 0.04);
  color: var(--ink);
  padding: 22px;
  text-align: left;
}

.role-card strong {
  font-size: 26px;
  font-weight: 500;
  line-height: 1.1;
}

.role-card span {
  color: var(--muted);
  line-height: 1.45;
}

.role-card.is-selected {
  border-color: var(--accent);
  background: rgba(255, 227, 156, 0.1);
  box-shadow: 0 0 0 4px rgba(255, 227, 156, 0.22);
}

.account-form {
  display: grid;
  gap: 16px;
  min-width: 0;
}

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

.account-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.account-field input,
.account-field select,
.account-field textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.account-field input[type="file"] {
  overflow: hidden;
}

.account-field span {
  color: var(--muted);
  font-size: 13px;
}

.account-field textarea {
  width: 100%;
  min-height: 170px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
  outline: none;
  padding: 14px;
}

.account-field textarea:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 4px rgba(255, 227, 156, 0.45);
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.account-actions-start {
  justify-content: flex-start;
}

.account-actions a,
.top-actions .account-chip,
.profile-links a,
.empty-box a,
.project-card-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.account-alert {
  border: 1px solid rgba(245, 116, 116, 0.44);
  background: rgba(245, 116, 116, 0.12);
  color: #ffd8d8;
  padding: 12px 14px;
  line-height: 1.45;
}

.account-success {
  border: 1px solid rgba(143, 209, 158, 0.42);
  background: rgba(143, 209, 158, 0.12);
  color: #dff7e4;
  padding: 12px 14px;
  line-height: 1.45;
}

.profile-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  background: rgba(247, 245, 238, 0.04);
  padding: 14px;
}

.profile-status b {
  color: var(--accent);
  font-weight: 600;
}

.avatar-row {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.avatar-preview {
  display: grid;
  place-items: center;
  width: 116px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--accent);
  font-size: 36px;
  overflow: hidden;
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
}

.dashboard-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--surface-muted);
}

.dashboard-card-body {
  display: grid;
  gap: 12px;
  min-height: 100%;
  padding: 16px;
}

.dashboard-card strong {
  font-size: 21px;
  font-weight: 500;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.dashboard-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.dashboard-card div {
  min-width: 0;
}

.dashboard-card dt {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-card dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.moderator-feedback {
  display: grid;
  gap: 5px;
  border-left: 3px solid var(--accent);
  background: rgba(255, 227, 156, 0.08);
  padding: 10px 12px;
  overflow-wrap: anywhere;
}

.moderator-feedback b {
  color: var(--accent);
  font-size: 12px;
}

.moderator-feedback span {
  line-height: 1.45;
}

.project-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.designer-project-form,
.project-form-section,
.project-subsection {
  display: grid;
  gap: 16px;
}

.project-form-section {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.designer-project-form > .project-form-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.subsection-title {
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}

.designer-plan-board {
  position: relative;
  aspect-ratio: var(--plan-ratio, 841.9 / 595.3);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #1d2022;
}

.designer-plan-board img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: grayscale(1) invert(1) brightness(1.75) contrast(1.28);
  opacity: 0.62;
}

.approved-series-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  background: radial-gradient(circle at center, rgba(255, 227, 156, 0.13), transparent 58%);
  color: var(--muted);
  text-align: center;
}

.approved-series-placeholder strong {
  color: var(--ink);
  font-size: clamp(28px, 5vw, 54px);
}

.designer-plan-markers {
  position: absolute;
  inset: 0;
}

.designer-apartment-marker,
.approved-apartment-option {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  border: 1px solid rgba(247, 245, 238, 0.72);
  background: rgba(247, 245, 238, 0.9);
  color: var(--page);
  padding: 4px 8px;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

.designer-apartment-marker b,
.approved-apartment-option b {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  min-height: 28px;
  background: var(--room-color);
  color: var(--page);
  font-size: 13px;
}

.designer-apartment-marker span,
.approved-apartment-option span {
  font-size: 13px;
}

.designer-apartment-marker.is-selected,
.approved-apartment-option.is-selected {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}

.approved-apartment-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.approved-apartment-option {
  position: static;
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
  transform: none;
  white-space: normal;
  text-align: left;
}

.approved-apartment-option span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.checkbox-grid,
.payout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.check-tile {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  background: rgba(247, 245, 238, 0.04);
  color: var(--ink);
  padding: 12px;
  line-height: 1.35;
}

.check-tile input {
  flex: 0 0 auto;
  width: 18px;
  min-height: 18px;
  margin: 1px 0 0;
}

.check-tile span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.preview-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.preview-strip img {
  flex: 0 0 132px;
  width: 132px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--surface-muted);
}

.missing-series-box {
  margin-top: 22px;
}

.series-request-history {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.series-request-list {
  display: grid;
  gap: 10px;
}

.series-request-list article {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 14px;
}

.series-request-list article > div:first-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
}

.series-request-list article > div:first-child span,
.series-request-list p {
  color: var(--muted);
}

.series-request-list p {
  margin: 0;
  overflow-wrap: anywhere;
}

.sales-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.sale-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.sale-row div {
  display: grid;
  gap: 4px;
}

.sale-row span {
  color: var(--muted);
  font-size: 13px;
}

.sale-row b {
  text-align: right;
}

.empty-box {
  display: grid;
  gap: 18px;
  min-height: 280px;
  align-content: center;
}

.settings-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.settings-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.settings-list span {
  color: var(--muted);
}

.settings-list strong {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: right;
}

.account-chip {
  gap: 10px;
  max-width: min(42vw, 270px);
  border-color: var(--line);
}

.account-chip b {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  color: var(--accent);
  font-size: 12px;
}

.account-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-profile {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.public-profile h2 {
  margin: 0;
  font-size: clamp(38px, 7vw, 82px);
  font-weight: 400;
  line-height: 1;
  overflow-wrap: anywhere;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.profile-links a {
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

@media (max-width: 980px) {
  .account-grid,
  .public-profile {
    grid-template-columns: 1fr;
  }

  .account-sidebar {
    position: static;
    display: flex;
    overflow-x: auto;
  }

  .account-sidebar a,
  .account-menu-button {
    white-space: nowrap;
  }

  .project-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1080px) {
  .is-register-page .top-actions .account-login-link,
  .is-register-page .top-actions a[href="/login"] {
    display: inline-flex !important;
  }

  .is-register-page .top-actions a[href="/register"] {
    display: none;
  }
}

@media (max-width: 720px) {
  .is-register-page .topbar {
    grid-template-columns: 44px minmax(0, 1fr) auto;
  }

  .is-register-page .top-actions {
    display: flex;
  }

  .is-register-page .top-actions > :not(.account-login-link):not([href="/login"]) {
    display: none;
  }

  .role-grid,
  .form-grid,
  .dashboard-card dl,
  .checkbox-grid,
  .payout-grid {
    grid-template-columns: 1fr;
  }

  .avatar-row {
    grid-template-columns: 1fr;
  }

  .designer-apartment-marker,
  .approved-apartment-option {
    min-height: 44px;
    padding: 5px;
  }

  .designer-apartment-marker b {
    min-width: 34px;
    min-height: 34px;
  }

  .designer-apartment-marker span {
    display: none;
  }

  .sale-row {
    display: grid;
  }

  .sale-row b {
    text-align: left;
  }

  .settings-list div {
    display: grid;
    gap: 5px;
  }

  .settings-list strong {
    text-align: left;
  }

  .account-actions {
    justify-content: stretch;
  }

  .account-actions > *,
  .project-card-actions > * {
    flex: 1 1 180px;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
  }
}

@media (max-width: 560px) {
  .top-actions {
    gap: 8px;
  }

  .top-actions a,
  .top-actions button {
    padding: 0 12px;
  }

  .account-chip {
    max-width: 120px;
  }
}
