/* =========================
   RESET
========================= */
* {
    box-sizing: border-box;
}

/* Clubs directory and outreach center */
.clubs-page {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto 48px;
}

.clubs-hero,
.clubs-coming-soon,
.clubs-filter-panel,
.clubs-empty {
    background: #fff;
    border: 1px solid #e1ebe8;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(38, 51, 49, 0.08);
    margin: 18px 0;
    padding: 24px;
}

.clubs-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.clubs-hero h1,
.clubs-coming-soon h2 {
    margin: 0 0 10px;
    color: #1F6F6D;
}

.clubs-hero p,
.clubs-coming-soon p,
.clubs-empty p {
    margin: 0;
    color: #52625f;
    line-height: 1.6;
}

.clubs-kicker {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #C8922E !important;
}

.clubs-hero-button,
.club-website {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border-radius: 8px;
    background: #2A8278;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    padding: 10px 16px;
    white-space: nowrap;
}

.clubs-coming-soon {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 20px;
    min-height: 220px;
}

.clubs-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #f8ecce;
    color: #7b5515;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 10px;
    margin-bottom: 10px;
}

.clubs-filter-form {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(150px, 1fr)) auto;
    gap: 12px;
    align-items: end;
}

.clubs-filter-form label {
    display: grid;
    gap: 6px;
    color: #33423f;
    font-weight: 700;
    font-size: 14px;
}

.clubs-filter-form input,
.clubs-filter-form select,
.clubs-filter-form button {
    width: 100%;
    min-height: 42px;
    border-radius: 8px;
    border: 1px solid #d6e2df;
    padding: 9px 11px;
    font: inherit;
}

.clubs-filter-form button {
    border: 0;
    background: #2A8278;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.club-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.club-card {
    display: grid;
    grid-template-columns: 86px 1fr;
    gap: 16px;
    background: #fff;
    border: 1px solid #e1ebe8;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(38, 51, 49, 0.07);
    padding: 18px;
}

.club-card-logo {
    width: 86px;
    height: 86px;
    border-radius: 10px;
    border: 1px solid #e1ebe8;
    background: #f7faf9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.club-card-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.club-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.club-card h2 {
    margin: 0 0 6px;
    color: #1F6F6D;
    font-size: 20px;
}

.club-card p {
    margin: 0 0 10px;
    color: #43514e;
    line-height: 1.55;
}

.club-meta,
.club-location,
.club-parent {
    color: #687572 !important;
    font-size: 14px;
}

.admin-form-grid-wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-form-grid .span-2,
.span-2 {
    grid-column: 1 / -1;
}

.admin-toggle-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    padding: 12px;
    border: 1px solid #e1ebe8;
    border-radius: 8px;
    background: #f7faf9;
}

.admin-toggle-row label,
.admin-inline-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #33423f;
}

.admin-details {
    border: 1px solid #e1ebe8;
    border-radius: 8px;
    padding: 12px;
    background: #fbfdfc;
}

.admin-details summary {
    cursor: pointer;
    font-weight: 700;
    color: #1F6F6D;
}

.textarea-short {
    min-height: 110px;
}

.small-number-field input {
    max-width: 120px;
}

.outreach-editor-card .newsletter-wysiwyg-surface {
    min-height: 250px;
}

.outreach-recipient-box {
    border: 1px solid #dfe9e6;
    border-radius: 10px;
    padding: 14px;
    background: #f7faf9;
}

.outreach-recipient-box h3 {
    margin: 0 0 12px;
    color: #1F6F6D;
}

.outreach-estimate {
    display: inline-block;
    margin: 8px 0 12px;
    color: #263331;
}

.outreach-contact-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px;
    max-height: 260px;
    overflow: auto;
    padding: 4px;
}

.outreach-contact-picker label {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 8px;
    align-items: start;
    border: 1px solid #dfe9e6;
    border-radius: 8px;
    background: #fff;
    padding: 9px;
}

.outreach-contact-picker small {
    grid-column: 2;
    color: #687572;
}

.outreach-button-row {
    justify-content: flex-end;
}

@media (max-width: 980px) {
    .clubs-filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-form-grid-wide {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .clubs-page {
        width: min(100% - 20px, 1120px);
    }

    .clubs-hero,
    .clubs-coming-soon {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: flex-start;
    }

    .clubs-filter-form,
    .club-card {
        grid-template-columns: 1fr;
    }

    .club-card-logo {
        width: 72px;
        height: 72px;
    }

    .club-card-heading {
        flex-direction: column;
    }

    .outreach-button-row {
        justify-content: stretch;
    }
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(200,146,46,0.08), transparent 28%),
        linear-gradient(180deg, #faf8f4 0%, #f5f5f5 100%);
    color: #222;
}

/* =========================
   CONTAINER
========================= */
.container {
    max-width: 1100px;
    margin: 60px auto;
    padding: 0 20px;
}

/* =========================
   HEADER
========================= */
.header {
    position: relative;
    z-index: 999;
    background: #faf8f4;
    border-bottom: 1px solid rgba(31,111,109,0.14);
    box-shadow: 0 12px 28px rgba(23,71,70,0.08);
}

.header-inner {
    max-width: 1280px;
    margin: auto;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 28px;
    padding: 12px 24px;
    min-height: 88px;
}

.header .logo {
    flex: 0 0 auto;
}

.header .logo img {
    display: block;
    height: 72px;
    width: auto;
    filter: drop-shadow(0 8px 16px rgba(23,71,70,0.10));
}

.nav {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    flex: 1 1 auto;
    min-width: 0;
    margin-left: 22px;
}

.nav-toggle {
    display: none;
    border: 1px solid rgba(31,111,109,0.22);
    border-radius: 6px;
    background: #FFFFFF;
    color: #1F6F6D;
    padding: 7px 10px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(23,71,70,0.08);
}

.header .nav a {
    background: transparent;
    color: #174746;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14.5px;
    font-weight: 650;
    letter-spacing: 0;
    white-space: nowrap;
    position: relative;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.header .nav a:hover {
    background: #FFFFFF;
    border-color: rgba(200,146,46,0.28);
    color: #1F6F6D;
    box-shadow: 0 6px 18px rgba(23,71,70,0.07);
}

.header .nav a.is-active {
    background: #FFF7EB;
    border-color: rgba(200,146,46,0.34);
    color: #1F6F6D;
    box-shadow: 0 7px 18px rgba(23,71,70,0.07);
}

.header .nav a.is-active::after {
    content: "";
    position: absolute;
    left: 11px;
    right: 11px;
    bottom: 4px;
    height: 2px;
    background: #C8922E;
    border-radius: 999px;
}

/* =========================
   LANGUAGE
========================= */
.header select {
    margin-left: auto;
    padding: 7px 24px 7px 9px;
    border-radius: 6px;
    border: 1px solid rgba(31,111,109,0.18);
    background: #FFFFFF;
    color: #174746;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
    box-shadow: 0 6px 16px rgba(23,71,70,0.06);
}

@media (max-width: 1180px) {
    .header-inner {
        gap: 12px;
        padding: 10px 16px;
    }

    .header .logo img {
        height: 62px;
    }

    .nav {
        gap: 4px;
        margin-left: 6px;
    }

    .header .nav a,
    .header .nav .admin-header-chat-link {
        padding: 8px 7px;
        font-size: 13.5px;
    }

    .header .nav .admin-header-chat-text {
        font-size: 13.5px;
    }
}

@media (max-width: 1024px) {
    .header-inner {
        gap: 10px;
        min-height: 70px;
        padding: 8px 14px;
        flex-wrap: wrap;
    }

    .header .logo img {
        height: 56px;
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        min-width: 40px;
        min-height: 38px;
    }

    .nav {
        display: none;
        flex-direction: column;
        align-items: stretch;
        flex: 0 0 100%;
        width: 100%;
        order: 4;
        gap: 0;
        margin-left: 0;
        padding: 8px 0 0;
        border-top: 1px solid rgba(31,111,109,0.14);
    }

    .nav.is-open {
        display: flex;
    }

    .header .nav a,
    .header .nav .admin-header-chat-link {
        justify-content: flex-start;
        width: 100%;
        padding: 10px 6px;
        border-radius: 0;
        border-bottom: 1px solid rgba(31,111,109,0.10);
        background: transparent;
        font-size: 14px;
        box-shadow: none;
    }

    .header .nav a:hover,
    .header .nav a.is-active,
    .header .nav .admin-header-chat-link:hover,
    .header .nav .admin-header-chat-link.is-active {
        background: #FFF7EB;
        border-color: transparent;
        border-bottom-color: rgba(31,111,109,0.10);
        box-shadow: none;
    }

    .header .nav a.is-active::after {
        left: 6px;
        right: auto;
        bottom: 5px;
        width: 34px;
    }

    .header .nav .admin-header-chat-badge {
        position: static;
        margin-left: auto;
    }

    .header select {
        margin-left: 0;
        min-height: 36px;
    }
}

/* =========================
   GRID / CARDS
========================= */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px,1fr));
    gap: 20px;
}

.cat-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.cat-card-body {
    padding: 15px;
}

/* =========================
   AUTH (LOGIN / REGISTER)
========================= */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.auth-box {
    width: 100%;
    max-width: 420px;
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.08);
}

.auth-box h1 {
    margin-top: 0;
}

.auth-sub {
    color: #666;
    margin-bottom: 20px;
}

/* Inputs */
.auth-box input {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 10px;
    border: 1px solid #ccc;
}

/* Button */
.auth-box button {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: #C8922E;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

.auth-box button:hover {
    background: #b37f25;
}

/* Messages */
.auth-error {
    background: #ffe5e5;
    color: #a10000;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 10px;
}

.auth-success {
    background: #e5ffe5;
    color: #007a00;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 10px;
}

/* Links */
.auth-links {
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
}

.auth-links a {
    font-size: 13px;
    text-decoration: none;
    color: #2f6f68;
}

/* =========================
   DETAIL
========================= */
.detail-return-bar {
    max-width: 1100px;
    margin: 22px auto -34px;
    padding: 0 20px;
}

.detail-return-bar .detail-back-link {
    margin-bottom: 0;
}

.detail-container {
    max-width: 1100px;
    margin: 60px auto;
    background: white;
    border-radius: 20px;
    overflow: hidden;
}

.detail-image {
    width: 100%;
    height: 400px;
    background: #edf3f6;
    border-bottom: 1px solid #edf0f2;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.detail-image.placeholder {
    height: 300px;
    padding: 28px;
}

.detail-image.placeholder img {
    width: min(340px, 58vw);
    height: auto;
    max-height: 240px;
    object-fit: contain;
}

.detail-image.placeholder .paywall-blur {
    transform: none;
    filter: blur(7px);
}

.detail-container .detail-image:not(.placeholder) {
    height: clamp(360px, 38vw, 440px);
    max-height: 460px;
}

.detail-container .detail-image img {
    object-fit: cover;
}

.detail-content {
    padding: 30px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.detail-box {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 10px;
}

/* =========================
   FOOTER
========================= */
.footer {
    margin-top: 60px;
    background: linear-gradient(135deg, #2f6f68, #1e4c49);
    color: white;
    padding: 40px 20px;
}

.footer-inner {
    max-width: 1100px;
    margin: auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.footer-links a {
    color: white;
    margin-right: 10px;
    text-decoration: none;
}

/* =========================
   MOBILE
========================= */
@media (max-width: 768px) {

    .header-inner {
        gap: 10px;
        min-height: 70px;
        padding: 8px 14px;
        flex-wrap: wrap;
    }

    .header .logo img {
        height: 56px;
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        min-width: 40px;
        min-height: 38px;
    }

    .nav {
        display: none;
        flex-direction: column;
        align-items: stretch;
        flex-basis: 100%;
        order: 4;
        gap: 0;
        margin-left: 0;
        padding: 8px 0 0;
        border-top: 1px solid rgba(31,111,109,0.14);
    }

    .nav.is-open {
        display: flex;
    }

    .header .nav a {
        padding: 9px 4px;
        border-radius: 0;
        border-bottom: 1px solid rgba(31,111,109,0.10);
        background: transparent;
        font-size: 14px;
        box-shadow: none;
    }

    .header .nav a:hover,
    .header .nav a.is-active {
        background: #FFF7EB;
        border-color: transparent;
        border-bottom-color: rgba(31,111,109,0.10);
        box-shadow: none;
    }

    .header .nav a.is-active::after {
        left: 4px;
        right: auto;
        bottom: 5px;
        width: 34px;
    }

    .header select {
        margin-left: 0;
        min-height: 36px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-container {
        margin: 30px 16px;
    }

    .detail-image {
        height: 280px;
    }

    .detail-container .detail-image:not(.placeholder) {
        height: clamp(240px, 64vw, 320px);
        max-height: 320px;
    }

    .detail-image.placeholder {
        height: 210px;
        padding: 22px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 15px;
    }
}

/* =========================
   FELIMATCH FEATURE BLOCK
========================= */
.fm-page {
    max-width: 1180px;
    margin: 44px auto;
    padding: 0 20px;
}

.fm-hero,
.fm-card,
.fm-detail-section,
.fm-review-panel {
    background: #ffffff;
    border: 1px solid rgba(47,111,104,0.14);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.06);
}

.fm-hero {
    padding: 28px;
    margin-bottom: 20px;
}

.fm-gold-line {
    width: 86px;
    height: 4px;
    border-radius: 999px;
    background: #C8922E;
    margin-bottom: 14px;
}

.fm-hero h1,
.fm-card h2,
.fm-detail-section h2,
.fm-review-panel h3 {
    color: #1F6F6D;
    margin-top: 0;
}

.fm-hero p,
.fm-card p,
.fm-form-note,
.fm-review p {
    color: #5f6866;
    line-height: 1.6;
}

.fm-card {
    padding: 22px;
    margin-bottom: 20px;
}

.fm-two-column {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
    gap: 20px;
}

.fm-profile-head,
.fm-actions,
.fm-inline-form,
.fm-rating-summary {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.fm-profile-head {
    justify-content: space-between;
    margin-bottom: 18px;
}

.fm-profile-avatar {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(31,111,109,0.18);
}

.fm-profile-avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1F6F6D, #C8922E);
    color: #ffffff;
    font-weight: 800;
    letter-spacing: 0;
}

.fm-info-box {
    border: 1px solid rgba(31,111,109,0.16);
    border-radius: 10px;
    background: #f7faf9;
    padding: 11px 12px;
    color: #243a38;
}

.fm-kicker {
    display: inline-block;
    color: #C8922E;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.fm-rating-pill,
.fm-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    background: #fff7e7;
    color: #8a641f;
    border: 1px solid rgba(200,146,46,0.28);
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
}

.fm-info-grid,
.fm-form-grid,
.fm-review-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.fm-info-item {
    background: #f7faf9;
    border: 1px solid #e5eeee;
    border-radius: 8px;
    padding: 12px;
}

.fm-info-item strong,
.fm-info-item span {
    display: block;
}

.fm-info-item strong {
    color: #1F6F6D;
    margin-bottom: 4px;
}

.fm-info-item.wide,
.fm-form-grid .wide,
.fm-package-grid .wide {
    grid-column: 1 / -1;
}

.fm-prose {
    border-top: 1px solid #edf0f2;
    margin-top: 16px;
    padding-top: 16px;
    line-height: 1.7;
}

.fm-button,
.back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1.25;
}

.fm-button.primary,
.back-button {
    background: #2A8278;
    color: #ffffff;
}

.fm-button.primary:hover,
.back-button:hover {
    background: #226B64;
}

.fm-button.secondary,
.back-button.secondary {
    background: #ffffff;
    color: #1F6F6D;
    border: 1px solid rgba(31,111,109,0.22);
}

.fm-button.danger,
.back-button.danger {
    background: #C84A43;
    color: #ffffff;
}

.fm-button.danger:hover,
.back-button.danger:hover {
    background: #B23B36;
}

.fm-button.small {
    padding: 7px 10px;
    font-size: 13px;
}

.fm-message {
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 18px;
}

.fm-message.success {
    background: #eef8ee;
    color: #216b21;
    border: 1px solid #b9dfb9;
}

.fm-message.error {
    background: #fff3f3;
    color: #8a1f1f;
    border: 1px solid #e5b3b3;
}

.fm-message.warning,
.fm-form-message.warning {
    background: #fff8e8;
    color: #7a5514;
    border: 1px solid #e8c878;
}

.fm-message.info,
.fm-form-message.info {
    background: #eef6ff;
    color: #175a85;
    border: 1px solid #b8d8f5;
}

.fm-form-message {
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 18px;
}

.fm-form-message.success {
    background: #eef8ee;
    color: #216b21;
    border: 1px solid #b9dfb9;
}

.fm-form-message.error {
    background: #fff3f3;
    color: #8a1f1f;
    border: 1px solid #e5b3b3;
}

.fm-form-message p,
.fm-form-message ul,
.message p,
.message ul {
    margin-top: 0;
}

.fm-form-message p:last-child,
.message p:last-child,
.fm-form-message ul:last-child,
.message ul:last-child {
    margin-bottom: 0;
}

.fm-form label,
.fm-inline-form label,
.fm-review-form label {
    display: grid;
    gap: 6px;
    color: #1F6F6D;
    font-weight: 700;
}

.fm-form input,
.fm-form select,
.fm-form textarea,
.fm-inline-form select,
.fm-review-form select,
.fm-review-form textarea {
    width: 100%;
    border: 1px solid #cfd9d7;
    border-radius: 8px;
    padding: 10px 11px;
    font: inherit;
    background: #ffffff;
    color: #222;
}

.fm-form textarea,
.fm-review-form textarea {
    min-height: 110px;
    resize: vertical;
}

.fm-checkbox-row {
    display: flex !important;
    grid-template-columns: auto 1fr;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
}

.fm-checkbox-row input {
    width: auto;
}

.fm-inline-form {
    align-items: flex-end;
}

.fm-inline-form label {
    flex: 1 1 320px;
}

.fm-table-wrap {
    overflow-x: auto;
}

.fm-table {
    width: 100%;
    border-collapse: collapse;
}

.fm-table th,
.fm-table td {
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #edf0f2;
    padding: 12px;
}

.fm-table th {
    color: #1F6F6D;
    background: #f7faf9;
}

.fm-status-dot {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    margin-right: 7px;
    vertical-align: middle;
}

.fm-status-dot.available {
    background: #16803a;
}

.fm-status-dot.requested {
    background: #d8a528;
}

.fm-status-dot.booked {
    background: #b63b3b;
}

.fm-status-dot.visitor {
    background: #e1348b;
}

.fm-status-dot.chip {
    background: #1469d8;
}

.fm-status-dot.unavailable {
    background: #c92828;
}

.fm-pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.fm-availability-pill,
.fm-availability-public {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.stud-status-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.stud-status-option {
    display: flex !important;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(31,111,109,0.14);
    border-radius: 8px;
    background: #ffffff;
    color: #263533;
    cursor: pointer;
}

.stud-status-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.stud-status-option strong {
    min-width: 0;
    font-size: 14px;
    line-height: 1.2;
}

.stud-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
}

.stud-status-icon.available {
    background: #16803a;
}

.stud-status-icon.visitor {
    background: #e1348b;
}

.stud-status-icon.chip {
    background: #1469d8;
}

.stud-status-icon.unavailable {
    background: #c92828;
}

.stud-status-option.is-selected {
    border-color: #1F6F6D;
    box-shadow: 0 0 0 3px rgba(31,111,109,0.12);
}

.stud-status-option.available.is-selected {
    border-color: #16803a;
    background: #eef8ee;
}

.stud-status-option.visitor.is-selected {
    border-color: #e1348b;
    background: #fff0f7;
}

.stud-status-option.chip.is-selected {
    border-color: #1469d8;
    background: #eef6ff;
}

.stud-status-option.unavailable.is-selected {
    border-color: #c92828;
    background: #fff3f3;
}

.stud-status-icon.paused,
.fm-status-dot.paused {
    background: #6b7280;
}

.stud-status-option.paused.is-selected {
    border-color: #6b7280;
    background: #f3f4f6;
}

.required {
    color: #b42318;
    font-weight: 900;
}

.fm-status-select-label {
    display: grid;
    gap: 7px;
    max-width: 420px;
}

.fm-status-select-label select {
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #cfd8d5;
    border-radius: 8px;
    background: #fff;
    color: #263533;
    font: inherit;
}

.fm-upload-feedback,
.fm-char-counter {
    margin-top: 7px;
    color: #5d6c68;
    font-size: 13px;
    line-height: 1.35;
}

.fm-minlength-hint {
    margin: 0 0 7px;
    color: #37413e;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

.fm-upload-feedback.success {
    color: #216b21;
}

.fm-upload-feedback.error,
.fm-char-counter.is-short {
    color: #8a1f1f;
}

.fm-upload-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.fm-upload-thumb {
    display: grid;
    align-content: start;
    gap: 6px;
    min-width: 0;
    padding: 8px;
    border: 1px solid rgba(31,111,109,0.12);
    border-radius: 8px;
    background: #f8faf9;
}

.fm-upload-thumb img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 6px;
    background: #eef2f1;
}

.fm-upload-thumb span,
.fm-upload-thumb em {
    min-width: 0;
    color: #4f5f5b;
    font-size: 12px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.fm-upload-thumb em {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 82px;
    border-radius: 6px;
    background: #eef2f1;
    color: #6b7774;
    font-style: normal;
    text-align: center;
    padding: 8px;
}

.fm-detail-section {
    padding: 18px;
    margin: 20px 0;
}

.fm-ranking-hint {
    margin: -6px 0 18px;
    color: #5f6866;
    font-size: 14px;
    line-height: 1.5;
}

.fm-premium-result,
.fm-premium-detail,
.fm-premium-frame {
    border: 3px solid #C8922E !important;
    box-shadow: 0 16px 38px rgba(135,94,25,0.20), 0 0 0 4px rgba(200,146,46,0.12) !important;
    position: relative;
}

.fm-premium-result {
    background: linear-gradient(180deg, #fffaf0 0%, #ffffff 70%);
}

.cards .card.fm-clickable-card {
    align-self: start;
}

.cards .card.fm-clickable-card > img {
    width: 100%;
    height: 240px;
    object-fit: cover;
}

.fm-premium-result.fm-premium-glow::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 0 0 42px rgba(216,165,40,0.14);
}

.fm-premium-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 20px;
    background: #C8922E;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(200,146,46,0.24);
}

.fm-premium-badge.in-card {
    position: absolute;
    z-index: 2;
    top: 10px;
    right: 10px;
}

.fm-premium-badge.detail-badge {
    margin-bottom: 12px;
}

.fm-premium-active-until {
    display: inline-flex;
    margin: 0 0 16px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #fff6dc;
    color: #7a5315;
    font-weight: 700;
}

.fm-package-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.fm-package-card {
    display: grid;
    gap: 8px;
    border: 1px solid rgba(200,146,46,0.36);
    background: #fffdf8;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
}

.fm-package-card input {
    width: auto;
}

.fm-package-card strong {
    color: #1F6F6D;
    font-size: 18px;
}

.fm-package-card span {
    color: #8a641f;
    font-weight: 700;
}

.fm-payment-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 14px 0;
}

.fm-payment-box {
    border: 1px solid #e5eeee;
    border-radius: 8px;
    background: #f7faf9;
    padding: 16px;
}

.fm-payment-box h4 {
    margin: 0 0 12px;
    color: #1F6F6D;
}

.fm-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.fm-card-actions a,
.fm-card-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: #2A8278;
    color: #ffffff !important;
    padding: 10px 16px;
    border-radius: 8px;
    border: 0;
    font-weight: 700;
    line-height: 1.25;
    cursor: pointer;
}

.fm-card-actions a:hover,
.fm-card-action:hover {
    background: #226B64;
}

.fm-card-actions a.secondary,
.fm-card-action.secondary {
    background: #ffffff;
    color: #1F6F6D !important;
    border: 1px solid rgba(31,111,109,0.22);
}

.fm-card-actions .fm-favorite-inline {
    margin: 0;
}

.fm-card-actions .fm-favorite-inline button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border: 1px solid rgba(31,111,109,0.22);
    border-radius: 8px;
    background: #ffffff;
    color: #1F6F6D;
    padding: 10px 16px;
    font-weight: 700;
    line-height: 1.25;
    cursor: pointer;
}

.fm-card-actions .fm-favorite-inline button[aria-pressed="true"],
.fm-favorite-button[aria-pressed="true"] {
    border-color: rgba(200,146,46,0.55);
    background: #fff8e7;
    color: #7a5315;
}

.fm-favorite-inline button.is-loading,
.fm-favorite-button.is-loading {
    opacity: 0.72;
    cursor: progress;
}

.fm-favorite-inline button.is-just-updated,
.fm-favorite-button.is-just-updated {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(31,111,109,0.18);
}

.fm-card-actions a.fm-premium-card-action {
    border-color: rgba(200,146,46,0.50);
    color: #7a5315 !important;
}

.fm-card-action-note {
    display: inline-flex;
    align-items: center;
    color: #7a5315;
    font-size: 13px;
    font-weight: 700;
}

.fm-clickable-card {
    cursor: pointer;
}

.fm-clickable-card:focus-visible {
    outline: 3px solid rgba(31,111,109,0.35);
    outline-offset: 3px;
}

.fm-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.fm-media-item {
    border-radius: 14px;
    overflow: hidden;
    background: #f7faf9;
    border: 1px solid #e5eeee;
}

.fm-media-item img,
.fm-media-item video {
    width: 100%;
    display: block;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.fm-review-list {
    display: grid;
    gap: 12px;
}

.fm-review {
    border: 1px solid #edf0f2;
    border-radius: 8px;
    padding: 12px;
    background: #fafafa;
}

.fm-review-panel {
    margin: 0 24px 18px;
    padding: 18px;
}

.fm-review-form textarea {
    margin-top: 12px;
}

.fm-local-actions {
    margin-top: 16px;
}

.fm-detail-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 18px 0;
}

.fm-inline-action {
    display: inline-flex;
    margin: 0;
}

.fm-gold-action {
    background: #C8922E;
    color: #ffffff;
}

.fm-favorite-toast {
    position: fixed;
    left: 50%;
    bottom: 22px;
    z-index: 10050;
    transform: translate(-50%, 16px);
    opacity: 0;
    pointer-events: none;
    max-width: min(420px, calc(100vw - 32px));
    border-radius: 8px;
    background: #263533;
    color: #fff;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.35;
    box-shadow: 0 12px 30px rgba(0,0,0,0.24);
    transition: opacity 160ms ease, transform 160ms ease;
}

.fm-favorite-toast.is-visible {
    transform: translate(-50%, 0);
    opacity: 1;
}

.fm-owner-actions-title {
    margin: 24px 0 8px;
    color: #1F6F6D;
    font-size: 20px;
}

.stud-edit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.stud-edit-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    min-height: 42px;
    padding: 11px 16px;
    border-radius: 8px;
    background: #2A8278;
    color: #ffffff !important;
    font: inherit;
    text-decoration: none;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(42,130,120,0.16);
}

.stud-edit-action-btn:hover {
    background: #226B64;
}

.stud-edit-action-btn.gold {
    background: #C8922E;
    box-shadow: 0 10px 22px rgba(200,146,46,0.18);
}

.stud-edit-action-btn.gold:hover {
    background: #a97722;
}

.stud-edit-delete-form {
    display: inline-flex;
    margin: 0;
}

.stud-edit-action-btn.danger {
    background: #C84A43;
    box-shadow: 0 10px 22px rgba(200,74,67,0.18);
}

.stud-edit-action-btn.danger:hover {
    background: #B23B36;
}

.fm-destructive-modal[hidden] {
    display: none;
}

.fm-destructive-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(18, 24, 27, 0.56);
}

.fm-destructive-modal__dialog {
    width: min(100%, 560px);
    box-sizing: border-box;
    background: #ffffff;
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.fm-destructive-modal__dialog h2 {
    margin: 0 0 12px;
    color: #8a1f1f;
    font-size: 22px;
    line-height: 1.25;
}

.fm-destructive-modal__dialog p {
    margin: 0 0 12px;
    color: #243d39;
    line-height: 1.55;
}

.fm-destructive-modal__check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    box-sizing: border-box;
    width: 100%;
    margin: 16px 0 18px;
    color: #243d39;
    font-weight: 700;
    line-height: 1.45;
}

.fm-destructive-modal__check input {
    flex: 0 0 auto;
    width: auto !important;
    margin-top: 3px;
}

.fm-destructive-modal__check span {
    min-width: 0;
    flex: 1 1 auto;
}

.fm-destructive-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.fm-modal-button {
    border: 0;
    border-radius: 10px;
    padding: 11px 14px;
    font-weight: 800;
    cursor: pointer;
}

.fm-modal-button.secondary {
    background: #eef3f2;
    color: #243d39;
}

.fm-modal-button.primary {
    background: #2A8278;
    color: #ffffff;
}

.fm-modal-button.primary:hover {
    background: #226B64;
}

.fm-modal-button.danger {
    background: #C84A43;
    color: #ffffff;
}

.fm-modal-button.danger:hover {
    background: #B23B36;
}

.fm-modal-button.danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 900px) {
    .fm-two-column,
    .fm-info-grid,
    .fm-form-grid,
    .fm-review-grid,
    .fm-payment-grid,
    .fm-package-grid {
        grid-template-columns: 1fr;
    }

    .fm-page {
        margin: 26px auto;
        padding: 0 16px;
    }

    .fm-hero,
    .fm-card {
        padding: 18px;
    }

    .fm-inline-form,
    .fm-actions {
        align-items: stretch;
    }

    .fm-button,
    .back-button,
    .stud-edit-action-btn {
        width: 100%;
    }

    .stud-edit-actions,
    .stud-edit-delete-form,
    .fm-detail-actions,
    .fm-inline-action {
        width: 100%;
    }

    .fm-destructive-modal {
        align-items: flex-end;
        padding: 12px;
    }

    .fm-destructive-modal__dialog {
        padding: 18px;
        border-radius: 12px;
    }

    .fm-destructive-modal__actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .fm-modal-button {
        width: 100%;
    }

    .cards .card.fm-clickable-card > img {
        height: 220px;
    }

    .search-page .cards {
        grid-template-columns: minmax(0, 1fr);
    }

    .search-page .cards .card.fm-clickable-card {
        max-width: 100%;
    }

    .search-page .cards .card.fm-clickable-card > img,
    .search-page .cards .card.fm-clickable-card.fm-premium-result > img {
        height: clamp(180px, 56vw, 220px);
        max-height: 220px;
    }

    .fm-review-panel {
        margin: 0 14px 16px;
    }
}

/* =========================
   LEGAL / CONSENT
========================= */
.legal-shell {
    max-width: 1060px;
    margin: 44px auto;
    padding: 0 20px;
}

.legal-hero,
.legal-card,
.legal-notice,
.legal-toc,
.legal-message {
    background: #fff;
    border: 1px solid rgba(47,111,104,0.12);
    box-shadow: 0 14px 34px rgba(0,0,0,0.06);
}

.legal-hero {
    border-radius: 18px;
    padding: 34px;
    margin-bottom: 20px;
}

.legal-kicker {
    display: inline-flex;
    margin-bottom: 12px;
    color: #C8922E;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.legal-hero h1 {
    margin: 0 0 12px;
    color: #1F6F6D;
    font-size: 36px;
    line-height: 1.15;
}

.legal-hero p,
.legal-card p,
.legal-card li,
.legal-notice {
    color: #3f4846;
    line-height: 1.7;
}

.legal-updated {
    margin-top: 18px;
    color: #6b7471 !important;
    font-size: 14px;
}

.legal-card,
.legal-notice,
.legal-toc,
.legal-message {
    border-radius: 16px;
    padding: 26px;
    margin-bottom: 18px;
}

.legal-card h2,
.legal-toc h2 {
    margin: 0 0 14px;
    color: #1F6F6D;
    font-size: 24px;
}

.legal-toc ol {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 22px;
    margin: 0;
    padding-left: 20px;
}

.legal-toc li {
    color: #64706d;
    padding-left: 4px;
}

.legal-toc a {
    color: #1F6F6D;
    font-weight: 700;
    text-decoration: none;
}

.legal-toc a:hover,
.legal-toc a:focus-visible {
    color: #C8922E;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.legal-data-list {
    display: grid;
    gap: 14px;
    margin: 0;
}

.legal-data-list div {
    display: grid;
    grid-template-columns: minmax(150px, 220px) 1fr;
    gap: 14px;
    border-bottom: 1px solid #edf0ef;
    padding-bottom: 12px;
}

.legal-data-list div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.legal-data-list dt {
    color: #64706d;
    font-weight: 700;
}

.legal-data-list dd {
    margin: 0;
    color: #222;
}

.legal-card a,
.legal-data-list a,
.cookie-link {
    color: #1F6F6D;
    font-weight: 700;
}

.legal-list {
    margin: 0;
    padding-left: 20px;
}

.legal-message.success {
    background: #edf8ef;
    color: #1f642f;
    border-color: #b8dfc0;
}

.legal-message.error {
    background: #fff1f0;
    color: #8f1d17;
    border-color: #efc0ba;
}

.legal-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    color: #1F6F6D;
    font-weight: 700;
}

.legal-field input,
.legal-field textarea {
    width: 100%;
    border: 1px solid #d7dedc;
    border-radius: 10px;
    padding: 12px 13px;
    font: inherit;
}

.legal-field textarea {
    min-height: 110px;
    resize: vertical;
}

.legal-checkbox {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    line-height: 1.55;
    margin: 16px 0;
}

.legal-checkbox input {
    margin-top: 4px;
}

.legal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.legal-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d7dedc;
    border-radius: 10px;
    padding: 12px 18px;
    background: #fff;
    color: #1F6F6D;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.legal-button.primary {
    background: #2A8278;
    border-color: #2A8278;
    color: #fff;
}

.legal-button.primary:hover {
    background: #226B64;
    border-color: #226B64;
}

.legal-button.danger {
    background: #C84A43;
    border-color: #C84A43;
    color: #fff;
}

.legal-button.danger:hover {
    background: #B23B36;
    border-color: #B23B36;
}

.legal-button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.cookie-settings-form {
    display: grid;
    gap: 14px;
}

.cookie-settings-row,
.cookie-category-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    border: 1px solid #edf0ef;
    border-radius: 12px;
    padding: 14px;
}

.cookie-settings-row small,
.cookie-category-row small {
    display: block;
    margin-top: 5px;
    color: #64706d;
    line-height: 1.45;
}

.cookie-settings-row input,
.cookie-category-row input {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

.cookie-settings-row.is-disabled {
    background: #f7faf9;
}

.cookie-banner {
    position: fixed;
    left: 18px;
    right: 18px;
    bottom: 18px;
    z-index: 1200;
}

.cookie-banner-inner {
    max-width: 1040px;
    margin: 0 auto;
    border: 1px solid rgba(31,111,109,0.18);
    border-radius: 16px;
    background: rgba(255,255,255,0.98);
    box-shadow: 0 18px 48px rgba(0,0,0,0.18);
    padding: 18px;
}

.cookie-banner-copy strong {
    color: #1F6F6D;
    font-size: 18px;
}

.cookie-banner-copy p {
    margin: 7px 0 0;
    color: #3f4846;
    line-height: 1.55;
}

.cookie-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.cookie-button {
    border: 1px solid #d7dedc;
    border-radius: 10px;
    background: #fff;
    color: #1F6F6D;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
}

.cookie-button.primary {
    background: #2A8278;
    border-color: #2A8278;
    color: #fff;
}

.cookie-button.ghost {
    background: #f7faf9;
}

.cookie-banner-settings {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
}

@media (max-width: 768px) {
    .header-inner {
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
    }

    .nav {
        width: 100%;
    }

    .nav-toggle {
        margin-left: auto;
    }

    .header .nav a {
        border-radius: 0;
        padding: 9px 4px;
    }

    .legal-shell {
        margin: 26px auto;
        padding: 0 14px;
    }

    .legal-hero,
    .legal-card,
    .legal-notice,
    .legal-toc,
    .legal-message {
        padding: 22px;
        border-radius: 14px;
    }

    .legal-hero h1 {
        font-size: 30px;
    }

    .legal-data-list div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .legal-toc ol {
        grid-template-columns: 1fr;
    }

    .legal-actions,
    .cookie-banner-actions {
        flex-direction: column;
    }

    .legal-button,
    .cookie-button {
        width: 100%;
    }

    .cookie-banner {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }

    .cookie-settings-row,
    .cookie-category-row {
        align-items: center;
    }
}
/* =========================
   GRID & CARDS FIX
========================= */

.card-grid {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;

    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.cat-card {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    transition: 0.3s;
}

.cat-card:hover {
    transform: translateY(-5px);
}

.cat-card-image {
    height: 200px;
    background: #e5e5e5;
}

.cat-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cat-card-body {
    padding: 15px;
}

.cat-card-body h3 {
    margin: 0 0 10px;
}

.cat-card-body p {
    margin: 5px 0;
}
/* =========================
   SEARCH PAGE
========================= */

.search-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
}

.search-form {
    margin-bottom: 30px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-form select,
.search-form input {
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #ccc;
}

.search-form button {
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    background: #2A8278;
    color: white;
    cursor: pointer;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.card {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    transition: 0.2s;
}

.card:hover {
    transform: translateY(-4px);
}

.card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.cards .card.fm-clickable-card > img {
    height: clamp(220px, 24vw, 260px);
    object-fit: cover;
}

.search-page .cards {
    grid-template-columns: repeat(auto-fit, minmax(250px, 320px));
    justify-content: center;
    align-items: start;
}

.search-page .cards .card.fm-clickable-card {
    width: 100%;
    max-width: 340px;
}

.search-page .cards .card.fm-clickable-card > img,
.search-page .cards .card.fm-clickable-card.fm-premium-result > img {
    height: clamp(220px, 24vw, 260px);
    max-height: 260px;
    object-fit: cover;
}

.card-content {
    padding: 15px;
}

.card-content a {
    text-decoration: none;
    color: #1F6F6D;
    font-weight: bold;
}
/* =========================
   SEARCH PAGE FIX
========================= */

.search-page {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.search-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.search-cards .card {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.search-cards .card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.search-cards .card-content {
    padding: 15px;
}
/* FILTER GRID */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

/* BOX */
.filter-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-box.full {
    grid-column: 1 / -1;
}

/* INPUT */
.filter-box input,
.filter-box select {
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #ddd;
}

/* CHIPS */
.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip {
    position: relative;
    cursor: pointer;
}

.chip input {
    display: none;
}

.chip span {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 20px;
    background: #f0f0f0;
    transition: 0.2s;
}

/* ACTIVE */
.chip input:checked + span {
    background: #2A8278;
    color: white;
}
/* FILTER */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.filter-box {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-box.full {
    margin-top: 10px;
}

.filter-box input,
.filter-box select {
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #ddd;
}

/* BUTTON */
.search-btn {
    margin-top: 15px;
    padding: 12px 20px;
    background: #2A8278;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

/* CHIPS */
.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip input {
    display: none;
}

.chip span {
    padding: 8px 14px;
    background: #eee;
    border-radius: 20px;
    cursor: pointer;
}

.chip input:checked + span {
    background: #2A8278;
    color: white;
}

/* CARDS */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.card {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.card-content {
    padding: 15px;
}
.filter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.filter-box {
    display: flex;
    flex-direction: column;
}

.filter-box input,
.filter-box select {
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #ddd;
}

.paywall-blur {
    filter: blur(10px);
    transform: scale(1.03);
}

.protected-profile-preview {
    position: relative;
    margin: 18px 0;
    border: 1px solid #eadfc9;
    border-radius: 12px;
    overflow: hidden;
    background: #fffdf8;
}

.protected-preview-blur {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 18px;
    filter: blur(4px);
    opacity: .45;
    pointer-events: none;
    user-select: none;
}

.protected-profile-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 22px;
    text-align: center;
    background: rgba(255,255,255,.78);
    color: #1F6F6D;
}

.paywall-notice {
    color: #8a5a00;
    font-weight: 700;
}

.paywall-upgrade-button {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 10px;
    background: #2A8278;
    color: #fff !important;
    text-decoration: none;
    font-weight: 700;
}

.paywall-subtext {
    margin-top: 8px;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

.unlock-intro {
    background: #fff;
    padding: 28px;
    border-radius: 16px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    margin-bottom: 24px;
}

.unlock-intro h1 {
    margin-top: 0;
    color: #1F6F6D;
}

.unlock-note {
    color: #666;
    line-height: 1.6;
}

.unlock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
}

.unlock-card {
    background: #fffdf8;
    border: 1px solid #eadfc9;
    border-top: 5px solid #C8922E;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.unlock-card h2 {
    margin: 0 0 14px 0;
    color: #1F6F6D;
    font-size: 24px;
    line-height: 1.2;
}

.unlock-price {
    color: #C8922E;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.unlock-duration {
    display: inline-block;
    background: #e7f1ef;
    color: #1F6F6D;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 999px;
    margin-bottom: 14px;
}

.unlock-card p {
    color: #555;
    line-height: 1.6;
}

.unlock-features {
    margin: 0 0 18px 0;
    padding-left: 18px;
    color: #555;
    line-height: 1.6;
}

.unlock-card button {
    border: none;
    cursor: pointer;
}

.unlock-coupon-field {
    display: grid;
    gap: 7px;
    margin: 14px 0 0;
    color: #1F6F6D;
    font-size: 13px;
    font-weight: 700;
}

.unlock-coupon-field input {
    width: 100%;
    border: 1px solid #d7d0c5;
    border-radius: 8px;
    padding: 10px 12px;
    font: inherit;
}

.paywall-disabled-button {
    display: inline-block;
    opacity: 0.65;
    cursor: not-allowed;
    pointer-events: none;
}

/* MOBILE */
@media (max-width: 900px) {
    .filter-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* =========================
   ADMIN
========================= */
.admin-shell {
    max-width: 1280px;
    margin: 24px auto;
    padding: 0 20px;
    min-width: 0;
}

.admin-panel,
.admin-hero,
.admin-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 26px rgba(0,0,0,0.08);
    border: 1px solid rgba(47,111,104,0.08);
    min-width: 0;
}

.admin-hero,
.admin-panel {
    padding: 16px;
    margin-bottom: 14px;
}

.admin-hero h1,
.admin-panel h2 {
    color: #1F6F6D;
    margin: 0 0 8px;
}

.admin-muted {
    color: #666;
    line-height: 1.55;
    font-size: 14px;
}

.admin-gold-line {
    height: 4px;
    width: 90px;
    background: #C8922E;
    border-radius: 999px;
    margin-bottom: 16px;
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
    padding: 10px;
    border: 1px solid #dbe7e4;
    border-radius: 14px;
    background: #f7faf9;
}

.admin-nav a,
.admin-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    background: #e7f1ef;
    color: #1F6F6D;
    padding: 9px 12px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    max-width: 100%;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
}

.admin-nav a.active,
.admin-button.primary {
    background: #2A8278;
    color: #fff;
}

.admin-button.primary:hover {
    background: #226B64;
}

.header .nav .admin-header-chat-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    min-height: 0;
    padding: 9px 11px;
    border: 1px solid rgba(200,146,46,0.36);
    border-radius: 6px;
    background: #FFFFFF;
    color: #174746;
}

.header .nav .admin-header-chat-link:hover,
.header .nav .admin-header-chat-link.is-active {
    background: #FFF7EB;
    border-color: rgba(200,146,46,0.48);
}

.header .nav .admin-header-chat-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #C8922E;
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(23,71,70,0.12);
}

.header .nav .admin-header-chat-text {
    font-size: 14.5px;
    font-weight: 650;
}

@media (max-width: 1024px) {
    .header .nav .admin-header-chat-link {
        justify-content: flex-start;
        width: 100%;
        padding: 10px 6px;
        border-radius: 0;
        border-color: transparent;
        border-bottom-color: rgba(31,111,109,0.10);
        background: transparent;
        box-shadow: none;
    }

    .header .nav .admin-header-chat-badge {
        position: static;
        margin-left: auto;
        transform: none;
    }

    .header .nav .admin-header-chat-text {
        font-size: 14px;
    }
}

.admin-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.admin-section-head h2 {
    margin: 0;
}

.admin-button.danger {
    background: #C84A43;
    color: #fff;
}

.admin-button.danger:hover {
    background: #B23B36;
}

.admin-button.warning {
    background: #C8922E;
    color: #fff;
}

.admin-button.secondary {
    background: #666;
    color: #fff;
}

.admin-payment-list {
    display: grid;
    gap: 12px;
}

.admin-coupon-list {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.admin-payment-card {
    border: 1px solid #e7ded1;
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
    min-width: 0;
}

.admin-payment-card.paid {
    border-left: 5px solid #2f8f5b;
}

.admin-payment-card.unpaid {
    border-left: 5px solid #a72a2a;
}

.admin-payment-card summary {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(160px, .9fr) max-content;
    gap: 16px;
    align-items: center;
    padding: 15px 18px;
    cursor: pointer;
    list-style: none;
}

.admin-payment-card summary::-webkit-details-marker {
    display: none;
}

.admin-payment-user {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.admin-payment-user strong,
.admin-payment-model {
    min-width: 0;
    overflow-wrap: anywhere;
}

.admin-payment-user small {
    color: #6b6258;
    overflow-wrap: anywhere;
}

.admin-payment-model {
    color: #1F6F6D;
    font-weight: 700;
}

.admin-payment-state {
    justify-self: end;
    border-radius: 999px;
    padding: 7px 11px;
    font-weight: 800;
    font-size: 13px;
    max-width: 100%;
    overflow-wrap: anywhere;
    text-align: center;
}

.admin-payment-state.paid {
    color: #17603c;
    background: #e7f6ef;
}

.admin-payment-state.unpaid {
    color: #8a1f1f;
    background: #fde8e8;
}

.admin-payment-details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 0 18px 18px;
}

.admin-payment-details div {
    border: 1px solid #efe7db;
    border-radius: 8px;
    padding: 10px 12px;
    background: #fbfaf7;
    min-width: 0;
}

.admin-payment-details span {
    display: block;
    color: #6b6258;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
}

.admin-payment-details strong {
    color: #142523;
    overflow-wrap: anywhere;
}

.admin-payment-actions {
    padding: 0 18px 18px;
}

.admin-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.admin-button.small {
    padding: 7px 10px;
    font-size: 13px;
}

.admin-document-list {
    display: grid;
    gap: 14px;
}

.admin-document-card {
    border: 1px solid #e7ded1;
    border-left: 5px solid #C8922E;
    border-radius: 8px;
    background: #fff;
    padding: 18px;
}

.admin-document-card.approved {
    border-left-color: #2f8f5b;
}

.admin-document-card.rejected,
.admin-document-card.blocked {
    border-left-color: #8a1f1f;
}

.admin-document-card.redacted_by_admin {
    border-left-color: #1F6F6D;
}

.admin-document-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}

.admin-document-head h2 {
    margin: 8px 0 4px;
    font-size: 20px;
    color: #142523;
}

.admin-document-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.admin-document-meta div {
    border: 1px solid #efe7db;
    border-radius: 8px;
    background: #fbfaf7;
    padding: 10px 12px;
}

.admin-document-meta span {
    display: block;
    color: #6b6258;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
}

.admin-document-meta strong {
    overflow-wrap: anywhere;
}

.admin-document-form {
    display: grid;
    gap: 12px;
}

.admin-document-buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.admin-document-buttons .admin-button {
    width: 100%;
    text-align: center;
}

.admin-document-options {
    border-top: 1px solid #edf1f0;
    padding-top: 10px;
}

.admin-document-options summary {
    cursor: pointer;
    color: #1F6F6D;
    font-weight: 800;
}

.admin-deck-doc-alert {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    margin-top: 14px;
    border: 1px solid rgba(138,31,31,0.20);
    border-radius: 999px;
    background: #fff8f8;
    padding: 8px 12px;
    color: #8a1f1f;
    font-weight: 800;
}

.admin-deck-doc-alert strong,
.admin-deck-doc-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 26px;
    border-radius: 999px;
    background: #fff3f3;
    color: #8a1f1f;
    font-size: 13px;
}

.admin-deck-doc-alert.is-clear {
    border-color: rgba(33,107,33,0.18);
    background: #f5fbf7;
    color: #216b21;
}

.admin-deck-doc-alert.is-clear strong {
    background: #e7f7ed;
    color: #216b21;
}

.admin-deck-doc-profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.admin-deck-doc-profile-card,
.admin-deck-doc-group {
    border: 1px solid #e7ded1;
    border-radius: 8px;
    background: #fff;
    padding: 16px;
}

.admin-deck-doc-profile-card.rejected {
    border-color: rgba(138,31,31,0.28);
    background: #fffafa;
}

.admin-deck-doc-profile-card h2,
.admin-deck-doc-group h3 {
    margin: 8px 0 4px;
    color: #142523;
}

.admin-deck-doc-types {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0;
}

.admin-deck-doc-types span {
    border-radius: 999px;
    background: #f3f6f6;
    color: #2c5651;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 800;
}

.admin-deck-doc-meta {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-deck-doc-body {
    display: grid;
    grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
    gap: 14px;
    margin-bottom: 12px;
}

.admin-deck-doc-preview,
.admin-deck-doc-file {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 130px;
    border: 1px solid #e7ded1;
    border-radius: 8px;
    background: #fbfaf7;
    overflow: hidden;
    text-decoration: none;
}

.admin-deck-doc-preview img {
    width: 100%;
    height: 100%;
    max-height: 180px;
    object-fit: cover;
}

.admin-deck-doc-file {
    flex-direction: column;
    gap: 8px;
    color: #1F6F6D;
    font-weight: 800;
}

.admin-deck-doc-file span {
    border-radius: 999px;
    background: #e7f1ef;
    padding: 5px 9px;
    font-size: 12px;
}

.admin-deck-doc-note,
.stud-document-note {
    border: 1px solid #f0d4d4;
    border-radius: 8px;
    background: #fff8f8;
    color: #702020;
    padding: 10px;
    margin-top: 8px;
}

.admin-deck-doc-note p,
.stud-document-note p {
    margin: 5px 0 0;
    line-height: 1.45;
}

.document-responsibility-warning {
    display: grid;
    gap: 8px;
    box-sizing: border-box;
    width: 100%;
    border: 2px solid #b42318;
    background: #fff3cd;
    color: #451a03;
    border-radius: 8px;
    padding: 14px;
    margin: 16px 0;
}

.document-responsibility-warning.is-invalid {
    box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.16);
}

.document-responsibility-warning > strong {
    display: block;
    color: #991b1b;
    font-size: 18px;
    margin: 0;
}

.document-responsibility-warning p {
    margin: 0;
    line-height: 1.5;
}

.document-responsibility-check {
    display: flex !important;
    gap: 10px;
    align-items: flex-start;
    box-sizing: border-box;
    width: 100%;
    margin-top: 12px;
    min-width: 0;
    max-width: 100%;
    line-height: 1.45;
    white-space: normal;
    overflow-wrap: break-word;
}

.document-responsibility-check input {
    flex: 0 0 auto;
    width: auto !important;
    min-width: 16px;
    margin-top: 3px;
    padding: 0;
}

.document-responsibility-check span {
    min-width: 0;
    flex: 1 1 auto;
    display: block;
}

.document-responsibility-check .required {
    display: inline;
    font-size: inherit;
}

.stud-health-pedigree-upload {
    border: 1px solid #dbe1e8;
    border-radius: 10px;
    background: #f8fafc;
    padding: 14px;
    margin-bottom: 14px;
}

.stud-health-pedigree-upload small {
    display: block;
    color: #5d6c68;
    line-height: 1.45;
    margin-top: 7px;
}

.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 12px;
    align-items: stretch;
}

.admin-stat {
    background: #fafafa;
    border: 1px solid #ececec;
    border-radius: 10px;
    padding: 12px;
    height: 100%;
}

.admin-dashboard-section {
    box-shadow: 0 8px 18px rgba(31,111,109,0.05);
}

.admin-stat strong {
    display: block;
    color: #1F6F6D;
    font-size: 24px;
    margin-bottom: 4px;
}

.admin-filter-row,
.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    align-items: end;
    min-width: 0;
}

.admin-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.admin-field.full,
.admin-actions.full {
    grid-column: 1 / -1;
}

.admin-field label {
    color: #1F6F6D;
    font-weight: 700;
    font-size: 13px;
}

.admin-field input,
.admin-field select,
.admin-field textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid #d7dedc;
    border-radius: 10px;
    padding: 10px 11px;
    font: inherit;
    background: #fff;
}

.admin-field textarea {
    min-height: 80px;
    resize: vertical;
}

.admin-table-wrap {
    max-width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid #ececec;
    padding: 12px 10px;
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

.admin-table th {
    color: #1F6F6D;
    font-size: 12px;
    text-transform: uppercase;
}

.newsletter-admin .newsletter-editor-card {
    padding: 24px;
}

.newsletter-editor-card .admin-section-head {
    margin-bottom: 18px;
}

.newsletter-editor-card .admin-section-head h2 {
    font-size: 24px;
    line-height: 1.25;
}

.newsletter-editor-form {
    display: grid;
    gap: 18px;
}

.newsletter-editor-grid {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.newsletter-editor-grid-main {
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
}

.newsletter-template-grid {
    grid-template-columns: 1fr;
}

.newsletter-editor-grid-send {
    grid-template-columns: minmax(260px, 360px) minmax(260px, 420px) minmax(120px, 160px);
    align-items: end;
}

.newsletter-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 7px;
    color: #1F6F6D;
    font-size: 13px;
    font-weight: 700;
}

.newsletter-field input,
.newsletter-field select,
.newsletter-field textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid #d7dedc;
    border-radius: 8px;
    padding: 11px 12px;
    background: #fff;
    color: #263331;
    font: inherit;
    font-weight: 500;
}

.newsletter-field input,
.newsletter-field select {
    min-height: 44px;
}

.newsletter-field textarea {
    line-height: 1.55;
    resize: vertical;
}

.newsletter-textarea-intro {
    min-height: 110px;
}

.newsletter-field-main-text textarea {
    display: none;
}

.newsletter-wysiwyg {
    border: 1px solid #d7dedc;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.newsletter-wysiwyg-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    border-bottom: 1px solid #e4ebe8;
    background: #f7faf9;
}

.newsletter-wysiwyg-toolbar button {
    min-width: 36px;
    min-height: 34px;
    border: 1px solid #cfdedb;
    border-radius: 7px;
    background: #fff;
    color: #1F6F6D;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
}

.newsletter-wysiwyg-toolbar button:hover {
    background: #e7f1ef;
}

.newsletter-wysiwyg-surface {
    min-height: 260px;
    padding: 13px 14px;
    color: #263331;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.6;
    outline: none;
}

.newsletter-wysiwyg-surface a {
    color: #1F6F6D;
    text-decoration: underline;
}

.newsletter-wysiwyg-surface ul {
    margin: 0 0 12px 22px;
    padding: 0;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.newsletter-field-html textarea {
    min-height: 240px;
}

.newsletter-field-text textarea {
    min-height: 160px;
}

.newsletter-field-batch input {
    max-width: 140px;
}

.newsletter-editor-actions {
    justify-content: flex-end;
    gap: 10px;
    padding-top: 4px;
}

.newsletter-button-grid {
    grid-template-columns: minmax(220px, 320px) minmax(260px, 1fr);
}

.newsletter-recipient-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
    border: 1px solid #dbe7e4;
    border-radius: 10px;
    background: #f7faf9;
}

.newsletter-recipient-summary div {
    min-width: 0;
}

.newsletter-recipient-summary span {
    display: block;
    color: #687572;
    font-size: 12px;
    font-weight: 700;
}

.newsletter-recipient-summary strong {
    display: block;
    margin-top: 3px;
    color: #1F6F6D;
    font-size: 17px;
    line-height: 1.25;
}

.newsletter-advanced-editor {
    border: 1px solid #e4ebe8;
    border-radius: 10px;
    padding: 12px 14px;
    background: #fbfdfc;
}

.newsletter-advanced-editor summary {
    color: #1F6F6D;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
}

.newsletter-advanced-editor[open] {
    display: grid;
    gap: 12px;
}

.newsletter-check-field {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: #263331;
    font-size: 13px;
    font-weight: 600;
}

.newsletter-check-field input {
    margin-top: 2px;
}

.newsletter-schedule-field span {
    color: #8a5a00;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

.newsletter-send-warning {
    margin: -6px 0 0;
    color: #8a5a00;
    font-weight: 700;
}

.newsletter-preview {
    border-top: 1px solid #e4ebe8;
    padding-top: 16px;
}

.newsletter-preview-card {
    max-width: 680px;
    border: 1px solid #e4ebe8;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 20px rgba(31,111,109,0.08);
}

.newsletter-preview-brand {
    padding: 18px 20px 14px;
    border-bottom: 4px solid #C8922E;
    text-align: center;
}

.newsletter-preview-brand img {
    display: block;
    width: 170px;
    max-width: 70%;
    height: auto;
    margin: 0 auto 8px;
}

.newsletter-preview-brand strong,
.newsletter-preview-card h3,
.newsletter-preview-card h4 {
    color: #1F6F6D;
}

.newsletter-preview-card h3,
.newsletter-preview-card h4,
.newsletter-preview-card p,
.newsletter-preview-card [data-newsletter-preview-body] {
    margin: 0;
    padding: 0 22px;
}

.newsletter-preview-card h3 {
    padding-top: 22px;
    font-size: 22px;
}

.newsletter-preview-card h4 {
    padding-top: 14px;
    font-size: 19px;
}

.newsletter-preview-card p,
.newsletter-preview-card [data-newsletter-preview-body] {
    padding-top: 12px;
    color: #263331;
    line-height: 1.6;
}

.newsletter-preview-card [data-newsletter-preview-button] {
    display: inline-block;
    margin: 18px 22px 8px;
    padding: 11px 16px;
    border-radius: 8px;
    background: #2A8278;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.newsletter-preview-card footer {
    margin-top: 20px;
    padding: 16px 22px;
    background: #f7faf9;
    color: #687572;
    font-size: 12px;
    line-height: 1.5;
}

.newsletter-filter-row {
    grid-template-columns: repeat(3, minmax(180px, 240px)) auto;
    align-items: end;
    margin-bottom: 14px;
}

.newsletter-filter-row select,
.newsletter-filter-row .admin-button {
    min-height: 40px;
}

.newsletter-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.newsletter-subscriber-table {
    min-width: 820px;
}

.newsletter-subscriber-table th,
.newsletter-subscriber-table td {
    padding: 9px 10px;
    font-size: 13px;
}

.newsletter-subscriber-table th {
    font-size: 11px;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.admin-actions .admin-button {
    flex: 0 1 auto;
}

.admin-status {
    display: inline-block;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 700;
    background: #e7f1ef;
    color: #1F6F6D;
}

.admin-status.pending,
.admin-status.pending_review,
.admin-status.trial {
    background: #fff6df;
    color: #8a5a00;
}

.admin-status.approved,
.admin-status.active,
.admin-status.paid,
.admin-status.done,
.admin-status.redacted_by_admin {
    background: #e7f7ed;
    color: #216b21;
}

.admin-status.rejected,
.admin-status.suspended,
.admin-status.expired {
    background: #fff3f3;
    color: #8a1f1f;
}

.admin-status.reviewing {
    background: #eef2ff;
    color: #35469c;
}

.admin-message,
.admin-error {
    border-radius: 12px;
    padding: 13px 15px;
    margin-bottom: 16px;
}

.admin-message {
    background: #eef8ee;
    border: 1px solid #b9dfb9;
    color: #216b21;
}

.admin-error {
    background: #fff3f3;
    border: 1px solid #e5b3b3;
    color: #8a1f1f;
}

.admin-empty {
    padding: 16px;
    background: #fafafa;
    border: 1px solid #ececec;
    border-radius: 12px;
    color: #666;
}

.admin-dashboard-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.admin-stat {
    min-height: 86px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: center;
}

.admin-stat-compact {
    min-height: auto;
    justify-content: flex-start;
}

.admin-stat small {
    color: #666;
    line-height: 1.45;
}

.admin-stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e7f1ef;
    color: #1F6F6D;
    font-weight: 800;
    margin-bottom: 6px;
}

.admin-kpi-grid,
.admin-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    align-items: stretch;
}

.admin-overview-grid {
    margin-top: 18px;
}

.admin-alert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.admin-alert-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    border: 1px solid #dbe7e4;
    border-radius: 12px;
    background: #fff;
    color: #243a38;
    padding: 10px 12px;
    text-decoration: none;
    font-weight: 800;
}

.admin-alert-card span {
    min-width: 0;
}

.admin-alert-card strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 30px;
    border-radius: 999px;
    background: #e7f1ef;
    color: #1F6F6D;
    font-size: 14px;
}

.admin-alert-card.needs-attention {
    border-color: rgba(138,31,31,0.24);
    background: #fff8f8;
}

.admin-alert-card.needs-attention strong {
    background: #fff3f3;
    color: #8a1f1f;
}

.admin-alert-card.is-clear strong {
    background: #e7f7ed;
    color: #216b21;
}

.admin-dashboard-workgrid .admin-alert-card {
    min-height: 92px;
}

.admin-dashboard-workgrid .admin-alert-card.ok strong {
    color: #216b21;
}

.admin-dashboard-workgrid .admin-alert-card.critical strong {
    color: #8a1f1f;
}

.admin-dashboard-workgrid .admin-alert-card.gold strong {
    color: #8a5a00;
}

.admin-shortcut-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.admin-shortcut-card {
    display: grid;
    gap: 6px;
    min-height: 92px;
    border: 1px solid #dbe7e4;
    border-radius: 12px;
    background: #fff;
    color: #243a38;
    padding: 14px;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(31,111,109,0.05);
}

.admin-shortcut-card.admin-primary-shortcut {
    border-color: rgba(200,146,46,0.42);
    background: linear-gradient(135deg, #fffdf8, #ffffff);
    box-shadow: 0 14px 30px rgba(31,111,109,0.09);
}

.admin-shortcut-card strong {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #1F6F6D;
    font-size: 16px;
}

.admin-shortcut-card.needs-attention {
    border-color: rgba(138,31,31,0.24);
    background: #fff8f8;
}

.admin-shortcut-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 22px;
    border-radius: 999px;
    background: #fff3f3;
    color: #8a1f1f;
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
}

.admin-shortcut-card span {
    color: #667;
    font-size: 13px;
    line-height: 1.45;
}

.admin-status-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    border: 1px solid #dbe7e4;
    border-radius: 999px;
    background: #fff;
    color: #243a38;
    padding: 7px 10px;
    text-decoration: none;
    box-shadow: 0 6px 14px rgba(31,111,109,0.04);
}

.admin-status-pill span {
    font-size: 12px;
    color: #667;
}

.admin-status-pill strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    border-radius: 999px;
    background: #eef6f4;
    color: #1F6F6D;
    font-size: 13px;
}

.admin-status-pill.critical strong {
    background: #fff3f3;
    color: #8a1f1f;
}

.admin-status-pill.needs-attention strong,
.admin-status-pill.attention.needs-attention strong {
    background: #fff3f3;
    color: #8a1f1f;
}

.admin-status-pill.gold strong {
    background: #fff7e8;
    color: #8a5a00;
}

.admin-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
    gap: 10px;
}

.admin-quick-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 64px;
    border: 1px solid #dbe7e4;
    border-radius: 12px;
    background: #fff;
    color: #1F6F6D;
    padding: 11px 12px;
    text-decoration: none;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(31,111,109,0.05);
}

.admin-dashboard-quick {
    border-color: rgba(31,111,109,0.16);
}

.admin-shortcut-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: #e7f1ef;
    color: #1F6F6D;
    font-size: 24px;
    line-height: 1;
}

.admin-quick-link span {
    display: block;
    color: #666;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
    margin-top: 4px;
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    padding: 5px 9px;
    background: #e7f1ef;
    color: #1F6F6D;
    font-size: 12px;
    font-weight: 800;
    width: fit-content;
    max-width: 100%;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
}

.admin-badge.gold,
.admin-status.lifetime,
.admin-status.lifetime_tester {
    background: #fff4d8;
    color: #8a5a00;
    border: 1px solid rgba(200,146,46,0.22);
}

.admin-badge.red,
.admin-badge.danger,
.admin-status.open,
.admin-status.pending_payment,
.admin-status.error,
.admin-status.failed {
    background: #fff3f3;
    color: #8a1f1f;
}

.admin-badge.green,
.admin-status.answered,
.admin-status.resolved,
.admin-status.manual {
    background: #e7f7ed;
    color: #216b21;
}

.admin-badge.blue,
.admin-status.info,
.admin-status.ignored {
    background: #eef2ff;
    color: #35469c;
}

.badge-admin,
.badge-lifetime,
.badge-launch-partner,
.badge-launchmember,
.badge-early-bird {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    vertical-align: middle;
    margin-left: 4px;
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid rgba(138, 101, 24, 0.32);
    background: #fffaf0;
    color: #79540f;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: 0;
    white-space: nowrap;
}

.badge-lifetime {
    border-color: rgba(200, 146, 46, 0.28);
    background: #fff4d8;
    color: #8a5a00;
}

.badge-launchmember {
    border-color: rgba(31, 111, 109, 0.28);
    background: #e7f1ef;
    color: #1F6F6D;
}

.badge-launch-partner {
    border-color: rgba(31, 111, 109, 0.30);
    background: #edf8f6;
    color: #17615a;
}

.badge-early-bird {
    border-color: rgba(53, 70, 156, 0.22);
    background: #eef2ff;
    color: #35469c;
}

.faq-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 44px 0 64px;
}

.faq-hero {
    background: #fff;
    border: 1px solid rgba(47,111,104,0.12);
    border-radius: 16px;
    padding: clamp(22px, 5vw, 36px);
    box-shadow: 0 14px 34px rgba(0,0,0,0.06);
    margin-bottom: 24px;
}

.faq-hero h1 {
    margin: 8px 0 10px;
    color: #1F6F6D;
    font-size: 34px;
    line-height: 1.15;
}

.faq-hero p {
    margin: 0;
    color: #555;
    line-height: 1.7;
}

.faq-layout {
    display: grid;
    gap: 18px;
}

.faq-section {
    background: #fff;
    border: 1px solid rgba(47,111,104,0.12);
    border-radius: 16px;
    padding: clamp(18px, 4vw, 26px);
    box-shadow: 0 10px 26px rgba(0,0,0,0.05);
}

.faq-section h2 {
    margin: 0 0 14px;
    color: #1F6F6D;
    font-size: 22px;
}

.faq-list {
    display: grid;
    gap: 10px;
}

.faq-item {
    border: 1px solid rgba(47,111,104,0.12);
    border-radius: 12px;
    background: #fbfcfc;
    overflow: hidden;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.faq-item:hover,
.faq-item:focus-within {
    border-color: rgba(200,146,46,0.38);
    box-shadow: 0 10px 24px rgba(0,0,0,0.06);
}

.faq-item h3 {
    margin: 0;
    font-size: 1rem;
}

.faq-question {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 16px;
    width: 100%;
    min-height: 56px;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 16px;
    color: #222;
    font: inherit;
    font-weight: 700;
    text-align: left;
}

.faq-question:focus-visible {
    outline: 3px solid rgba(200,146,46,0.35);
    outline-offset: -3px;
}

.faq-icon {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(31,111,109,0.08);
    color: #1F6F6D;
    transition: background-color .2s ease, transform .2s ease;
}

.faq-icon::before,
.faq-icon::after {
    content: "";
    grid-area: 1 / 1;
    width: 12px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.faq-icon::after {
    transform: rotate(90deg);
    transition: transform .2s ease;
}

.faq-question[aria-expanded="true"] .faq-icon {
    background: rgba(200,146,46,0.16);
    color: #9a6813;
    transform: rotate(180deg);
}

.faq-question[aria-expanded="true"] .faq-icon::after {
    transform: rotate(0deg);
}

.faq-answer {
    border-top: 1px solid rgba(47,111,104,0.1);
    padding: 0 16px 17px;
    color: #555;
    line-height: 1.7;
    animation: faqReveal .18s ease;
}

@keyframes faqReveal {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.admin-user-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: flex-end;
    align-items: center;
    min-width: 0;
    max-width: 100%;
}

.admin-user-inline-actions .admin-button,
.admin-user-inline-actions .admin-state-badge {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
}

.chat-report-link {
    align-self: flex-start;
    margin-top: 10px;
    text-decoration: none;
}

.chat-message-report {
    margin-left: 10px;
    color: #8a5a00;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.chat-message-report:hover {
    text-decoration: underline;
}

.admin-contact-actions {
    display: grid;
    gap: 12px;
    margin: 0 0 16px;
    padding: 12px;
    border: 1px solid #e7ded1;
    border-radius: 12px;
    background: #fbfaf7;
}

.admin-quick-message-form {
    display: grid;
    gap: 10px;
}

.admin-quick-message-form .admin-field textarea {
    min-height: 84px;
}

.admin-chat-message.is-admin-message:not(.own) {
    border-color: rgba(200,146,46,0.30);
    background: #fffaf0;
}

.admin-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
    gap: 20px;
    align-items: stretch;
    margin-bottom: 20px;
}

.admin-detail-grid > .admin-panel,
.admin-detail-grid > .admin-card {
    height: 100%;
    margin-bottom: 0;
}

.admin-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
    min-width: 0;
}

.admin-info-box {
    border: 1px solid #ececec;
    border-radius: 12px;
    padding: 12px;
    background: #fafafa;
    min-width: 0;
}

.admin-info-box span {
    display: block;
    color: #666;
    font-size: 12px;
    margin-bottom: 5px;
}

.admin-info-box strong {
    color: #1F6F6D;
    word-break: break-word;
}

.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: end;
    gap: 12px;
    min-width: 0;
}

.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-tab {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 8px 12px;
    background: #e7f1ef;
    color: #1F6F6D;
    text-decoration: none;
    font-weight: 800;
    font-size: 13px;
}

.admin-tab.active {
    background: #2A8278;
    color: #fff;
}

.admin-row-highlight {
    background: #fffdf7;
}

.admin-table .admin-compact {
    white-space: nowrap;
}

.admin-table a {
    color: #1F6F6D;
    font-weight: 800;
    text-decoration: none;
}

.admin-user-list {
    display: grid;
    gap: 8px;
}

.admin-user-card {
    border: 1px solid #dbe7e4;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(31,111,109,0.05);
    overflow: hidden;
}

.admin-user-card.is-lifetime {
    border-color: rgba(200,146,46,0.35);
    background: #fffdf7;
}

.admin-user-summary {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(220px, 1fr) max-content;
    gap: 8px;
    align-items: center;
    padding: 9px 11px;
    list-style: none;
    cursor: pointer;
}

.admin-user-summary > * {
    min-width: 0;
    max-width: 100%;
}

.admin-user-summary::-webkit-details-marker {
    display: none;
}

.admin-user-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.admin-user-main strong,
.admin-user-main strong a {
    color: #1F6F6D;
    font-size: 16px;
    text-decoration: none;
}

.admin-user-status-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    min-width: 0;
}

.admin-state-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 22px;
    border: 1px solid #d9dfdc;
    border-radius: 999px;
    padding: 3px 7px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.admin-state-badge.ok {
    background: #e7f7ed;
    border-color: #bddfc8;
    color: #216b21;
}

.admin-state-badge.neutral {
    background: #f4f5f4;
    border-color: #d9dfdc;
    color: #606764;
}

.admin-state-badge.critical {
    background: #fff3f3;
    border-color: #e4b8b8;
    color: #8a1f1f;
}

.admin-state-badge.role {
    background: #eef6f5;
    border-color: #c8dddd;
    color: #1F6F6D;
}

.admin-state-badge.trial {
    background: #fff6df;
    border-color: #ecd18d;
    color: #8a5a00;
}

.admin-state-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #2f8f55;
    color: #fff;
    font-size: 10px;
    line-height: 1;
}

.admin-user-plan span {
    display: block;
    color: #666;
    font-size: 12px;
    margin-bottom: 3px;
}

.admin-user-plan strong {
    color: #222;
}

.admin-user-quickfacts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 8px;
    color: #606764;
    font-size: 12px;
    line-height: 1.25;
}

.admin-user-quickfacts span {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-user-quickfacts strong {
    color: #1F6F6D;
}

.admin-pay-pill {
    border: 1px solid #dbe7e4;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 800;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.admin-pay-pill.paid {
    background: #e7f7ed;
    border-color: #b9dfb9;
    color: #216b21;
}

.admin-pay-pill.unpaid {
    background: #fff3f3;
    border-color: #e5b3b3;
    color: #8a1f1f;
}

.admin-pay-pill.trial {
    background: #fff6df;
    border-color: #ecd18d;
    color: #8a5a00;
}

.admin-user-expand {
    color: #1F6F6D;
    font-size: 13px;
    font-weight: 800;
    text-align: right;
    white-space: normal;
    overflow-wrap: anywhere;
    justify-self: end;
}

.admin-user-expand::after {
    content: " +";
}

.admin-user-card[open] .admin-user-expand::after {
    content: " -";
}

.admin-user-details {
    border-top: 1px solid #edf1f0;
    padding: 10px;
    background: #fafafa;
}

.admin-user-details .admin-info-grid {
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    gap: 8px;
}

.admin-user-details .admin-info-box {
    padding: 9px 10px;
    border-radius: 8px;
}

.admin-user-details .admin-info-box span {
    margin-bottom: 3px;
}

.admin-user-actions {
    margin-top: 14px;
}

.admin-member-action-form {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #edf1f0;
}

.admin-member-action-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
}

.admin-member-action-card {
    display: grid;
    gap: 6px;
    align-content: start;
    border: 1px solid #e1e8e5;
    border-radius: 8px;
    background: #fff;
    padding: 8px;
    min-width: 0;
}

.admin-member-action-card-wide {
    grid-column: 1 / -1;
}

.admin-member-action-card h3 {
    margin: 0;
    color: #1F6F6D;
    font-size: 13px;
    line-height: 1.25;
}

.admin-member-card-status {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.admin-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    min-width: 0;
}

.admin-quick-actions {
    background: #fff;
    border: 1px solid #e1e8e5;
    border-radius: 10px;
    padding: 10px;
}

.admin-quick-action-form {
    margin: 0;
}

.admin-quick-plan {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #606764;
    font-size: 12px;
    font-weight: 800;
}

.admin-quick-plan select {
    min-height: 30px;
    border-radius: 8px;
    border: 1px solid #dbe7e4;
    padding: 5px 8px;
}

.admin-member-action-form .admin-button {
    min-height: 27px;
    border-radius: 8px;
    padding: 5px 8px;
    background: #eef1f0;
    color: #44504c;
    font-size: 12px;
    font-weight: 800;
    box-shadow: none;
}

.admin-member-action-form .admin-button.primary {
    background: #2A8278;
    color: #fff;
}

.admin-member-action-form .admin-button.warning {
    background: #8f6b35;
    color: #fff;
}

.admin-member-action-form .admin-button.danger {
    background: #9b3a35;
    color: #fff;
}

.admin-member-action-form textarea {
    min-height: 56px;
}

.admin-member-action-form .admin-field {
    gap: 3px;
}

.admin-member-action-form .admin-field select,
.admin-member-action-form .admin-field input,
.admin-member-action-form .admin-field textarea {
    min-height: 30px;
    padding: 6px 8px;
    border-radius: 7px;
    font-size: 12px;
}

.admin-inline-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #edf1f0;
}

.admin-inline-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.admin-inline-section-head h3 {
    margin: 0;
    color: #1F6F6D;
    font-size: 14px;
}

.admin-empty.compact {
    padding: 10px 12px;
    font-size: 13px;
}

.admin-inline-document-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.admin-inline-document-card {
    display: grid;
    grid-template-columns: minmax(190px, 1.2fr) minmax(120px, 0.45fr) minmax(260px, 1fr);
    gap: 6px 8px;
    align-items: start;
    border: 1px solid #e1e8e5;
    border-left: 4px solid #C8922E;
    border-radius: 8px;
    background: #fff;
    padding: 7px 8px;
    min-width: 0;
}

.admin-doc-row {
    align-items: stretch;
}

.admin-doc-info {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.admin-inline-document-card.approved {
    border-left-color: #2f8f5b;
}

.admin-inline-document-card.rejected,
.admin-inline-document-card.blocked {
    border-left-color: #8a1f1f;
}

.admin-inline-document-card.redacted_by_admin {
    border-left-color: #1F6F6D;
}

.admin-inline-document-main {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.admin-inline-document-main strong,
.admin-inline-document-main .admin-muted {
    overflow-wrap: anywhere;
}

.admin-inline-document-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    color: #606764;
    font-size: 12px;
}

.admin-inline-document-preview,
.admin-doc-preview {
    border: 1px solid #edf1f0;
    border-radius: 8px;
    background: #fbfaf7;
    padding: 6px;
}

.admin-doc-preview {
    display: grid;
    gap: 6px;
    align-content: start;
    justify-items: stretch;
}

.admin-inline-document-preview summary,
.admin-inline-document-options summary {
    cursor: pointer;
    color: #1F6F6D;
    font-size: 13px;
    font-weight: 800;
}

.admin-inline-document-preview img,
.admin-doc-preview img {
    display: block;
    width: 100%;
    max-height: 96px;
    object-fit: contain;
    border-radius: 6px;
    background: #f7f7f7;
}

.admin-doc-open-button {
    width: 100%;
}

.admin-doc-file-token {
    display: grid;
    place-items: center;
    min-height: 54px;
    max-height: 96px;
    border-radius: 6px;
    background: #eef6f5;
    color: #1F6F6D;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.admin-inline-document-preview iframe {
    display: block;
    width: 100%;
    height: 140px;
    margin-top: 6px;
    border: 1px solid #e1e8e5;
    border-radius: 6px;
    background: #fff;
}

.admin-inline-document-form {
    display: grid;
    gap: 6px;
}

.admin-inline-document-form .admin-button {
    min-height: 27px;
    border-radius: 8px;
    padding: 5px 8px;
    font-size: 12px;
    font-weight: 800;
}

.admin-inline-document-options {
    border-top: 1px solid #edf1f0;
    padding-top: 6px;
}

.admin-inline-document-options textarea {
    min-height: 52px;
}

.admin-doc-note-panel {
    margin-top: 2px;
}

.admin-mini-list {
    display: grid;
    gap: 10px;
}

.admin-mini-item {
    border: 1px solid #ececec;
    border-radius: 12px;
    padding: 12px;
    background: #fff;
}

.admin-chat-layout {
    display: grid;
    grid-template-columns: minmax(230px, 320px) minmax(0, 1fr);
    gap: 18px;
}

.admin-chat-list {
    display: grid;
    gap: 8px;
}

.admin-chat-thread-link {
    display: block;
    border: 1px solid #e2e8e6;
    border-radius: 12px;
    padding: 12px;
    text-decoration: none;
    color: #222;
    background: #fff;
}

.admin-chat-thread-link.active {
    border-color: #1F6F6D;
    box-shadow: 0 0 0 3px rgba(31,111,109,0.08);
}

.admin-chat-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    color: #1F6F6D;
    font-weight: 700;
    text-decoration: none;
}

.admin-chat-back-link:hover {
    text-decoration: underline;
}

.admin-chat-window {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 560px;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid #e2e8e6;
    border-radius: 14px;
    background: #fafafa;
}

.admin-chat-message {
    max-width: min(720px, 92%);
    border-radius: 14px;
    padding: 11px 13px;
    background: #fff;
    border: 1px solid #ececec;
}

.admin-chat-message.own {
    align-self: flex-end;
    background: #e7f1ef;
    border-color: #cfe1dd;
}

.admin-chat-message.note {
    background: #fff6df;
    border-color: #ecd18d;
}

.admin-chat-meta {
    color: #666;
    font-size: 12px;
    margin-bottom: 5px;
}

.admin-warning {
    border-radius: 12px;
    padding: 13px 15px;
    margin-bottom: 16px;
    background: #fff6df;
    border: 1px solid #ecd18d;
    color: #8a5a00;
}

@media (max-width: 1180px) {
    .admin-user-summary {
        grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.3fr) minmax(160px, 0.8fr);
    }

    .admin-member-action-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .admin-shell {
        margin: 22px auto;
        padding: 0 14px;
    }

    .admin-hero,
    .admin-panel {
        padding: 20px;
    }

    .admin-nav a,
    .admin-button {
        flex: 1 1 auto;
        text-align: center;
    }

    .admin-detail-grid,
    .admin-chat-layout {
        grid-template-columns: 1fr;
    }

    .admin-user-summary {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .faq-shell {
        width: min(100% - 24px, 1120px);
        padding: 28px 0 46px;
    }

    .faq-hero,
    .faq-section {
        padding: 20px;
        border-radius: 10px;
    }

    .faq-hero h1 {
        font-size: 28px;
    }

    .faq-question {
        min-height: 52px;
        padding: 14px;
    }

    .faq-answer {
        padding: 0 14px 15px;
    }

    .admin-user-inline-actions {
        justify-content: flex-start;
        width: 100%;
        min-width: 0;
    }

    .admin-user-inline-actions .admin-button {
        flex: 1 1 auto;
    }

    .newsletter-admin .newsletter-editor-card {
        padding: 18px;
    }

    .newsletter-editor-grid-main,
    .newsletter-editor-grid-send,
    .newsletter-button-grid,
    .newsletter-recipient-summary,
    .newsletter-filter-row {
        grid-template-columns: 1fr;
    }

    .newsletter-field-batch input {
        max-width: none;
    }

    .newsletter-editor-actions {
        justify-content: stretch;
    }

    .newsletter-editor-actions .admin-button {
        flex: 1 1 100%;
    }

    .admin-user-status-strip,
    .admin-member-card-status {
        gap: 5px;
    }

    .admin-member-action-grid {
        grid-template-columns: 1fr;
    }

    .admin-action-row .admin-button {
        flex: 1 1 150px;
    }

    .admin-payment-card summary,
    .admin-payment-details,
    .admin-document-meta,
    .admin-document-buttons {
        grid-template-columns: 1fr;
    }

    .admin-deck-doc-meta,
    .admin-deck-doc-body {
        grid-template-columns: 1fr;
    }

    .admin-deck-doc-alert {
        align-items: flex-start;
        border-radius: 12px;
        max-width: 100%;
    }

    .admin-document-head {
        flex-direction: column;
    }

    .admin-payment-state {
        justify-self: start;
    }

    .admin-pay-pill {
        width: fit-content;
    }

    .admin-user-expand {
        text-align: left;
    }

    .admin-table th,
    .admin-table td {
        padding: 10px 8px;
        font-size: 13px;
    }

    .protected-preview-blur {
        grid-template-columns: 1fr;
    }

    .admin-inline-document-card.admin-doc-row {
        grid-template-columns: 1fr;
    }

    .admin-chat-window {
        max-height: 480px;
    }
}

@media (min-width: 761px) and (max-width: 1080px) {
    .admin-payment-card summary {
        grid-template-columns: minmax(0, 1fr) max-content;
        gap: 10px 14px;
    }

    .admin-payment-model {
        grid-column: 1 / -1;
    }

    .admin-payment-details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-user-summary {
        grid-template-columns: minmax(0, 1fr) max-content;
        align-items: start;
    }

    .admin-user-status-strip {
        grid-column: 1 / -1;
    }
}

@media (max-width: 860px) {
    .admin-form-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
    }

    .admin-payment-card summary,
    .admin-payment-details {
        grid-template-columns: 1fr;
    }

    .admin-payment-state,
    .admin-user-expand {
        justify-self: start;
    }

    .admin-actions .admin-button,
    .admin-action-row .admin-button,
    .admin-form-actions .admin-button {
        flex: 1 1 180px;
    }
}

/* Scoped final UI fixes */
.fm-page .fm-back-link,
.unlock-page .fm-back-link,
.admin-shell .fm-back-link,
.legal-shell .fm-back-link,
.container > .fm-back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: fit-content;
    min-height: 0;
    margin: 0 0 14px;
    padding: 6px 11px;
    border: 1px solid rgba(31,111,109,0.28);
    border-radius: 999px;
    appearance: none;
    background: #ffffff;
    color: #1F6F6D !important;
    cursor: pointer;
    box-shadow: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
}

.fm-hero .fm-back-link,
.members-hero .fm-back-link {
    margin: 6px 0 0;
}

.fm-page .fm-back-link::before,
.unlock-page .fm-back-link::before,
.admin-shell .fm-back-link::before,
.legal-shell .fm-back-link::before,
.container > .fm-back-link::before {
    content: "←";
    font-size: 14px;
    line-height: 1;
}

.fm-page .fm-back-link:hover,
.unlock-page .fm-back-link:hover,
.admin-shell .fm-back-link:hover,
.legal-shell .fm-back-link:hover,
.container > .fm-back-link:hover {
    border-color: rgba(31,111,109,0.48);
    background: #f7faf9;
    color: #185a59 !important;
}

.fm-page .fm-back-link::before,
.unlock-page .fm-back-link::before,
.admin-shell .fm-back-link::before,
.legal-shell .fm-back-link::before,
.container > .fm-back-link::before {
    content: "\2190";
}

.fm-page .fm-back-link:focus-visible,
.unlock-page .fm-back-link:focus-visible,
.admin-shell .fm-back-link:focus-visible,
.legal-shell .fm-back-link:focus-visible,
.container > .fm-back-link:focus-visible {
    outline: 3px solid rgba(200,146,46,0.28);
    outline-offset: 2px;
    border-color: rgba(200,146,46,0.65);
}

.detail-container .detail-image:not(.placeholder) {
    height: clamp(320px, 32vw, 360px);
    max-height: 360px;
}

.detail-container .detail-image:not(.placeholder) > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.detail-container .detail-image:not(.placeholder) > img.deckkater-detail-image {
    width: 100%;
    height: auto;
    max-height: 360px;
    object-fit: contain;
    object-position: center center;
}

.detail-container > .deckkater-detail-image-wrap:not(.placeholder) {
    width: min(calc(100% - 40px), 960px);
    max-width: 980px;
    min-height: 220px;
    max-height: 360px;
    margin: 22px auto 0;
    border: 1px solid #edf0f2;
    border-radius: 22px;
    background: #f6f2ea;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-container > .deckkater-detail-image-wrap:not(.placeholder) > img.deckkater-detail-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 360px;
    object-fit: contain;
    object-position: center center;
    border-radius: 18px;
}

.detail-container .deckkater-thumb-grid {
    grid-template-columns: repeat(auto-fill, minmax(84px, 110px));
    gap: 10px;
}

.deckkater-thumb-button {
    display: block;
    width: 100%;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 10px;
    background: #f3f6f5;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(31,111,109,0.08);
}

.deckkater-thumb-button:hover,
.deckkater-thumb-button:focus-visible {
    border-color: #C8922E;
    outline: none;
}

.deckkater-thumb-button img.deckkater-gallery-thumb {
    display: block;
    width: 100%;
    height: 92px;
    object-fit: cover;
}

.deckkater-lightbox[hidden] {
    display: none;
}

.deckkater-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(10, 22, 21, 0.76);
}

.deckkater-lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(0,0,0,0.34);
}

.deckkater-lightbox-close {
    position: fixed;
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255,255,255,0.56);
    border-radius: 999px;
    background: rgba(20, 34, 33, 0.82);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

@media (max-width: 768px) {
    .detail-container .detail-image:not(.placeholder) {
        height: clamp(220px, 58vw, 280px);
        max-height: 280px;
    }

    .detail-container .detail-image:not(.placeholder) > img.deckkater-detail-image {
        height: auto;
        max-height: 260px;
    }

    .detail-container > .deckkater-detail-image-wrap:not(.placeholder) {
        width: calc(100% - 24px);
        min-height: 180px;
        max-height: 260px;
        margin-top: 12px;
        border-radius: 16px;
    }

    .detail-container > .deckkater-detail-image-wrap:not(.placeholder) > img.deckkater-detail-image {
        height: auto;
        max-height: 260px;
    }

    .deckkater-lightbox {
        padding: 16px;
    }

    .deckkater-lightbox img {
        max-width: 92vw;
        max-height: 82vh;
    }
}

/* =========================
   SEARCH PAGE PREMIUM DESKTOP REFINEMENT
========================= */
.search-page {
    width: min(100% - 36px, 1500px);
    max-width: 1500px;
    margin: 30px auto 50px;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.search-page button,
.search-page input,
.search-page select {
    font-family: inherit;
    letter-spacing: 0;
}

.search-hero-panel,
.search-form,
.search-results-panel {
    border: 1px solid rgba(31,111,109,0.12);
    background: rgba(255,255,255,0.95);
    box-shadow: 0 14px 34px rgba(31,111,109,0.07);
}

.search-page {
    font-family: inherit;
    font-weight: 400;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.search-hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px;
    align-items: center;
    border-radius: 12px 12px 8px 8px;
    padding: 22px 26px 20px;
    margin-bottom: 12px;
}

.search-kicker,
.search-results-head span,
.filter-section-head span {
    display: inline-flex;
    color: #C8922E;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
}

.search-page h1 {
    margin: 5px 0 7px;
    color: #1F6F6D;
    font-size: clamp(30px, 2.2vw, 40px);
    line-height: 1.1;
}

.search-page .fm-ranking-hint {
    max-width: 920px;
    margin: 0;
    color: #556562;
    font-size: 14px;
    line-height: 1.5;
}

.search-hero-stat {
    min-width: 120px;
    border: 1px solid rgba(200,146,46,0.22);
    border-radius: 999px;
    background: #fffaf0;
    padding: 9px 14px;
    text-align: right;
}

.search-hero-stat span {
    display: block;
    color: #7a641e;
    font-size: 12px;
    font-weight: 700;
}

.search-hero-stat strong {
    display: block;
    margin-top: 1px;
    color: #1F6F6D;
    font-size: 26px;
    line-height: 1;
}

.search-page .search-form {
    display: grid;
    gap: 12px;
    margin: 0 0 18px;
    border-radius: 8px 8px 12px 12px;
    padding: 16px;
}

.filter-section {
    display: grid;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(31,111,109,0.10);
    border-radius: 8px;
    background: #fcfbf8;
}

.filter-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(31,111,109,0.09);
}

.search-page .filter-grid {
    display: grid;
    gap: 10px;
    margin: 0;
}

.search-page .location-grid {
    grid-template-columns: minmax(180px, 1.15fr) minmax(180px, 1.15fr) minmax(180px, 1fr) minmax(120px, 0.68fr) minmax(110px, 0.58fr);
}

.search-page .cat-grid {
    grid-template-columns: minmax(250px, 1.45fr) minmax(112px, 0.55fr) minmax(180px, 1fr);
}

.search-page .ems-grid {
    grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.search-page .filter-box {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.search-page .filter-box label,
.search-page .filter-box .stud-ems-field-label {
    color: #27423e;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.search-page .filter-box input,
.search-page .filter-box select {
    width: 100%;
    min-height: 39px;
    border: 1px solid #d7dfdc;
    border-radius: 7px;
    background: #ffffff;
    color: #263533;
    padding: 8px 10px;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 1px 0 rgba(255,255,255,0.9) inset;
}

.search-page .filter-box select:disabled {
    color: #8b9895;
    background: #f4f7f6;
    cursor: not-allowed;
}

.search-page .filter-box input:focus,
.search-page .filter-box select:focus {
    outline: 3px solid rgba(31,111,109,0.14);
    border-color: rgba(31,111,109,0.48);
}

.search-page .filter-box.stud-ems-field {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.search-page .filter-box .stud-ems-multiselect summary {
    min-height: 39px;
    border: 1px solid #d7dfdc;
    border-radius: 7px;
    color: #263533;
    padding: 8px 10px;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 1px 0 rgba(255,255,255,0.9) inset;
}

.search-page .filter-box .stud-ems-multiselect:focus-within summary {
    outline: 3px solid rgba(31,111,109,0.14);
    border-color: rgba(31,111,109,0.48);
    box-shadow: 0 1px 0 rgba(255,255,255,0.9) inset;
}

.search-page .filter-box .stud-ems-multiselect-panel {
    font-size: 13px;
    font-weight: 500;
}

.search-ems-compact-grid {
    align-items: start;
}

.search-page .compact-field input,
.search-page .compact-field select {
    text-align: left;
}

.carrier-section {
    background: #ffffff;
}

.health-section {
    background: #ffffff;
}

.search-page .chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-page .chip-group.compact {
    gap: 6px;
}

.ems-filter-panel {
    display: grid;
    gap: 8px;
    margin-top: 10px;
    min-width: 0;
}

.ems-filter-panel-head strong {
    color: #1f3733;
    font-size: 13px;
    font-weight: 850;
    line-height: 1.2;
}

.ems-filter-card-grid,
.ems-filter-groups {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    min-width: 0;
}

.ems-visible-card-grid {
    grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr);
}

.search-page .filter-box.full-line,
.search-page .ems-subhead {
    grid-column: 1 / -1;
}

.search-page .ems-subhead strong {
    color: #1f3733;
    font-size: 13px;
    font-weight: 850;
}

.ems-filter-card,
.ems-filter-group {
    display: grid;
    align-content: start;
    gap: 8px;
    min-width: 0;
    padding: 11px;
    border: 1px solid rgba(31,111,109,0.10);
    border-radius: 8px;
    background: #ffffff;
}

.ems-filter-card > strong,
.ems-filter-group strong {
    color: #27423e;
    font-size: 12px;
    font-weight: 850;
    line-height: 1.25;
}

.ems-carrier-filter-groups,
.stud-ems-carrier-groups,
.fm-ems-carrier-summary {
    min-width: 0;
}

.stud-ems-section .stud-ems-carrier-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.ems-carrier-filter-group,
.stud-ems-carrier-group {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.stud-ems-section .stud-ems-carrier-group {
    align-content: start;
    gap: 9px;
    padding: 12px;
    border: 1px solid rgba(31,111,109,0.12);
    border-radius: 8px;
    background: #f8fbfa;
}

.stud-ems-carrier-group strong {
    color: #64736f;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0;
}

.stud-ems-section .stud-ems-carrier-group > strong {
    color: #27423e;
    font-size: 12px;
    line-height: 1.25;
}

.fm-ems-carrier-summary span {
    display: block;
    color: #324a46;
    line-height: 1.45;
}

.fm-ems-carrier-summary b {
    color: #5e6e6a;
    font-weight: 850;
}

.search-page .chip span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border: 1px solid rgba(31,111,109,0.16);
    border-radius: 999px;
    background: #f5f8f7;
    color: #2f4a46;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 650;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.health-chip-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 9px;
}

.health-filter-groups {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.health-filter-group {
    display: grid;
    align-content: start;
    gap: 8px;
    min-width: 0;
    padding: 11px;
    border: 1px solid rgba(31,111,109,0.10);
    border-radius: 8px;
    background: #ffffff;
}

.health-filter-group > strong {
    color: #27423e;
    font-size: 12px;
    font-weight: 850;
    line-height: 1.25;
}

.health-filter-stack {
    display: grid;
    gap: 7px;
}

.health-option {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 5px;
    min-width: 0;
}

.health-option.has-refinement {
    min-height: 31px;
    border: 1px solid rgba(31,111,109,0.10);
    border-radius: 8px;
    background: #f8faf8;
    padding: 6px;
}

.search-page .health-option .chip span {
    min-height: 27px;
    padding: 5px 9px;
    border-color: rgba(31,111,109,0.12);
    background: #f6f8f7;
    font-size: 12px;
    font-weight: 650;
    box-shadow: none;
}

.search-page .health-option.has-refinement .chip span {
    border-color: transparent;
}

.health-refinement {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #5c6a67;
    font-size: 11px;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    padding: 3px 5px;
}

.health-refinement input {
    width: 13px;
    height: 13px;
    margin: 0;
    accent-color: #1F6F6D;
}

.health-refinement span {
    transform: translateY(0.5px);
}

.health-refinement input:checked + span {
    color: #1F6F6D;
}

.search-page .chip input:checked + span {
    border-color: #2A8278;
    background: #2A8278;
    color: #ffffff;
}

.search-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 0;
}

.search-page .search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 178px;
    min-height: 42px;
    margin: 0;
    border: 0;
    border-radius: 8px;
    background: #2A8278;
    color: #ffffff;
    padding: 10px 18px;
    font: inherit;
    font-weight: 900;
    box-shadow: 0 10px 20px rgba(42,130,120,0.16);
    cursor: pointer;
}

.search-page .search-btn:hover {
    background: #226B64;
}

.search-page .fm-message {
    width: 100%;
    margin: 0 0 14px;
}

.search-results-panel {
    border-radius: 12px;
    padding: 18px;
}

.search-results-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    margin-bottom: 14px;
}

.search-results-head h2 {
    margin: 3px 0 0;
    color: #1F6F6D;
    font-size: 22px;
    line-height: 1.15;
}

.search-results-head > strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    min-height: 36px;
    border-radius: 999px;
    background: #fff7e7;
    color: #8a641f;
    font-size: 18px;
}

.search-page .cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
    align-items: start;
    margin-top: 0;
}

.search-page .cards .card.fm-clickable-card {
    width: 100%;
    max-width: none;
    min-height: 100%;
    border: 1px solid rgba(31,111,109,0.10);
    box-shadow: 0 12px 26px rgba(31,111,109,0.07);
}

.search-page .cards .card.fm-clickable-card > img,
.search-page .cards .card.fm-clickable-card.fm-premium-result > img {
    height: clamp(200px, 14vw, 250px);
    max-height: 250px;
}

.search-page .card-content {
    padding: 16px;
}

.search-page .card-content h3 {
    margin: 0 0 8px;
    color: #1F6F6D;
    font-size: 19px;
    line-height: 1.2;
}

.search-page .card-content p {
    margin: 6px 0;
    color: #42504d;
    font-size: 14px;
    line-height: 1.45;
}

.search-page .fm-card-actions {
    margin-top: 14px;
}

/* =========================
   STUD FORM STRUCTURED FIELDS
========================= */
.stud-form-section {
    margin: 8px 0 4px;
    padding: 14px;
    border: 1px solid rgba(31,111,109,0.12);
    border-radius: 10px;
    background: #fbfcfb;
}

.stud-form-section h2 {
    margin: 0 0 12px;
    color: #1F6F6D;
    line-height: 1.2;
}

.stud-form-section h2 {
    font-size: 18px;
}

.stud-ems-section {
    display: grid;
    gap: 12px;
}

.stud-ems-block {
    display: grid;
    gap: 8px;
    min-width: 0;
    padding: 11px;
    border: 1px solid rgba(31,111,109,0.10);
    border-radius: 8px;
    background: #ffffff;
}

.stud-ems-block h3 {
    margin: 0;
    color: #27423e;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
}

.stud-ems-subtitle {
    color: #64736f;
    font-size: 11px;
    font-weight: 850;
    line-height: 1.25;
}

.stud-ems-info-note {
    margin: 0;
    color: #64736f;
    font-size: 12px;
    line-height: 1.45;
}

.stud-ems-color-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.stud-ems-modular-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.stud-ems-modular-grid label,
.stud-ems-modular-grid .stud-ems-field {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.stud-ems-field-label,
.stud-ems-modular-grid label > span {
    color: #51615e;
    font-size: 12px;
    font-weight: 800;
}

.stud-ems-multiselect {
    position: relative;
    min-width: 0;
}

.stud-ems-multiselect summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    box-sizing: border-box;
    min-height: 41px;
    width: 100%;
    border: 1px solid #cfd9d7;
    border-radius: 8px;
    background: #fff;
    color: #222;
    cursor: pointer;
    font: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: 1.25;
    list-style: none;
    padding: 10px 11px;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.stud-ems-multiselect summary:hover {
    border-color: #b7c7c4;
}

.stud-ems-multiselect:focus-within summary {
    border-color: #1F6F6D;
    box-shadow: 0 0 0 3px rgba(31,111,109,0.12);
    outline: none;
}

.stud-ems-multiselect summary::-webkit-details-marker {
    display: none;
}

.stud-ems-multiselect summary::after {
    border-bottom: 2px solid currentColor;
    border-right: 2px solid currentColor;
    content: "";
    flex: 0 0 auto;
    height: 7px;
    margin-left: auto;
    transform: rotate(45deg) translateY(-2px);
    width: 7px;
}

.stud-ems-multiselect[open] summary::after {
    transform: rotate(225deg) translate(-1px, -1px);
}

.stud-ems-multiselect summary span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stud-ems-multiselect-panel {
    background: #fff;
    border: 1px solid rgba(31,111,109,0.16);
    border-radius: 8px;
    box-shadow: 0 14px 30px rgba(26,55,51,0.13);
    display: grid;
    gap: 5px;
    left: 0;
    max-height: 260px;
    min-width: 100%;
    overflow: auto;
    padding: 8px;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 20;
}

.stud-ems-multiselect-panel .stud-compact-check {
    min-height: 40px;
}

.stud-ems-preview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.stud-ems-radio-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.stud-ems-review-note {
    margin: 0;
    border: 1px solid rgba(200,146,46,0.28);
    border-radius: 8px;
    background: #fffaf0;
    color: #76591a;
    padding: 9px 11px;
    font-size: 13px;
    font-weight: 750;
}

.stud-ems-preview > div {
    min-width: 0;
    border: 1px solid rgba(31,111,109,0.12);
    border-radius: 8px;
    background: #f8faf9;
    padding: 10px 11px;
}

.stud-ems-preview span {
    display: block;
    color: #6b7774;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 3px;
}

.stud-ems-preview strong {
    display: block;
    color: #1f3733;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.stud-choice-pill {
    display: flex !important;
    align-items: center;
    min-width: 0;
    gap: 7px;
    margin: 0;
    padding: 8px 9px;
    border: 1px solid rgba(31,111,109,0.14);
    border-radius: 8px;
    background: #f8faf9;
    color: #263533;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
}

.stud-choice-pill input {
    width: auto !important;
    accent-color: #1F6F6D;
}

.stud-choice-pill span,
.stud-compact-check span {
    min-width: 0;
}

.stud-health-group {
    margin-top: 14px;
    border: 1px solid rgba(31,111,109,0.12);
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
}

.stud-health-group > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    padding: 10px 12px;
    cursor: pointer;
    list-style: none;
}

.stud-health-group > summary::-webkit-details-marker,
.stud-health-card > summary::-webkit-details-marker {
    display: none;
}

.stud-health-group > summary span {
    font-size: 14px;
    color: #8a641f;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.stud-health-group > summary small {
    color: #687673;
    font-size: 12px;
    font-weight: 700;
}

.stud-health-grid,
.stud-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.stud-checkbox-grid.compact {
    gap: 7px;
}

.stud-health-grid {
    padding: 0 12px 12px;
}

.stud-health-shared-upload,
.stud-health-genetic-shared,
.stud-health-genetic-document-section {
    margin: 0 12px 12px;
}

.stud-health-genetic-shared {
    margin: 14px 0 0;
}

.stud-health-shared-upload small,
.stud-health-genetic-shared small,
.stud-health-genetic-document-section small,
.stud-health-document-hint,
.stud-health-summary-document-state {
    display: block;
    margin-top: 4px;
    color: #66736f;
    font-size: 12px;
    line-height: 1.35;
}

.stud-health-document-hint.is-required,
.stud-health-summary-document-state.is-required {
    color: #8a1f1f;
    font-weight: 800;
}

.stud-health-genetic-shared,
.stud-health-genetic-document-section {
    display: grid;
    gap: 10px;
    border: 1px solid rgba(31,111,109,0.12);
    border-radius: 8px;
    background: #f8fafc;
    padding: 12px;
}

.stud-health-genetic-document-section {
    margin: 0 0 14px;
}

.stud-health-genetic-document-section p {
    margin: 4px 0 0;
    color: #51615e;
    font-size: 13px;
    line-height: 1.4;
}

.stud-health-genetic-shared > strong,
.stud-health-genetic-document-section strong,
.stud-health-genetic-tests > span {
    color: #27423e;
    font-size: 13px;
}

.stud-health-genetic-tests {
    display: grid;
    gap: 8px;
}

.stud-health-genetic-subgroup {
    border: 1px solid rgba(31,111,109,0.12);
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
}

.stud-health-genetic-subgroup > summary {
    cursor: pointer;
    list-style: none;
    padding: 10px 12px;
    color: #27423e;
    font-size: 13px;
    font-weight: 850;
}

.stud-health-genetic-subgroup > summary::-webkit-details-marker {
    display: none;
}

.stud-health-genetic-subgroup .stud-checkbox-grid {
    padding: 0 12px 12px;
}

.stud-health-genetic-other {
    display: grid;
    grid-column: 1 / -1;
    gap: 4px;
    min-width: 0;
}

.stud-health-genetic-other span {
    color: #51615e;
    font-size: 12px;
    font-weight: 700;
}

.stud-health-card {
    border: 1px solid rgba(31,111,109,0.12);
    border-radius: 8px;
    background: #ffffff;
    padding: 0;
    overflow: hidden;
}

.stud-health-card > summary {
    display: grid;
    gap: 5px;
    min-height: 40px;
    padding: 10px 12px;
    cursor: pointer;
    list-style: none;
}

.stud-health-toggle,
.stud-compact-check,
.stud-health-subcheck {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 700;
}

.stud-health-toggle input,
.stud-compact-check input,
.stud-health-subcheck input {
    width: auto !important;
    accent-color: #1F6F6D;
}

.stud-health-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    padding: 0 12px 12px;
}

.stud-health-card:not(.is-active) .stud-health-fields {
    display: none;
}

.stud-health-fields label {
    min-width: 0;
}

.stud-health-fields label span,
.stud-health-upload span {
    display: block;
    color: #51615e;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stud-health-subcheck,
.stud-health-upload {
    grid-column: 1 / -1;
}

.stud-health-security-note {
    margin: 0 0 12px;
    border: 1px solid rgba(200,146,46,0.24);
    border-radius: 8px;
    background: #fffaf0;
    color: #6f561c;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.45;
}

.fm-health-public-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fm-health-public-badge {
    max-width: 100%;
    white-space: normal;
}

.fm-health-public-badge strong {
    color: inherit;
}

.fm-health-public-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.fm-health-public-group {
    display: grid;
    gap: 7px;
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(31,111,109,0.10);
    border-radius: 8px;
    background: #ffffff;
}

.fm-health-public-group > strong {
    color: #27423e;
    font-size: 12px;
    font-weight: 850;
}

.stud-document-overview {
    gap: 12px;
}

.stud-document-empty {
    margin: 0;
    color: #64736f;
    font-size: 13px;
}

.stud-document-list {
    display: grid;
    gap: 10px;
}

.stud-document-card {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 11px;
    border: 1px solid rgba(31,111,109,0.12);
    border-radius: 8px;
    background: #fff;
}

.stud-document-card strong,
.stud-document-card span,
.stud-document-card small {
    display: block;
    min-width: 0;
}

.stud-document-card strong {
    color: #27423e;
    font-size: 13px;
}

.stud-document-card small {
    color: #66736f;
    font-size: 12px;
}

.stud-document-included-tests {
    margin-top: 4px;
    line-height: 1.4;
}

.stud-document-included-tests ul {
    margin: 3px 0 0 16px;
    padding: 0;
    color: #66736f;
    font-size: 12px;
}

.stud-document-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.stud-document-badges span {
    border-radius: 999px;
    background: #eef5f4;
    color: #2c5651;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 800;
}

.stud-document-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.stud-document-actions a {
    border-radius: 8px;
    background: #2A8278;
    color: #fff;
    padding: 7px 10px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
}

@media (max-width: 760px) {
    .stud-health-grid,
    .stud-checkbox-grid,
    .stud-health-fields,
    .stud-ems-color-grid,
    .stud-ems-modular-grid,
    .stud-ems-carrier-groups,
    .stud-ems-preview,
    .stud-ems-radio-grid,
    .ems-filter-card-grid,
    .ems-filter-groups,
    .health-filter-groups,
    .fm-health-public-groups {
        grid-template-columns: 1fr;
    }

    .stud-document-card {
        grid-template-columns: 1fr;
    }

    .stud-document-actions {
        justify-content: flex-start;
    }

    .stud-ems-multiselect-panel {
        max-height: 48vh;
        position: static;
        width: 100%;
    }

    .stud-ems-multiselect summary span {
        white-space: normal;
    }
}

@media (min-width: 1320px) {
    .search-page .cards {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1560px) {
    .search-page .cards {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 1180px) {
    .search-page {
        width: min(100% - 32px, 1180px);
    }

    .search-page .location-grid,
    .search-page .ems-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ems-filter-card-grid,
    .ems-filter-groups {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .health-filter-groups {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .search-page .cat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .search-page {
        width: min(100% - 28px, 860px);
        margin: 24px auto 42px;
    }

    .search-hero-panel {
        grid-template-columns: 1fr;
        align-items: start;
        padding: 20px;
    }

    .search-hero-stat {
        justify-self: start;
        text-align: left;
    }

    .search-page .search-form,
    .search-results-panel {
        padding: 16px;
    }

    .search-page .location-grid,
    .search-page .cat-grid,
    .search-page .ems-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .search-page .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .search-page .cards .card.fm-clickable-card > img,
    .search-page .cards .card.fm-clickable-card.fm-premium-result > img {
        height: clamp(190px, 28vw, 230px);
    }
}

@media (max-width: 640px) {
    .search-page {
        width: min(100% - 24px, 560px);
        margin: 20px auto 36px;
    }

    .search-hero-panel,
    .search-page .search-form,
    .search-results-panel {
        padding: 14px;
        border-radius: 10px;
    }

    .search-page h1 {
        font-size: 28px;
    }

    .filter-section {
        padding: 12px;
    }

    .search-page .location-grid,
    .search-page .cat-grid,
    .search-page .ems-grid,
    .search-page .cards,
    .ems-filter-card-grid,
    .ems-filter-groups,
    .health-filter-groups,
    .fm-health-public-groups {
        grid-template-columns: 1fr;
    }

    .search-actions,
    .search-results-head {
        align-items: stretch;
        flex-direction: column;
    }

    .search-hero-stat {
        width: 100%;
    }

    .search-page .search-btn {
        width: 100%;
        min-width: 0;
    }

    .search-page .cards .card.fm-clickable-card > img,
    .search-page .cards .card.fm-clickable-card.fm-premium-result > img {
        height: clamp(190px, 58vw, 230px);
    }
}

/* =========================
   PREMIUM UX ALIGNMENT
========================= */
:root {
    --fm-teal: #1F6F6D;
    --fm-teal-dark: #174f4d;
    --fm-action-green: #2A8278;
    --fm-action-green-hover: #226B64;
    --fm-action-red: #C84A43;
    --fm-action-red-hover: #B23B36;
    --fm-gold: #C8922E;
    --fm-line: rgba(31,111,109,0.12);
    --fm-soft-shadow: 0 10px 24px rgba(31,111,109,0.06);
}

.fm-button.primary,
.back-button,
.admin-button.primary,
.legal-button.primary,
.cookie-button.primary,
.search-btn,
.paywall-upgrade-button,
.stud-edit-action-btn:not(.gold):not(.danger),
.stud-edit-save-btn,
.unlock-card button,
.auth-box button {
    background: var(--fm-action-green);
    border-color: var(--fm-action-green);
    color: #ffffff;
}

.fm-button.primary:hover,
.back-button:hover,
.admin-button.primary:hover,
.legal-button.primary:hover,
.cookie-button.primary:hover,
.search-btn:hover,
.paywall-upgrade-button:hover,
.stud-edit-action-btn:not(.gold):not(.danger):hover,
.stud-edit-save-btn:hover,
.unlock-card button:hover,
.auth-box button:hover {
    background: var(--fm-action-green-hover);
    border-color: var(--fm-action-green-hover);
    color: #ffffff;
}

.fm-button.danger,
.back-button.danger,
.admin-button.danger,
.legal-button.danger,
.stud-edit-action-btn.danger,
.fm-modal-button.danger {
    background: var(--fm-action-red);
    border-color: var(--fm-action-red);
    color: #ffffff;
}

.fm-button.danger:hover,
.back-button.danger:hover,
.admin-button.danger:hover,
.legal-button.danger:hover,
.stud-edit-action-btn.danger:hover,
.fm-modal-button.danger:hover {
    background: var(--fm-action-red-hover);
    border-color: var(--fm-action-red-hover);
    color: #ffffff;
}

button,
.btn,
.fm-button,
.back-button,
.admin-button,
.legal-button,
.cookie-button,
.search-btn,
.paywall-upgrade-button,
.stud-edit-action-btn,
.stud-edit-save-btn,
.unlock-card button,
.auth-box button {
    border-radius: 7px;
    font-weight: 650;
    letter-spacing: 0;
}

.fm-button,
.back-button,
.admin-button,
.legal-button,
.cookie-button,
.stud-edit-action-btn {
    padding: 9px 12px;
}

.fm-hero,
.fm-card,
.fm-detail-section,
.fm-review-panel,
.cat-card,
.auth-box,
.detail-container,
.search-hero-panel,
.search-form,
.search-results-panel,
.stud-form-section,
.filter-section,
.admin-panel,
.admin-stat,
.unlock-card {
    border-radius: 8px;
    box-shadow: var(--fm-soft-shadow);
}

.fm-hero h1,
.search-page h1,
.registration-hero h1,
.unlock-hero h1 {
    font-weight: 750;
    letter-spacing: 0;
}

.fm-card h2,
.fm-detail-section h2,
.stud-form-section h2,
.search-results-head h2,
.filter-section-head span {
    font-weight: 750;
    letter-spacing: 0;
}

.filter-section-head span,
.stud-form-section h2 {
    color: var(--fm-teal-dark);
    font-size: 15px;
    text-transform: none;
}

.ems-filter-panel-head strong,
.ems-filter-card > strong,
.ems-filter-group strong,
.health-filter-group > strong,
.stud-ems-block h3,
.stud-health-group > summary span {
    color: #243d39;
    font-size: 13px;
    font-weight: 750;
    text-transform: none;
}

.search-page .chip span,
.stud-choice-pill,
.stud-compact-check,
.health-refinement {
    border-radius: 6px;
    font-weight: 600;
}

.search-page .chip span {
    min-height: 28px;
    padding: 4px 9px;
    background: #ffffff;
}

.search-hero-stat,
.search-results-head > strong,
.fm-rating-pill,
.fm-badge,
.admin-badge,
.user-badge {
    border-radius: 7px;
}

.back-to-top {
    position: fixed;
    right: 18px;
    bottom: 20px;
    z-index: 1000;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(31,111,109,0.18);
    border-radius: 8px;
    background: rgba(255,255,255,0.94);
    color: var(--fm-teal);
    box-shadow: 0 12px 26px rgba(31,111,109,0.12);
    cursor: pointer;
}

.back-to-top:hover {
    background: #f5faf9;
}

.back-to-top[hidden] {
    display: none;
}

.members-page {
    max-width: 1240px;
}

.members-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 22px;
    align-items: end;
    padding: 26px 0 18px;
}

.members-hero h1 {
    margin: 4px 0 8px;
    color: #173f3c;
    font-size: clamp(32px, 5vw, 58px);
    line-height: 1.02;
    letter-spacing: 0;
}

.members-hero p {
    max-width: 760px;
    color: #56615f;
    line-height: 1.6;
    margin: 0;
}

.members-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(88px, 1fr));
    gap: 10px;
}

.members-stats div {
    min-width: 96px;
    padding: 12px;
    border: 1px solid rgba(31,111,109,0.16);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 14px 28px rgba(31,111,109,0.08);
}

.members-stats strong {
    display: block;
    color: #1F6F6D;
    font-size: 26px;
    line-height: 1;
}

.members-stats span {
    display: block;
    margin-top: 5px;
    color: #63706d;
    font-size: 12px;
    font-weight: 700;
}

.members-filter {
    display: grid;
    grid-template-columns: minmax(220px, 1.3fr) repeat(4, minmax(140px, 1fr)) auto;
    gap: 12px;
    align-items: end;
}

.members-filter label {
    display: grid;
    gap: 6px;
}

.members-filter label span {
    color: #243d39;
    font-size: 12px;
    font-weight: 750;
}

.members-filter input,
.members-filter select {
    width: 100%;
    min-height: 42px;
    border: 1px solid rgba(31,111,109,0.18);
    border-radius: 8px;
    background: #ffffff;
    color: #243d39;
    padding: 9px 10px;
}

.members-filter-actions {
    display: flex;
    gap: 8px;
}

.members-map-shell {
    overflow: hidden;
    border: 1px solid rgba(31,111,109,0.15);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 44px rgba(31,111,109,0.12);
    margin-bottom: 24px;
}

.members-map-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(31,111,109,0.12);
}

.members-map-toolbar strong,
.members-section-head h2 {
    color: #173f3c;
    margin: 0;
}

.members-map-toolbar span,
.members-section-head span {
    color: #62706d;
    font-size: 13px;
}

.members-map {
    position: relative;
    height: min(68vh, 680px);
    min-height: 540px;
    overflow: hidden;
    background: #dcebe8;
}

.members-map .leaflet-container {
    font: inherit;
}

.members-map-fallback {
    display: grid;
    place-items: center;
    height: 100%;
    color: #5f6866;
    padding: 18px;
    text-align: center;
}

.member-paw-marker,
.member-cluster-marker {
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #1F6F6D;
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(23,63,60,0.24);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.member-paw-marker span,
.member-cluster-marker span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.member-paw-marker span {
    font-size: 18px;
}

.member-cluster-marker {
    background: #C8922E;
    color: #173f3c;
    font-weight: 850;
}

.members-leaflet-popup .leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(23,63,60,0.18);
}

.members-leaflet-popup .leaflet-popup-content {
    margin: 14px;
}

.members-popup-card {
    min-width: 230px;
}

.members-popup-head {
    display: flex;
    gap: 10px;
    align-items: center;
}

.members-popup-avatar,
.member-card-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    object-fit: cover;
    flex: 0 0 auto;
}

.members-popup-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.members-popup-avatar.is-placeholder,
.member-card-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1F6F6D, #C8922E);
    color: #ffffff;
    font-weight: 850;
}

.members-popup-head strong,
.members-popup-head small {
    display: block;
}

.members-popup-head strong {
    color: #173f3c;
}

.members-popup-head small {
    color: #C8922E;
    font-weight: 750;
}

.members-popup-meta {
    display: grid;
    gap: 4px;
    margin: 12px 0;
    color: #56615f;
    font-size: 13px;
}

.members-popup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.members-popup-actions a,
.member-stud-link {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 7px 10px;
    border-radius: 8px;
    background: #f5faf9;
    color: #1F6F6D;
    font-weight: 750;
    text-decoration: none;
}

.members-section-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin: 0 0 12px;
}

.members-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.member-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid rgba(31,111,109,0.14);
    border-radius: 8px;
    background: #ffffff;
}

.member-card-title {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.member-card-title strong {
    color: #173f3c;
}

.member-card-title span {
    padding: 4px 7px;
    border-radius: 7px;
    background: #fff7e7;
    color: #8a641f;
    font-size: 12px;
    font-weight: 750;
}

.member-card-muted,
.member-card-location {
    color: #5f6866;
    font-size: 13px;
    line-height: 1.45;
}

.member-card-body {
    display: grid;
    gap: 4px;
    min-width: 0;
}

@media (max-width: 768px) {
    body {
        font-size: 15px;
    }

    .container,
    .fm-page,
    .search-page {
        margin-top: 20px;
    }

    .fm-hero,
    .fm-card,
    .fm-detail-section,
    .fm-review-panel,
    .auth-box,
    .search-hero-panel,
    .search-page .search-form,
    .search-results-panel,
    .stud-form-section {
        padding: 16px;
    }

    .fm-hero h1,
    .search-page h1 {
        font-size: 27px;
        line-height: 1.18;
    }

    .filter-section-head,
    .ems-filter-panel-head {
        align-items: flex-start;
    }

    .search-page .chip-group,
    .health-chip-group {
        gap: 6px;
    }

    .search-page .search-btn,
    .auth-box button,
    .stud-edit-save-btn {
        min-height: 40px;
        padding: 9px 13px;
    }

    .stud-status-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stud-status-option {
        padding: 11px 10px;
    }

    .back-to-top {
        right: 14px;
        bottom: 16px;
        width: 39px;
        height: 39px;
    }

    .members-hero,
    .members-filter,
    .members-list {
        grid-template-columns: 1fr;
    }

    .members-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
    }

    .members-stats div {
        min-width: 0;
        padding: 10px;
    }

    .members-map {
        min-height: 470px;
    }

    .members-map-toolbar,
    .members-section-head,
    .member-card {
        align-items: flex-start;
    }

    .members-map-toolbar,
    .member-card {
        flex-direction: column;
    }

    .member-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .member-card > .fm-button {
        grid-column: 1 / -1;
        width: 100%;
        justify-content: center;
    }

    .members-filter-actions {
        width: 100%;
    }

    .members-filter-actions .fm-button {
        flex: 1;
        justify-content: center;
    }
}

.admin-form-grid.admin-form-grid-wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-form-grid.admin-form-grid-wide .span-2 {
    grid-column: 1 / -1;
}

@media (max-width: 980px) {
    .admin-form-grid.admin-form-grid-wide {
        grid-template-columns: 1fr;
    }
}

/* Navigation UX refactor */
.header-inner {
    flex-wrap: nowrap;
    gap: 16px;
}

.header .logo a {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.header .logo img {
    height: 64px;
}

.nav {
    justify-content: flex-end;
    gap: 6px;
    margin-left: auto;
    flex: 1 1 auto;
    min-width: 0;
}

.header .nav .nav-link,
.nav-more-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    white-space: nowrap;
    line-height: 1;
}

.nav-more {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-more-trigger {
    gap: 6px;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #174746;
    font: inherit;
    font-size: 14.5px;
    font-weight: 650;
    cursor: pointer;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.nav-more:hover .nav-more-trigger,
.nav-more:focus-within .nav-more-trigger,
.nav-more.is-open .nav-more-trigger,
.nav-more.is-active .nav-more-trigger {
    background: #fff;
    border-color: rgba(200,146,46,0.28);
    color: #1F6F6D;
    box-shadow: 0 6px 18px rgba(23,71,70,0.07);
}

.nav-more-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1000;
    display: none;
    min-width: 190px;
    padding: 8px;
    border: 1px solid #dbe7e4;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 18px 38px rgba(23,71,70,0.14);
}

.nav-more:hover .nav-more-menu,
.nav-more:focus-within .nav-more-menu,
.nav-more.is-open .nav-more-menu {
    display: grid;
    gap: 4px;
}

.header .nav .nav-more-link {
    justify-content: space-between;
    width: 100%;
    padding: 10px 11px;
    border-radius: 8px;
}

.header .nav .nav-admin-link {
    background: #2A8278;
    color: #fff;
    border-color: #2A8278;
}

.header .nav .nav-admin-link:hover,
.header .nav .nav-admin-link.is-active {
    background: #226B64;
    color: #fff;
    border-color: #226B64;
}

.header .nav .admin-header-chat-link {
    width: 38px;
    min-width: 38px;
    min-height: 38px;
    padding: 0;
    border-radius: 999px;
}

.header .nav .admin-header-chat-icon {
    font-size: 17px;
    line-height: 1;
}

.header .nav .admin-header-chat-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.header .nav .admin-header-chat-badge {
    top: -5px;
    right: -5px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 10px;
    line-height: 16px;
}

.header .nav .admin-header-chat-badge.inline {
    position: static;
    min-width: 18px;
    margin-left: 8px;
}

.header select {
    flex: 0 0 auto;
    margin-left: 0;
}

@media (max-width: 1180px) {
    .header-inner {
        gap: 10px;
        padding: 9px 14px;
    }

    .header .logo img {
        height: 56px;
    }

    .nav {
        gap: 4px;
        margin-left: auto;
    }

    .header .nav .nav-link,
    .nav-more-trigger {
        padding-left: 8px;
        padding-right: 8px;
        font-size: 13.5px;
    }

    .header .nav .admin-header-chat-link {
        width: 36px;
        min-width: 36px;
    }
}

@media (max-width: 1100px) {
    .header-inner {
        flex-wrap: wrap;
        min-height: 70px;
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        min-width: 40px;
        min-height: 38px;
        order: 2;
    }

    .header select {
        order: 3;
        min-height: 36px;
    }

    .nav {
        display: none;
        flex: 0 0 100%;
        width: 100%;
        order: 4;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin-left: 0;
        padding: 8px 0 0;
        border-top: 1px solid rgba(31,111,109,0.14);
    }

    .nav.is-open {
        display: flex;
    }

    .nav-more {
        display: contents;
    }

    .nav-more-trigger {
        display: none;
    }

    .nav-more-menu {
        position: static;
        display: contents;
        min-width: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
        background: transparent;
    }

    .header .nav .nav-link,
    .header .nav .admin-header-chat-link,
    .header .nav .nav-more-link {
        justify-content: flex-start;
        width: 100%;
        min-width: 0;
        min-height: 42px;
        padding: 10px 6px;
        border-radius: 0;
        border-color: transparent;
        border-bottom: 1px solid rgba(31,111,109,0.10);
        background: transparent;
        color: #174746;
        box-shadow: none;
        font-size: 14px;
    }

    .header .nav .nav-link:hover,
    .header .nav .nav-link.is-active,
    .header .nav .admin-header-chat-link:hover,
    .header .nav .admin-header-chat-link.is-active {
        background: #FFF7EB;
        border-color: transparent;
        border-bottom-color: rgba(31,111,109,0.10);
        color: #1F6F6D;
        box-shadow: none;
    }

    .header .nav .admin-header-chat-text {
        position: static;
        width: auto;
        height: auto;
        margin: 0;
        overflow: visible;
        clip: auto;
        white-space: nowrap;
        font-size: 14px;
    }

    .header .nav .admin-header-chat-icon {
        width: 20px;
        text-align: center;
        margin-right: 7px;
    }

    .header .nav .admin-header-chat-badge {
        position: static;
        margin-left: auto;
        transform: none;
    }

    .header .nav a.is-active::after {
        left: 6px;
        right: auto;
        bottom: 5px;
        width: 34px;
    }
}

@media (max-width: 520px) {
    .header-inner {
        padding: 8px 10px;
    }

    .header .logo img {
        height: 50px;
    }

    .header select {
        max-width: 74px;
    }
}

/* Robust closed state for the desktop "More" menu. */
@media (min-width: 1101px) {
    .header .nav .nav-more {
        position: relative !important;
        display: inline-flex;
    }

    .header .nav .nav-more-menu {
        position: absolute;
        top: 100%;
        right: 0;
        z-index: 9999;
        display: none !important;
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        margin-top: 8px;
    }

    .header .nav .nav-more:hover > .nav-more-menu,
    .header .nav .nav-more:focus-within > .nav-more-menu,
    .header .nav .nav-more.is-open > .nav-more-menu {
        display: grid !important;
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 1100px) {
    .header .nav:not(.is-open) .nav-more-menu {
        display: none !important;
    }

    .header .nav.is-open .nav-more-menu {
        display: contents;
    }
}

.club-request-panel {
    max-width: 920px;
}

.club-request-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.club-request-form label {
    display: grid;
    gap: 7px;
    color: #33423f;
    font-weight: 700;
}

.club-request-form input,
.club-request-form textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid #d6e2df;
    border-radius: 8px;
    padding: 10px 12px;
    font: inherit;
    background: #fff;
}

.club-request-form textarea {
    min-height: 150px;
    resize: vertical;
}

.club-request-form .span-2 {
    grid-column: 1 / -1;
}

.club-request-confirm {
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 10px;
    padding: 12px;
    border: 1px solid #dfe9e6;
    border-radius: 8px;
    background: #f7faf9;
}

.club-request-confirm input {
    width: auto;
    min-height: 0;
    margin-top: 3px;
}

.club-request-actions {
    display: flex;
    justify-content: flex-end;
}

.club-request-honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

@media (max-width: 720px) {
    .club-request-form {
        grid-template-columns: 1fr;
    }

    .club-request-actions {
        justify-content: stretch;
    }
}
