/* =========================================================================
   Secret Snakes — stylesheet
   "Snake den" theme: deep forest green + brass gold + warm cream.
   Professional bones, goofy details (scale patterns, squiggle dividers).
   Mobile-first, responsive across phones and desktop.
   ========================================================================= */

/* ---------- Design tokens ------------------------------------------------ */
:root {
    /* Brand palette */
    --green-950: #0c2014;
    --green-900: #14301f;
    --green-700: #1f3d2b;
    --green-600: #2f5d3a;
    --green-500: #3c7a4a;
    --green-400: #58996a;
    --green-100: #e7f0e8;

    --red-700: #9b2d2d;
    --red-600: #c0392b;
    --red-100: #f7e4e1;

    --gold-600: #b8860b;
    --gold-500: #d4a437;
    --gold-300: #e9c25d;
    --gold-100: #faf0d8;

    --cream-50: #faf7f1;
    --cream-100: #f3ede2;
    --cream-200: #e7dfd0;

    --ink-900: #20271f;
    --ink-700: #3a443a;
    --ink-500: #6b746b;
    --ink-300: #9aa39a;

    --white: #ffffff;

    /* Semantic */
    --bg: var(--cream-50);
    --surface: var(--white);
    --surface-alt: var(--cream-100);
    --text: var(--ink-900);
    --text-muted: var(--ink-500);
    --primary: var(--green-600);
    --primary-dark: var(--green-700);
    --accent: var(--red-600);
    --accent-dark: var(--red-700);
    --link: var(--green-600);

    --border: var(--cream-200);
    --ring: rgba(47, 93, 58, 0.35);

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 2px rgba(20, 48, 31, 0.06), 0 1px 3px rgba(20, 48, 31, 0.08);
    --shadow: 0 6px 18px rgba(20, 48, 31, 0.09), 0 2px 6px rgba(20, 48, 31, 0.06);
    --shadow-lg: 0 18px 40px rgba(20, 48, 31, 0.18);

    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-display: "Baloo 2", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    --maxw: 1180px;

    /* Snake-scale pattern (subtle, used on dark header/footer surfaces) */
    --scales: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.06' stroke-width='1.2'%3E%3Cpath d='M0 14a14 14 0 0 1 28 0'/%3E%3Cpath d='M-14 28a14 14 0 0 1 28 0'/%3E%3Cpath d='M14 28a14 14 0 0 1 28 0'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---------- Reset / base ------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        radial-gradient(circle at 12% -10%, rgba(47, 93, 58, 0.10), transparent 42%),
        radial-gradient(circle at 100% 0%, rgba(212, 164, 55, 0.10), transparent 38%);
    background-attachment: fixed;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    line-height: 1.2;
    color: var(--green-700);
    margin: 0 0 0.5em;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.2rem;
}

h4 {
    font-size: 1.05rem;
    margin-top: 1.4em;
    color: var(--green-600);
}

p {
    margin: 0 0 1rem;
}

:focus-visible {
    outline: 3px solid var(--ring);
    outline-offset: 2px;
    border-radius: 4px;
}

::selection {
    background: var(--gold-300);
    color: var(--green-900);
}

/* ---------- Header / nav ------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--green-900);
    background-image: var(--scales), linear-gradient(150deg, #102818 0%, #1d402b 55%, #245034 100%);
    color: var(--cream-50);
    border-bottom: 3px solid var(--gold-500);
    box-shadow: 0 2px 14px rgba(12, 32, 20, 0.35);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 12px 20px;
}

.branding {
    display: flex;
    align-items: center;
    gap: 14px;
    color: inherit;
    flex-shrink: 0;
}

.branding:hover {
    text-decoration: none;
}

.image-container {
    flex-shrink: 0;
}

.image-placeholder {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gold-500);
    box-shadow: 0 0 0 3px rgba(212, 164, 55, 0.25), var(--shadow-sm);
    transition: transform 0.25s ease;
}

/* The snakes lean in when greeted. */
.branding:hover .image-placeholder {
    transform: rotate(-8deg) scale(1.06);
}

.branding-text h1 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--white);
    letter-spacing: 0.2px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

.branding-text i {
    display: block;
    font-size: 0.8rem;
    color: var(--gold-300);
    font-style: italic;
}

/* Hamburger (hidden on desktop) */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(233, 194, 93, 0.4);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.nav-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    margin: 0 auto;
    background: var(--gold-300);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.site-nav ul {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav a {
    display: inline-block;
    padding: 8px 14px;
    color: rgba(255, 255, 255, 0.92);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-pill);
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.site-nav a:hover {
    background: rgba(255, 255, 255, 0.14);
    color: var(--white);
    text-decoration: none;
}

.site-nav a.active {
    background: var(--gold-500);
    color: var(--green-950);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.highlight,
.site-header .current a {
    background: var(--accent);
    color: var(--white);
}

/* ---------- Main layout / panels ---------------------------------------- */
.site-main {
    flex: 1 0 auto;
    width: 100%;
    max-width: var(--maxw);
    margin: 28px auto;
    padding: 0 20px;
}

main {  /* legacy alias kept for safety */
    width: 100%;
}

.common-page-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.common-panel {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow);
    margin: 0;
}

/* Panel headings: emoji chip + title */
.panel-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.panel-head h2,
.panel-head h3 {
    margin: 0;
}

.panel-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
    background: linear-gradient(160deg, var(--green-100), #d9e9dc);
    border: 1px solid rgba(47, 93, 58, 0.15);
    border-radius: 12px;
}

/* Squiggle divider — every panel gets a little snake under its title. */
.line {
    border: 0;
    height: 9px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='9' viewBox='0 0 24 9'%3E%3Cpath d='M0 4.5 Q6 -0.5 12 4.5 T24 4.5' fill='none' stroke='%233c7a4a' stroke-width='1.6' stroke-linecap='round' opacity='0.45'/%3E%3C/svg%3E") repeat-x left center;
    margin: 4px 0 0;
}

.line-padding {
    margin-bottom: 14px;
}

/* Stack the two legacy divider elements gracefully when both present */
.line + .line-padding {
    margin-bottom: 14px;
}

/* ---------- Badges & chips ----------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--gold-100);
    color: var(--gold-600);
    border: 1px solid rgba(212, 164, 55, 0.45);
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.badge-green {
    background: var(--green-100);
    color: var(--green-600);
    border-color: rgba(47, 93, 58, 0.3);
}

/* ---------- Buttons ------------------------------------------------------ */
.button {
    -webkit-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 11px 22px;
    background: linear-gradient(180deg, var(--green-500), var(--green-600));
    color: var(--white);
    border: none;
    border-radius: var(--radius-pill);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), var(--shadow-sm);
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.button:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    text-decoration: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), var(--shadow);
}

.button:active {
    transform: translateY(1px);
    filter: brightness(0.97);
}

.button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    filter: none;
}

.small-button {
    -webkit-appearance: none;
    appearance: none;
    min-height: 36px;
    margin: 4px;
    padding: 7px 14px;
    background: linear-gradient(180deg, var(--green-500), var(--green-600));
    color: var(--white);
    border: none;
    border-radius: var(--radius-pill);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.2s ease;
}

.small-button:hover {
    filter: brightness(1.08);
}

/* Text buttons act as links but keep a comfortable tap target. */
.text-button {
    -webkit-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    margin: 2px 0;
    padding: 6px 10px;
    background: none;
    border: none;
    color: var(--link);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: color 0.2s ease, background-color 0.2s ease;
}

.text-button:hover {
    color: var(--accent);
    background: var(--green-100);
    text-decoration: none;
}

/* In action rows (modals, tip cards) the text-buttons read better as pills. */
.modal-actions .text-button,
.tip-actions .text-button,
.note-form .text-button,
#tip-form .text-button {
    padding: 9px 18px;
    color: var(--white);
    background: linear-gradient(180deg, var(--green-500), var(--green-600));
    border-radius: var(--radius-pill);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), var(--shadow-sm);
}

.modal-actions .text-button:hover,
.tip-actions .text-button:hover,
.note-form .text-button:hover,
#tip-form .text-button:hover {
    filter: brightness(1.08);
    color: var(--white);
}

.tip-actions .delete-tip-button {
    background: linear-gradient(180deg, var(--red-600), var(--red-700));
}

#cancel-email-update,
#cancel-shipping-update,
#cancel-delete,
#cancel-update {
    background: var(--surface-alt) !important;
    color: var(--ink-700) !important;
    border: 1px solid var(--border);
    box-shadow: none !important;
}

#cancel-email-update:hover,
#cancel-shipping-update:hover,
#cancel-delete:hover,
#cancel-update:hover {
    background: var(--cream-200) !important;
    filter: none;
}

.submit-button {
    background: none;
    border: none;
    color: var(--link);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
}

.submit-button:hover {
    color: var(--accent);
}

/* ---------- Forms & inputs ---------------------------------------------- */
.form-container {
    max-width: 560px;
    margin: 28px auto;
    padding: 32px 28px;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    text-align: center;
}

.form-container h2,
.form-container h3 {
    margin-bottom: 18px;
    text-align: center;
}

.form-container > div {
    text-align: left;
}

.form-container .button {
    width: 100%;
    max-width: 360px;
    margin: 22px auto 0;
}

.general-form {
    display: flex;
    flex-direction: column;
    max-width: 420px;
    margin: 0 auto;
    gap: 16px;
    text-align: left;
}

.general-form > div {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.general-form label,
#login-form label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--ink-700);
}

label {
    color: var(--ink-700);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 11px 13px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--ring);
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Inline form feedback (replaces ad-hoc green/red inline styles) */
.form-msg {
    margin: 12px 0 0;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-msg.success {
    color: var(--green-500);
}

.form-msg.error {
    color: var(--accent-dark);
}

/* Checkbox lists in admin (participants / exclusions) */
.participant-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 220px;
    overflow-y: auto;
    padding: 12px;
    margin-top: 6px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.participant-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
}

.participant-list label:hover {
    background: var(--green-100);
}

.participant-list br {
    display: none;
}

.error {
    color: var(--accent-dark);
    font-weight: 600;
}

/* ---------- Empty states -------------------------------------------------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 28px 16px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state .empty-emoji {
    font-size: 2.4rem;
    line-height: 1;
    filter: grayscale(0.15);
}

.empty-state p {
    margin: 0;
    max-width: 36ch;
}

/* ---------- Home: logged-out landing ------------------------------------ */
.landing {
    display: flex;
    flex-direction: column;
    gap: 28px;
    align-items: stretch;
    max-width: 1020px;
    margin: 0 auto;
}

.landing-intro {
    padding-top: 8px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 6px 14px;
    background: var(--gold-100);
    border: 1px solid rgba(212, 164, 55, 0.5);
    border-radius: var(--radius-pill);
    color: var(--gold-600);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.landing-intro h2 {
    font-size: clamp(2rem, 4.5vw, 2.75rem);
    margin-bottom: 10px;
}

.landing-intro h2 .hero-snake {
    display: inline-block;
    transition: transform 0.25s ease;
}

.landing-intro h2:hover .hero-snake {
    animation: wiggle 0.6s ease;
}

.landing-lead {
    font-size: 1.12rem;
    color: var(--ink-700);
    max-width: 48ch;
}

.how-it-works {
    list-style: none;
    margin: 26px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.how-it-works li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    color: var(--ink-700);
}

.step-num {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: linear-gradient(180deg, var(--green-500), var(--green-600));
    color: var(--white);
    border-radius: 50%;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.step-text strong {
    display: block;
    color: var(--green-700);
    font-family: var(--font-display);
    font-size: 1.02rem;
}

/* ---------- Home / login ------------------------------------------------- */
.home-container {
    max-width: 460px;
    margin: 36px auto;
    padding: 36px 28px;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    text-align: center;
}

.landing-login {
    margin: 0 auto;
    width: 100%;
    border-top: 4px solid var(--gold-500);
}

/* ---------- Home: logged-in dashboard ----------------------------------- */
.dashboard {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.dashboard-greeting {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.dashboard-greeting h2 {
    font-size: clamp(1.6rem, 3.4vw, 2.1rem);
    margin-bottom: 0;
}

.dashboard-greeting .badge {
    transform: translateY(-4px);
}

.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
}

.stat-chip {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 16px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border-top: 3px solid var(--gold-500);
}

.stat-chip .stat-num {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.7rem;
    line-height: 1.1;
    color: var(--green-700);
}

.stat-chip .stat-label {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.dashboard-status .status-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.dashboard-status .status-item:last-child {
    border-bottom: none;
}

.status-icon {
    flex-shrink: 0;
    font-size: 1.3rem;
    line-height: 1.4;
}

.status-item .text-button {
    padding-left: 0;
    padding-right: 0;
}

.status-warning {
    color: var(--accent-dark);
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.action-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    color: var(--text);
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.action-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--green-500);
    text-decoration: none;
}

.action-icon {
    font-size: 1.8rem;
}

.action-card:hover .action-icon {
    animation: wiggle 0.5s ease;
}

.action-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.15rem;
    color: var(--green-700);
}

.action-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.action-card-admin {
    border-left: 3px solid var(--gold-500);
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25%      { transform: rotate(-10deg); }
    75%      { transform: rotate(10deg); }
}

/* Landing: intro and login sit side by side on wider screens. */
@media (min-width: 768px) {
    .landing {
        flex-direction: row;
        align-items: center;
        gap: 48px;
    }

    .landing-intro {
        flex: 1 1 0;
    }

    .landing-login {
        flex: 0 0 400px;
    }

    .home-container.landing-login {
        margin: 0;
    }
}

.login-container h2 {
    margin-bottom: 18px;
}

.login-container h3 {
    margin-top: 28px;
    margin-bottom: 12px;
    font-size: 1.05rem;
    color: var(--ink-700);
}

#login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 320px;
    margin: 0 auto 18px;
    text-align: left;
}

#login-form div {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.home-container .button {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}

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

.home-container .text-button {
    justify-content: center;
}

/* ---------- Profile ------------------------------------------------------ */
.profile-page-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.right-panels {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.property-container {
    margin-bottom: 6px;
}

.property-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 14px;
    margin-bottom: 4px;
    color: var(--ink-700);
}

.property-title strong {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.property-value {
    text-align: left;
    word-break: break-word;
    color: var(--text);
}

.property-value address {
    font-style: normal;
    line-height: 1.7;
}

/* Address presented like a little shipping label */
.address-card {
    display: inline-block;
    margin-top: 4px;
    padding: 14px 18px;
    background: var(--cream-50);
    border: 1.5px dashed var(--gold-500);
    border-radius: var(--radius);
}

.address-card address {
    font-style: normal;
    line-height: 1.7;
}

.current-assignment-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    padding: 12px 0;
}

.assignment {
    margin-top: 10px;
    text-align: left;
}

.current-assignment {
    color: var(--gold-600);
    font-weight: 600;
}

.current-assignment-link {
    text-decoration: none;
}

.current-assignment-link:hover {
    color: var(--gold-500);
    text-decoration: underline;
    cursor: pointer;
}

.past-assignment {
    color: var(--text-muted);
}

.assignment-n-tips {
    margin-left: 0;
    font-size: 0.9rem;
}

/* ---------- Admin panel grouping ---------------------------------------- */
/* Turn the flat stack of admin forms into clearly separated tool cards. */
.profile-admin-panel h4 {
    margin: 22px 0 8px;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.profile-admin-panel form {
    margin: 0 0 6px;
    padding: 16px;
    background: var(--cream-50);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.profile-admin-panel form > div {
    margin-bottom: 10px;
}

.profile-admin-panel form .button {
    width: 100%;
    margin-top: 4px;
}

/* Inline checkbox rows (e.g. "Allow Registration") read better side by side. */
#toggle-registration-form > div {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

#toggle-registration-form label {
    margin: 0;
}

/* ---------- Assignment page --------------------------------------------- */
.assignment-page-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.assignment-note-form-container {
    margin-top: 8px;
}

/* Scroll region: minimal chrome — the cards carry the visual weight. */
.assignment-tips-container {
    max-height: 380px;
    overflow-y: auto;
    margin-top: 8px;
    padding: 2px;
    scrollbar-width: thin;
    scrollbar-color: var(--green-400) transparent;
}

.assignment-tips-container::-webkit-scrollbar {
    width: 8px;
}

.assignment-tips-container::-webkit-scrollbar-thumb {
    background: var(--green-400);
    border-radius: 4px;
}

.assignment-tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Shared, single-level tip card used on the assignment and give-tips pages. */
.assignment-tip-item,
.tips-tip-item-container {
    list-style: none;
    margin: 0 0 10px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--gold-500);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease;
}

.assignment-tip-item:last-child,
.tips-tip-item-container:last-child {
    margin-bottom: 0;
}

.assignment-tip-item:hover,
.tips-tip-item-container:hover {
    box-shadow: var(--shadow);
}

.assignment-tip-item small,
.tips-tip-item small {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* ---------- Tips page ---------------------------------------------------- */
.tip-page-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.tip-subject-select {
    cursor: pointer;
    background: var(--surface);
}

.tip-textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

/* Layout only — the card styling comes from the shared rule above. */
.tips-tip-item-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tips-tip-item {
    flex: 1;
}

.tips-tip-item strong {
    color: var(--green-700);
}

.tip-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 4px;
    border-top: 1px solid var(--border);
}

/* ---------- Modal -------------------------------------------------------- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    overflow-y: auto;
    background-color: rgba(12, 32, 20, 0.6);
    backdrop-filter: blur(3px);
    padding: 5vh 16px;
}

.modal-content {
    background-color: var(--surface);
    margin: 0 auto;
    padding: 26px;
    border: none;
    border-top: 4px solid var(--gold-500);
    width: 100%;
    max-width: 440px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: modal-in 0.18s ease-out;
}

@keyframes modal-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.modal-actions,
.general-form > .modal-actions {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

/* ---------- Toasts (replace alert()) ------------------------------------- */
.toast-region {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
    width: max-content;
    max-width: 92vw;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: min(92vw, 520px);
    padding: 12px 22px;
    background: var(--green-900);
    color: var(--cream-50);
    border: 1px solid rgba(233, 194, 93, 0.45);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-lg);
    font-weight: 600;
    font-size: 0.95rem;
    animation: toast-in 0.25s ease-out;
}

.toast-error {
    background: var(--red-700);
    border-color: rgba(255, 255, 255, 0.3);
}

.toast-out {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Footer ------------------------------------------------------- */
.site-footer {
    flex-shrink: 0;
    margin-top: 28px;
    padding: 26px 20px;
    text-align: center;
    color: rgba(250, 247, 241, 0.85);
    font-size: 0.9rem;
    background-color: var(--green-900);
    background-image: var(--scales), linear-gradient(150deg, #102818, #1d402b);
    border-top: 3px solid var(--gold-500);
}

.site-footer p {
    margin: 0;
}

.footer-tagline {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--white);
}

.footer-countdown {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 4px 14px;
    background: rgba(212, 164, 55, 0.15);
    border: 1px solid rgba(212, 164, 55, 0.4);
    border-radius: var(--radius-pill);
    color: var(--gold-300);
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.03em;
}

.footer-smallprint {
    margin-top: 10px !important;
    font-size: 0.78rem;
    color: rgba(250, 247, 241, 0.55);
}

/* =========================================================================
   Responsive layout
   ========================================================================= */

/* Tablet and up: side-by-side panel layouts */
@media (min-width: 768px) {
    /* Equal-height columns so panels align and fill the row. */
    .profile-page-container,
    .assignment-page-container,
    .tip-page-container {
        flex-direction: row;
        align-items: stretch;
    }

    .profile-details-panel {
        flex: 5 1 0;
        min-width: 0;
    }

    .right-panels {
        flex: 4 1 0;
        min-width: 0;
    }

    .assignment-left-panel,
    .tip-form-container {
        flex: 3 1 0;
        min-width: 0;
    }

    .assignment-tips-panel,
    .past-tips-container {
        flex: 2 1 0;
        min-width: 0;
        /* Become flex columns so the scroll list can grow to fill height. */
        display: flex;
        flex-direction: column;
    }

    /* The tip list expands to fill the panel and scrolls internally,
       matching the height of the taller neighbouring column. */
    .assignment-tips-panel .assignment-tips-container,
    .past-tips-container .assignment-tips-container {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
    }

    .property-container .current-property-container {
        max-width: 640px;
    }
}

/* Desktop: a touch more breathing room */
@media (min-width: 993px) {
    .common-panel {
        padding: 34px;
    }

    .site-main {
        margin: 36px auto;
    }
}

/* Mobile: collapse nav into a hamburger menu */
@media (max-width: 767px) {
    /* Let the branding shrink so the hamburger stays on the top row. */
    .branding {
        flex: 1 1 0%;
        min-width: 0;
    }

    .branding-text {
        min-width: 0;
    }

    .branding-text h1 {
        font-size: 1.25rem;
    }

    .branding-text i {
        font-size: 0.72rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .image-placeholder {
        width: 46px;
        height: 46px;
    }

    /* Only collapse when JS is available to toggle the menu. */
    .js .nav-toggle {
        display: flex;
    }

    .js .site-nav {
        flex-basis: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.28s ease;
    }

    .js .site-header.nav-open .site-nav {
        max-height: 420px;
    }

    .site-nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 8px 0 6px;
    }

    .site-nav a {
        display: block;
        padding: 12px 14px;
        text-align: center;
        background: rgba(255, 255, 255, 0.08);
    }

    /* Animate hamburger into an X when open */
    .nav-open .nav-toggle-bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .nav-open .nav-toggle-bar:nth-child(2) {
        opacity: 0;
    }
    .nav-open .nav-toggle-bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .common-panel {
        padding: 20px;
    }

    .form-container {
        padding: 24px 18px;
    }

    .tip-actions {
        justify-content: stretch;
    }

    .tip-actions .text-button {
        flex: 1;
        justify-content: center;
    }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
