@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=Noto+Sans+Sinhala:wght@400;500;600;700&display=swap');

:root {
    --ink: #17231f;
    --ink-soft: #45524c;
    --bg: #f6f2e7;
    --bg-card: #ffffff;
    --teal: #0e4d44;
    --teal-dark: #0a3730;
    --gold: #d9a441;
    --gold-dark: #b9852a;
    --maroon: #7a1f3d;
    --line: #ddd3bd;
    --danger: #a3272c;
    --radius: 10px;
    --shadow: 0 2px 10px rgba(23, 35, 31, 0.08);
    --shadow-lg: 0 12px 32px rgba(23, 35, 31, 0.14);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Inter', 'Noto Sans Sinhala', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.55;
}

h1, h2, h3, h4, .logo {
    font-family: 'Fraunces', 'Noto Sans Sinhala', Georgia, serif;
    font-weight: 600;
    line-height: 1.15;
    margin: 0 0 0.5em;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Signature motif: a woven Dumbara-mat inspired stripe, used sparingly --- */
.woven-strip {
    height: 6px;
    background: repeating-linear-gradient(
        135deg,
        var(--gold) 0px, var(--gold) 10px,
        var(--maroon) 10px, var(--maroon) 20px,
        var(--teal) 20px, var(--teal) 30px
    );
}

/* --- Header --- */
.site-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 50;
    transition: transform 0.25s ease;
}
.site-header.header-hidden {
    transform: translateY(-100%);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    gap: 16px;
}
.logo {
    font-size: 1.5rem;
    color: var(--teal-dark);
    white-space: nowrap;
    position: relative;
}
.logo span { color: var(--maroon); }
.logo small { font-family: 'Inter', sans-serif; font-weight: 500; font-size: 0.9rem; color: var(--ink-soft); margin-left: 2px; }

.main-nav { display: flex; align-items: center; gap: 22px; }
.main-nav a { color: var(--ink); font-weight: 500; font-size: 0.95rem; }
.main-nav a:hover { color: var(--teal); text-decoration: none; }

.nav-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--ink); }

.nav-user { position: relative; font-weight: 600; }
.nav-user-toggle {
    background: none; border: none; cursor: pointer; font: inherit; color: var(--ink);
    padding: 0; display: inline-flex; align-items: center; gap: 4px;
}
.nav-user-caret { font-size: 0.65em; transition: transform 0.15s ease; }
.nav-user.open .nav-user-caret { transform: rotate(180deg); }
.nav-user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 130%;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 190px;
    padding: 8px;
    z-index: 60;
}
.nav-user.open .nav-user-dropdown { display: block; }
.nav-user-dropdown a { display: block; padding: 8px 10px; border-radius: 6px; font-weight: 500; color: var(--ink); }
.nav-user-dropdown a:hover { background: var(--bg); text-decoration: none; }

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 12px 22px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 2px solid transparent;
    cursor: pointer;
    text-align: center;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: var(--gold-dark); }
.btn-outline { background: transparent; border-color: var(--teal); color: var(--teal); }
.btn-outline:hover { background: var(--teal); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-block { display: block; width: 100%; }

/* --- Messages --- */
.messages { margin-top: 16px; }
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 10px; font-weight: 500; border: 1px solid transparent; }
.alert-success { background: #e7f3ee; color: var(--teal-dark); border-color: #bfe0d1; }
.alert-error, .alert-danger { background: #fbe9e9; color: var(--danger); border-color: #f0c3c3; }
.alert-info { background: #eef3fb; color: #2a4a7a; border-color: #cddcf2; }
.alert-warning { background: #fdf3e0; color: #7a5a10; border-color: #f0dba8; }

/* --- Hero --- */
.hero {
    background: linear-gradient(180deg, var(--teal-dark), var(--teal));
    color: #fff;
    padding: 64px 0 56px;
}
.hero .container { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 2.6rem; color: #fff; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero p { color: #e3ece9; font-size: 1.05rem; max-width: 46ch; }
.hero-actions { display: flex; gap: 14px; margin-top: 26px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 30px; margin-top: 34px; }
.hero-stats div { }
.hero-stats strong { display: block; font-family: 'Fraunces', serif; font-size: 1.8rem; color: var(--gold); }
.hero-stats span { font-size: 0.85rem; color: #cfe0da; }
.hero-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 16px;
    padding: 22px;
}
.hero-card .woven-strip { border-radius: 6px 6px 0 0; margin: -22px -22px 16px; }

/* --- Sections --- */
.section { padding: 52px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 10px; }
.section-head h2 { font-size: 1.7rem; }
.section-alt { background: var(--bg-card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* --- Petition cards --- */
.petition-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.petition-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--line);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.petition-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.petition-card-img { height: 150px; background: linear-gradient(135deg, var(--teal), var(--teal-dark)); position: relative; }
.petition-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.petition-card-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.petition-card-body a { color: var(--ink); }
.petition-card-body h3 { font-size: 1.1rem; }
.badge { display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 3px 10px; border-radius: 999px; background: var(--bg); color: var(--teal-dark); border: 1px solid var(--line); width: fit-content; }
.badge-gold { background: #fbf0da; color: var(--gold-dark); border-color: #efd9a0; }
.petition-card-meta { font-size: 0.82rem; color: var(--ink-soft); }
.petition-card-summary { font-size: 0.92rem; color: var(--ink-soft); flex: 1; }

.progress-track { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 6px 0; }
.progress-fill { height: 100%; background: var(--gold); }
.progress-label { font-size: 0.8rem; font-weight: 600; color: var(--teal-dark); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-soft); }

/* --- Forms --- */
.form-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 34px;
    max-width: 460px;
    margin: 48px auto;
    box-shadow: var(--shadow);
}
.form-card.wide { max-width: 720px; }
.form-card .woven-strip { border-radius: 6px 6px 0 0; margin: -34px -34px 24px; }
.form-eyebrow { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--maroon); }
.form-group { margin-bottom: 18px; }
label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=tel], textarea, select {
    width: 100%;
    padding: 11px 13px;
    border: 1.5px solid var(--line);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
    color: var(--ink);
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(14, 77, 68, 0.15);
}
textarea { resize: vertical; }
.help-text { font-size: 0.8rem; color: var(--ink-soft); margin-top: 4px; }
.field-errors { color: var(--danger); font-size: 0.82rem; margin-top: 4px; font-weight: 600; }
.captcha-box { background: var(--bg); border: 1.5px dashed var(--gold-dark); border-radius: 8px; padding: 14px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.captcha-box input { flex: 1; min-width: 90px; width: auto; }
.captcha-question { font-family: 'Fraunces', serif; font-size: 1.3rem; font-weight: 600; color: var(--teal-dark); white-space: nowrap; }
.captcha-refresh { background: none; border: none; cursor: pointer; font-size: 1.1rem; color: var(--teal); padding: 4px; }

/* Honeypot: visually hidden but present in the DOM for bots to fill */
.hp-field { position: absolute; left: -9999px; top: -9999px; opacity: 0; height: 0; width: 0; overflow: hidden; }

.otp-input { letter-spacing: 0.5em; font-size: 1.4rem; text-align: center; font-weight: 700; }

.step-indicator { display: flex; gap: 8px; margin-bottom: 22px; }
.step-dot { flex: 1; height: 4px; border-radius: 999px; background: var(--line); }
.step-dot.active { background: var(--gold); }
.step-dot.done { background: var(--teal); }

/* --- Petition detail --- */
.petition-detail { display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; align-items: start; }
.petition-hero-img { width: 100%; border-radius: 12px; overflow: hidden; margin-bottom: 20px; }
.petition-hero-img img { width: 100%; display: block; }
.sign-panel { background: var(--bg-card); border: 1px solid var(--line); border-radius: 14px; padding: 24px; position: sticky; top: 90px; }
.sign-panel .big-count { font-family: 'Fraunces', serif; font-size: 2.3rem; color: var(--teal-dark); }
.signature-list { list-style: none; padding: 0; margin: 16px 0 0; max-height: 320px; overflow-y: auto; }
.signature-list li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.signature-list .comment { color: var(--ink-soft); font-style: italic; }

.district-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 0.85rem; color: var(--ink-soft); }

/* --- Filters bar --- */
.filters-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.filters-bar input, .filters-bar select { width: auto; }
.filters-bar form { display: flex; flex-wrap: wrap; gap: 10px; width: 100%; }

/* --- Footer --- */
.site-footer { background: var(--teal-dark); color: #d9e5e0; padding: 46px 0 0; margin-top: 60px; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; padding-bottom: 30px; }
.site-footer h4 { color: #fff; font-family: 'Inter', sans-serif; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
.site-footer a { color: #cfe0da; display: block; margin-bottom: 8px; }
.site-footer .logo { color: #fff; }
.site-footer .logo span { color: var(--gold); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); padding: 16px 20px; font-size: 0.82rem; text-align: center; color: #a9c2ba; }

/* --- Rendered rich-text content (petition detail) --- */
.richtext-content h1, .richtext-content h2, .richtext-content h3 { color: var(--teal-dark); margin-top: 0.6em; }
.richtext-content ol, .richtext-content ul { padding-left: 22px; }
.richtext-content li { margin-bottom: 6px; }
.richtext-content blockquote {
    border-left: 3px solid var(--gold);
    margin: 12px 0;
    padding: 6px 16px;
    color: var(--ink-soft);
    font-style: italic;
    background: var(--bg);
}
.richtext-content p { margin: 0 0 12px; }

/* --- Field example text (shown under wizard labels) --- */
.field-example {
    font-size: 0.78rem;
    color: var(--ink-soft);
    background: var(--bg);
    border-left: 3px solid var(--line);
    padding: 6px 10px;
    margin-top: 6px;
    border-radius: 0 6px 6px 0;
    line-height: 1.45;
}
.field-example .eg-label { font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.68rem; color: var(--gold-dark); margin-right: 4px; }

/* --- Petition creation wizard --- */
.wizard-steps { display: flex; gap: 6px; margin-bottom: 28px; flex-wrap: wrap; }
.wizard-steps .w-step {
    flex: 1;
    min-width: 70px;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--ink-soft);
    padding-bottom: 8px;
    border-bottom: 3px solid var(--line);
}
.wizard-steps .w-step.active { color: var(--teal-dark); border-color: var(--gold); }
.wizard-steps .w-step.done { color: var(--teal); border-color: var(--teal); }

.wizard-pane { display: none; }
.wizard-pane.active { display: block; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.wizard-nav { display: flex; justify-content: space-between; margin-top: 26px; gap: 10px; }
.wizard-error { color: var(--danger); font-size: 0.85rem; font-weight: 600; margin-top: 8px; display: none; }
.wizard-error.show { display: block; }

/* --- Target rows (multi-add, up to 10) --- */
.target-row { display: flex; gap: 8px; margin-bottom: 10px; align-items: flex-start; }
.target-row input { flex: 1; }
.target-remove {
    background: none; border: 1.5px solid var(--line); color: var(--danger);
    border-radius: 8px; width: 42px; height: 42px; cursor: pointer; font-size: 1rem; flex-shrink: 0;
}
.target-remove:hover { background: #fbe9e9; }
.target-add-hint { font-size: 0.8rem; color: var(--ink-soft); margin-top: 4px; }

/* --- Rich-text editor (Quill) theming to match the site --- */
.editor-wrap .ql-toolbar {
    border: 1.5px solid var(--line);
    border-radius: 8px 8px 0 0;
    background: var(--bg);
}
.editor-wrap .ql-container {
    border: 1.5px solid var(--line);
    border-top: none;
    border-radius: 0 0 8px 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    min-height: 180px;
    background: #fff;
}
.editor-wrap .ql-editor { min-height: 180px; }

/* --- Sign petition modal --- */
.modal-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 200;
    background: rgba(23, 35, 31, 0.55);
    align-items: flex-start; justify-content: center;
    padding: 30px 16px;
    overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: #fff; border-radius: 14px; max-width: 480px; width: 100%;
    padding: 30px; position: relative; box-shadow: var(--shadow-lg);
    margin: auto;
}
.modal-close {
    position: absolute; top: 14px; right: 16px; background: none; border: none;
    font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--ink-soft);
}
.modal-close:hover { color: var(--ink); }

.sigpad-wrap { border: 1.5px solid var(--line); border-radius: 8px; overflow: hidden; background: #fcfbf7; touch-action: none; }
#sigPad { display: block; width: 100%; height: 150px; cursor: crosshair; }

.sign-warning {
    background: #fdf3e0; border: 1px solid #f0dba8; color: #7a5a10;
    border-radius: 8px; padding: 10px 12px; font-size: 0.85rem; font-weight: 600; margin-top: 14px;
}

.saved-sig-prompt {
    display: flex; gap: 14px; align-items: center; background: var(--bg);
    border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 10px; flex-wrap: wrap;
}
.saved-sig-preview { flex-shrink: 0; }
.saved-sig-preview svg { display: block; }
.saved-sig-actions { flex: 1; min-width: 180px; }
.saved-sig-actions .btn { margin-right: 6px; margin-bottom: 4px; }
.saved-sig-actions .btn.active-choice { background: var(--teal); color: #fff; border-color: var(--teal); }

/* --- Comments section controls --- */
.comments-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.comments-controls { display: flex; gap: 8px; }
.comments-controls select { width: auto; padding: 7px 10px; font-size: 0.85rem; }


.review-block { background: var(--bg); border-radius: 8px; padding: 14px 16px; margin-bottom: 14px; }
.review-block h4 { margin: 0 0 6px; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--maroon); }
.review-block ul { margin: 4px 0 0; padding-left: 18px; }

/* --- Media step: image upload + preview, video link --- */
.image-drop {
    border: 1.5px dashed var(--line);
    border-radius: 10px;
    padding: 18px;
    text-align: center;
    cursor: pointer;
    background: var(--bg);
}
.image-drop:hover { border-color: var(--gold-dark); }
.image-preview-wrap { margin-top: 12px; display: none; }
.image-preview-wrap.show { display: block; }
.image-preview-wrap img { max-width: 100%; max-height: 220px; border-radius: 10px; display: block; margin: 0 auto; }
.image-preview-meta { font-size: 0.78rem; color: var(--ink-soft); text-align: center; margin-top: 6px; }
.field-ok { color: var(--teal-dark) !important; }
.optional-tag { font-weight: 500; font-size: 0.75rem; color: var(--ink-soft); text-transform: none; letter-spacing: 0; }


/* --- Target chips (who the petition is addressed to) --- */
.target-chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.target-chip {
    display: inline-block; background: var(--bg); border: 1px solid var(--line);
    border-radius: 999px; padding: 5px 14px; font-size: 0.82rem; color: var(--teal-dark); font-weight: 500;
}

/* --- Video embed --- */
.video-embed-wrap { position: relative; padding-bottom: 56.25%; height: 0; border-radius: 10px; overflow: hidden; background: #000; }
.video-embed-wrap iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* --- Organiser card --- */
.organiser-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.organiser-card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.organiser-avatar {
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--teal); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Fraunces', serif; font-size: 1.3rem; font-weight: 600;
    flex-shrink: 0;
}
.organiser-name { font-weight: 700; color: var(--ink); }
.organiser-about { white-space: pre-line; color: var(--ink-soft); margin: 0 0 16px; }
.organiser-contact-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.organiser-email { font-size: 0.88rem; color: var(--ink-soft); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; }

/* --- Section heading with a small icon accent --- */
.section-title { display: flex; align-items: center; gap: 8px; }
.section-title .icon-badge {
    width: 30px; height: 30px; border-radius: 8px; background: var(--bg);
    display: flex; align-items: center; justify-content: center; font-size: 0.95rem; flex-shrink: 0;
}

/* --- Dashboard: stat cards --- */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; text-align: center; }
.stat-value { font-family: 'Fraunces', serif; font-size: 1.7rem; color: var(--teal-dark); font-weight: 600; }
.stat-label { font-size: 0.78rem; color: var(--ink-soft); margin-top: 4px; }

/* --- Dashboard: charts --- */
.dash-charts { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; }
.dash-chart-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.dash-chart-card h3 { font-size: 1rem; margin-bottom: 10px; }
.chart-wrap { position: relative; height: 220px; }

/* --- Dashboard: generic panel --- */
.dash-panel { background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.dash-panel h3 { margin-top: 0; }

/* --- Publish results link --- */
.results-link-row { display: flex; gap: 8px; }
.results-link-row input { flex: 1; background: var(--bg); font-size: 0.85rem; }

/* --- Export panel --- */
.export-row { margin-bottom: 16px; }
.export-row > label { font-weight: 600; font-size: 0.9rem; margin-bottom: 8px; display: block; }
.export-format-choices, .export-field-choices { display: flex; flex-wrap: wrap; gap: 12px 18px; }
.export-format-choices label, .export-field-choices label { font-weight: 500; font-size: 0.88rem; display: flex; align-items: center; gap: 6px; }
.export-date-range { display: flex; align-items: center; gap: 10px; }
.export-date-range input { width: auto; }
.export-action-group { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.export-action-label { font-weight: 600; font-size: 0.9rem; margin-bottom: 8px; }

/* --- Send results to target --- */
.send-result-warning {
    background: #fdf3e0; border: 1.5px solid #f0dba8; border-radius: 10px;
    padding: 18px 20px; font-size: 0.9rem; color: #5a4108; line-height: 1.6;
}
.send-result-warning-title { font-weight: 700; font-size: 1rem; color: #7a5a10; margin-bottom: 8px; }
.email-preview-frame { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-top: 10px; background: #fff; }
.email-preview-frame iframe { width: 100%; height: 560px; border: 0; display: block; }

/* --- Dashboard signer table --- */
.dash-table-wrap { overflow-x: auto; margin-top: 10px; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; white-space: nowrap; }
.dash-table th { text-align: left; padding: 9px 12px; background: var(--bg); border-bottom: 2px solid var(--line); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink-soft); }
.dash-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); }
.comment-icon-btn {
    background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
    width: 30px; height: 28px; cursor: pointer; font-size: 0.95rem; line-height: 1;
}
.comment-icon-btn:hover { background: var(--line); }

/* --- Public results page: signature drawings --- */
.results-sig-list li.results-sig-row { display: flex; align-items: center; gap: 14px; }
.results-sig-drawing { flex-shrink: 0; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 4px; }
.results-sig-drawing svg { display: block; width: 90px; height: 34px; }
.results-sig-info { flex: 1; }
.ip-tiny { font-size: 0.72rem; color: var(--ink-soft); opacity: 0.75; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.report-link { font-size: 0.78rem; color: var(--ink-soft); opacity: 0.8; }
.report-link:hover { color: var(--danger); opacity: 1; }

.faq-list { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.faq-item { background: var(--bg-card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; }
.faq-item summary { cursor: pointer; font-weight: 600; color: var(--teal-dark); list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before { content: "+"; display: inline-block; width: 18px; color: var(--gold-dark); font-weight: 700; }
.faq-item[open] summary::before { content: "\2212"; }
.faq-item p { margin: 10px 0 2px; color: var(--ink-soft); }


.mt-2 { margin-top: 16px; }
.mt-4 { margin-top: 32px; }
.small-muted { font-size: 0.85rem; color: var(--ink-soft); }

@media (max-width: 900px) {
    .hero .container { grid-template-columns: 1fr; }
    .petition-grid { grid-template-columns: repeat(2, 1fr); }
    .petition-detail { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr; }
    .dash-charts { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .petition-grid { grid-template-columns: 1fr; }
    .nav-toggle { display: block; }
    .main-nav {
        display: none;
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--bg-card);
        flex-direction: column;
        align-items: flex-start;
        padding: 16px 20px;
        border-bottom: 1px solid var(--line);
        gap: 14px;
    }
    .main-nav.open { display: flex; }
    .nav-user { width: 100%; }
    .nav-user-toggle { width: 100%; justify-content: space-between; }
    .nav-user-dropdown {
        position: static;
        display: none;
        box-shadow: none;
        border: none;
        background: transparent;
        min-width: 0;
        width: 100%;
        padding: 4px 0 0 8px;
        margin-top: 4px;
    }
    .nav-user.open .nav-user-dropdown { display: block; }
    .hero h1 { font-size: 2rem; }
    .hero-stats { gap: 16px; flex-wrap: wrap; }
    .form-card { padding: 24px; margin: 24px auto; }
    .stat-cards { grid-template-columns: repeat(2, 1fr); }
    .export-date-range { flex-wrap: wrap; }
    .results-sig-list li.results-sig-row { flex-direction: column; align-items: flex-start; }
    .comments-head { flex-direction: column; align-items: flex-start; }
    .comments-controls { width: 100%; }
    .comments-controls select { flex: 1; }
}
