:root {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); }
a { color: inherit; text-decoration: none; }

.site-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 1240px;
    padding: 24px 32px;
}

.brand { display: flex; align-items: center; flex-shrink: 0; }
.brand__logo { display: block; width: 232px; height: auto; }

nav { align-items: center; display: flex; gap: 34px; }
nav a { color: var(--ink); font-size: 14px; font-weight: 600; }
.nav-login { border: 1px solid var(--ink); border-radius: 999px; padding: 10px 20px; }
.nav-profile { display: inline-flex; align-items: center; gap: 8px; }
.nav-profile svg { flex-shrink: 0; }

.hero {
    align-items: center;
    display: grid;
    gap: 80px;
    grid-template-columns: 1.05fr .95fr;
    margin: 0 auto;
    max-width: 1240px;
    min-height: 660px;
    padding: 64px 56px 92px;
}

.eyebrow {
    color: var(--action);
    display: block;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .15em;
    margin-bottom: 20px;
    text-transform: uppercase;
}

h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: -.035em; margin: 0; }
h1 { font-size: clamp(52px, 6vw, 84px); line-height: .98; }
.hero__lead { color: var(--muted); font-size: 19px; line-height: 1.65; margin: 30px 0; max-width: 610px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__note { color: var(--muted); font-size: 13px; margin: 14px 0 0; }

.button {
    border: 1px solid transparent;
    border-radius: 10px;
    display: inline-flex;
    font-size: 15px;
    font-weight: 750;
    justify-content: center;
    padding: 15px 22px;
}
.button--primary { background: var(--action); color: white; }
.button--secondary { border-color: var(--action); background: white; }
.button--dark { background: var(--ink); color: white; }
.button--full { width: 100%; }

.portal-preview {
    background: white;
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 26px 60px rgba(46, 76, 111, .12);
    padding: 30px;
    transform: rotate(1deg);
}
.portal-preview__header { align-items: center; display: flex; justify-content: space-between; }
.portal-preview__header strong { display: block; font-family: Georgia, serif; font-size: 30px; font-weight: 500; margin-top: 2px; }
.portal-preview__label, .portal-preview__meta span { color: var(--muted); font-size: 12px; }
.status { background: var(--surface-soft); border-radius: 999px; color: var(--ink); font-size: 12px; font-weight: 700; padding: 8px 11px; }
.status span { background: var(--action); border-radius: 50%; display: inline-block; height: 7px; margin-right: 4px; width: 7px; }
.message-card { align-items: center; background: var(--white); border-left: 4px solid var(--accent); border-radius: 15px; display: flex; gap: 15px; margin: 32px 0 14px; padding: 22px; }
.message-card__icon { align-items: center; background: var(--accent-soft); border-radius: 50%; display: flex; font-size: 21px; height: 46px; justify-content: center; width: 46px; }
.message-card span, .message-card strong { display: block; }
.message-card div span { color: var(--action); font-size: 12px; font-weight: 750; margin-bottom: 5px; }
.message-card strong { font-size: 15px; }
.portal-preview__meta { border-top: 1px solid var(--line); display: grid; gap: 20px; grid-template-columns: 1fr 1fr; margin-top: 26px; padding-top: 22px; }
.portal-preview__meta strong { display: block; font-size: 14px; margin-top: 5px; }

.value-grid {
    background: var(--ink);
    color: white;
    display: grid;
    gap: 48px;
    grid-template-columns: 1.4fr .8fr .8fr;
    padding: 78px max(32px, calc((100vw - 1128px) / 2));
}
.value-grid h2 { font-size: clamp(34px, 4vw, 48px); line-height: 1.1; }
.value-grid article { border-left: 1px solid rgba(255,255,255,.18); padding-left: 28px; }
.value-grid h3 { font-size: 18px; margin: 30px 0 10px; }
.value-grid p { color: var(--white); font-size: 14px; line-height: 1.6; margin: 0; }
.value-grid .eyebrow { color: var(--accent-soft); }
.step { color: var(--accent-soft); font-family: Georgia, serif; font-size: 18px; }

.site-footer { color: var(--muted); display: flex; font-size: 12px; justify-content: space-between; margin: 0 auto; max-width: 1240px; padding: 28px 32px; }
.site-footer div { display: flex; gap: 22px; }

.message {
    border-radius: 10px;
    font-size: 14px;
    left: 50%;
    max-width: min(560px, calc(100% - 32px));
    padding: 14px 18px;
    position: fixed;
    top: 18px;
    transform: translateX(-50%);
    width: max-content;
    z-index: 20;
}
.message.success { background: #dff4e9; color: #155d4b; }
.message.error { background: #fde9e7; color: #8c2921; }
.message.warning { background: #fff2cf; color: #74540a; }

.account-page {
    align-items: start;
    display: grid;
    gap: 90px;
    grid-template-columns: 1fr 500px;
    margin: 0 auto;
    max-width: 1120px;
    min-height: 720px;
    padding: 70px 32px 100px;
}
.account-page--login { padding-top: 110px; }
.account-intro { padding-top: 28px; }
.account-intro h1 { font-size: clamp(48px, 6vw, 72px); line-height: 1; }
.account-intro > p { color: var(--muted); font-size: 18px; line-height: 1.7; max-width: 520px; }
.back-link { color: var(--muted); display: inline-block; font-size: 13px; margin-bottom: 50px; }
.privacy-note { border-left: 3px solid var(--accent-soft); display: grid; font-size: 13px; gap: 5px; margin-top: 42px; padding: 5px 0 5px 18px; }
.privacy-note span { color: var(--muted); }
.account-card {
    background: white;
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 22px 50px rgba(46, 76, 111, .09);
    padding: 34px;
}
.account-card label { display: block; font-size: 13px; font-weight: 750; margin-bottom: 8px; }
.account-card .input { margin-bottom: 20px; }
.account-card input {
    background: var(--white);
    border: 1px solid var(--control-border);
    border-radius: 9px;
    color: var(--ink);
    font: inherit;
    min-height: 48px;
    padding: 10px 13px;
    width: 100%;
}
.account-card input:focus { border-color: var(--action); box-shadow: 0 0 0 3px rgba(21, 103, 145, .11); outline: none; }
.account-card .error input { border-color: #bc5149; }
.account-card .error-message { color: #9b3129; display: block; font-size: 12px; margin-top: 5px; }
.account-card .help-text { color: var(--muted); display: block; font-size: 12px; margin-top: 5px; }
.password-help { margin: -16px 0 20px; }
.form-row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.form-terms { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 8px 0 20px; }
.account-card__footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; margin: 24px 0 0; padding-top: 22px; text-align: center; }
.account-card__footer--compact { border-top: 0; margin-top: 14px; padding-top: 0; }
.account-card__footer a { color: var(--action); font-weight: 750; }
.compact-title { font-family: inherit; font-size: 22px; font-weight: 800; letter-spacing: 0; margin-bottom: 14px; }

.dashboard { margin: 0 auto; max-width: 1120px; min-height: 720px; padding: 80px 32px 110px; }
.dashboard__top { align-items: flex-end; display: flex; justify-content: space-between; }
.dashboard__top h1 { font-size: clamp(48px, 6vw, 72px); }
.dashboard__top p { color: var(--muted); font-size: 17px; }
.dashboard-grid { display: grid; gap: 18px; grid-template-columns: 1.35fr .65fr; margin-top: 55px; }
.dashboard-card { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 28px; }
.dashboard-card--primary { background: var(--ink); color: white; grid-row: span 2; padding: 38px; }
.dashboard-card--primary h2 { font-family: Georgia, serif; font-size: 36px; font-weight: 500; margin: 55px 0 15px; }
.dashboard-card--primary p { color: var(--white); line-height: 1.6; max-width: 440px; }
.dashboard-card--primary .button { margin-top: 28px; }
.dashboard-card__label { color: var(--muted); display: block; font-size: 12px; margin-bottom: 14px; }
.dashboard-card > strong { display: block; font-size: 15px; margin-bottom: 24px; overflow-wrap: anywhere; }
.dashboard-card .status { display: inline-block; }
.dashboard-card h3 { font-size: 21px; margin: 0 0 10px; }
.dashboard-card > p { color: var(--muted); font-size: 14px; line-height: 1.55; }
.dashboard-card--wide { grid-column: span 1; }
.button--light { background: white; color: var(--ink); }
.button--disabled { cursor: default; background: var(--surface-soft); color: var(--ink); border-color: var(--control-border); }
.dashboard-grid--full { grid-template-columns: 1fr 1fr 1fr; }
.portal-workspace { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; margin-top: 18px; }
.portal-form { display: grid; gap: 16px; }
.portal-form label {
    display: block;
    font-size: 13px;
    font-weight: 750;
    margin-bottom: 8px;
}
.portal-form input,
.portal-form textarea {
    background: var(--white);
    border: 1px solid var(--control-border);
    border-radius: 9px;
    color: var(--ink);
    font: inherit;
    min-height: 48px;
    padding: 10px 13px;
    resize: vertical;
    width: 100%;
}
.portal-form input:focus,
.portal-form textarea:focus {
    border-color: var(--action);
    box-shadow: 0 0 0 3px rgba(21, 103, 145, .11);
    outline: none;
}
.invite-box {
    align-items: center;
    border-top: 1px solid var(--line);
    display: grid;
    gap: 16px;
    grid-template-columns: 132px 1fr;
    margin-top: 22px;
    padding-top: 22px;
}
.invite-box img {
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: block;
    height: 132px;
    padding: 8px;
    width: 132px;
}
.invite-box a {
    color: var(--action);
    display: block;
    font-size: 13px;
    font-weight: 750;
    overflow-wrap: anywhere;
}
.portal-muted {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}
.message-list {
    display: grid;
    gap: 12px;
}
.message-list article {
    border-top: 1px solid var(--line);
    padding-top: 12px;
}
.message-list span {
    color: var(--muted);
    display: block;
    font-size: 12px;
    font-weight: 750;
    margin-bottom: 6px;
}
.message-list p {
    margin: 0;
    white-space: pre-wrap;
}

.admin-shell {
    margin: 0 auto;
    max-width: 1180px;
    min-height: 720px;
    padding: 56px 32px 110px;
}
.admin-topbar {
    align-items: flex-end;
    display: flex;
    gap: 24px;
    justify-content: space-between;
    margin-bottom: 34px;
}
.admin-topbar h1 {
    font-size: clamp(42px, 5vw, 64px);
}
.admin-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.admin-stats {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 18px;
}
.admin-stats article,
.admin-panel {
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.admin-stats article {
    padding: 18px;
}
.admin-stats span,
.admin-table td span,
.admin-panel p,
.admin-content-fetch__dates {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    max-width: 600px;
}
.admin-content-fetch__dates .input,
.admin-content-fetch__dates input {
    min-width: 0;
}
.admin-content-fetch .checkbox label {
    align-items: flex-start;
    display: flex;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    margin: 0;
    cursor: pointer;
}
.admin-content-fetch input[type="checkbox"] {
    accent-color: var(--action);
    flex: 0 0 18px;
    height: 18px;
    margin: 2px 0 0;
    padding: 0;
    width: 18px;
}
.admin-content-fetch > .button {
    justify-self: start;
}
.admin-note {
    color: var(--muted);
}
.admin-stats span {
    display: block;
    font-size: 12px;
    font-weight: 750;
    margin-bottom: 8px;
    text-transform: uppercase;
}
.admin-stats strong {
    display: block;
    font-size: 30px;
}
.admin-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
}
.admin-panel {
    padding: 24px;
}
.admin-panel--spaced {
    margin-top: 18px;
}
.admin-today {
    margin-bottom: 18px;
}
.admin-today .admin-panel__header {
    flex-wrap: wrap;
    gap: 12px 24px;
    margin-bottom: 12px;
}
.admin-today h2 {
    margin-bottom: 6px;
}
.admin-today h2 span {
    display: inline-block;
    color: var(--muted);
    font-size: 16px;
    font-weight: 500;
}
.admin-today p {
    display: block;
    margin: 0;
}
.admin-today .admin-table {
    min-width: 0;
    table-layout: fixed;
    overflow-wrap: anywhere;
}
.admin-today .admin-table th:first-child {
    width: 70%;
}
.admin-today__empty {
    border-top: 1px solid var(--line);
    padding-top: 18px;
}
.admin-panel h2 {
    font-family: inherit;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0 0 18px;
}
.admin-panel__header {
    align-items: center;
    display: flex;
    justify-content: space-between;
}
.admin-panel__header a,
.admin-table a {
    color: var(--action);
    font-weight: 750;
}
.admin-table-wrap {
    overflow-x: auto;
}
.admin-table {
    border-collapse: collapse;
    min-width: 680px;
    width: 100%;
}
.admin-table th,
.admin-table td {
    border-bottom: 1px solid var(--line);
    padding: 14px 10px;
    text-align: left;
    vertical-align: top;
}
.admin-table th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}
.admin-table td {
    font-size: 14px;
}
.admin-table td span {
    display: block;
    font-size: 12px;
    margin-top: 3px;
    overflow-wrap: anywhere;
}
.admin-pill {
    background: var(--surface-soft);
    border-radius: 999px;
    color: var(--action) !important;
    display: inline-flex !important;
    font-size: 12px !important;
    font-weight: 800;
    padding: 6px 10px;
}
.admin-toggle-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}
.admin-filters {
    align-items: end;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(220px, 1fr) 180px auto;
    margin-bottom: 22px;
}
.admin-filters label,
.admin-status-form label {
    display: block;
    font-size: 13px;
    font-weight: 750;
    margin-bottom: 8px;
}
.admin-filters input,
.admin-filters select,
.admin-status-form select {
    background: var(--white);
    border: 1px solid var(--control-border);
    border-radius: 9px;
    color: var(--ink);
    font: inherit;
    min-height: 48px;
    padding: 10px 13px;
    width: 100%;
}
.admin-details {
    display: grid;
    gap: 10px 18px;
    grid-template-columns: 170px minmax(0, 1fr);
    margin: 0;
}
.admin-details dt {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}
.admin-details dd {
    margin: 0;
    overflow-wrap: anywhere;
}
.admin-status-form {
    display: grid;
    gap: 16px;
}
.admin-form {
    display: grid;
    gap: 16px;
}
.admin-form-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.admin-form label {
    display: block;
    font-size: 13px;
    font-weight: 750;
    margin-bottom: 8px;
}
.admin-form input,
.admin-form select {
    background: var(--white);
    border: 1px solid var(--control-border);
    border-radius: 9px;
    color: var(--ink);
    font: inherit;
    min-height: 48px;
    padding: 10px 13px;
    width: 100%;
}
.admin-form input[type="checkbox"] {
    min-height: auto;
    width: auto;
}
.admin-form input:focus,
.admin-form select:focus {
    border-color: var(--action);
    box-shadow: 0 0 0 3px rgba(21, 103, 145, .11);
    outline: none;
}
.admin-note {
    font-size: 13px;
    line-height: 1.55;
    margin: 18px 0 0;
}
.admin-subsection {
    border-top: 1px solid rgba(21, 103, 145, .13);
    display: grid;
    gap: 18px;
    padding-top: 18px;
}
.admin-subsection + .admin-subsection {
    margin-top: 24px;
}
.admin-subsection h3 {
    margin: 0;
}
.portal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0 12px;
}

@media (max-width: 820px) {
    .site-header nav a:not(.nav-login) { display: none; }
    .hero { gap: 50px; grid-template-columns: 1fr; padding: 50px 24px 70px; }
    .portal-preview { transform: none; }
    .value-grid { grid-template-columns: 1fr; padding: 62px 28px; }
    .value-grid article { border-left: 0; border-top: 1px solid rgba(255,255,255,.18); padding: 26px 0 0; }
    .account-page { gap: 45px; grid-template-columns: 1fr; padding-top: 35px; }
    .account-page--login { padding-top: 35px; }
    .account-intro { padding-top: 0; }
    .back-link { margin-bottom: 35px; }
    .dashboard__top { align-items: flex-start; flex-direction: column; gap: 24px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-card--primary { grid-row: auto; }
    .dashboard-grid--full { grid-template-columns: 1fr; }
    .portal-workspace { grid-template-columns: 1fr; }
    .admin-topbar { align-items: flex-start; flex-direction: column; }
    .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-grid { grid-template-columns: 1fr; }
    .admin-filters { grid-template-columns: 1fr; }
    .admin-form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .site-header { padding: 18px; }
    .brand__logo { width: 180px; }
    .nav-login { padding: 9px 15px; }
    h1 { font-size: 48px; }
    .hero__actions, .hero__actions .button { width: 100%; }
    .portal-preview { padding: 22px; }
    .portal-preview__header { align-items: flex-start; gap: 15px; }
    .site-footer { gap: 18px; flex-direction: column; }
    .account-page { padding-left: 18px; padding-right: 18px; }
    .account-card { padding: 24px 20px; }
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .dashboard { padding: 55px 18px 80px; }
    .invite-box { grid-template-columns: 1fr; }
    .admin-shell { padding: 40px 18px 80px; }
    .admin-stats { grid-template-columns: 1fr; }
    .admin-panel { padding: 18px; }
    .admin-details { grid-template-columns: 1fr; }
}

/* Source text formatting, scoped to imported content previews. */
.imported-content-description {
    max-width: 75ch;
    line-height: 1.6;
    overflow-wrap: anywhere;
    overflow-x: auto;
}
.admin-panel .imported-content-description p {
    display: block;
    max-width: none;
    margin: 0 0 1em;
}
.imported-content-description ul,
.imported-content-description ol {
    display: block;
    margin: 0 0 1em;
    padding-left: 1.6em;
}
.imported-content-description ul { list-style: disc; }
.imported-content-description ol { list-style: decimal; }
.imported-content-description li { margin: .25em 0; }
.admin-panel .imported-content-description :is(h1, h2, h3, h4, h5, h6) {
    margin: 1.2em 0 .5em;
    line-height: 1.3;
    font-size: 1.2em;
}
.imported-content-description a {
    color: var(--action);
    text-decoration: underline;
}
.imported-content-description blockquote {
    margin: 1em 0;
    padding-left: 1em;
    border-left: 3px solid var(--line);
}
.imported-content-description pre { white-space: pre-wrap; }
.imported-content-description table { border-collapse: collapse; margin-bottom: 1em; }
.imported-content-description :is(th, td) { padding: .5em; border: 1px solid var(--line); }
.imported-content-description > :first-child { margin-top: 0; }

.imported-audio-preview {
    display: block;
    max-width: 100%;
    margin: 1rem 0;
}

.imported-video-preview {
    width: 100%;
    max-width: 960px;
    aspect-ratio: 16 / 9;
    margin: 1rem 0;
    overflow: hidden;
    border-radius: 8px;
    background: var(--ink);
}
.imported-video-preview iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.imported-message-dates {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
    gap: 12px;
    margin: 0;
}
.imported-message-dates > div {
    padding: 16px 18px;
    border-radius: 8px;
    background: var(--surface-soft);
}
.imported-message-dates dt {
    margin-bottom: 8px;
    font-size: .85rem;
    color: var(--ink);
}
.imported-message-dates dd {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}
.imported-message-dates time span {
    display: block;
    margin-top: 4px;
    font-size: .9rem;
    font-weight: 400;
}
.imported-elements-heading {
    margin: 28px 0 14px;
    font-family: inherit;
    font-size: 1.35rem;
    font-weight: 800;
}
.admin-panel.imported-element-card {
    padding: 0;
    margin-bottom: 12px;
    overflow: hidden;
}
.imported-element-card > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    list-style: none;
    cursor: pointer;
    font-weight: 750;
    line-height: 1.4;
    overflow-wrap: anywhere;
}
.imported-element-card > summary > h2 { margin: 0; }
.imported-element-card > summary::-webkit-details-marker { display: none; }
.imported-element-card > summary::after {
    content: '';
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
}
.imported-element-card[open] > summary::after { transform: rotate(225deg); }
.imported-element-card > summary:hover { background: var(--surface-soft); }
.imported-element-card > summary:focus-visible {
    outline: 2px solid var(--action);
    outline-offset: -4px;
}
.imported-element-card__body {
    padding: 20px 24px 24px;
    border-top: 1px solid var(--line);
}
.imported-element-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}
.imported-element-card__meta a { color: var(--action); font-weight: 750; }

/* Publication changes are an optional action, collapsed by default. */
.admin-panel.imported-schedule { margin-top: 16px; }
.imported-schedule__intro { margin: 0 0 16px; }
.imported-schedule__notice {
    padding: 12px 16px;
    margin: 0 0 24px;
    border-left: 3px solid var(--control-border);
    border-radius: 4px;
    background: var(--surface-soft);
    font-size: 14px;
    line-height: 1.55;
}
.imported-schedule__dates {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 20px;
    width: 100%;
    max-width: 720px;
}
.imported-schedule__dates > div,
.imported-schedule__dates input { min-width: 0; }
@media (max-width: 600px) {
    .imported-schedule__dates { grid-template-columns: 1fr; }
}
.imported-schedule__help { margin: 8px 0 0; font-size: 13px; line-height: 1.5; }
.imported-schedule .button { justify-self: start; }

/* Customer overview and loved one's workspace. */
.portal-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 48px; }
.portal-section-heading h2 { margin-bottom: 8px; }
.portal-section-heading p { color: var(--muted); line-height: 1.6; }
.elder-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 18px; margin-top: 24px; }
.elder-card { display: flex; flex-direction: column; align-items: flex-start; }
.elder-card h2 { margin: 0 0 12px; overflow-wrap: anywhere; }
.elder-card .button { margin-top: auto; }
.dashboard-card--primary > p { color: var(--white); }
.dashboard__top h1 { overflow-wrap: anywhere; }
@media (max-width: 680px) {
    .portal-section-heading { align-items: flex-start; flex-direction: column; }
}

/* Keep subscription management secondary to everyday contact. */
.subscription-summary { margin-top: 32px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.subscription-summary > summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 19px 22px; cursor: pointer; list-style: none; }
.subscription-summary > summary::-webkit-details-marker { display: none; }
.subscription-summary > summary:focus-visible, .device-disclosure > summary:focus-visible { outline: 2px solid var(--action); outline-offset: 4px; border-radius: 8px; }
.subscription-summary__status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 14px; }
.subscription-summary__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--action); flex-shrink: 0; }
.subscription-summary__price { color: var(--muted); }
.subscription-summary__toggle { color: var(--ink); font-size: 14px; font-weight: 750; white-space: nowrap; }
.subscription-summary__toggle > span { display: inline-block; margin-left: 8px; }
.subscription-summary[open] .subscription-summary__toggle > span { transform: rotate(180deg); }
.subscription-summary__body { padding: 22px; border-top: 1px solid var(--line); }
.subscription-summary__body h2 { font-size: 20px; margin: 0 0 18px; }
.subscription-summary--attention { border-color: #d9b779; background: #fff8ea; }
.subscription-summary--attention .subscription-summary__dot { background: #976112; }
.subscription-notice { color: #785017; font-size: 14px; line-height: 1.6; margin: 10px 0 0; }
.elder-workspace { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; margin-top: 26px; align-items: start; }
.elder-workspace__messages { display: grid; gap: 20px; min-width: 0; }
.elder-workspace__device { min-width: 0; }
.elder-workspace h2 { font-size: 22px; margin: 0 0 18px; }
.elder-workspace .device-access-code { font-size: clamp(24px, 4vw, 32px); font-weight: 750; letter-spacing: .15em; color: var(--ink); margin: 24px 0; }
.device-disclosure { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 20px; }
.device-disclosure > summary { color: var(--action); font-size: 14px; font-weight: 750; cursor: pointer; }
.device-disclosure p { color: var(--muted); font-size: 14px; line-height: 1.6; }
.device-disclosure[open] > summary { margin-bottom: 18px; }
@media (max-width: 760px) {
    .elder-workspace { grid-template-columns: minmax(0, 1fr); }
    .subscription-summary > summary { align-items: flex-start; flex-direction: column; gap: 12px; }
    .subscription-summary__price { flex-basis: 100%; padding-left: 18px; }
}

.message-illustrated { background-size: cover; background-position: center; }
.message-illustrated[style] { padding: clamp(16px, 4vw, 48px); }
.message-readable { padding: 16px; border-radius: 12px; background: #fff; color: var(--ink); }
.message-photo { display: block; max-width: 100%; max-height: 650px; width: auto; height: auto; margin: 16px auto 0; object-fit: contain; border-radius: 8px; }

.background-picker { border: 1px solid var(--line); border-radius: 12px; padding: 16px; min-width: 0; }
.background-options, .background-library { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; }
.background-options label { display: flex; flex-direction: column; gap: 8px; border: 2px solid var(--control-border); border-radius: 10px; padding: 10px; cursor: pointer; }
.background-options label:has(input:checked) { border-color: var(--action); background: var(--surface-soft); }
.background-options label:focus-within { outline: 3px solid var(--action); outline-offset: 3px; }
.portal-form .background-options input { width: 20px; height: 20px; accent-color: var(--action); }
.background-options img, .background-library img { width: 100%; height: 120px; object-fit: cover; border-radius: 6px; }
.background-library { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); margin: 24px 0; }
.background-library > article { min-width: 0; overflow-wrap: anywhere; }
.background-library img { display: block; max-width: 100%; object-fit: contain; }

.image-upload-error { color: #852b22; background: #fff0ed; border-left: 4px solid #b43c30; border-radius: 6px; padding: 12px 16px; }
.image-upload-error[hidden] { display: none; }

/* Shared brand interaction states, including forms with their own focus styles. */
.button--primary:not(:disabled):not(.button--disabled):hover,
.button--primary:not(:disabled):not(.button--disabled):active {
    background: var(--ink);
}
.button--secondary:not(:disabled):not(.button--disabled):hover {
    background: var(--surface-soft);
}
a:focus-visible, button:focus-visible, summary:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible,
.account-card input:focus, .portal-form input:focus, .portal-form textarea:focus,
.admin-form input:focus, .admin-form select:focus {
    outline: 3px solid var(--ink);
    outline-offset: 3px;
    box-shadow: 0 0 0 3px var(--white), 0 0 0 8px var(--white);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
