﻿body.acc-page {
  --acc-primary: #2563eb;
  --acc-primary-strong: #1d4ed8;
  --acc-primary-soft: #eff6ff;
  --acc-border: #e6eef8;
  --acc-border-strong: #d8e5f7;
  --acc-text: #0f172a;
  --acc-text-muted: #64748b;
  --acc-success: #16a34a;
  min-height: max(884px, 100dvh);
  color: var(--acc-text);
}

.acc-page,
.acc-page * {
  box-sizing: border-box;
}

.acc-page :where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.acc-page .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.acc-page .muted {
  color: #475569;
}

.acc-page .muted-2 {
  color: var(--acc-text-muted);
}

.acc-page .gbtn {
  background: linear-gradient(90deg, #2563eb 0%, #0ea5e9 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 10px 20px -12px rgba(37, 99, 235, 0.45);
}

.acc-page .gtext {
  background: linear-gradient(90deg, #2563eb 0%, #0ea5e9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.acc-page .btn-orange {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  box-shadow: none;
}

.acc-main {
  padding-top: 90px;
}

.acc-shell {
  width: min(100%, var(--content-max-width, 640px));
  margin-inline: auto;
  padding-left: 12px;
  padding-right: 12px;
}

.acc-section-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 12px;
}

.acc-card,
.acc-page .card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--acc-border);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  padding: 16px;
}

.acc-card-hero {
  border-radius: 22px;
  padding: 20px;
}

.acc-card-muted {
  background: rgba(255, 255, 255, 0.9);
}

.acc-section-headline {
  margin-bottom: 14px;
}

.acc-section-title {
  font-size: 1.125rem;
  line-height: 1.35;
  font-weight: 700;
  color: #0f172a;
}

.acc-section-caption {
  margin-top: 4px;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--acc-text-muted);
}

.acc-hero-top {
  display: flex;
  align-items: center;
  gap: 16px;
}

.acc-avatar {
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.acc-avatar-edit {
  min-width: 40px;
  min-height: 40px;
}

.acc-hero-identity {
  min-width: 0;
}

.acc-hero-name {
  line-height: 1.2;
}

.acc-hero-email {
  margin-top: 4px;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--acc-text-muted);
  overflow-wrap: anywhere;
}

.acc-status-pill {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #15803d;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.acc-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--acc-success);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.18);
}

.acc-hero-actions {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.acc-btn {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 10px 14px;
  font-size: 0.875rem;
  line-height: 1.2;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.acc-btn:hover {
  transform: translateY(-1px);
}

.acc-btn-primary {
  background: var(--acc-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 20px -12px rgba(37, 99, 235, 0.6);
}

.acc-btn-primary:hover {
  background: var(--acc-primary-strong);
}

.acc-btn-secondary {
  color: var(--acc-primary-strong);
  background: var(--acc-primary-soft);
  border-color: #bfdbfe;
}

.acc-btn-secondary:hover {
  background: #dbeafe;
}

.acc-btn-ghost {
  color: #334155;
  background: #fff;
  border-color: #e2e8f0;
}

.acc-btn-ghost:hover {
  background: #f8fafc;
}

.acc-btn-small {
  flex: 1;
}

.acc-summary-grid {
  width: 100%;
  border: 0;
  padding: 0;
  margin: 0 0 12px;
  background: transparent;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  text-align: left;
  cursor: pointer;
}

.acc-summary-item {
  border: 1px solid #dbe7f8;
  background: #f8fbff;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 86px;
}

.acc-summary-label {
  font-size: 0.6875rem;
  line-height: 1.4;
  color: var(--acc-text-muted);
  font-weight: 600;
}

.acc-summary-value {
  font-size: 1.375rem;
  line-height: 1.1;
  color: #0f172a;
  font-weight: 700;
}

.acc-row-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.acc-row {
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  width: 100%;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.acc-row:hover {
  transform: translateY(-1px);
  border-color: #cbdcf5;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.07);
}

.acc-row-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: var(--acc-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.acc-row-icon .material-symbols-outlined {
  font-size: 22px;
}

.acc-row-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.acc-row-label {
  font-size: 0.875rem;
  line-height: 1.35;
  font-weight: 600;
  color: #0f172a;
}

.acc-row-value {
  margin-top: 1px;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--acc-text-muted);
  overflow-wrap: anywhere;
}

.acc-row-chevron {
  color: #94a3b8;
  font-size: 20px;
  flex-shrink: 0;
}

.acc-row-tag {
  flex-shrink: 0;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.625rem;
  line-height: 1;
  font-weight: 700;
  color: #334155;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.acc-row-danger .acc-row-icon {
  color: #dc2626;
  background: #fef2f2;
  border-color: #fecaca;
}

.acc-row-danger .acc-row-label {
  color: #b91c1c;
}

.acc-address-summary {
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 16px;
  padding: 12px;
}

.acc-address-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.acc-address-line {
  font-size: 0.875rem;
  line-height: 1.6;
  color: #0f172a;
  font-weight: 500;
}

.acc-region-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.acc-region-item {
  border-radius: 10px;
  padding: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.acc-region-label {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  font-weight: 700;
}

.acc-region-value {
  margin-top: 2px;
  display: block;
  font-size: 0.75rem;
  line-height: 1.35;
  color: #334155;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.acc-map-link {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  line-height: 1;
  color: var(--acc-primary);
  font-weight: 600;
  text-decoration: none;
}

.acc-map-link:hover {
  text-decoration: underline;
}

.acc-address-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.acc-list-wrap {
  margin-top: 12px;
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
}

.acc-manage-btn {
  min-height: 44px;
  width: 100%;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  font-size: 0.8125rem;
  font-weight: 600;
  justify-content: center;
}

.acc-manage-btn:hover {
  border-color: #bfdbfe;
  color: #1d4ed8;
  background: #f8fbff;
}

.acc-address-item {
  border-color: #dbe7f8 !important;
  background: #fff;
}

.acc-page select:disabled {
  background: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
}

.acc-page .modal-overlay {
  transition: opacity 0.35s ease, backdrop-filter 0.35s ease;
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(0);
}

.acc-page .modal-overlay.modal-active {
  opacity: 1;
  pointer-events: auto;
  backdrop-filter: blur(4px);
}

.acc-page .modal-content-anim {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
  transform: translateY(20px) scale(0.98);
  opacity: 0;
}

.acc-page .modal-overlay.modal-active .modal-content-anim {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.acc-modal-card {
  width: 100%;
  max-width: 480px;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.acc-modal-card-lg {
  max-width: 760px;
  max-height: 86vh;
}

.acc-address-modal-shell {
  /* Sync with home/orders layout: top bar 70px, bottom from CCUI bar height */
  top: calc(70px + env(safe-area-inset-top, 0px)) !important;
  right: 0 !important;
  bottom: calc(var(--cc-bottom-height, 64px) + env(safe-area-inset-bottom, 0px)) !important;
  left: 0 !important;
  padding: 0 12px;
}

.acc-address-modal {
  width: min(100%, var(--content-max-width, 640px));
  height: 100%;
  max-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.acc-address-modal-body {
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 16px;
}

.acc-address-modal-footer {
  position: relative;
  z-index: 2;
  background: #fff;
  box-shadow: 0 -6px 14px rgba(15, 23, 42, 0.06);
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
}

.acc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
}

.acc-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.acc-modal-close:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.acc-modal-body {
  padding: 16px;
}

.acc-modal-footer {
  padding: 14px 16px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.acc-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.75rem;
  line-height: 1.2;
  font-weight: 700;
  color: #475569;
}

.acc-input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d1dbe8;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.875rem;
  color: #0f172a;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.acc-input:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  outline: 0;
}

.acc-input-textarea {
  min-height: 74px;
  resize: vertical;
}

.avatar-popup {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 60;
  min-width: 180px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.avatar-popup.active {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  pointer-events: auto;
}

.avatar-popup button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #334155;
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.avatar-popup button:hover {
  background: #f0f6ff;
}

.avatar-popup button .material-symbols-outlined {
  font-size: 20px;
  color: var(--acc-primary);
}

.avatar-popup hr {
  margin: 0;
  border: none;
  border-top: 1px solid #eee;
}

.crop-container {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 50%;
  background: #1a1a2e;
  cursor: grab;
  touch-action: none;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.24);
}

.crop-container:active {
  cursor: grabbing;
}

.crop-container canvas {
  position: absolute;
  top: 0;
  left: 0;
}

.drop-zone {
  border: 2px dashed #c0d4f0;
  border-radius: 16px;
  padding: 32px 16px;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}

.drop-zone.drag-over {
  border-color: var(--acc-primary);
  background: rgba(37, 99, 235, 0.06);
}

.zoom-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  justify-content: center;
}

.zoom-row input[type="range"] {
  flex: 1;
  max-width: 200px;
  accent-color: var(--acc-primary);
}

.view-photo-img {
  width: auto;
  min-width: 300px;
  max-width: min(90vw, 600px);
  max-height: 80vh;
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
}

@media (min-width: 520px) {
  .acc-hero-actions {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .acc-card,
  .acc-page .card {
    border-radius: 16px;
    padding: 14px;
  }

  .acc-card-hero {
    border-radius: 20px;
    padding: 16px;
  }

  .acc-hero-top {
    align-items: flex-start;
  }

  .acc-avatar {
    width: 112px !important;
    height: 112px !important;
  }

  .acc-summary-grid {
    grid-template-columns: 1fr;
  }

  .acc-summary-item {
    min-height: 74px;
  }

  .acc-region-grid {
    grid-template-columns: 1fr;
  }

  .acc-address-actions {
    flex-direction: column;
  }

  .acc-btn-small {
    width: 100%;
  }

  .acc-address-modal-shell {
    top: calc(70px + env(safe-area-inset-top, 0px)) !important;
    bottom: calc(var(--cc-bottom-height, 64px) + env(safe-area-inset-bottom, 0px)) !important;
    padding: 0 8px;
  }

  .acc-address-modal {
    width: 100%;
    border-radius: 16px;
  }

  .acc-address-modal-footer {
    flex-wrap: wrap;
    gap: 10px;
  }

  .acc-address-modal-footer > label {
    width: 100%;
    margin-right: 0;
  }

  .acc-address-modal-footer > button {
    flex: 1;
    min-width: 0;
  }
}
