:root {
    --tg-petition-text: #202124;
    --tg-petition-muted: #6b7280;
    --tg-petition-border: #e5e7eb;
    --tg-petition-bg: #ffffff;
    --tg-petition-soft: #f7f7f8;
    --tg-petition-accent: #1f5f4a;
    --tg-petition-radius: 18px;
    --tg-petition-shadow: 0 20px 55px rgba(0,0,0,.10);
}

body.tg-petition-page { margin: 0; background: var(--tg-petition-bg); color: var(--tg-petition-text); }
.tg-petition-shell { min-height: 100vh; background: var(--tg-petition-bg); color: var(--tg-petition-text); }
.tg-petition-brandbar { max-width: 1440px; margin: 0 auto; min-height: 76px; padding: 12px 28px; display: flex; align-items: center; justify-content: space-between; gap: 24px; box-sizing: border-box; }
.tg-petition-brand { color: inherit; text-decoration: none; font-weight: 700; }
.tg-petition-brand .custom-logo-link { display: inline-flex; }
.tg-petition-brand img { max-height: 50px; width: auto; }
.tg-petition-back { color: inherit; text-decoration: none; font-size: 14px; }

.tg-petition { max-width: 1440px; margin: 0 auto; padding: 0 28px 56px; box-sizing: border-box; }
.tg-petition-hero { position: relative; min-height: 470px; border-radius: 24px; overflow: hidden; background: #30343a; display: flex; align-items: flex-end; }
.tg-petition-hero.has-image { background-image: var(--tg-petition-image); background-position: center; background-size: cover; }
.tg-petition-hero-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.08) 22%, rgba(0,0,0,.78) 100%); }
.tg-petition-hero-inner { position: relative; z-index: 1; width: min(880px, 100%); padding: 54px 48px; color: #fff; }
.tg-petition-kicker { display: inline-block; margin-bottom: 14px; padding: 7px 12px; border-radius: 999px; background: rgba(255,255,255,.16); font-size: 13px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.tg-petition-hero h1 { margin: 0; color: #fff; font-size: clamp(38px, 5vw, 68px); line-height: 1.02; letter-spacing: -.035em; }

.tg-petition-layout { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 52px; align-items: start; max-width: 1240px; margin: 0 auto; }
.tg-petition-content { padding: 54px 0 0; font-size: 18px; line-height: 1.75; }
.tg-petition-content > *:first-child { margin-top: 0; }
.tg-petition-content h2 { margin-top: 1.8em; font-size: clamp(30px, 4vw, 44px); line-height: 1.1; letter-spacing: -.025em; }
.tg-petition-content h3 { margin-top: 1.6em; font-size: 26px; }
.tg-petition-content img { max-width: 100%; height: auto; border-radius: 12px; }
.tg-petition-sidebar { position: relative; margin-top: -145px; z-index: 4; }
.tg-petition-card { position: sticky; top: 24px; background: #fff; border: 1px solid var(--tg-petition-border); border-radius: var(--tg-petition-radius); box-shadow: var(--tg-petition-shadow); padding: 30px; }
.tg-petition-counter { padding-bottom: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--tg-petition-border); text-align: center; }
.tg-petition-count { display: block; font-size: 48px; line-height: 1; letter-spacing: -.04em; }
.tg-petition-counter > span { display: block; margin-top: 8px; color: var(--tg-petition-muted); }
.tg-petition-progress { height: 8px; margin: 16px 0 8px; border-radius: 999px; overflow: hidden; background: var(--tg-petition-border); }
.tg-petition-progress span { display: block; height: 100%; background: var(--tg-petition-accent); }
.tg-petition-card h2 { margin: 0 0 22px; font-size: 26px; line-height: 1.15; }
.tg-petition-form label:not(.tg-check) { display: block; margin-bottom: 16px; font-size: 14px; font-weight: 600; }
.tg-petition-form input[type="text"], .tg-petition-form input[type="email"] { width: 100%; box-sizing: border-box; margin-top: 7px; min-height: 48px; border: 1px solid #aeb3ba; border-radius: 9px; padding: 10px 12px; font: inherit; background: #fff; }
.tg-petition-form input:focus { outline: 2px solid color-mix(in srgb, var(--tg-petition-accent) 32%, transparent); border-color: var(--tg-petition-accent); }
.tg-check { display: flex; align-items: flex-start; gap: 10px; margin: 18px 0; font-size: 13px; line-height: 1.45; font-weight: 400; }
.tg-check input { margin-top: 3px; }
.tg-petition-form button, .tg-copy-link { width: 100%; min-height: 52px; border: 0; border-radius: 10px; background: var(--tg-petition-accent); color: #fff; padding: 12px 18px; font: inherit; font-weight: 700; cursor: pointer; }
.tg-petition-form button:disabled { opacity: .6; cursor: progress; }
.tg-petition-privacy { margin: 14px 0 0; color: var(--tg-petition-muted); font-size: 12px; line-height: 1.45; }
.tg-petition-message { margin-top: 12px; color: #9b1c1c; font-size: 14px; }
.tg-hp { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
.tg-petition-success { text-align: center; }
.tg-petition-success-icon { width: 58px; height: 58px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 50%; background: #e6f4ed; color: var(--tg-petition-accent); font-size: 30px; font-weight: 700; }
.tg-copy-status { margin-top: 10px; font-size: 13px; color: var(--tg-petition-muted); }
.tg-petition-closed { text-align: center; }

.tg-petition-public-signers { margin-top: 56px; padding-top: 38px; border-top: 1px solid var(--tg-petition-border); }
.tg-petition-signers-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin-top: 20px; }
.tg-petition-signer { padding: 14px 16px; border: 1px solid var(--tg-petition-border); border-radius: 12px; background: var(--tg-petition-soft); }
.tg-petition-signer strong, .tg-petition-signer span { display: block; }
.tg-petition-signer span { margin-top: 2px; color: var(--tg-petition-muted); font-size: 13px; }
.tg-petition-footer { max-width: 1240px; margin: 20px auto 0; padding: 28px; display: flex; gap: 18px; justify-content: space-between; border-top: 1px solid var(--tg-petition-border); font-size: 13px; color: var(--tg-petition-muted); box-sizing: border-box; }
.tg-petition-footer a { color: inherit; }

@media (max-width: 980px) {
    .tg-petition { padding-inline: 18px; }
    .tg-petition-brandbar { padding-inline: 18px; }
    .tg-petition-hero { min-height: 390px; }
    .tg-petition-hero-inner { padding: 38px 26px; }
    .tg-petition-layout { grid-template-columns: 1fr; gap: 0; }
    .tg-petition-sidebar { grid-row: 1; margin-top: -42px; padding: 0 14px; }
    .tg-petition-card { position: relative; top: auto; }
    .tg-petition-content { padding-top: 42px; }
}

@media (max-width: 620px) {
    .tg-petition-brandbar { min-height: 64px; }
    .tg-petition-brand img { max-height: 40px; }
    .tg-petition-back { font-size: 12px; }
    .tg-petition-hero { min-height: 320px; border-radius: 16px; }
    .tg-petition-hero-inner { padding: 30px 20px; }
    .tg-petition-hero h1 { font-size: 38px; }
    .tg-petition-sidebar { padding: 0 8px; margin-top: -26px; }
    .tg-petition-card { padding: 22px; }
    .tg-petition-content { font-size: 17px; }
    .tg-petition-signers-grid { grid-template-columns: 1fr; }
    .tg-petition-footer { flex-direction: column; }
}


/* Petition pages use their own minimal shell. Hide globally injected Readabler controls. */
body.tg-petition-page [class*="readabler"],
body.tg-petition-page [id*="readabler"] { display: none !important; }
body.tg-petition-page .tg-check a { color: inherit; text-decoration: underline; }
