/* Member dashboard (account page only). Loaded only by /account, so no other page changes.
   Senior-friendly: 20px+ text, strong contrast, 48px+ tap targets, clear focus rings. */

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }

.dash { padding: 1.5rem 0 3rem; font-size: 1.25rem; }
.dash h2 { font-size: clamp(1.6rem, 1.2rem + 1vw, 2rem); }
.dash h3 { font-size: 1.4rem; }
.dash button, .dash .button { min-height: 52px; font-size: 1.2rem; padding: 0.75rem 1.35rem; }
.dash :focus-visible { outline: 4px solid var(--gold-bright); outline-offset: 3px; box-shadow: 0 0 0 7px var(--navy); }

/* Family view banner */
.dash-banner {
  display: flex; align-items: center; gap: 0.9rem; margin: 0 0 1.25rem; padding: 1rem 1.25rem;
  background: var(--navy); color: #fff; border-radius: 16px; font-weight: 700; font-size: 1.25rem;
}
.dash-banner p { margin: 0; }
.dash-banner-icon { flex: 0 0 auto; width: 34px; height: 34px; fill: none; stroke: var(--gold-bright); stroke-width: 2; }

/* Header */
.dash-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 1.25rem; }
.dash-head h1 { margin: 0 0 0.25rem; font-size: clamp(2.1rem, 1.4rem + 2vw, 3rem); }
.dash-sub { margin: 0; color: var(--ink-soft); overflow-wrap: anywhere; }
.dash-head-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem 1rem; }
.dash-switch { min-width: 15rem; }
.dash-switch select { min-height: 52px; font-size: 1.15rem; }

/* Tab bar: one row on wide screens, a big two-column menu on phones */
.dash-nav { margin: 0 0 1.5rem; }
.dash-tabs {
  display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 0.4rem; padding: 0.45rem;
  background: var(--bg-raised); border: 2px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
}
.dash-tabs [role="tab"] {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.3rem;
  min-height: 84px; padding: 0.6rem 0.35rem; border-radius: 16px; border: 2px solid transparent;
  background: transparent; color: var(--navy); font-size: 1.1rem; font-weight: 700; line-height: 1.15; text-align: center;
}
.dash-tabs [role="tab"] svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.dash-tabs [role="tab"]:hover { background: var(--tint); color: var(--navy); }
.dash-tabs [role="tab"][aria-selected="true"] { background: var(--sage); color: #fff; border-color: var(--sage-deep); }
.dash-tabs [role="tab"][aria-selected="true"]:hover { background: var(--sage-deep); }
@media (max-width: 1040px) and (min-width: 760px) {
  .dash-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 759px) {
  .dash-tabs { grid-template-columns: 1fr 1fr; gap: 0.55rem; padding: 0.55rem; }
  .dash-tabs [role="tab"] { flex-direction: row; justify-content: flex-start; gap: 0.7rem; min-height: 64px; padding: 0.6rem 0.9rem; font-size: 1.2rem; text-align: left; background: #fff; border-color: var(--line); }
  .dash-tabs [role="tab"] svg { width: 28px; height: 28px; flex: 0 0 auto; }
  .dash-head-actions { width: 100%; }
  .dash-head-actions > * { flex: 1 1 100%; }
  .dash-head-actions .button-secondary { width: 100%; }
}
@media (max-width: 360px) { .dash-tabs { grid-template-columns: 1fr; } }

/* Panels and cards */
.dash-panel { outline: none; scroll-margin-top: 1rem; }
.dash-intro { font-size: 1.25rem; color: var(--ink-soft); margin-bottom: 1.25rem; }
.dash-msg { margin: 0 0 1rem; }
.dash-loading { font-size: 1.25rem; color: var(--ink-soft); padding: 1rem 0; }
.dash-empty { padding: 1.1rem 1.25rem; background: var(--bg-raised); border: 2px dashed var(--line); border-radius: 16px; color: var(--ink-soft); }
.dash-section-title { font-size: 1.45rem; margin: 1.75rem 0 0.85rem; color: var(--navy); }
.dash-grid { display: grid; gap: 1.25rem; }
.dash-grid > .dash-feature .dash-section-title, .dash-grid > .dash-panel-card .dash-section-title { margin-top: 0; }
@media (min-width: 900px) {
  .dash-grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .dash-hello-card { grid-column: 1 / -1; }
}
.dash-hello-card {
  padding: 1.5rem 1.6rem; border-radius: 22px; color: var(--ink);
  background: radial-gradient(ellipse at 100% 0%, rgba(226, 162, 58, 0.25), transparent 55%), var(--tint-sage);
  border: 2px solid #cfe5dc;
}
.dash-hello-card h2 { margin-bottom: 0.4rem; }
.dash-hello-card p { margin: 0; font-size: 1.25rem; }
.dash-panel-card { padding: 1.35rem 1.5rem; background: var(--bg-raised); border: 2px solid var(--line); border-radius: 20px; }
.dash-quick { display: grid; gap: 0.6rem; }
.dash-quick button { width: 100%; justify-content: flex-start; }

.dash-cards { display: grid; gap: 1rem; }
.dash-card {
  position: relative; padding: 1.35rem 1.5rem 1.2rem; background: #fff; border: 2px solid var(--line);
  border-left: 8px solid var(--sage); border-radius: 18px; box-shadow: 0 6px 18px rgba(16, 36, 62, 0.05);
}
.dash-card-scam_alert { border-left-color: var(--danger); }
.dash-card-activity { border-left-color: var(--gold-bright); }
.dash-card-title { font-size: 1.45rem; margin: 0.35rem 0 0.5rem; }
.dash-summary { font-size: 1.25rem; margin-bottom: 0.75rem; }
.dash-card-body { border-top: 2px solid var(--line); padding-top: 0.9rem; margin-top: 0.5rem; }
.dash-card-body p { font-size: 1.25rem; max-width: 46rem; }
.dash-subhead { font-size: 1.3rem; margin: 1rem 0 0.35rem; color: var(--navy); }
.dash-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem 0.75rem; font-size: 1.05rem; }
.dash-type { font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--sage-deep); }
.dash-type-scam_alert { color: var(--danger); }
.dash-type-activity { color: var(--gold); }
.dash-new { display: inline-block; padding: 0.1rem 0.65rem; border-radius: 999px; background: var(--gold-bright); color: #1a1205; font-weight: 700; }
.dash-when { color: var(--ink-soft); }
.dash-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.75rem; }
.dash-read { background: var(--sage); }
.dash-save.is-saved { background: var(--tint); border-color: var(--gold); color: #3d2604; }
.dash-more-wrap { margin-top: 1.25rem; }
.dash-danger { color: var(--danger); border-color: var(--danger); }
.dash-danger:hover { background: var(--danger); color: #fff; }

/* Search */
.dash-tools { margin: 0 0 0.5rem; }
.dash-search label { display: block; font-weight: 700; color: var(--navy); margin-bottom: 0.35rem; }
.dash-search-row { display: flex; gap: 0.6rem; }
.dash-search input[type="search"] {
  flex: 1 1 auto; min-height: 56px; font: inherit; font-size: 1.25rem; padding: 0.6rem 0.9rem;
  border: 2px solid #5c6b7c; border-radius: 12px; background: #fff; color: var(--ink);
}
@media (max-width: 480px) { .dash-search-row { flex-direction: column; } }

/* My emails timeline */
.dash-timeline { list-style: none; margin: 0 0 1.5rem; padding: 0; position: relative; }
.dash-timeline::before { content: ""; position: absolute; left: 13px; top: 8px; bottom: 8px; width: 3px; background: var(--line); border-radius: 3px; }
.dash-tl-item { position: relative; display: grid; grid-template-columns: 30px 1fr auto; gap: 0.25rem 1rem; align-items: center; padding: 0.9rem 0; }
.dash-tl-dot { width: 22px; height: 22px; margin-left: 3px; border-radius: 50%; background: var(--sage); border: 4px solid var(--bg); box-shadow: 0 0 0 2px var(--sage); }
.dash-tl-main { background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 0.8rem 1.1rem; }
.dash-tl-title { margin: 0; font-size: 1.3rem; }
.dash-kicker { margin: 0 0 0.2rem; font-size: 1.05rem; color: var(--ink-soft); font-weight: 700; }
@media (max-width: 640px) {
  .dash-tl-item { grid-template-columns: 30px 1fr; }
  .dash-tl-act { grid-column: 2; }
  .dash-tl-act button { width: 100%; }
}
.dash-upcoming { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 0.6rem; }
.dash-upcoming li { padding: 0.85rem 1.1rem; border-radius: 14px; background: var(--tint); }
.dash-upcoming strong { display: block; color: var(--navy); }

/* Email reader */
.dash-reader-bar { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: space-between; margin-bottom: 1rem; }
.dash-reader-paper { background: #fffdf9; border: 2px solid var(--line); border-radius: 20px; padding: 1.5rem 1.6rem; max-width: 46rem; box-shadow: var(--shadow); }
.dash-reader-paper h2 { outline: none; }
.dash-pre { white-space: pre-line; }
.dash-reader-paper blockquote { margin: 0 0 1rem; padding: 0.8rem 1rem; background: var(--tint); border-left: 5px solid var(--gold-bright); border-radius: 8px; }

/* Family */
.dash-callout { padding: 1rem 1.2rem; border-radius: 14px; background: var(--tint-sage); border: 2px solid #cfe5dc; margin-bottom: 1.25rem; font-weight: 700; color: var(--sage-deep); }
.dash-people { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 0.75rem; }
.dash-person { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; padding: 1rem 1.2rem; background: #fff; border: 2px solid var(--line); border-radius: 16px; }
.dash-person-name { margin: 0; font-weight: 700; font-size: 1.3rem; color: var(--navy); }
.dash-person-meta { margin: 0; color: var(--ink-soft); overflow-wrap: anywhere; }
.dash-person-act { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.dash-person-act select { width: auto; min-height: 52px; }
.dash-form h3 { margin-top: 0; }
.dash-form fieldset .choice span { font-size: 1.2rem; }
.dash-copy { margin-top: 1rem; }
.dash-copy label { font-weight: 700; color: var(--navy); display: block; margin-bottom: 0.35rem; }
.dash-copy-row { display: flex; gap: 0.6rem; }
.dash-copy-row input { flex: 1 1 auto; }
@media (max-width: 480px) { .dash-copy-row { flex-direction: column; } }

/* Settings */
.dash-setting { padding: 1.25rem 1.4rem; background: var(--bg-raised); border: 2px solid var(--line); border-radius: 18px; margin-bottom: 1rem; }
.dash-setting h3 { margin-top: 0; }
.dash-details { padding-left: 1.2rem; }
.dash-disclaimer { margin-top: 2rem; }

/* Printing a single item */
#print-area { display: none; }
@media print {
  body.printing-item > *:not(#print-area) { display: none !important; }
  body.printing-item #print-area { display: block !important; font-size: 14pt; line-height: 1.5; color: #000; }
  #print-area .print-brand-line { font-size: 11pt; text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1pt solid #000; padding-bottom: 4pt; margin-bottom: 10pt; }
  #print-area .dash-card, #print-area .dash-reader-paper { border: none; box-shadow: none; padding: 0; }
  #print-area [hidden] { display: block !important; }
  #print-area button, #print-area .dash-actions { display: none !important; }
  #print-area a.button { color: #000; background: none; border: 1pt solid #000; }
  .dash-tabs, .dash-head-actions, .dash-banner-icon { display: none !important; }
}

/* Overrides for the older sign-in page styles inside the dashboard */
#acct-view .button-secondary { width: auto; max-width: none; }
.dash [tabindex="-1"]:focus, .dash [tabindex="-1"]:focus-visible { outline: none; box-shadow: none; }
