:root {
    --brand: #1e5bc4;
    --brand-mid: #2563eb;
    --brand-dark: #102a61;
    --hero-deep: #0b1f52;
    --bg: #e8eef9;
    --text: #0f172a;
    --muted: #51627a;
    --card: #ffffff;
    --border: #c9d9f5;
    --danger: #b42318;
    --success: #0f5132;
    --radius: 12px;
    --shadow: 0 14px 40px rgba(15, 50, 120, 0.12);
    --font-stack: "Open Sans", "Helvetica Neue", Helvetica, Arial, ui-sans-serif, system-ui, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-stack);
    font-size: 16px;
    line-height: 1.65;
    color: var(--text);
    background:
        radial-gradient(ellipse 100% 80% at 50% -20%, rgba(37, 99, 235, 0.18), transparent 55%),
        linear-gradient(180deg, #dbe7fc 0%, var(--bg) 38%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.page-home .site-main {
    padding-top: 0;
}

a {
    color: var(--brand);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.visually-hidden {
    position: absolute;
    clip: rect(0 0 0 0);
    width: 1px;
    height: 1px;
    margin: -1px;
}

.site-header {
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.shell {
    width: min(1080px, 100% - 32px);
    margin: 0 auto;
}

/* Public header: logo | menu (centered) | language (+ sandwich on small screens) */
.site-header-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-areas: "brand nav tools";
    align-items: center;
    gap: 12px 20px;
    padding: 12px 0 16px;
}

.header-brand {
    grid-area: brand;
    justify-self: start;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.header-nav {
    grid-area: nav;
    justify-self: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 14px;
    padding: 0;
    border: none;
    min-width: 0;
}

.header-tools {
    grid-area: tools;
    justify-self: end;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.header-lang {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.nav-sandwich {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
    line-height: 0;
    outline-offset: 3px;
}

.nav-sandwich:hover {
    border-color: rgba(30, 91, 196, 0.35);
}

.nav-sandwich-icon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 20px;
}

.nav-sandwich-icon span {
    display: block;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-header-bar.is-nav-open .nav-sandwich-icon span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.site-header-bar.is-nav-open .nav-sandwich-icon span:nth-child(2) {
    opacity: 0;
}

.site-header-bar.is-nav-open .nav-sandwich-icon span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (prefers-reduced-motion: reduce) {
    .nav-sandwich-icon span {
        transition: none;
    }
}

@media (max-width: 720px) {
    .site-header-bar {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "brand tools"
            "nav nav";
        align-items: center;
        gap: 10px 12px;
        padding: 10px 0 12px;
    }

    .header-brand {
        justify-self: start;
        text-align: start;
    }

    .header-nav {
        display: none;
        justify-self: stretch;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 4px;
        padding: 10px 0 4px;
        margin-top: 2px;
        border-top: 1px solid var(--border);
    }

    .site-header-bar.is-nav-open .header-nav {
        display: flex;
    }

    .header-nav .nav-link {
        justify-content: center;
        text-align: center;
    }

    .header-tools {
        justify-self: end;
    }

    .nav-sandwich {
        display: inline-flex;
    }

    body.is-mobile-nav-open {
        overflow: hidden;
    }
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 0;
}

.brand-logo-link {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    line-height: 0;
    outline-offset: 3px;
    border-radius: 8px;
}

.brand-logo-link:hover {
    opacity: 0.92;
    text-decoration: none;
}

.brand-logo-img {
    display: block;
    height: clamp(50px, 11vw, 67px);
    width: auto;
    max-width: min(346px, 54vw);
    object-fit: contain;
}

.admin-brand-logo-img {
    height: 88px;
    max-width: 480px;
}

.site-title-small {
    font-weight: 600;
    color: var(--text);
}

.lang-switch {
    display: inline-flex;
    gap: 6px;
}

.lang-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--text);
}

.lang-flag {
    width: 1.35rem;
    height: auto;
    flex-shrink: 0;
    display: block;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
    object-fit: cover;
}

.lang-chip-label {
    line-height: 1.2;
}

.lang-chip[aria-current="true"] {
    border-color: var(--brand);
    color: var(--brand-dark);
}

.nav:not(.header-nav) {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    padding: 4px 0 14px;
    border-top: 1px solid var(--border);
}

.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 10px;
    color: var(--text);
}

.nav-link[aria-current="page"] {
    background: rgba(30, 91, 196, 0.12);
    color: var(--brand-dark);
    font-weight: 600;
}

main.site-main {
    flex: 1;
    padding: 28px 0 52px;
}

.home-flash-wrap {
    padding-top: 14px;
    margin-bottom: -6px;
    position: relative;
    z-index: 5;
}

/* —— Landing hero (home) —— */
.home-hero {
    position: relative;
    padding: clamp(36px, 8vw, 72px) 0 clamp(52px, 10vw, 88px);
    background:
        radial-gradient(circle at 85% 20%, rgba(96, 165, 250, 0.35), transparent 42%),
        radial-gradient(circle at 10% 60%, rgba(30, 64, 175, 0.45), transparent 48%),
        linear-gradient(135deg, var(--hero-deep) 0%, var(--brand-dark) 42%, var(--brand) 92%);
    color: #eef4ff;
    margin-bottom: 0;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}

/* Hero uses .shell like header/nav so title and menu share the same horizontal alignment */
.home-hero-inner.shell {
    max-width: none;
}

.hero-title {
    margin: 0 0 14px;
    font-size: clamp(28px, 4.6vw, 44px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.025em;
    text-wrap: balance;
}

.hero-lead {
    margin: 0 0 26px;
    font-size: clamp(15px, 2.4vw, 18px);
    line-height: 1.65;
    color: rgba(238, 244, 255, 0.88);
    max-width: 56ch;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-actions .button {
    padding: 11px 20px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
}

.button-white {
    background: #ffffff;
    color: var(--brand-dark) !important;
    box-shadow: 0 12px 32px rgba(0, 0, 40, 0.2);
}

.button-white:hover {
    filter: brightness(1.04);
}

.button-ghost {
    background: transparent;
    color: #fff !important;
    border: 2px solid rgba(255, 255, 255, 0.45);
}

.button-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

/* Services grid */
.section-title {
    margin: 28px 0 8px;
    font-size: clamp(22px, 3.2vw, 28px);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--brand-dark);
}

.section-lead {
    margin: 0 0 22px;
    color: var(--muted);
    max-width: 62ch;
    font-size: 15px;
}

.home-service-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    margin-bottom: 8px;
}

.home-service-card {
    border-radius: var(--radius);
    padding: 20px 20px 20px;
    background: linear-gradient(145deg, #ffffff 0%, #f2f7ff 100%);
    border: 1px solid rgba(30, 91, 196, 0.15);
    box-shadow: 0 8px 24px rgba(15, 50, 120, 0.06);
    position: relative;
    overflow: hidden;
}

.home-service-card::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 18px;
    bottom: 18px;
    width: 3px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--brand), var(--brand-mid));
}

html[dir='rtl'] .home-service-card::before {
    inset-inline-start: auto;
    inset-inline-end: 0;
}

.home-service-card h3 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--brand-dark);
}

.home-service-card p {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
    line-height: 1.55;
}

.home-service-icon {
    display: block;
    width: 40px;
    height: 40px;
    margin-bottom: 12px;
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.12);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.2);
    position: relative;
}

.home-service-icon::after {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 6px;
    background: var(--brand-mid);
    opacity: 0.25;
}

.home-service-icon-1::after {
    clip-path: polygon(20% 0, 80% 0, 100% 100%, 0 100%);
}
.home-service-icon-2::after {
    clip-path: circle(35% at 50% 50%);
}
.home-service-icon-3::after {
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.home-service-icon-4::after {
    border-radius: 50%;
    clip-path: none;
}

.home-about.intro {
    margin-top: 32px;
    margin-bottom: 8px;
}

.intro-heading {
    margin-top: 0;
    margin-bottom: 14px;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--brand-dark);
}

/* IPO listing cards — badges */
.ipo-card-head {
    display: grid;
    gap: 10px;
    margin-bottom: 6px;
}

.ipo-badge {
    justify-self: start;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ipo-badge-live {
    background: rgba(37, 99, 235, 0.12);
    color: var(--brand);
    border: 1px solid rgba(37, 99, 235, 0.28);
}

.ipo-badge-muted {
    background: #edf1f8;
    color: var(--muted);
    border: 1px solid var(--border);
}

html[dir='rtl'] .ipo-badge {
    text-transform: none;
}

.ipo-card-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
}

.ipo-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ipo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(15, 50, 120, 0.12);
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 22px;
    box-shadow: var(--shadow);
}

.card + .card {
    margin-top: 18px;
}

/* IPO listing — stacked list (single column) */
.ipo-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* List layout uses gap — no stacked .card sibling margins */
.ipo-list > .ipo-card + .ipo-card {
    margin-top: 0;
}

.ipo-list > .ipo-card {
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
}

.ipo-card-list .ipo-card-title {
    margin: 0 0 10px;
}

.ipo-excerpt {
    margin: 0 0 4px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--muted);
}

.ipo-card .ipo-actions.ipo-actions-list {
    margin-top: 14px;
    padding-top: 0;
    flex-shrink: 0;
}

.page-title {
    margin: 0 0 10px;
    font-size: clamp(26px, 4vw, 34px);
    letter-spacing: -0.03em;
}

.form-page-alerts {
    margin: 0 0 18px;
}

.form-page-alerts .alert:last-child {
    margin-bottom: 0;
}

.lead-muted {
    color: var(--muted);
    margin: 0;
}

.intro p {
    margin: 14px 0 0;
    color: #304257;
}

.grid {
    display: grid;
    gap: 16px;
}

/* Admin dashboard: two stat blocks per row */
.admin-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 20px;
    align-items: stretch;
}

.admin-dashboard-grid > .card {
    margin: 0;
}

.admin-dashboard-grid > .card + .card {
    margin-top: 0;
}

.admin-stat-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 20px 22px 22px;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(15, 35, 80, 0.08);
}

.admin-stat-title {
    margin: 0 0 10px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--muted);
}

.admin-stat-value {
    margin: 0;
    font-size: clamp(28px, 4.5vw, 40px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--brand-dark);
}

.admin-stat-foot {
    margin-top: auto;
    padding-top: 16px;
    margin-bottom: 0;
}

@media (max-width: 720px) {
    .admin-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .admin-stat-card {
        padding: 16px 16px 18px;
    }
}

/* Narrow screens: payment-links table — readable columns without forcing page width */
@media (max-width: 900px) {
    table.admin-links-table {
        min-width: 640px;
    }

    table.admin-links-table.admin-ipos-dir-table {
        min-width: 880px;
    }
}

.ipo-meta {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 10px;
}

.ipo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

/* IPO detail: description + CTA share the same left/right edge as .page-title (default .card padding would inset text) */
.ipo-detail-page > .card {
    padding-inline: 0;
}

.ipo-detail-page > .card + .card {
    margin-top: 14px;
}

.ipo-detail-prose {
    margin: 0;
    font-size: 16px;
    line-height: 1.65;
    color: var(--text);
    max-width: 72ch;
}

.ipo-detail-actions {
    box-shadow: none;
}

.ipo-detail-back-nav {
    margin: 0 0 14px;
}

.ipo-detail-back-link {
    display: inline-flex;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 10px 14px;
    border: none;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
}

.button-primary {
    background: linear-gradient(135deg, var(--brand-mid), var(--brand-dark));
    color: #fff !important;
    box-shadow: 0 14px 30px rgba(30, 64, 175, 0.28);
}

.button-primary:hover {
    filter: brightness(1.06);
}

.button-muted {
    background: rgba(37, 99, 235, 0.1);
    color: var(--brand-dark);
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.forms .field {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.label {
    font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
textarea,
select {
    border: 1px solid var(--border);
    padding: 10px 12px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 15px;
    background: #fbfcff;
    width: 100%;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.site-footer {
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.7);
}

.footer-shell {
    width: min(1080px, 100% - 32px);
    margin: 0 auto;
    padding: 16px 0;
}

.footer-muted {
    color: var(--muted);
    margin: 0;
    font-size: 14px;
    text-align: center;
}

.alert {
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 18px;
    border: 1px solid transparent;
}

.alert-danger {
    background: rgba(180, 35, 24, 0.08);
    border-color: rgba(180, 35, 24, 0.25);
    color: var(--danger);
}

.alert-success {
    background: rgba(15, 81, 50, 0.08);
    border-color: rgba(15, 81, 50, 0.25);
    color: var(--success);
}

.muted-banner {
    color: var(--muted);
}

.captcha-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.captcha-refresh-icon {
    display: inline-block;
    font-size: 1.1em;
    line-height: 1;
    transform: translateY(0.05em);
}

/* Contact: math prompt + Refresh + answer on one horizontal row */
body.page-contact .contact-captcha-fieldset {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
}

body.page-contact .contact-captcha-fieldset > legend {
    padding: 0;
    margin-bottom: 8px;
}

body.page-contact .contact-captcha-oneline {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px 12px;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
}

body.page-contact .contact-captcha-oneline .captcha-head-inline {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px 12px;
    flex: 0 0 auto;
    margin: 0;
    min-width: 0;
}

body.page-contact .contact-captcha-oneline .captcha-head-inline .muted-banner {
    margin: 0;
    white-space: nowrap;
}

body.page-contact .contact-captcha-oneline .captcha-refresh-inline {
    flex-shrink: 0;
}

body.page-contact .contact-captcha-oneline #contact_captcha {
    width: 5.5rem;
    min-width: 4.75rem;
    max-width: 100%;
    flex: 0 0 auto;
    box-sizing: border-box;
}

.how-steps h2:first-child {
    margin-top: 0;
}

.subscribe-ipsub {
    font-weight: 600;
    color: var(--brand-dark);
    font-size: clamp(18px, 2.8vw, 22px);
    margin: -4px 0 12px;
    line-height: 1.4;
}

.subscribe-ipo-overview {
    margin: 0 0 24px;
    padding-bottom: 4px;
    font-size: 15px;
    line-height: 1.72;
    color: #394a60;
    overflow-wrap: break-word;
}

/* —— IPO subscription page (reference layout) —— */
body.page-subscribe {
    background: linear-gradient(180deg, #e2e6f5 0%, #ebe7f4 42%, #e8eef9 100%);
}

body.page-subscribe .site-main {
    padding-top: 28px;
    padding-bottom: 52px;
}

.page-subscribe .page-title {
    color: #0a1530;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.page-subscribe .subscribe-ipsub {
    color: #0a1530;
    font-weight: 700;
    font-size: clamp(17px, 2.2vw, 21px);
    margin: -2px 0 14px;
}

.page-subscribe .subscribe-ipo-overview {
    color: #5a6578;
    max-width: min(1020px, 100%);
    width: 100%;
    margin-inline: 0;
    margin-bottom: 22px;
    box-sizing: border-box;
}

.page-subscribe .subscribe-sheet-layout {
    margin-top: 4px;
}

.page-subscribe .subscribe-form-card,
.page-subscribe .subscribe-pick-ipo.subscribe-block {
    border-radius: 20px;
    padding: clamp(24px, 4.5vw, 38px);
    border: 1px solid rgba(30, 91, 196, 0.14);
    box-shadow: 0 22px 55px rgba(25, 35, 72, 0.1);
    background: #fff;
}

.page-subscribe .subscribe-form-stack {
    gap: 22px;
}

.page-subscribe .subscribe-field-aligned .label {
    color: #1a2533;
    font-weight: 600;
}

.page-subscribe .subscribe-field-aligned input[type='text'],
.page-subscribe .subscribe-field-aligned select {
    min-height: 46px;
    border-radius: 8px;
    border: 1px solid #cfd6e6;
    background: #fafbff;
    padding: 10px 14px;
}

.page-subscribe .subscribe-captcha-inner {
    min-width: 0;
}

.page-subscribe .subscribe-captcha-inner .captcha-head-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-bottom: 2px;
}

.page-subscribe .subscribe-captcha-inner .captcha-head-inline .muted-banner {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
}

.page-subscribe .subscribe-captcha-inner .captcha-refresh-inline {
    flex-shrink: 0;
}

.page-subscribe #sub_captcha {
    min-height: 46px;
    border-radius: 8px;
    border: 1px solid #cfd6e6;
    background: #fafbff;
    padding: 10px 14px;
    margin-top: 12px;
    max-width: min(280px, 100%);
    width: 100%;
}

.page-subscribe .subscribe-terms-cell .checkbox-line {
    margin: 0;
    align-items: center;
}

.page-subscribe .subscribe-terms-cell .checkbox-line input[type='checkbox'] {
    margin-top: 0;
}

.page-subscribe .subscribe-terms-row .label {
    margin-top: 0.35rem;
}

.page-subscribe .subscribe-actions {
    margin-top: 4px;
    padding-top: 12px;
}

.page-subscribe .subscribe-actions .button-primary {
    min-width: 148px;
    border-radius: 10px;
    padding: 12px 28px;
    font-weight: 700;
}

.checkbox-line {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-weight: 500;
}

.checkbox-line input[type='checkbox'] {
    width: 20px;
    height: 20px;
    margin-top: 3px;
    flex-shrink: 0;
}

.subscribe-sheet {
    max-width: min(1020px, 100%);
    margin-inline: 0;
}

.subscribe-block.forms {
    width: 100%;
}

.subscribe-form-stack {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3);
}

.subscribe-field-aligned {
    display: grid;
    gap: var(--spacing-2);
}

@media (min-width: 640px) {
    .subscribe-field-aligned:not(.subscribe-terms-row) {
        grid-template-columns: minmax(140px, 200px) 1fr;
        align-items: start;
        column-gap: var(--spacing-4);
        row-gap: var(--spacing-2);
    }

    .page-subscribe .subscribe-field-aligned {
        grid-template-columns: minmax(160px, 220px) 1fr;
        align-items: start;
        column-gap: 1.35rem;
        row-gap: 0.35rem;
    }

    .page-subscribe .subscribe-field-aligned .label {
        margin-top: 0.5rem;
    }
}
.subscribe-field-aligned .checkbox-line .label {
    margin-top: 0;
}

.input-wide,
.subscribe-field-aligned input[type='text']:not(#sub_captcha),
.subscribe-field-aligned select {
    width: 100%;
    max-width: 440px;
    box-sizing: border-box;
}

.page-subscribe .input-wide,
.page-subscribe .subscribe-field-aligned input[type='text']:not(#sub_captcha),
.page-subscribe .subscribe-field-aligned select {
    max-width: none;
}

.subscribe-captcha-block {
    margin-top: var(--spacing-2);
}

fieldset.subscribe-captcha-fieldset {
    border: 1px dashed var(--ring);
    border-radius: var(--radius-sm);
    padding: var(--spacing-3);
    margin: 0;
    max-width: 440px;
    box-sizing: border-box;
}

fieldset.subscribe-captcha-fieldset legend {
    padding-inline: 4px;
    margin-inline-end: 12px;
}

.subscribe-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: var(--spacing-2);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

html[dir='rtl'] .subscribe-actions {
    justify-content: flex-end;
}

/* Admin / sheet tables — column fit without overflow breaking layout */
table.sheet-table {
    width: 100%;
    table-layout: fixed;
    word-wrap: break-word;
}

table.sheet-table th,
table.sheet-table td {
    vertical-align: top;
    overflow-wrap: anywhere;
    word-break: break-word;
}

table.sheet-table .col-pay-url {
    width: 40%;
}

/* Admin IPO list (`section=ipos`) — shares payment-links chrome */
section.admin-ipo-directory {
    position: relative;
}

.admin-links-th-ipo-title {
    width: 18%;
    min-width: 5.5rem;
}

.admin-links-th-ipo-dates {
    width: 10.5rem;
}

.admin-links-th-ipo-status {
    width: 5rem;
}

.admin-icon-btn.admin-icon-btn-edit {
    border: 1px solid rgba(30, 64, 175, 0.35);
    background: #fff;
    color: var(--brand-mid);
    text-decoration: none;
}

.admin-icon-btn.admin-icon-btn-edit:hover {
    background: #f1f5ff;
    color: var(--brand-dark);
    text-decoration: none;
    filter: none;
}

/* Admin IPO edit — payment links table (reference layout) */
section.admin-payment-links {
    position: relative;
}

.admin-payment-links-title {
    margin: 0 0 6px;
    font-size: clamp(1.25rem, 2.2vw, 1.45rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--brand-dark);
}

.admin-payment-links-lead {
    margin-bottom: 14px;
}

.admin-link-status-forms {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.admin-links-table-wrap {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    background: var(--card);
    box-shadow: var(--shadow);
}

table.admin-links-table {
    width: 100%;
    margin: 0;
    font-size: 14px;
    border-collapse: collapse;
    table-layout: fixed;
}

.admin-links-table thead th {
    background: #f1f4fb;
    color: var(--brand-dark);
    font-weight: 700;
    font-size: 13px;
    text-align: start;
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.admin-links-table thead th.admin-links-th-icon {
    text-align: center;
}

.admin-links-table tbody td {
    padding: 12px 10px;
    border-bottom: 1px solid #e8ecf3;
    vertical-align: middle;
}

.admin-links-tr:last-child td {
    border-bottom: none;
}

.admin-links-th-id {
    width: 3.25rem;
}

.admin-links-th-value {
    width: 6.25rem;
}

.admin-links-th-url {
    width: 36%;
}

.admin-links-th-status {
    width: 5.5rem;
}

.admin-links-th-actions {
    width: 8.75rem;
}

.admin-links-th-icon {
    width: 3.25rem;
}

.admin-links-url {
    color: var(--brand);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
    word-break: break-all;
}

.admin-links-url:hover {
    color: var(--brand-dark);
}

.admin-link-status-select {
    width: 100%;
    max-width: 10.5rem;
    min-height: 40px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font: inherit;
    font-size: 14px;
    background: #fbfcff;
    color: var(--text);
    box-sizing: border-box;
}

.admin-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 8px;
    cursor: pointer;
    line-height: 0;
    box-sizing: border-box;
}

.admin-icon-btn-save {
    border: 1px solid rgba(30, 64, 175, 0.35);
    background: linear-gradient(135deg, var(--brand-mid), var(--brand-dark));
    color: #fff;
}

.admin-icon-btn-save:hover {
    filter: brightness(1.05);
}

.admin-icon-btn-delete {
    border: 1px solid #f87171;
    background: #fff;
    color: #b91c1c;
}

.admin-icon-btn-delete:hover {
    background: #fff5f5;
}

.admin-link-delete-form {
    display: inline;
    margin: 0;
}

.admin-links-td-icon {
    text-align: center;
}

.admin-add-link-title {
    margin: 22px 0 12px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--brand-dark);
}

.admin-add-link-actions {
    margin: 6px 0 0;
}

/* Terms modal + full-page content */
.link-like-button {
    appearance: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    font-weight: 600;
    color: var(--brand);
    text-decoration: underline;
    cursor: pointer;
    vertical-align: baseline;
    white-space: normal;
}

.link-like-button:hover {
    color: var(--brand-dark);
}

.link-like-button:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.terms-dialog {
    padding: 0;
    margin: auto;
    max-width: min(640px, 94vw);
    border: none;
    border-radius: var(--radius);
    background: transparent;
    box-shadow: none;
}

.terms-dialog::backdrop {
    background: rgba(10, 20, 40, 0.45);
}

.terms-dialog-panel {
    margin: 0;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.terms-dialog-header {
    flex-shrink: 0;
}

.terms-dialog-title {
    margin: 0 0 12px;
    font-size: 1.25rem;
}

.terms-dialog-scroll {
    overflow: auto;
    flex: 1;
    padding: 8px 0 12px;
    max-height: min(52vh, 420px);
}

.terms-dialog-footer {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.prose-terms,
.prose-terms.full {
    font-size: 0.965rem;
    line-height: 1.65;
}

.terms-full-page {
    padding: 18px 20px;
}
