.app-shell > .container { padding-top: 20px; padding-bottom: 60px; }

.profile-header {
  display: flex; align-items: center; gap: 22px;
  padding: 32px; margin: 30px 0 24px;
}
.profile-avatar-btn {
  position: relative; width: 84px; height: 84px; border-radius: 50%;
  border: none; padding: 0; cursor: pointer; flex-shrink: 0;
  background: var(--surface-2);
  transition: transform var(--dur-fast) var(--ease-spring);
}
.profile-avatar-btn:hover { transform: scale(1.05); }
.profile-avatar { display: block; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; }
.profile-avatar svg { width: 100%; height: 100%; overflow: visible; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-edit {
  position: absolute; bottom: -2px; right: -2px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--signal-grad); color: #0a0714;
  display: flex; align-items: center; justify-content: center;
  border: 3px solid var(--void);
}
.profile-avatar-edit svg { width: 14px; height: 14px; }
.profile-info h1 { font-size: 26px; margin-bottom: 4px; }
.profile-info p { font-size: 13.5px; margin-bottom: 10px; }

.dashboard-stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.dash-stat-card { padding: 22px; }
.dash-stat-icon {
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  color: var(--signal-2); margin-bottom: 14px;
}
.dash-stat-icon svg { width: 18px; height: 18px; }
.dash-stat-value { font-family: var(--font-display); font-size: 28px; font-weight: 700; margin-bottom: 4px; }
.dash-stat-label { font-size: 12.5px; color: var(--ink-faint); }

@media (max-width: 780px) {
  .dashboard-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-header { flex-direction: column; text-align: center; }
}

/* ============================================================
   Billing modal (dashboard "Upgrade to Pro" + the pricing page)
   ============================================================ */
.billing-modal { max-width: 480px; max-height: 86vh; overflow-y: auto; }
.billing-unavailable { padding: 20px 0; text-align: center; }

.billing-plan-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface-2); border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-md); padding: 14px 16px; margin-bottom: 18px;
}
.billing-plan-summary-name { font-weight: 700; font-size: 15px; }
.billing-plan-summary-price { font-family: var(--font-display); font-size: 17px; font-weight: 700; color: var(--signal-1); }

.billing-perks { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 0 0 20px; padding: 0; }
.billing-perks li {
  font-size: 13.5px; color: var(--ink-dim); padding-left: 22px; position: relative;
}
.billing-perks li::before {
  content: ''; position: absolute; left: 0; top: 6px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--glass-strong); border: 1px solid var(--signal-1);
}
.billing-perks li::after {
  content: ''; position: absolute; left: 4px; top: 9px; width: 6px; height: 3px;
  border-left: 2px solid var(--signal-1); border-bottom: 2px solid var(--signal-1); transform: rotate(-45deg);
}

.billing-provider-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.billing-provider-tab {
  flex: 1; min-width: 90px; text-align: center; cursor: pointer;
  background: var(--surface-2); border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); padding: 9px 10px; font-size: 13px; font-weight: 600; color: var(--ink-dim);
  transition: border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.billing-provider-tab.active { border-color: var(--signal-1); color: var(--ink); background: var(--glass-strong); }

.billing-panel { display: none; }
.billing-panel.active { display: block; }
.billing-fineprint { font-size: 12px; margin-top: 10px; line-height: 1.5; }
.billing-pay-btn:disabled { opacity: 0.6; cursor: not-allowed; }

#billingOrdersSection { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.billing-orders-head { font-size: 13px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 10px; }
.billing-orders-list { display: flex; flex-direction: column; gap: 8px; max-height: 180px; overflow-y: auto; }
.billing-order-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 13px; padding: 9px 12px; border-radius: var(--radius-sm); background: var(--surface-2);
}
.billing-order-row .muted { font-size: 11.5px; }
.billing-order-status {
  font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 99px; text-transform: uppercase; letter-spacing: 0.03em;
}
.billing-order-status.paid { background: rgba(53, 214, 143, 0.15); color: var(--good); }
.billing-order-status.awaiting_review { background: rgba(255, 159, 0, 0.15); color: var(--signal-2); }
.billing-order-status.rejected, .billing-order-status.failed, .billing-order-status.canceled { background: rgba(255, 84, 112, 0.15); color: var(--danger); }
.billing-order-status.pending { background: var(--glass-strong); color: var(--ink-dim); }

/* ============================================================
   Pricing page
   ============================================================ */
.pricing-hero { text-align: center; padding: 64px 0 48px; }
.pricing-hero h1 { font-size: 36px; margin-bottom: 10px; letter-spacing: -0.01em; }
.pricing-hero p { font-size: 15.5px; max-width: 480px; margin: 0 auto; }

.pricing-cards {
  display: flex; align-items: stretch; justify-content: center; flex-wrap: wrap;
  gap: 22px; max-width: 980px; margin: 0 auto 72px; padding: 0 4px;
}
.pricing-cards-loading { min-height: 320px; align-items: center; }
.spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid var(--line-strong); border-top-color: var(--signal-1);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.plan-card {
  flex: 1 1 260px; max-width: 300px; padding: 30px 26px 26px;
  display: flex; flex-direction: column; position: relative;
  border-radius: var(--radius-lg); border: 1px solid var(--line-strong);
  background: var(--surface); transition: transform var(--dur-med) var(--ease-out);
}
.plan-card[data-tier="base"] { background: transparent; }
.plan-card[data-tier="mid"] { border-color: rgba(0, 181, 173, 0.35); box-shadow: 0 0 0 1px rgba(0, 181, 173, 0.12); }
.plan-card-top {
  border-color: rgba(255, 159, 0, 0.45);
  background: linear-gradient(180deg, rgba(255, 159, 0, 0.07), var(--surface) 55%);
  box-shadow: 0 0 0 1px rgba(255, 159, 0, 0.18), var(--shadow-md);
}
.plan-card-ribbon {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--signal-grad); color: #0a0714; font-size: 11px; font-weight: 700;
  padding: 5px 14px; border-radius: 99px; white-space: nowrap;
}
.plan-card-head { text-align: center; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.plan-card-head h3 { font-size: 19px; font-weight: 700; margin-bottom: 12px; }
.plan-card-price { display: flex; align-items: baseline; justify-content: center; gap: 7px; flex-wrap: wrap; }
.plan-card-price .amount { font-family: var(--font-display); font-size: 32px; font-weight: 800; line-height: 1; }
.plan-card-price .unit { font-size: 12.5px; color: var(--ink-faint); font-weight: 500; }

.plan-card-features { list-style: none; padding: 0; margin: 0 0 26px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.plan-card-features li {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 13.5px; color: var(--ink-dim); line-height: 1.4;
}
.plan-card-features li svg { flex: none; width: 16px; height: 16px; margin-top: 1px; color: var(--signal-1); }
.plan-card-features li.is-off { color: var(--ink-faint); }
.plan-card-features li.is-off svg { color: var(--ink-faint); }
.plan-card-cta { width: 100%; text-align: center; }

@media (max-width: 760px) {
  .pricing-cards { flex-direction: column; align-items: center; }
  .plan-card { width: 100%; max-width: 360px; }
}

/* ============================================================
   Profile picture dialog (public/js/avatar-picker.js)
   ============================================================ */
.avatar-picker { max-width: 500px; padding: 24px 24px 20px; max-height: calc(100vh - 48px); display: flex; flex-direction: column; }
.avatar-picker [hidden] { display: none !important; }
.avatar-picker .modal-head { margin-bottom: 14px; }

.ap-preview { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.ap-preview-ring {
  position: relative; width: 84px; height: 84px; flex-shrink: 0; border-radius: 50%; overflow: hidden;
  background: var(--surface-2);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--line-strong);
}
.ap-preview-ring svg { width: 100%; height: 100%; overflow: visible; }
.ap-preview-ring img { display: block; }
.ap-preview-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ap-preview-meta strong { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-preview-meta .muted { font-size: 12.5px; }

.ap-tabs { display: flex; gap: 4px; padding: 4px; background: var(--void-2); border: 1px solid var(--line); border-radius: 99px; margin-bottom: 16px; }
.ap-tab {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 14px; border: 0; border-radius: 99px; cursor: pointer;
  background: transparent; color: var(--ink-dim);
  font: inherit; font-size: 13.5px; font-weight: 600;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.ap-tab:hover { color: var(--ink); }
.ap-tab.active { background: var(--surface-2); color: var(--ink); box-shadow: 0 1px 0 var(--line-strong) inset; }
.ap-tab:focus-visible { outline: 2px solid var(--signal-1); outline-offset: 2px; }
.ap-lock {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  background: rgba(255, 159, 0, 0.14); color: var(--signal-2); border: 1px solid rgba(255, 159, 0, 0.3);
}

.ap-panels { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 0 -6px; padding: 2px 6px 6px; }
.ap-grid { max-height: none; overflow: visible; padding: 4px; }
.ap-grid .avatar-option { font: inherit; color: inherit; }
.ap-grid .avatar-option:focus-visible { outline: 2px solid var(--signal-1); outline-offset: 2px; }

.ap-locked { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 26px 18px 22px; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); background: var(--glass); }
.ap-locked-icon { width: 52px; height: 52px; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: var(--signal-grad); color: #0a0714; }
.ap-locked-icon svg { width: 26px; height: 26px; }
.ap-locked h3 { margin: 0; font-size: 16px; }
.ap-locked p { margin: 0 0 4px; font-size: 13px; line-height: 1.6; max-width: 340px; }

.ap-current { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-md); }
.ap-current-thumb { width: 46px; height: 46px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: var(--void-2); }
.ap-current-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ap-current-meta { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ap-current-meta strong { font-size: 13.5px; }
.ap-current-meta .muted { font-size: 12px; }
.ap-danger { color: var(--danger); }

.ap-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px;
  padding: 30px 18px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius-md);
  color: var(--ink-dim); background: var(--glass); cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.ap-drop strong { color: var(--ink); font-size: 14px; }
.ap-drop .muted { font-size: 12px; }
.ap-drop svg { color: var(--signal-1); margin-bottom: 4px; }
.ap-drop:hover, .ap-drop:focus-visible, .ap-drop.over { border-color: var(--signal-1); background: var(--glass-strong); outline: none; }
.ap-drop.over { transform: scale(1.01); }

.ap-editor { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ap-stage {
  position: relative; width: min(280px, 100%); aspect-ratio: 1; overflow: hidden; border-radius: var(--radius-md);
  background: var(--void-2) repeating-conic-gradient(#12171e 0% 25%, #0e1319 0% 50%) 50% / 18px 18px;
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
}
.ap-stage.dragging { cursor: grabbing; }
.ap-stage:focus-visible { outline: 2px solid var(--signal-1); outline-offset: 3px; }
.ap-stage img { pointer-events: none; display: block; }
.ap-mask { position: absolute; inset: 0; pointer-events: none; border-radius: 50%; box-shadow: 0 0 0 999px rgba(10, 14, 19, 0.66), inset 0 0 0 2px rgba(255, 255, 255, 0.85); }
.ap-zoom { display: flex; align-items: center; gap: 10px; width: min(280px, 100%); color: var(--ink-faint); }
.ap-zoom input[type=range] { flex: 1; accent-color: var(--signal-1); height: 18px; }
.ap-fileinfo { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; font-size: 12.5px; color: var(--ink-dim); }
.ap-chip { padding: 2px 8px; border-radius: 99px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; background: rgba(0, 181, 173, 0.14); color: var(--signal-1); border: 1px solid var(--line-strong); }
.ap-link { background: none; border: 0; padding: 0; font: inherit; font-size: 12.5px; color: var(--signal-1); cursor: pointer; }
.ap-link:hover { text-decoration: underline; }

.ap-notice { margin-top: 12px; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 12.5px; line-height: 1.55; color: var(--ink-dim); background: var(--glass-strong); border: 1px solid var(--line); }
.ap-notice a { color: var(--signal-1); text-decoration: none; font-weight: 600; }
.ap-notice a:hover { text-decoration: underline; }
.ap-notice-error { color: #ffd6dc; background: rgba(255, 84, 112, 0.1); border-color: rgba(255, 84, 112, 0.35); }

.ap-footer { display: flex; justify-content: flex-end; gap: 10px; padding-top: 16px; margin-top: 8px; border-top: 1px solid var(--line); }
.ap-footer .btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

@media (max-width: 520px) {
  .avatar-picker { padding: 20px 16px 16px; }
  .ap-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ============================================================
   Dashboard tabs, plan card, orders, security
   ============================================================ */
.dash-tabs { display: flex; gap: 4px; padding: 4px; margin: 0 0 22px; background: var(--surface-2); border-radius: 999px; width: fit-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.dash-tabs::-webkit-scrollbar { display: none; }
.dash-tab { white-space: nowrap; border: none; background: transparent; font: inherit; padding: 9px 20px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink-faint); cursor: pointer; transition: all var(--dur-fast) var(--ease-out); }
.dash-tab:hover { color: var(--ink); }
.dash-tab.active { color: #0a0714; background: var(--signal-grad); }
.dash-tab .tab-badge { margin-left: 6px; }
.dash-panel { animation: dashIn .25s var(--ease-out); }
@keyframes dashIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.dash-two { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 16px; }
.dash-mini { padding: 22px; display: flex; flex-direction: column; align-items: flex-start; }
.dash-mini-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.dash-mini-value { font-family: var(--font-display); font-size: 26px; font-weight: 700; margin: 6px 0 2px; }

.cur-plan-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.plan-remaining { margin-top: 20px; }
.plan-days { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.plan-days b { font-family: var(--font-display); font-size: 44px; line-height: 1; }
.plan-days span { color: var(--ink-faint); }
.plan-bar { height: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.plan-bar-fill { height: 100%; border-radius: 999px; background: var(--signal-grad); transition: width .6s var(--ease-out); }
.plan-bar-fill.low { background: linear-gradient(90deg, #ff9a5a, var(--danger)); }
.plan-dates { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; margin-top: 8px; flex-wrap: wrap; }

.orders-list { display: flex; flex-direction: column; }
.order-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.order-row:last-child { border-bottom: none; }
.danger-zone { border-color: rgba(255, 84, 112, 0.25); }

@media (max-width: 780px) {
  .dash-two { grid-template-columns: 1fr; }
  .dash-tabs { width: 100%; }
}
