:root {
    --green-950: #12372a;
    --green-900: #1b4d3b;
    --green-800: #2a6a4f;
    --green-700: #2e8b57;
    --green-100: #eaf4ee;
    --green-50: #f7f9f7;
    --ink: #183028;
    --muted: #5f7167;
    --disabled: #a8b3ac;
    --line: #d9e3dc;
    --white: #ffffff;
    --danger: #c0392b;
    --danger-soft: #fff0f0;
    --success: #2e8b57;
    --success-soft: #edf8f0;
    --warning: #f4a300;
    --gold: #d4a017;
    --gold-hover: #e3b341;
    --shadow: 0 18px 48px rgba(18, 55, 42, 0.16);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--ink);
    background: var(--green-50) url('../images/background.jpg') center / cover fixed;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.55;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(247, 249, 247, 0.56), rgba(247, 249, 247, 0.42));
    z-index: -1;
}

.background {
    display: none;
}

header {
    width: 100%;
    padding: 22px 24px 20px;
    color: var(--white);
    background: linear-gradient(135deg, rgba(18, 55, 42, 0.98), rgba(42, 106, 79, 0.94));
    border-bottom: 4px solid var(--gold);
    box-shadow: 0 10px 28px rgba(18, 55, 42, 0.2);
    text-align: center;
}

header h1 {
    display: inline-block;
    color: var(--white);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(1.8rem, 4vw, 2.55rem);
    letter-spacing: -0.035em;
    line-height: 1.05;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

header h1::after {
    content: '';
    display: block;
    width: 54px;
    height: 3px;
    margin: 9px auto 0;
    background: var(--gold);
    border-radius: 999px;
}

header p {
    margin-top: 7px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.88rem;
}

main,
.content-container {
    width: min(1120px, calc(100% - 32px));
    min-width: 0;
    max-width: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    margin: 42px auto;
    padding: clamp(20px, 4vw, 42px);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.home-intro {
    max-width: 670px;
    text-align: center;
}

.eyebrow {
    margin-bottom: 8px;
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.home-intro h2 {
    color: var(--green-950);
    font-size: clamp(1.65rem, 5vw, 2.45rem);
    letter-spacing: -0.05em;
    line-height: 1.08;
}

.home-intro p:last-child {
    margin: 12px auto 0;
    color: var(--muted);
    font-size: 1rem;
}

.search-container,
.register-form,
.login-form,
.form-container,
.results-container {
    width: min(100%, 650px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.search-container {
    padding: clamp(18px, 4vw, 30px);
    background: var(--green-50);
    border: 1px solid var(--line);
    border-top: 3px solid var(--gold);
    border-radius: 22px;
}

.search-container h2,
.lookup-header h2,
.register-header h2,
.login-header h2,
.results-container h2 {
    color: var(--green-950);
    font-size: clamp(1.25rem, 4vw, 1.6rem);
    letter-spacing: -0.03em;
    text-align: center;
}

.search-container form,
.register-form,
.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.form-note {
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}

.search-bar,
.denomination-dropdown,
.input-field {
    width: min(100%, 440px);
    min-height: 48px;
    padding: 12px 16px;
    color: var(--ink);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 12px;
    font: inherit;
    text-align: left;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-bar:focus,
.denomination-dropdown:focus,
.input-field:focus {
    border-color: var(--green-700);
    box-shadow: 0 0 0 4px rgba(46, 139, 87, 0.14);
    outline: none;
}

.uppercase {
    text-transform: uppercase;
}

.buttons,
.text-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.text-buttons {
    margin-top: 1px;
}

.text-buttons a,
.link-button,
.text-back-button,
.privacy-content a,
.info-message a,
.success-message a {
    color: var(--green-700);
    font-weight: 700;
    text-decoration: none;
}

.text-buttons a:hover,
.link-button:hover,
.text-back-button:hover,
.privacy-content a:hover,
.info-message a:hover,
.success-message a:hover {
    text-decoration: underline;
}

.inline-form {
    display: inline;
}

.link-button {
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
    font: inherit;
}

.btn {
    min-width: 118px;
    padding: 12px 20px;
    color: var(--white);
    background: var(--green-800);
    border: 1px solid var(--green-800);
    border-radius: 12px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.btn:hover {
    background: var(--green-950);
    border-color: var(--green-950);
    transform: translateY(-1px);
}

.btn-secondary {
    color: var(--green-900);
    background: var(--green-50);
    border-color: var(--green-200);
}

.btn-secondary:hover {
    color: var(--white);
    background: var(--green-800);
    border-color: var(--green-800);
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.found-note,
.register {
    color: var(--green-900);
    background: var(--white);
    border-color: var(--green-700);
}

.found-note:hover,
.register:hover {
    color: var(--white);
    background: var(--green-800);
    border-color: var(--green-800);
}

.no-underline {
    text-decoration: none;
}

.stats-container {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.stats {
    width: auto;
    min-width: 0;
    padding: 20px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 5px 15px rgba(18, 55, 42, 0.06);
    text-align: left;
}

.stats:nth-child(-n + 3) {
    background: var(--green-900);
    border-color: var(--green-900);
    color: var(--white);
    text-align: center;
}

.stats h3 {
    margin-bottom: 8px;
    color: var(--green-900);
    font-size: 0.96rem;
    line-height: 1.25;
}

.stats:nth-child(-n + 3) h3 {
    color: rgba(255, 255, 255, 0.8);
}

.stats:nth-child(-n + 3) p {
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -0.05em;
}

.stats ul {
    padding: 0;
    color: var(--muted);
    font-size: 0.91rem;
    list-style: none;
}

.stats li + li {
    margin-top: 6px;
}

.stats a {
    color: var(--green-700);
    font-weight: 700;
    text-decoration: none;
}

.stats a:hover {
    text-decoration: underline;
}

.lookup-header,
.register-header {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(56px, 1fr) auto minmax(56px, 1fr);
    align-items: center;
    gap: 12px;
}

.text-back-button {
    justify-self: start;
    font-size: 0.92rem;
}

.text-back-button::before {
    content: '← ';
}

.results-container {
    text-align: center;
}

.results-container p {
    color: var(--muted);
}

.lookup-actions {
    margin-top: 18px;
}

.lookup-summary-card {
    width: 100%;
    overflow: hidden;
    background: var(--green-50);
    border: 1px solid var(--line);
    border-top: 3px solid var(--gold);
    border-radius: 18px;
    text-align: left;
}

.lookup-summary-heading {
    padding: 15px 18px 13px;
    border-bottom: 1px solid var(--line);
}

.lookup-summary-heading .eyebrow {
    margin-bottom: 2px;
}

.lookup-summary-heading h3 {
    color: var(--green-950);
    font-size: 1.08rem;
    line-height: 1.25;
}

.lookup-summary-body {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 18px;
    background: var(--white);
}

.lookup-note-preview {
    flex: 0 0 auto;
    padding: 8px;
    background: var(--green-50);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.lookup-note-image {
    display: block;
    width: 72px;
    height: auto;
    border-radius: 4px;
}

.lookup-summary-details {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 32px;
}

.lookup-summary-details div {
    min-width: 130px;
}

.lookup-summary-details dt {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.lookup-summary-details dd {
    margin-top: 2px;
    color: var(--ink);
    font-size: 1.02rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.results-container .lookup-tracking-count {
    color: var(--green-900);
    font-weight: 700;
}

.bold {
    color: var(--ink);
    font-weight: 700;
}

.success-message,
.error-message,
.info-message {
    width: min(100%, 650px);
    margin-inline: auto;
    padding: 12px 16px;
    border-radius: 12px;
    text-align: center;
}

.success-message {
    color: var(--success);
    background: var(--success-soft);
    border: 1px solid #b9ddc4;
}

.undo-form {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 6px;
}

.undo-button {
    padding: 0;
    color: var(--success);
    background: transparent;
    border: 0;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
}

.undo-button:hover {
    color: var(--green-900);
}

.error-message {
    color: var(--danger);
    background: var(--danger-soft);
    border: 1px solid #efc8c8;
}

.info-message {
    color: var(--green-900);
    background: var(--green-50);
    border: 1px solid var(--line);
}

small {
    color: var(--muted);
    text-align: center;
}

.privacy-content {
    width: min(100%, 760px);
    color: var(--ink);
}

.privacy-content h3 {
    margin: 18px 0 5px;
    color: var(--green-800);
}

.privacy-content h3:first-child {
    margin-top: 0;
}

.privacy-content p {
    margin-bottom: 12px;
}

.privacy-content ul {
    margin: 0 0 14px 22px;
}

.notes-table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: 14px;
}

table {
    width: 100%;
    min-width: 540px;
    overflow: hidden;
    border-collapse: collapse;
    background: var(--white);
    font-size: 0.9rem;
}

th,
td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

th {
    color: var(--white);
    background: var(--green-900);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

tr:nth-child(even) {
    background: var(--green-50);
}

tr:hover {
    background: var(--green-100);
}

.denomination-table {
    min-width: 700px;
    background: var(--white);
}

.denomination-table a {
    color: inherit;
    text-decoration: none;
}

.denomination-table a:hover {
    text-decoration: underline;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
}

.pagination a {
    min-width: 34px;
    padding: 5px 9px;
    color: var(--green-700);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
}

.pagination a:hover,
.pagination .current-page {
    color: var(--white);
    background: var(--green-800);
    border-color: var(--green-800);
}

.delete-button {
    padding: 5px 9px;
    color: var(--danger);
    background: var(--danger-soft);
    border: 1px solid #efc8c8;
    border-radius: 7px;
    cursor: pointer;
}

.profile-header {
    width: min(100%, 520px);
}

.notes-tables-links {
    width: min(100%, 520px) !important;
}

.denomination-link {
    width: 100% !important;
    border-radius: 12px !important;
    box-shadow: 0 3px 10px rgba(18, 55, 42, 0.05);
}

footer {
    width: 100%;
    margin-top: auto;
    padding: 18px 24px;
    color: rgba(255, 255, 255, 0.82);
    background: var(--green-950);
    text-align: center;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px 20px;
    font-size: 0.82rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
}

.footer-links a {
    color: var(--white);
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

.grecaptcha-badge {
    z-index: 3 !important;
}

@media (max-width: 780px) {
    main,
    .content-container {
        width: min(100% - 20px, 680px);
        margin: 22px auto;
        border-radius: 20px;
    }

    .stats-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    header {
        padding: 18px 14px 16px;
    }

    main,
    .content-container {
        gap: 18px;
        padding: 16px;
        border-radius: 16px;
    }

    .search-container {
        padding: 16px;
        border-radius: 14px;
    }

    .stats-container {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .stats {
        padding: 16px;
        border-radius: 14px;
    }

    .buttons,
    .buttons .btn {
        width: 100%;
    }

    .lookup-header,
    .register-header {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .text-back-button {
        grid-row: 2;
        justify-self: center;
    }

    footer {
        padding: 15px 12px;
    }

    .footer-content {
        flex-direction: column;
    }
}

/* Refined shared layout */
body {
    background-position: center top;
}

body::before {
    background: rgba(247, 249, 247, 0.82);
}

.site-header {
    padding: 0 24px;
    text-align: left;
}

.header-inner {
    width: min(1120px, 100%);
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 0 auto;
}

.site-brand {
    display: flex;
    flex: 0 1 210px;
    color: var(--white);
    text-decoration: none;
}

.site-brand-logo {
    width: min(100%, 210px);
    height: auto;
    display: block;
}

.site-brand-name {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(1.45rem, 3vw, 1.9rem);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 1.05;
}

.site-brand-tagline {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.78rem;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-toggle {
    display: none;
}

.site-nav a {
    padding: 6px 9px;
    color: rgba(255, 255, 255, 0.86);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.site-nav a:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
}

.site-nav .nav-primary {
    color: var(--green-950);
    background: var(--gold);
}

.site-nav .nav-primary:hover {
    color: var(--green-950);
    background: var(--gold-hover);
}

main,
.content-container {
    margin: 32px auto;
    padding: clamp(20px, 4vw, 36px);
    border-radius: 18px;
    box-shadow: 0 14px 38px rgba(18, 55, 42, 0.12);
}

.search-container {
    border-top-width: 1px;
    border-radius: 14px;
}

.search-container form,
.register-form,
.login-form,
.form-container {
    align-items: stretch;
}

.form-field {
    width: min(100%, 440px);
    margin: 0 auto;
}

.form-field label {
    display: block;
    margin-bottom: 5px;
    color: var(--green-950);
    font-size: 0.86rem;
    font-weight: 700;
}

.form-field .search-bar,
.form-field .denomination-dropdown,
.form-field .input-field {
    width: 100%;
}

.input-field::placeholder,
.search-bar::placeholder {
    color: #87958d;
}

.btn {
    min-height: 46px;
    border-radius: 9px;
}

.stats-container {
    gap: 12px;
}

.stats {
    padding: 17px;
    border-radius: 12px;
    box-shadow: none;
}

.stats:nth-child(-n + 3) {
    background: var(--green-950);
}

.profile-header {
    width: min(100%, 620px);
    text-align: center;
}

.profile-header h2 {
    color: var(--green-950);
    font-size: clamp(1.5rem, 4vw, 2rem);
    letter-spacing: -0.04em;
}

.profile-header p:last-child {
    margin-top: 8px;
    color: var(--muted);
}

.profile-stats {
    width: min(100%, 820px);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.profile-stats div {
    padding: 16px;
    color: var(--white);
    background: var(--green-950);
    border-radius: 12px;
    text-align: center;
}

.profile-stats span,
.profile-stats strong {
    display: block;
}

.profile-stats span {
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.82rem;
}

.profile-stats strong {
    margin-top: 3px;
    font-size: 1.55rem;
    letter-spacing: -0.05em;
}

.profile-stat-text {
    overflow-wrap: anywhere;
    font-size: 1.12rem !important;
    letter-spacing: -0.025em !important;
}

.notes-tables-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.recent-activity {
    width: 100%;
    margin-top: 8px;
}

.section-heading {
    margin-bottom: 12px;
}

.section-heading h3 {
    color: var(--green-950);
    font-size: 1.35rem;
}

.recent-activity-table a {
    color: var(--green-700);
    font-weight: 700;
    text-decoration: none;
}

.recent-activity-table a:hover {
    text-decoration: underline;
}

.empty-activity {
    color: var(--muted);
}

.denomination-link {
    display: block;
    padding: 14px;
    color: var(--green-950);
    background: var(--green-50);
    border: 1px solid var(--line);
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.denomination-link:hover {
    background: var(--green-100);
    border-color: var(--green-700);
}

.terms-container {
    width: min(100%, 440px);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 2px auto;
    color: var(--muted);
    font-size: 0.9rem;
}

.terms-container input {
    margin-top: 4px;
}

@media (max-width: 820px) {
    .profile-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .site-header {
        padding: 0 14px;
    }

    .header-inner {
        min-height: auto;
        flex-wrap: wrap;
        gap: 8px;
        padding: 9px 0 8px;
    }

    .site-brand {
        flex: 0 1 190px;
        min-width: 0;
    }

    .site-brand-logo {
        width: min(100%, 190px);
    }

    .nav-toggle {
        display: flex;
        flex: 0 0 auto;
        margin-left: auto;
        align-items: center;
        gap: 8px;
        padding: 8px 10px;
        color: var(--white);
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.28);
        border-radius: 8px;
        cursor: pointer;
        font: inherit;
        font-size: 0.9rem;
        font-weight: 700;
    }

    .nav-toggle:hover,
    .nav-toggle:focus-visible {
        background: rgba(255, 255, 255, 0.16);
    }

    .nav-toggle-icon,
    .nav-toggle-icon span {
        display: block;
    }

    .nav-toggle-icon span {
        width: 18px;
        height: 2px;
        margin: 3px 0;
        background: currentColor;
        border-radius: 999px;
    }

    .site-nav {
        width: 100%;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding-top: 5px;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }

    .site-nav.is-open {
        display: flex;
    }

    .site-nav a,
    .nav-form,
    .nav-logout {
        width: 100%;
    }

    .site-nav a,
    .nav-logout {
        padding: 9px 10px;
        text-align: left;
    }

    main,
    .content-container {
        margin: 16px auto;
    }
}

/* Home page and account navigation tidy-up */
.nav-divider {
    width: 1px;
    height: 24px;
    margin: 0 4px;
    background: rgba(255, 255, 255, 0.22);
}

.nav-form {
    display: flex;
}

.nav-logout {
    padding: 6px 9px;
    color: rgba(255, 255, 255, 0.86);
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
}

.nav-logout:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
}

.home-hero {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(330px, 0.88fr);
    align-items: center;
    gap: clamp(24px, 5vw, 58px);
    padding: clamp(22px, 4vw, 42px);
    overflow: hidden;
    background: linear-gradient(135deg, var(--green-950), var(--green-800));
    border-radius: 15px;
}

.home-hero .home-intro {
    max-width: 590px;
    text-align: left;
}

.home-hero .eyebrow {
    color: var(--gold-hover);
}

.home-intro h1 {
    color: var(--white);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: -0.055em;
    line-height: 1;
}

.home-hero .home-intro > p:last-of-type {
    max-width: 560px;
    margin-top: 16px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1rem;
}

.hero-points {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}

.hero-points span {
    padding: 6px 9px;
    color: rgba(255, 255, 255, 0.82);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
}

.home-hero .search-container {
    width: 100%;
    padding: clamp(18px, 3vw, 26px);
    background: rgba(255, 255, 255, 0.98);
    border: 0;
    box-shadow: 0 16px 38px rgba(18, 55, 42, 0.2);
}

.home-hero .search-container .eyebrow {
    margin-bottom: -10px;
    color: var(--gold);
    text-align: center;
}

.home-hero .search-container .form-field {
    width: 100%;
}

@media (max-width: 860px) {
    .home-hero {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .home-hero .home-intro {
        max-width: 680px;
    }
}

@media (max-width: 620px) {
    .nav-divider {
        display: none;
    }

    .home-hero {
        padding: 18px;
        border-radius: 12px;
    }

    .home-intro h1 {
        font-size: clamp(2rem, 11vw, 2.7rem);
    }

    .hero-points {
        margin-top: 18px;
    }
}

/* Account settings */
.account-page {
    display: grid;
    gap: 18px;
}

.account-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.account-card {
    padding: clamp(18px, 3vw, 26px);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--green-100);
    border-radius: 12px;
}

.account-card h3 {
    margin: 4px 0 6px;
    color: var(--green-950);
}

.account-card > p:last-of-type {
    margin-bottom: 18px;
    color: var(--muted);
}

.account-form {
    display: grid;
    gap: 14px;
}

.account-form .form-field {
    width: 100%;
}

.account-form .btn {
    justify-self: start;
}

.danger-card {
    border-color: #f0caca;
}

.danger-card .eyebrow {
    color: var(--danger);
}

.danger-button,
.danger-button:hover {
    background: var(--danger);
    border-color: var(--danger);
}

@media (max-width: 760px) {
    .account-grid {
        grid-template-columns: 1fr;
    }
}

/* Home page statistics */
.stats-container {
    gap: 14px;
}

.stats {
    position: relative;
    overflow: hidden;
    border-color: var(--green-100);
    box-shadow: 0 6px 16px rgba(18, 55, 42, 0.07);
}

.stats-summary {
    padding: 21px 18px 19px;
    background: linear-gradient(135deg, var(--green-950), var(--green-900));
    box-shadow: 0 8px 18px rgba(18, 55, 42, 0.16);
}

.stats-summary::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: var(--gold);
}

.stats-summary h3 {
    margin-bottom: 5px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.stats-summary p {
    line-height: 1.08;
}

.stats-list {
    padding: 0;
}

.stats-list h3 {
    margin: 0;
    padding: 14px 15px 12px;
    background: var(--green-50);
    border-bottom: 1px solid var(--green-100);
}

.stats-list ul {
    padding: 7px 14px 10px;
}

.stats-list li {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    min-height: 31px;
}

.stats-list li + li {
    margin-top: 0;
    border-top: 1px solid var(--green-100);
}

.stats-rank {
    width: 18px;
    height: 18px;
    color: var(--green-800);
    background: var(--green-100);
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.stats-label {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stats-count {
    padding: 2px 6px;
    color: var(--green-800);
    background: var(--green-50);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.stats-recent {
    grid-column: span 2;
}

@media (max-width: 780px) {
    .stats-recent {
        grid-column: span 2;
    }
}

@media (max-width: 520px) {
    .stats-recent {
        grid-column: auto;
    }
}

/* Searchable UK town lists and admin dashboard */
.ukcity-select {
    display: grid;
    gap: 8px;
}

.ukcity-select {
    position: relative;
}

.ukcity-options {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    display: grid;
    left: 0;
    max-height: 240px;
    overflow-y: auto;
    position: absolute;
    right: 0;
    top: calc(100% - 2px);
    z-index: 10;
}

.ukcity-options[hidden] {
    display: none;
}

.ukcity-option {
    background: #fff;
    border: 0;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    padding: 10px 12px;
    text-align: left;
}

.ukcity-option:last-child {
    border-bottom: 0;
}

.ukcity-option:hover,
.ukcity-option:focus {
    background: var(--green-50);
}

.ukcity-message {
    color: var(--muted);
    text-align: left;
}

.admin-page {
    display: grid;
    gap: 18px;
}

.admin-card {
    width: 100%;
}

.admin-card .account-form {
    max-width: 620px;
}

.admin-card .form-field {
    margin: 0;
}

.tracking-map-card {
    width: min(100%, 650px);
    margin-top: 8px;
    overflow: hidden;
    background: var(--green-50);
    border: 1px solid var(--line);
    border-top: 3px solid var(--gold);
    border-radius: 18px;
    text-align: left;
}

.tracking-map-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 18px 16px;
}

.tracking-map-heading .eyebrow {
    margin-bottom: 3px;
}

.tracking-map-heading h3 {
    color: var(--green-950);
    font-size: 1.08rem;
    line-height: 1.25;
}

.tracking-map-heading > p,
.results-container .tracking-map-note {
    color: var(--muted);
    font-size: 0.82rem;
}

.tracking-map-heading > p {
    max-width: 180px;
    text-align: right;
}

.tracking-map {
    width: 100%;
    height: clamp(280px, 48vw, 390px);
    background: var(--green-100);
    border-top: 1px solid var(--line);
}

.results-container .tracking-map-note {
    padding: 11px 16px 13px;
    text-align: left;
}

.tracking-map-pin-wrapper {
    background: transparent;
    border: 0;
}

.tracking-map-pin {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    background: var(--green-900);
    border: 3px solid var(--gold);
    border-radius: 50% 50% 50% 8px;
    box-shadow: 0 5px 12px rgba(18, 55, 42, 0.3);
    font-size: 0.78rem;
    font-weight: 700;
    transform: rotate(-45deg);
}

.tracking-map-pin span {
    line-height: 1;
    transform: rotate(45deg);
}

.tracking-map-pin-wrapper:hover .tracking-map-pin,
.tracking-map-pin-wrapper:focus .tracking-map-pin {
    background: var(--green-700);
}

.tracking-map-tooltip {
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 8px 22px rgba(18, 55, 42, 0.18);
}

.tracking-map-tooltip strong,
.tracking-map-tooltip span {
    display: block;
}

.tracking-map-tooltip span {
    color: var(--muted);
    font-size: 0.78rem;
}

@media (max-width: 560px) {
    .tracking-map-heading {
        display: block;
    }

    .tracking-map-heading > p {
        max-width: none;
        margin-top: 5px;
        text-align: left;
    }
}

/* Home page county heat map */
.home-heat-map-card {
    width: 100%;
    grid-column: 1 / -1;
    overflow: hidden;
    background: var(--green-50);
    border: 1px solid var(--line);
    border-top: 3px solid var(--gold);
    border-radius: 18px;
    box-shadow: 0 8px 18px rgba(18, 55, 42, 0.09);
}

.home-heat-map-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 20px 17px;
}

.home-heat-map-heading .eyebrow {
    margin-bottom: 3px;
}

.home-heat-map-heading h2 {
    color: var(--green-950);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(1.45rem, 3vw, 1.9rem);
    line-height: 1.15;
}

.home-heat-map-heading p:last-child,
.home-heat-map-status {
    color: var(--muted);
    font-size: 0.86rem;
}

.home-heat-map-heading p:last-child {
    margin-top: 5px;
}

.home-heat-map-key {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px 13px;
    color: var(--muted);
    font-size: 0.76rem;
    white-space: nowrap;
}

.home-heat-map-key span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.home-heat-map-swatch {
    width: 15px;
    height: 15px;
    display: inline-block;
    border: 1px solid rgba(18, 55, 42, 0.14);
    border-radius: 4px;
}

.heat-level-0 {
    background: #f2f7f3;
}

.heat-level-2 {
    background: #b8dcc4;
}

.heat-level-5 {
    background: #1b4d3b;
}

.home-heat-map {
    width: 100%;
    height: clamp(360px, 58vw, 560px);
    background: var(--green-100);
    border-top: 1px solid var(--line);
}

.home-heat-map-status {
    padding: 11px 16px 13px;
}

.home-heat-map .leaflet-interactive {
    cursor: default;
}

.home-heat-map .leaflet-interactive:focus {
    outline: none;
}

.home-heat-map-tooltip span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
}

@media (max-width: 620px) {
    .home-heat-map-heading {
        display: block;
        padding: 17px 16px 14px;
    }

    .home-heat-map-key {
        justify-content: flex-start;
        margin-top: 12px;
    }

    .home-heat-map {
        height: 440px;
    }
}

/* Admin dashboard overview */
.admin-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.admin-stat-card {
    display: grid;
    gap: 5px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--green-100);
    border-top: 3px solid var(--gold);
    border-radius: 12px;
}

.admin-stat-card span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.admin-stat-card strong {
    color: var(--green-950);
    font-size: clamp(1.8rem, 4vw, 2.45rem);
    line-height: 1;
}

.admin-dashboard-grid,
.admin-management-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
    gap: 18px;
    align-items: start;
}

.admin-management-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-activity-card,
.admin-checks-card {
    height: 100%;
}

.admin-check-count {
    display: block;
    margin-bottom: 2px;
    color: var(--green-950);
    font-size: 2rem;
    line-height: 1;
}

.admin-all-clear {
    color: var(--green-700) !important;
    font-weight: 700;
}

.admin-access-label {
    display: inline-block;
    padding: 3px 8px;
    color: var(--muted);
    background: var(--green-50);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.admin-access-label.is-admin {
    color: var(--green-900);
    background: var(--green-100);
}

.admin-activity-table {
    min-width: 620px;
}

.admin-users-table {
    min-width: 760px;
}

@media (max-width: 820px) {
    .admin-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-dashboard-grid,
    .admin-management-grid {
        grid-template-columns: 1fr;
    }
}

/* User profiles */
.profile-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    justify-items: center;
    gap: 18px;
    overflow-x: hidden;
}

.profile-page > * {
    min-width: 0;
    max-width: 100%;
}

.profile-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 0;
    padding: clamp(20px, 4vw, 34px);
    background: linear-gradient(135deg, var(--green-950), var(--green-900));
    border-top: 3px solid var(--gold);
    border-radius: 16px;
    color: #fff;
}

.profile-hero h1 {
    color: #fff;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(2rem, 5vw, 3.2rem);
}

.profile-hero .eyebrow,
.profile-hero p:last-child {
    color: rgba(255, 255, 255, 0.78);
}

.profile-settings-link {
    flex: 0 0 auto;
}

.profile-private-note,
.profile-message-card {
    width: 100%;
    padding: 16px 18px;
    background: #fff8df;
    border: 1px solid #ead48c;
    border-radius: 12px;
}

.profile-message-card h1 {
    margin: 4px 0 6px;
    color: var(--green-950);
}

.profile-heat-map-card {
    margin-top: 0;
}

.checkbox-field {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--green-950);
    cursor: pointer;
}

.checkbox-field input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--green-900);
}

.checkbox-field span,
.checkbox-field small {
    display: block;
    text-align: left;
}

.checkbox-field small {
    margin-top: 2px;
    color: var(--muted);
    line-height: 1.35;
}

@media (max-width: 620px) {
    .profile-hero {
        display: block;
    }

    .profile-settings-link {
        margin-top: 16px;
    }

    .profile-stats {
        grid-template-columns: 1fr;
    }
}

/* Public release notes */
.version-page {
    max-width: 960px;
    align-items: stretch;
    gap: 0;
}

.version-page-heading {
    padding: 0 0 20px;
    color: var(--ink);
    background: transparent;
    border-bottom: 1px solid var(--line);
    box-shadow: none;
    text-align: left;
}

.version-page-heading .eyebrow {
    margin-bottom: 5px;
}

.version-page-heading h1 {
    color: var(--green-950);
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    letter-spacing: -0.045em;
    line-height: 1.08;
}

.version-page-heading p:last-child {
    margin-top: 9px;
    color: var(--muted);
}

.release-jump-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.86rem;
}

.release-jump-links span {
    margin-right: 2px;
    font-weight: 700;
}

.release-jump-links a {
    padding: 3px 9px;
    color: var(--green-800);
    background: var(--green-50);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none;
}

.release-jump-links a:hover,
.release-jump-links a:focus-visible {
    color: var(--green-950);
    border-color: var(--green-800);
}

.release-history {
    display: grid;
}

.release-entry {
    display: grid;
    grid-template-columns: 138px minmax(0, 1fr);
    gap: 28px;
    padding: 30px 0;
    border-bottom: 1px solid var(--line);
    scroll-margin-top: 18px;
}

.release-entry:last-child {
    border-bottom: 0;
}

.release-meta {
    position: relative;
    padding-top: 4px;
}

.release-meta::before {
    content: '';
    display: block;
    width: 28px;
    height: 3px;
    margin-bottom: 10px;
    background: var(--gold);
    border-radius: 999px;
}

.release-version {
    color: var(--green-950);
    font-size: 1.22rem;
    font-weight: 800;
    letter-spacing: -0.035em;
}

.release-meta time {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.release-content {
    min-width: 0;
}

.release-label {
    margin-bottom: 5px;
    color: var(--green-800);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.release-content h2 {
    color: var(--green-950);
    font-size: clamp(1.4rem, 4vw, 1.75rem);
    letter-spacing: -0.035em;
    line-height: 1.15;
}

.release-content h2 + p,
.release-content p + ul,
.release-content ul + p {
    margin-top: 9px;
}

.release-content p,
.release-content li {
    color: #475a53;
}

.release-content ul {
    margin: 8px 0 0;
    padding-left: 19px;
}

.release-content li + li {
    margin-top: 3px;
}

.release-section {
    margin-top: 23px;
}

.release-section h3 {
    padding-bottom: 6px;
    color: var(--green-950);
    border-bottom: 1px solid var(--green-100);
    font-size: 1.12rem;
    line-height: 1.3;
}

.release-section h3 span {
    margin-right: 4px;
    font-size: 1rem;
}

.release-section h4 {
    margin-top: 13px;
    color: var(--green-800);
    font-size: 0.96rem;
}

.release-section h4 + p,
.release-section h4 + ul {
    margin-top: 3px;
}

.release-closing {
    margin-top: 24px;
    padding: 14px 16px;
    background: var(--green-50);
    border-left: 3px solid var(--gold);
    border-radius: 0 8px 8px 0;
}

@media (max-width: 620px) {
    .version-page-heading {
        padding-bottom: 17px;
    }

    .release-entry {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 24px 0;
    }

    .release-meta::before {
        margin-bottom: 7px;
    }

    .release-version,
    .release-meta time {
        display: inline;
    }

    .release-meta time {
        margin-left: 7px;
    }
}


/* Profile links and achievements */
.profile-page-link-card {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: clamp(18px, 3vw, 24px);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 10px 26px rgba(18, 55, 42, 0.08);
}

.profile-page-link-card h2 {
    color: var(--green-950);
    font-size: clamp(1.45rem, 4vw, 2rem);
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.profile-page-link-card p:last-child {
    margin-top: 6px;
    color: var(--muted);
}

.achievements-page {
    max-width: 1040px;
    align-items: stretch;
}

.achievements-page .lookup-header {
    width: 100%;
}

.achievements-panel {
    width: 100%;
    display: grid;
    gap: 18px;
}

.achievements-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: clamp(18px, 4vw, 36px);
    padding: clamp(24px, 5vw, 42px);
    overflow: hidden;
    position: relative;
    color: #fff;
    background:
        radial-gradient(circle at 92% 12%, rgba(212, 160, 23, 0.32), transparent 30%),
        linear-gradient(135deg, var(--green-950), var(--green-800));
    border-radius: 24px;
    box-shadow: 0 18px 44px rgba(18, 55, 42, 0.18);
}

.achievements-hero::after {
    content: '';
    position: absolute;
    right: -78px;
    bottom: -95px;
    width: 230px;
    height: 230px;
    border: 32px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.achievements-hero-copy,
.achievements-score {
    position: relative;
    z-index: 1;
}

.achievements-hero-copy {
    max-width: 680px;
}

.achievements-hero-copy .eyebrow {
    color: #f0d27a;
}

.achievements-hero-copy h1 {
    color: #fff;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(2.35rem, 7vw, 4.8rem);
    line-height: 0.95;
    letter-spacing: -0.06em;
}

.achievements-hero-copy p:last-child {
    max-width: 560px;
    margin-top: 14px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 1rem;
}

.achievements-score {
    min-width: 140px;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 18px;
    text-align: right;
    backdrop-filter: blur(8px);
}

.achievements-score strong,
.achievements-score span,
.achievements-summary span,
.achievements-summary strong,
.achievements-progress-top span,
.achievements-progress-top strong {
    display: block;
}

.achievements-score strong {
    color: #fff;
    font-size: clamp(2.2rem, 6vw, 3.5rem);
    line-height: 1;
    letter-spacing: -0.07em;
}

.achievements-score span {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.86rem;
    font-weight: 700;
}

.achievements-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: 18px;
}

.achievements-summary div {
    min-width: 0;
    padding: 16px 18px;
    background: #fff;
}

.achievements-summary span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.achievements-summary strong {
    margin-top: 4px;
    overflow-wrap: anywhere;
    color: var(--green-950);
    font-size: clamp(1.12rem, 3vw, 1.55rem);
    line-height: 1.15;
    letter-spacing: -0.04em;
}

.achievements-progress {
    display: grid;
    gap: 10px;
    padding: 18px;
    background: #fff8df;
    border: 1px solid #ead48c;
    border-radius: 18px;
}

.achievements-progress-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
}

.achievements-progress-top strong {
    color: var(--green-950);
}

.achievements-progress-bar {
    height: 12px;
    overflow: hidden;
    background: rgba(18, 55, 42, 0.12);
    border-radius: 999px;
}

.achievements-progress-bar span {
    display: block;
    height: 100%;
    min-width: 0;
    background: linear-gradient(90deg, var(--green-800), var(--gold));
    border-radius: inherit;
}

.achievements-sections {
    display: grid;
    gap: 22px;
}

.achievements-category {
    display: grid;
    gap: 10px;
}

.achievements-category-heading h2 {
    color: var(--green-950);
    font-size: clamp(1.25rem, 3vw, 1.65rem);
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.achievements-list {
    display: grid;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
}

.achievement-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
}

.achievement-row:last-child {
    border-bottom: 0;
}

.achievement-row.is-locked {
    color: var(--muted);
    background: #fbfcfb;
}

.achievement-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--green-800);
    border-radius: 50%;
    font-weight: 800;
}

.achievement-row.is-locked .achievement-mark {
    color: var(--muted);
    background: #e7ede9;
}

.achievement-row-main {
    min-width: 0;
}

.achievement-type {
    display: block;
    color: var(--gold);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.achievement-row.is-locked .achievement-type {
    color: var(--muted);
}

.achievement-row h2,
.achievement-row h3 {
    margin-top: 2px;
    color: var(--green-950);
    font-size: clamp(1.05rem, 3vw, 1.22rem);
    line-height: 1.2;
    letter-spacing: -0.03em;
}

.achievement-row.is-locked h2,
.achievement-row.is-locked h3 {
    color: #6d7c73;
}

.achievement-row-status {
    color: var(--muted);
    font-size: 0.9rem;
    text-align: right;
    white-space: nowrap;
}

.profile-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin: 0;
}

.profile-section-heading h1,
.profile-section-heading h2,
.recent-activity .section-heading h2 {
    color: var(--green-950);
    font-size: clamp(1.45rem, 4vw, 2rem);
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.profile-section-heading > p {
    max-width: 260px;
    color: var(--muted);
    font-size: 0.92rem;
    text-align: right;
}

@media (max-width: 760px) {
    .achievements-hero,
    .achievements-summary {
        grid-template-columns: 1fr;
    }

    .achievements-score {
        width: fit-content;
        text-align: left;
    }

    .achievements-progress-top,
    .achievement-row {
        display: grid;
        justify-content: stretch;
    }

    .achievement-row {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 12px;
    }

    .achievement-row-status {
        grid-column: 2;
        text-align: left;
        white-space: normal;
    }
}

@media (max-width: 620px) {
    .profile-page-link-card,
    .profile-section-heading {
        display: grid;
        justify-content: stretch;
    }

    .profile-section-heading > p {
        max-width: none;
        text-align: left;
    }
}

/* Reworked user profile page */
.profile-page {
    max-width: 1100px;
    align-items: stretch;
    gap: 18px;
}

.profile-page .lookup-header {
    width: 100%;
}

.profile-hero {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(18px, 4vw, 34px);
    padding: clamp(22px, 4vw, 36px);
    overflow: hidden;
    position: relative;
    background:
        radial-gradient(circle at top right, rgba(212, 160, 23, 0.2), transparent 34%),
        linear-gradient(135deg, var(--green-950), var(--green-800));
    border: 0;
    border-radius: 24px;
    box-shadow: 0 18px 44px rgba(18, 55, 42, 0.2);
    color: #fff;
}

.profile-hero::after {
    content: '';
    position: absolute;
    right: -80px;
    bottom: -110px;
    width: 260px;
    height: 260px;
    border: 34px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.profile-hero-main,
.profile-hero-actions {
    position: relative;
    z-index: 1;
}

.profile-hero-main {
    display: flex;
    align-items: center;
    gap: clamp(16px, 3vw, 24px);
    min-width: 0;
}

.profile-avatar {
    flex: 0 0 auto;
    width: clamp(82px, 12vw, 118px);
    height: clamp(82px, 12vw, 118px);
    display: grid;
    place-items: center;
    color: var(--green-950);
    background: linear-gradient(135deg, #fff, #f5e3ad);
    border: 4px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.22);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(2.2rem, 7vw, 4.2rem);
    font-weight: 700;
    line-height: 1;
}

.profile-identity {
    min-width: 0;
}

.profile-identity h1 {
    max-width: 100%;
    overflow-wrap: anywhere;
    color: #fff;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(2.3rem, 6vw, 4.4rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.profile-identity .eyebrow,
.profile-identity p {
    color: rgba(255, 255, 255, 0.78);
}

.profile-identity p {
    margin-top: 10px;
    font-size: 1rem;
}

.profile-status-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: 12px;
    padding: 5px 10px;
    color: var(--green-950);
    background: #fff4c9;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.profile-hero-actions {
    display: grid;
    justify-items: end;
    gap: 12px;
}

.profile-achievement-count {
    min-width: 150px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 16px;
    text-align: right;
    backdrop-filter: blur(8px);
}

.profile-achievement-count span,
.profile-achievement-count strong {
    display: block;
}

.profile-achievement-count span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.82rem;
    font-weight: 700;
}

.profile-achievement-count strong {
    color: #fff;
    font-size: 2rem;
    letter-spacing: -0.06em;
}

.profile-settings-link {
    color: var(--green-950);
    background: #fff;
    border-color: #fff;
}

.profile-settings-link:hover,
.profile-settings-link:focus-visible {
    color: #fff;
    background: var(--green-950);
    border-color: #fff;
}

.profile-private-note,
.profile-message-card {
    width: 100%;
    padding: 15px 18px;
    color: var(--green-950);
    background: #fff8df;
    border: 1px solid #ead48c;
    border-radius: 14px;
}

.profile-overview {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(220px, 1.35fr) repeat(3, minmax(150px, 1fr));
    gap: 12px;
}

.profile-stat-card {
    min-width: 0;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 10px 26px rgba(18, 55, 42, 0.08);
}

.profile-stat-card-featured {
    color: #fff;
    background: linear-gradient(135deg, var(--green-900), var(--green-700));
    border-color: transparent;
}

.profile-stat-card-wide {
    grid-column: span 2;
}

.profile-stat-card span,
.profile-stat-card strong,
.profile-stat-card p {
    display: block;
}

.profile-stat-card span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.profile-stat-card-featured span,
.profile-stat-card-featured p {
    color: rgba(255, 255, 255, 0.78);
}

.profile-stat-card strong {
    margin-top: 6px;
    color: var(--green-950);
    font-size: clamp(1.7rem, 4vw, 2.4rem);
    line-height: 1.05;
    letter-spacing: -0.06em;
}

.profile-stat-card-featured strong {
    color: #fff;
    font-size: clamp(2.3rem, 6vw, 3.7rem);
}

.profile-stat-card p {
    margin-top: 8px;
    font-size: 0.9rem;
}

.profile-stat-text {
    overflow-wrap: anywhere;
    font-size: clamp(1.25rem, 3vw, 1.65rem) !important;
    letter-spacing: -0.035em !important;
}

.profile-note-links {
    width: 100%;
    display: grid;
    grid-template-columns: auto repeat(4, minmax(78px, 1fr));
    align-items: center;
    gap: 10px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 10px 26px rgba(18, 55, 42, 0.08);
}

.profile-note-links span {
    padding-right: 8px;
    color: var(--green-950);
    font-size: 1.05rem;
    font-weight: 800;
}

.profile-note-links a {
    padding: 11px 14px;
    color: var(--green-950);
    background: var(--green-50);
    border: 1px solid var(--line);
    border-radius: 14px;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
}

.profile-note-links a:hover {
    border-color: var(--green-700);
    background: var(--green-100);
}

.profile-heat-map-card,
.recent-activity {
    width: 100%;
    padding: clamp(18px, 3vw, 24px);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 10px 26px rgba(18, 55, 42, 0.08);
}

.recent-activity .section-heading h2 {
    color: var(--green-950);
    font-size: clamp(1.45rem, 4vw, 2rem);
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.recent-activity .section-heading {
    margin-bottom: 14px;
}

.empty-activity {
    color: var(--muted);
}

@media (max-width: 980px) {
    .profile-hero {
        grid-template-columns: 1fr;
    }

    .profile-hero-actions {
        justify-items: start;
    }

    .profile-achievement-count {
        text-align: left;
    }

    .profile-overview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-note-links {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .profile-note-links span {
        grid-column: 1 / -1;
        padding-right: 0;
    }

}

@media (max-width: 620px) {
    .profile-page {
        gap: 14px;
    }

    .profile-hero-main {
        display: grid;
    }

    .profile-avatar {
        width: 78px;
        height: 78px;
        font-size: 2.2rem;
    }

    .profile-overview {
        grid-template-columns: 1fr;
    }

    .profile-stat-card-wide {
        grid-column: auto;
    }

    .profile-note-links {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-note-links span {
        grid-column: 1 / -1;
        padding-right: 0;
    }

    .profile-section-heading > p {
        max-width: none;
        text-align: left;
    }
}
