.account-page {
  display: grid;
  gap: 1.1rem;
  padding: 4.2rem 0 2rem;
}

.account-page-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.3rem 0 0.2rem;
}

.account-page h1,
.account-page h2,
.account-page h3,
.account-page p {
  margin-top: 0;
}

.account-page h1 {
  margin-bottom: 0;
  font-size: 2rem;
  line-height: 1.1;
}

.account-page h1 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem;
}

.account-logout-link {
  border: 0;
  background: transparent;
  color: #666;
  padding: 0;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.account-primary-button,
.account-tab-button,
.account-secondary-button,
.account-danger-button,
.account-search-agent-card button {
  border: 1px solid #d6d6d6;
  background: #fff;
  color: #1f1f1f;
  border-radius: 4px;
  min-height: 40px;
  padding: 0 0.9rem;
  font-weight: 800;
  cursor: pointer;
}

.account-primary-button {
  border-color: var(--color-brand);
  background: var(--color-brand);
  color: #fff;
}

.account-danger-button {
  color: #b42318;
}

.account-secondary-button {
  background: #fff;
  color: #1f1f1f;
}

.account-tabs {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
}

.account-tab-button.is-active {
  border-color: #1f1f1f;
  background: #1f1f1f;
  color: #fff;
}

.account-tab-panel {
  display: none;
}

.account-tab-panel.is-active {
  display: block;
}

.account-order-group,
.account-empty-state,
.account-section-heading,
.account-section-card {
  border: 1px solid #dedede;
  background: #fff;
  border-radius: 6px;
  padding: 1rem;
}

.account-section-card {
  display: grid;
  gap: 0.8rem;
}

.account-section-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.account-order-group h2,
.account-section-heading h2,
.account-section-card h2 {
  margin-bottom: 0.7rem;
  font-size: 1rem;
}

.account-section-card h2 {
  margin-bottom: 0;
}

.account-edit-form {
  display: grid;
  gap: 0.75rem;
}

.account-edit-form fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.account-edit-form label {
  display: grid;
  gap: 0.28rem;
  color: #2f2f2f;
  font-size: 0.82rem;
  font-weight: 800;
}

.account-edit-form input,
.account-edit-form textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  padding: 0.55rem 0.7rem;
  background: #fff;
  color: #1f1f1f;
  font: inherit;
  font-weight: 400;
}

.account-edit-form textarea {
  min-height: 104px;
  resize: vertical;
}

.account-edit-form fieldset:disabled input,
.account-edit-form fieldset:disabled textarea {
  background: #f7f7f7;
  color: #555;
}

.account-field-wide {
  grid-column: 1 / -1;
}

.account-edit-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.account-edit-actions[hidden] {
  display: none;
}

.account-edit-status {
  min-height: 1.1rem;
  margin: 0;
  color: #666;
  font-size: 0.86rem;
}

.account-edit-status.is-error {
  color: #b3261e;
}

.account-contact-note {
  margin: -0.2rem 0 0;
  color: #555;
  font-size: 0.9rem;
  line-height: 1.45;
}

.account-shop-link {
  color: #1f1f1f;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.account-shop-description {
  max-width: 680px;
  margin-bottom: 0;
  color: #555;
  font-size: 0.9rem;
  line-height: 1.45;
}

.account-shop-link-group {
  display: grid;
  gap: 0.25rem;
  justify-items: start;
  color: #2f2f2f;
  font-size: 0.82rem;
  font-weight: 400;
}

.account-shop-link-row {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  flex-wrap: wrap;
}

.account-shop-link-label {
  font-weight: 400;
}

.account-copy-button {
  width: 34px;
  height: 34px;
  border: 1px solid #d8d8d8;
  border-radius: 4px;
  background: #fff;
  color: #1f1f1f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.account-copy-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.account-copy-status {
  min-height: 1.1rem;
  margin: 0;
  color: #666;
  font-size: 0.82rem;
  font-weight: 400;
}

.account-seller-form fieldset {
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: start;
}

.account-seller-image {
  grid-row: span 2;
}

.account-seller-image img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border: 1px solid #dedede;
  border-radius: 999px;
  background: #fafafa;
}

.account-order-list,
.account-search-agent-list {
  display: grid;
  gap: 0.6rem;
}

.account-search-agent-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  min-height: 76px;
  border-top: 1px solid #ededed;
  padding-top: 0.65rem;
}

.account-search-agent-card:first-child {
  border-top: 0;
  padding-top: 0;
}

.account-order-card {
  border-top: 1px solid #ededed;
  padding-top: 0.65rem;
}

.account-order-card:first-child {
  border-top: 0;
  padding-top: 0;
}

.account-order-card-button {
  width: 100%;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  min-height: 76px;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.account-order-card-button:hover .account-order-card-title,
.account-order-card-button:focus-visible .account-order-card-title {
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.account-order-card img,
.account-order-thumb-placeholder,
.account-search-agent-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border: 1px solid #ededed;
  background: #fafafa;
}

.account-order-thumb-placeholder {
  display: block;
}

.account-order-card-main {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.account-search-agent-thumb {
  display: block;
  border-radius: 4px;
}

.account-search-agent-thumb--empty {
  position: relative;
}

.account-search-agent-thumb--empty::before,
.account-search-agent-thumb--empty::after {
  position: absolute;
  content: "";
  left: 50%;
  transform: translateX(-50%);
  border: 2px solid #777;
}

.account-search-agent-thumb--empty::before {
  top: 14px;
  width: 15px;
  height: 15px;
  border-radius: 999px;
}

.account-search-agent-thumb--empty::after {
  bottom: 13px;
  width: 24px;
  height: 12px;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  border-bottom: 0;
}

.account-search-agent-card h3 {
  margin-bottom: 0.18rem;
  font-size: 0.95rem;
  line-height: 1.2;
}

.account-order-card-title {
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.2;
}

.account-order-card-main span:not(.account-order-card-title),
.account-search-agent-card p,
.account-order-empty,
.account-order-group-description,
.account-section-heading p,
.account-empty-state p {
  margin-bottom: 0;
  color: #666;
  font-size: 0.86rem;
}

.account-order-card-meta {
  display: grid;
  justify-items: end;
  gap: 0.15rem;
  white-space: nowrap;
}

.account-order-card-meta span {
  color: #666;
  font-size: 0.8rem;
}

.account-order-detail {
  margin: 0.75rem 0 0 56px;
  padding: 0.75rem;
  border: 1px solid #e6e6e6;
  border-radius: 4px;
  background: #fafafa;
}

.account-order-detail[hidden] {
  display: none;
}

.account-order-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.8rem;
}

.account-order-contact {
  display: grid;
  gap: 0.7rem;
  margin-bottom: 0.8rem;
  padding: 0.75rem;
  border: 1px solid #e6e6e6;
  border-radius: 4px;
  background: #fff;
}

.account-order-contact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.account-order-contact-header h3 {
  margin: 0;
  font-size: 0.95rem;
}

.account-order-contact-form {
  display: grid;
  gap: 0.65rem;
}

.account-order-contact-form fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  border: 0;
  padding: 0;
  margin: 0;
}

.account-order-contact-form label {
  display: grid;
  gap: 0.24rem;
  color: #2f2f2f;
  font-size: 0.78rem;
  font-weight: 800;
}

.account-order-contact-form input {
  width: 100%;
  min-height: 38px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  padding: 0.48rem 0.6rem;
  background: #fff;
  color: #1f1f1f;
  font: inherit;
  font-weight: 400;
}

.account-order-contact-form fieldset:disabled input {
  background: #f7f7f7;
  color: #555;
}

.account-order-contact-note {
  margin: -0.2rem 0 0;
  color: #666;
  font-size: 0.82rem;
}

.account-order-detail-field {
  display: grid;
  gap: 0.12rem;
}

.account-order-detail-field span:first-child {
  color: #666;
  font-size: 0.78rem;
  font-weight: 800;
}

.account-order-line-list,
.account-order-status-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.account-order-line {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
}

.account-order-line img,
.account-order-line-thumb {
  width: 44px;
  height: 44px;
  border: 1px solid #e6e6e6;
  background: #fff;
  object-fit: cover;
}

.account-order-line-thumb {
  display: block;
}

.account-order-line-title,
.account-order-status-title {
  font-weight: 800;
}

.account-order-line-meta,
.account-order-status-meta {
  color: #666;
  font-size: 0.82rem;
}

.account-order-detail-raw {
  margin-top: 0.75rem;
}

.account-order-detail-raw pre {
  max-height: 260px;
  overflow: auto;
  background: #fff;
  border: 1px solid #e1e1e1;
  border-radius: 4px;
  padding: 0.65rem;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.78rem;
}

.account-search-agent-card {
  grid-template-columns: 56px minmax(0, 1fr) auto;
  border: 1px solid #dedede;
  border-radius: 6px;
  background: #fff;
  padding: 0.7rem;
}

.account-search-agent-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
}

.account-search-agent-card button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

@media (max-width: 900px) {
  .account-page-header {
    align-items: start;
    flex-direction: column;
  }

  .account-edit-form fieldset,
  .account-seller-form fieldset {
    grid-template-columns: 1fr;
  }

  .account-seller-image {
    grid-row: auto;
  }

  .account-search-agent-card {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .account-order-card-button {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .account-order-card-meta {
    grid-column: 2;
    justify-items: start;
  }

  .account-order-detail {
    margin-left: 0;
  }

  .account-order-detail-grid,
  .account-order-contact-form fieldset,
  .account-order-line {
    grid-template-columns: 1fr;
  }

  .account-search-agent-thumb {
    width: 48px;
    height: 48px;
  }

  .account-search-agent-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}
