/* ============ Account page ============ */
/* A local profile and a reading of the app's own stores. The page is a
   scrolling sheet inside a full-window frame; the frame's label row carries
   the title and the close, so nothing here repeats them. */

.acc-page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.acc-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px 30px;
}

.acc-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ============ Hero ============ */

.acc-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px 24px;
  background: var(--bg-light);
  border: 1px solid var(--cardBorders);
  border-radius: 12px;
}

.acc-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 6% 0%, rgba(74, 144, 217, 0.22), transparent 46%),
    radial-gradient(circle at 96% 100%, rgba(176, 128, 208, 0.12), transparent 42%);
  pointer-events: none;
}

.acc-avatar {
  position: relative;
  width: 84px;
  height: 84px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #4a90d9, #b080d0);
  color: #10151c;
  font-family: var(--font-condensed);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow:
    0 0 0 4px var(--bg-light),
    0 0 0 5px rgba(74, 144, 217, 0.45);
  cursor: pointer;
  user-select: none;
}

.acc-avatar:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.acc-avatar-initials {
  display: block;
  line-height: 1;
}

.acc-avatar-img {
  display: none;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.acc-avatar.has-photo .acc-avatar-initials { display: none; }
.acc-avatar.has-photo .acc-avatar-img { display: block; }

/* The camera badge is always visible, so the photo reads as editable without
   needing a hover on a touch screen. */
.acc-avatar-edit {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-mid);
  border: 1px solid var(--cardBorders);
  box-shadow: 0 0 0 2px var(--bg-light);
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1;
  pointer-events: none;
  transition: color 140ms ease, border-color 140ms ease;
}

.acc-avatar:hover .acc-avatar-edit,
.acc-avatar:focus-visible .acc-avatar-edit {
  color: var(--accent);
  border-color: var(--accent);
}

.acc-identity {
  position: relative;
  flex: 1;
  min-width: 0;
}

.acc-name {
  margin: 0;
  font-family: var(--font-condensed);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acc-email {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
}

.acc-chip {
  padding: 3px 8px;
  border: 1px solid var(--cardBorders);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.acc-chip--accent {
  color: #bcd8f5;
  border-color: rgba(74, 144, 217, 0.45);
  background: rgba(74, 144, 217, 0.12);
}

.acc-chip--button {
  font-family: inherit;
  line-height: 1.2;
  cursor: pointer;
}

.acc-chip--button:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.acc-remove-photo[hidden] { display: none; }

.acc-hero-note {
  position: relative;
  width: 200px;
  flex-shrink: 0;
  margin: 0;
  font-size: 10px;
  line-height: 1.55;
  color: var(--text-muted);
  text-align: right;
}

/* ============ Stats ============ */

.acc-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.acc-stat {
  --acc-color: #4a90d9;
  position: relative;
  overflow: hidden;
  display: block;
  padding: 14px 16px 13px;
  background: var(--bg-light);
  border: 1px solid var(--cardBorders);
  border-radius: 10px;
  color: inherit;
  font-family: inherit;
  text-align: left;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.acc-stat--link { cursor: pointer; }

.acc-stat--link:hover {
  transform: translateY(-2px);
  border-color: var(--acc-color);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.acc-stat .material-symbols-outlined {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 18px;
  color: var(--acc-color);
  opacity: 0.85;
}

.acc-stat strong {
  display: block;
  font-family: var(--font-condensed);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}

.acc-stat > span:not(.material-symbols-outlined) {
  display: block;
  margin-top: 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.acc-stat small {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: var(--text-muted);
}

/* ============ Columns ============ */

.acc-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.acc-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.acc-card {
  padding: 16px 18px;
  background: var(--bg-light);
  border: 1px solid var(--cardBorders);
  border-radius: 10px;
}

.acc-card-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}

.acc-card-head h2 {
  margin: 0;
  font-family: var(--font-condensed);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.acc-card-head span {
  font-size: 10px;
  color: var(--text-muted);
}

/* ============ Profile form ============ */

.acc-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.acc-name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.acc-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.acc-input {
  padding: 7px 9px;
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  outline: none;
}

.acc-input:focus { border-color: var(--accent); }

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

.acc-form-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 2px;
}

.acc-saved {
  margin-left: auto;
  font-size: 10px;
  color: #50b070;
  opacity: 0;
  transition: opacity 180ms ease;
}

.acc-saved.show { opacity: 1; }

/* ============ Buttons ============ */

.acc-btn {
  padding: 6px 12px;
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
}

.acc-btn:hover { border-color: var(--accent); }

.acc-btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #10151c;
  font-weight: 600;
}

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

.acc-btn--danger { color: #e07070; }

.acc-btn--danger:hover { border-color: #e07070; }

.acc-btn--danger.armed {
  background: rgba(224, 112, 112, 0.12);
  border-color: #e07070;
}

.acc-card--quiet {
  background: transparent;
  border-style: dashed;
}

.acc-card--quiet p {
  margin: 9px 0 0;
  font-size: 10px;
  line-height: 1.55;
  color: var(--text-muted);
}

/* ============ Preference toggle ============ */

.acc-toggle-row {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}

.acc-toggle-row > span {
  flex: 1;
  min-width: 0;
}

.acc-toggle-row strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.acc-toggle-row small {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  line-height: 1.45;
  color: var(--text-muted);
}

.acc-check {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ============ Meta ============ */

.acc-meta {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.acc-meta div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
}

.acc-meta dt { color: var(--text-muted); }

.acc-meta dd {
  margin: 0;
  color: var(--text-secondary);
  text-align: right;
}

/* ============ Narrow ============ */

@media (max-width: 900px) {
  .acc-columns { grid-template-columns: 1fr; }
  .acc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acc-hero { flex-wrap: wrap; }
  .acc-hero-note {
    width: 100%;
    text-align: left;
  }
}

@media (max-width: 560px) {
  .acc-stats { grid-template-columns: 1fr; }
  .acc-name-row { grid-template-columns: 1fr; }
  .acc-avatar {
    width: 64px;
    height: 64px;
    font-size: 24px;
  }
  .acc-avatar-edit {
    width: 22px;
    height: 22px;
    font-size: 13px;
  }
  .acc-name { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .acc-stat,
  .acc-saved { transition: none; }
}
