/* ── Shared sub-page shell ──────────────────────────────────────── */
.subpage { padding-top: 16px; }
.subpage-back { margin-bottom: 12px; }
.subpage-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px;
}
.subpage-head-text { }
.subpage-title { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -.01em; margin-bottom: 4px; }
.subpage-subtitle { font-size: 14px; color: var(--muted); }

/* ── Password change view ───────────────────────────────────────── */
.pw-view { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.pw-view-form { display: flex; flex-direction: column; gap: 16px; }
.pw-view-form .card { padding: 20px; display: flex; flex-direction: column; gap: 16px; }

.pw-requirements { }
.pw-requirements .card { padding: 18px; }
.pw-req-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px; }
.pw-req-list { display: flex; flex-direction: column; gap: 8px; }
.pw-req-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted);
  transition: color .2s;
}
.pw-req-item.req-met { color: var(--ok); }
.pw-req-check {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--border); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.pw-req-item.req-met .pw-req-check { background: var(--ok); color: #fff; }

.pw-tip { margin-top: 12px; }
.pw-tip .card { padding: 14px 16px; background: var(--info-bg); border-color: var(--info-border); }
.pw-tip-title { font-size: 12px; font-weight: 700; color: var(--info); margin-bottom: 4px; }
.pw-tip-body { font-size: 13px; color: var(--text-2); line-height: 1.5; }

/* ── Notification settings view ─────────────────────────────────── */
.notifv-section { margin-bottom: 20px; }
.notifv-section-label {
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 8px;
}
.notifv-card { overflow: hidden; }
.notifv-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--border-light);
}
.notifv-row:last-child { border-bottom: none; }
.notifv-icon {
  width: 36px; height: 36px;
  background: var(--neutral-bg); border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); flex-shrink: 0;
}
.notifv-body { flex: 1; min-width: 0; }
.notifv-label { font-size: 14px; font-weight: 600; color: var(--text); }
.notifv-sub { font-size: 12px; color: var(--muted); }

/* ── Toggle switch ──────────────────────────────────────────────── */
.toggle {
  position: relative; width: 42px; height: 24px; flex-shrink: 0;
  cursor: pointer;
}
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute; inset: 0;
  background: var(--border); border-radius: 12px;
  transition: background .2s;
}
.toggle input:checked ~ .toggle-track { background: var(--brand); }
.toggle-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .2s;
}
.toggle input:checked ~ .toggle-thumb { transform: translateX(18px); }

/* ── Address view ───────────────────────────────────────────────── */
.addrv-list { display: flex; flex-direction: column; gap: 12px; }
.addr-card { padding: 16px; }
.addr-card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.addr-card-name { font-size: 15px; font-weight: 700; color: var(--text); }
.addr-card-actions { display: flex; gap: 6px; }
.addr-card-body { font-size: 13.5px; color: var(--text-2); line-height: 1.6; }
.addr-card-meta {
  display: flex; gap: 16px; flex-wrap: wrap;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border-light);
  font-size: 12px; color: var(--muted);
}
.addr-add-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 16px; border-radius: var(--r);
  border: 2px dashed var(--border);
  font-size: 14px; font-weight: 600; color: var(--muted);
  cursor: pointer; transition: border-color .15s, color .15s, background .15s;
}
.addr-add-btn:hover { border-color: var(--brand); color: var(--brand); background-color: rgba(var(--brand-rgb),.06); }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 899px) {
  .pw-view { grid-template-columns: 1fr; }
}

/* Prevent mobile browsers from auto-zooming focused form fields. */
@media (max-width: 768px) {
  input,
  textarea,
  select,
  .field-input input,
  .field-input textarea,
  .form-control,
  .search-input input,
  .search-input-row input,
  .topbar-search input,
  .receipt-date-input {
    font-size: 16px;
  }
}

/* Keep portal viewport locked to the visible screen after mobile auth focus. */
html,
body,
#app {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.app,
.app-shell,
.app-body,
.app-main {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.app-main:focus { outline: none; }
