.account-main {
  padding: clamp(24px, 4vw, 56px) 0;
  background:
    linear-gradient(180deg, rgba(248, 251, 255, 0.86), rgba(255, 255, 255, 0) 220px),
    var(--background);
}

.account-page [hidden] {
  display: none !important;
}

.account-hero {
  max-width: 760px;
  margin-bottom: 28px;
}

.account-kicker {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--accent-hover);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.account-hero h1,
.account-toolbar h2 {
  margin: 0;
  color: var(--text-main);
}

.account-hero p {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 1rem;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.account-dashboard .account-grid {
  grid-template-columns: minmax(360px, 0.95fr) minmax(0, 1.05fr);
}

.account-card {
  min-width: 0;
  padding: clamp(18px, 3vw, 26px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.account-card h2,
.account-card h3 {
  margin: 0 0 16px;
  color: var(--text-main);
}

.account-profile-card {
  border-top: 4px solid var(--accent);
}

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

.account-form-section {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f8fbff;
}

.account-form-section legend {
  float: none;
  width: auto;
  margin: 0 0 2px;
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 800;
}

.account-form-section p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.account-form label {
  display: grid;
  gap: 6px;
  margin: 0;
  color: var(--text-main);
  font-weight: 700;
}

.account-form input,
.account-form textarea,
.account-form select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text-main);
  font: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.account-form input:focus,
.account-form textarea:focus,
.account-form select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}

.account-form textarea {
  resize: vertical;
}

.account-address-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(150px, 0.7fr);
  gap: 12px;
}

.account-address-country,
.account-address-street {
  grid-column: 1 / -1;
}

.account-check {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px !important;
  color: var(--text-muted) !important;
  font-weight: 500 !important;
}

.account-check input {
  width: 18px;
  min-height: 18px;
  margin-top: 3px;
}

.account-profile-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 18px;
}

.account-profile-row {
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f8fbff;
}

.account-profile-row span {
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.account-profile-row strong {
  min-width: 0;
  color: var(--text-main);
  overflow-wrap: anywhere;
}

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

.account-type-option {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px !important;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.account-type-option input {
  width: 18px;
  min-height: 18px;
  margin-top: 3px;
}

.account-type-option strong,
.account-type-option small {
  display: block;
}

.account-type-option small {
  margin-top: 2px;
  color: var(--text-muted);
  font-weight: 500;
}

.account-type-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.account-company-fields {
  display: grid;
  gap: 12px;
  padding-top: 2px;
}

.account-result {
  min-height: 22px;
  margin: 0;
  color: var(--text-muted);
}

.account-result.is-error {
  color: #b42318;
}

.account-result.is-success {
  color: #247a35;
}

.account-dashboard {
  display: grid;
  gap: 20px;
}

.account-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.account-tab {
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.account-tab:hover,
.account-tab:focus-visible {
  border-color: var(--border);
  color: var(--text-main);
  outline: none;
}

.account-tab.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.account-panels,
.account-tab-panel {
  min-width: 0;
}

.account-toolbar,
.account-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.account-section-head {
  margin-bottom: 16px;
}

.account-toolbar {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.account-orders {
  display: grid;
  gap: 10px;
}

.account-order {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f8fbff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.account-order.is-open {
  border-color: var(--accent-border);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.account-order-head,
.account-order-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.account-order strong {
  color: var(--text-main);
}

.account-order-head > div {
  display: grid;
  gap: 2px;
}

.account-order small,
.account-order-meta {
  color: var(--text-muted);
}

.account-order-toggle {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--accent-hover);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
}

.account-order-toggle:hover,
.account-order-toggle:focus-visible {
  background: var(--accent-soft);
  outline: none;
}

.account-order-details {
  display: grid;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.account-order-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.account-order-detail-grid > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8fbff;
}

.account-order-detail-grid span,
.account-order-totals span {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.account-order-detail-grid strong,
.account-order-totals strong {
  color: var(--text-main);
  overflow-wrap: anywhere;
}

.account-order-items {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  list-style: none;
  overflow: hidden;
}

.account-order-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  min-height: 42px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
}

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

.account-order-item span {
  min-width: 0;
  color: var(--text-main);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.account-order-item small {
  white-space: nowrap;
}

.account-order-totals {
  display: grid;
  gap: 7px;
  justify-self: end;
  width: min(100%, 360px);
}

.account-order-totals > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.account-order-totals .is-discount strong {
  color: #15803d;
}

.account-order-totals .is-final {
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 1.08rem;
}

.account-order-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-size: 0.78rem;
  font-weight: 800;
}

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

  .account-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-order-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .account-card {
    padding: 16px;
  }

  .account-address-grid,
  .account-profile-row,
  .account-profile-summary,
  .account-order-detail-grid,
  .account-type-options {
    grid-template-columns: 1fr;
  }

  .account-tab,
  .account-order-toggle {
    width: 100%;
  }

  .account-order-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .account-address-country,
  .account-address-street {
    grid-column: auto;
  }
}
