/* ══════════════════════════════════════════════════════
   SDA Digital Tithe Slip — Theme Isolation
   Targeted overrides only — no all:initial (which breaks layout)
   Every rule uses #sdats-tithe-form-wrap for ID-level specificity
══════════════════════════════════════════════════════ */

/* 1. The form wrapper itself */
#sdats-tithe-form-wrap {
    box-sizing: border-box !important;
    font-family: 'Georgia', 'Times New Roman', serif !important;
    max-width: 700px !important;
    margin: 24px auto !important;
    background: #fff !important;
    border: 1.5px solid #222 !important;
    color: #111 !important;
    box-shadow: 0 2px 16px rgba(0,0,0,0.13) !important;
    line-height: normal !important;
    float: none !important;
    clear: both !important;
}

/* 2. Universal box-sizing inside form */
#sdats-tithe-form-wrap *,
#sdats-tithe-form-wrap *::before,
#sdats-tithe-form-wrap *::after {
    box-sizing: border-box !important;
}

/* 3. Reset only the properties themes most commonly clobber */
/* Images — only override max-width on the logo specifically */
#sdats-tithe-form-wrap .sdats-logo-img {
    max-width: none !important;
    height: 56px !important;
    width: auto !important;
    vertical-align: middle !important;
    display: block !important;
    border: none !important;
    box-shadow: none !important;
}

/* Paragraphs — themes add margin-bottom */
#sdats-tithe-form-wrap p {
    margin: 0 !important;
    padding: 0 !important;
}

/* Headings — themes change size, weight, margins */
#sdats-tithe-form-wrap h1,
#sdats-tithe-form-wrap h2,
#sdats-tithe-form-wrap h3,
#sdats-tithe-form-wrap h4,
#sdats-tithe-form-wrap h5 {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
    color: inherit !important;
}

/* Lists — themes add margin/padding/bullets */
#sdats-tithe-form-wrap ul,
#sdats-tithe-form-wrap ol {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Links — themes colour and underline links */
#sdats-tithe-form-wrap a,
#sdats-tithe-form-wrap a:hover,
#sdats-tithe-form-wrap a:visited,
#sdats-tithe-form-wrap a:active {
    color: inherit !important;
    text-decoration: none !important;
}

/* Inputs — themes add border-radius, box-shadow, border, font */
#sdats-tithe-form-wrap input,
#sdats-tithe-form-wrap textarea,
#sdats-tithe-form-wrap select {
    font-family: inherit !important;
    color: #111 !important;
    -webkit-appearance: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    max-width: none !important;
}

/* Buttons — themes style all buttons */
#sdats-tithe-form-wrap button {
    font-family: inherit !important;
    cursor: pointer !important;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

/* Tables — themes collapse borders, add padding to td/th */
#sdats-tithe-form-wrap table {
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    width: 100% !important;
    margin: 0 !important;
}
/* Reset td/th padding/margin only — do NOT touch border or background,
   the giving table needs its own borders set by plugin CSS below */
#sdats-tithe-form-wrap td,
#sdats-tithe-form-wrap th {
    padding: 0 !important;
    margin: 0 !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    text-align: left !important;
}

/* ═══════════════════════════════════════════════════════
   SDA Digital Tithe Slip — v2.4
═══════════════════════════════════════════════════════ */

/* box-sizing/margin/padding reset now in targeted reset block above */

.sdats-wrap {
    font-family: 'Georgia', 'Times New Roman', serif;
    max-width: 700px;
    margin: 24px auto;
    background: #fff;
    border: 1.5px solid #222;
    color: #111;
    box-shadow: 0 2px 16px rgba(0,0,0,0.13);
}

/* ── HEADER ─────────────────────────────────────── */
.sdats-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 24px 14px;
    border-bottom: 1.5px solid #222;
}
.sdats-logo-img { height: 56px; width: auto; display: block; flex-shrink: 0; }
.sdats-title-area { flex: 1; }
.sdats-church-name { font-family: 'Georgia', serif; font-size: 18px; font-weight: bold; color: #111; line-height: 1.25; }
.sdats-slip-title { font-family: Arial, sans-serif; font-size: 11px; color: #444; margin-top: 3px; }

/* ── SCRIPTURE ──────────────────────────────────── */
.sdats-scripture {
    text-align: center;
    padding: 12px 24px 12px;
    font-size: 13px;
    font-style: italic;
    line-height: 1.55;
    color: #222;
}
.sdats-scripture .sdats-ref { display: block; font-style: normal; font-weight: bold; font-size: 11px; margin-top: 3px; font-family: Arial, sans-serif; }

/* ── INFO GRID ──────────────────────────────────── */
.sdats-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1.5px solid #222;
}
.sdats-field { padding: 14px 20px 12px; border: none; background: #fff; }
.sdats-field-pray { grid-column: 1 / span 2; padding-bottom: 14px; }

.sdats-field label {
    display: block;
    font-family: Arial, sans-serif;
    font-size: 9.5px;
    font-weight: bold;
    letter-spacing: 0.8px;
    color: #333;
    text-transform: uppercase;
    margin-bottom: 9px;
}
.sdats-field label small { font-weight: normal; font-size: 8px; color: #999; letter-spacing: 0; text-transform: none; margin-left: 5px; }

.sdats-field input {
    width: 100%;
    border: none;
    border-bottom: 1.5px solid #888;
    background: transparent;
    font-family: 'Georgia', serif;
    font-size: 14px;
    padding: 2px 0 5px;
    outline: none;
    color: #111;
    -webkit-appearance: none;
    border-radius: 0;
}
.sdats-field input:focus { border-bottom-color: #1a4b8c; }
.sdats-field input[readonly] { color: #555; cursor: default; border-bottom-style: solid; }

/* ── PCG HEADING ────────────────────────────────── */
.sdats-pcg-heading { text-align: center; padding: 14px 24px 12px; border-bottom: 1.5px solid #222; }
.sdats-pcg-heading span { font-family: 'Georgia', serif; font-size: 20px; color: #111; }

/* ═══════════════════════════════════════════════
   GIVING TABLE — HTML <table> for perfect borders
═══════════════════════════════════════════════ */
.sdats-giving-outer { border-bottom: 1.5px solid #222; }

table.sdats-giving-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
table.sdats-giving-table col.col-section { width: 28px; }
table.sdats-giving-table col.col-label   { width: auto; }
table.sdats-giving-table col.col-amount  { width: 200px; }

table.sdats-giving-table td { border: none; padding: 0; vertical-align: middle; }

/* Section label cells */
.sdats-section-cell {
    border-right: 1.5px solid #222 !important;
    background: #f5f5f5;
    text-align: center;
    vertical-align: middle !important;
}
.sdats-section-inner {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    font-family: Arial, sans-serif;
    font-size: 7.5px;
    font-weight: bold;
    letter-spacing: 3px;
    color: #111;
    display: block;
    padding: 8px 0;
}

/* Full-width row separator */
table.sdats-giving-table tr.sdats-row-sep td {
    border-top: 1.5px solid #222 !important;
}

/* Label cells — left padding for breathing room */
.sdats-label-cell {
    padding: 14px 16px 14px 22px;
    border-right: 1.5px solid #222 !important;
    vertical-align: middle !important;
}
.sdats-label-cell strong {
    font-family: Arial, sans-serif;
    font-size: 11.5px;
    font-weight: 700;
    display: block;
    color: #111;
    margin-bottom: 3px;
}
.sdats-label-cell small {
    font-family: Arial, sans-serif;
    font-size: 8.5px;
    color: #666;
    margin-top: 0;
    display: block;
}

/* ── AMOUNT CELL — underline style ─────────────── */
.sdats-amount-cell {
    padding: 10px 14px;
    vertical-align: middle !important;
}




/* Dollars — underline only, no box */




/* The dot separator */


/* Cents — underline only, fixed width */




/* Other gifts */
.sdats-other-label-cell {
    padding: 14px 16px 14px 22px;
    border-right: 1.5px solid #222 !important;
    vertical-align: top !important;
}
.sdats-other-label-cell strong {
    font-family: Arial, sans-serif;
    font-size: 11.5px;
    font-weight: 700;
    display: block;
    margin-bottom: 6px;
}
.sdats-add-gift {
    font-family: Arial, sans-serif;
    font-size: 10.5px;
    background: #1a4b8c;
    color: #fff;
    border: none;
    border-radius: 3px;
    padding: 4px 10px;
    cursor: pointer;
    display: inline-block;
    margin-bottom: 4px;
}
.sdats-add-gift:hover { background: #0d3369; }
.sdats-gift-list { list-style: disc; margin: 5px 0 0 16px; padding: 0; font-size: 11px; font-family: Arial, sans-serif; color: #222; }
.sdats-gift-list li { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.sdats-gift-remove { background: none; border: none; color: #c0392b; cursor: pointer; font-size: 14px; font-weight: bold; padding: 0; line-height: 1; }
.sdats-other-amount-cell { padding: 14px 12px; vertical-align: top !important; }

/* TOTAL row */
.sdats-total-row td { border-top: 2px solid #222 !important; background: #f0f0f0; }
.sdats-total-section-cell { border-right: 1.5px solid #222 !important; background: #e8e8e8; text-align: center; vertical-align: middle !important; }
.sdats-total-label-cell {
    padding: 14px 16px 14px 22px;
    border-right: 1.5px solid #222 !important;
    vertical-align: middle !important;
    background: #f0f0f0;
}
.sdats-total-label-cell span { font-family: Arial, sans-serif; font-size: 14px; font-weight: 900; letter-spacing: 1px; }
.sdats-total-amount-cell { padding: 10px 12px; vertical-align: middle !important; background: #f0f0f0; }

/* ── THANK YOU ──────────────────────────────────── */
.sdats-thankyou-line { text-align: center; font-family: 'Georgia', serif; font-size: 14px; font-style: italic; padding: 10px 24px; border-top: 1.5px solid #222; color: #333; }

/* ── UPLOAD ─────────────────────────────────────── */
.sdats-upload-area { padding: 16px 24px; border-top: 1px solid #e0e0e0; }
.sdats-upload-area > label { display: block; font-family: Arial, sans-serif; font-size: 12px; font-weight: bold; color: #222; margin-bottom: 8px; }
.sdats-upload-area > label small { font-weight: normal; color: #888; margin-left: 6px; }
.sdats-upload-box { border: 2px dashed #bbb; border-radius: 6px; padding: 16px; text-align: center; cursor: pointer; background: #fafafa; position: relative; transition: border-color 0.2s, background 0.2s; }
.sdats-upload-box:hover, .sdats-upload-box.drag-over { border-color: #1a4b8c; background: #f0f5ff; }
.sdats-upload-box input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; z-index: 2; }
.sdats-upload-hint { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #aaa; font-family: Arial, sans-serif; font-size: 12px; }
.sdats-upload-preview { margin-top: 8px; }
.sdats-upload-preview img { max-height: 110px; max-width: 100%; border: 1px solid #ddd; border-radius: 4px; }
.sdats-file-name { font-family: Arial, sans-serif; font-size: 11px; color: #333; padding: 6px 10px; background: #f0f5ff; border-radius: 4px; display: inline-block; }

/* ── SUBMIT ─────────────────────────────────────── */
.sdats-submit-area { padding: 16px 24px 20px; text-align: center; }
.sdats-submit-btn { background: #1a4b8c; color: #fff; border: none; font-family: Arial, sans-serif; font-size: 15px; font-weight: bold; padding: 13px 48px; border-radius: 5px; cursor: pointer; transition: background 0.2s; }
.sdats-submit-btn:hover { background: #0d3369; }
.sdats-submit-btn:disabled { background: #999; cursor: not-allowed; }

/* ── MESSAGES ───────────────────────────────────── */
.sdats-messages { margin: 0 24px 16px; padding: 12px 16px; border-radius: 5px; font-family: Arial, sans-serif; font-size: 13px; line-height: 1.5; }
.sdats-messages.sdats-error { background: #fdecea; border: 1px solid #f5c6cb; color: #721c24; }
.sdats-messages.sdats-info  { background: #e8f4fd; border: 1px solid #bee5eb; color: #0c5460; }

/* ── RECEIPT ────────────────────────────────────── */
.sdats-success-panel { padding: 24px; }
.sdats-receipt-preview { border: 1.5px solid #222; background: #fff; padding: 22px 26px; font-family: 'Georgia', serif; max-width: 420px; margin: 0 auto 20px; }
.sdats-receipt-header { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid #ccc; }
.sdats-receipt-logo { height: 40px; width: auto; flex-shrink: 0; }
.sdats-receipt-header > div { font-family: Arial, sans-serif; font-size: 11px; line-height: 1.6; }
.sdats-receipt-header strong { font-size: 12.5px; }
.sdats-receipt-scripture { text-align: center; font-size: 12px; font-style: italic; margin-bottom: 12px; line-height: 1.6; }
.sdats-receipt-scripture strong { font-style: normal; font-family: Arial, sans-serif; font-size: 10px; display: block; margin-top: 2px; }
.sdats-receipt-table { width: 100%; font-size: 12px; margin-bottom: 12px; }
.sdats-receipt-table th { text-align: left; font-family: Arial, sans-serif; font-size: 9px; font-weight: bold; letter-spacing: 0.5px; color: #666; padding: 3px 0; width: 70px; }
.sdats-receipt-table td { font-size: 13px; padding: 3px 0; }
.sdats-receipt-amounts { width: 100%; border-collapse: collapse; }
.sdats-receipt-amounts tr { border: 1px solid #bbb; }
.sdats-receipt-amounts td { padding: 8px 10px; vertical-align: middle; font-size: 12px; }
.sdats-receipt-amounts td:first-child { font-family: Arial, sans-serif; font-size: 10px; font-weight: bold; width: 52%; border-right: 1px solid #bbb; }
.sdats-receipt-amounts td:nth-child(2) { font-weight: bold; font-size: 13px; width: 22px; text-align: center; border-right: 1px solid #bbb; padding: 8px 2px; }
.sdats-receipt-amounts td:last-child { font-size: 13px; text-align: right; padding-right: 12px; }
.sdats-receipt-enclosed td { background: #f5f5f5; font-weight: bold; }
.sdats-receipt-footer { text-align: center; margin-top: 16px; font-style: italic; font-size: 14px; line-height: 1.9; }
.sdats-receipt-id { display: block; font-style: normal; font-family: Arial, sans-serif; font-size: 11px; color: #333; margin-top: 6px; }
.sdats-receipt-note { font-style: normal; font-family: Arial, sans-serif; font-size: 10px; color: #888; margin: 3px 0 0; }
.sdats-success-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.sdats-download-btn, .sdats-new-btn { display: inline-block; padding: 12px 30px; border-radius: 5px; font-family: Arial, sans-serif; font-size: 14px; font-weight: bold; cursor: pointer; text-decoration: none; text-align: center; border: none; transition: background 0.2s; }
.sdats-download-btn { background: #1a4b8c; color: #fff !important; text-decoration: none; }
.sdats-download-btn:hover { background: #0d3369; color: #fff !important; }
.sdats-pdf-btn {
    background: #2e7d32;
    color: #fff !important;
    border: none;
}
.sdats-pdf-btn:hover { background: #1b5e20; }
.sdats-new-btn { background: #fff; color: #1a4b8c; border: 2px solid #1a4b8c; }
.sdats-new-btn:hover { background: #f0f5ff; }

/* ── MODAL ──────────────────────────────────────── */
.sdats-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    overscroll-behavior: none;
}
.sdats-modal {
    background: #fff;
    border-radius: 8px;
    padding: 26px 30px;
    width: 360px;
    max-width: calc(100vw - 24px);
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    font-family: Arial, sans-serif;
}
.sdats-modal h3 { margin: 0 0 18px; font-size: 16px; color: #1a4b8c; }
.sdats-modal-dollar {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-right: 5px;
    flex-shrink: 0;
}
.sdats-modal label { display: block; font-size: 12px; font-weight: bold; color: #333; margin-bottom: 14px; }
.sdats-modal label input[type="text"] { display: block; width: 100%; margin-top: 6px; border: 1.5px solid #ccc; border-radius: 4px; padding: 9px 11px; font-size: 14px; outline: none; font-family: Georgia, serif; }
.sdats-modal label input:focus { border-color: #1a4b8c; }
.sdats-modal-amount {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}
.sdats-modal-amount input[type="number"] {
    border: 1.5px solid #ccc;
    border-radius: 5px;
    padding: 7px 8px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    background: #fff;
    color: #111;
    box-sizing: border-box;
}
.sdats-modal-amount input[type="number"]:focus { border-color: #1a4b8c; }
.sdats-modal-amount input[type="number"]:first-of-type {
    flex: 1;
    text-align: right;
}
.sdats-modal-amount input[type="number"]:last-of-type {
    width: 62px;
    text-align: center;
}
.sdats-modal-dot {
    font-size: 15px;
    font-weight: bold;
    color: #555;
    flex-shrink: 0;
    user-select: none;
    padding: 0 1px;
}
.sdats-modal-btns { display: flex; gap: 10px; margin-top: 18px; }
.sdats-modal-add { flex: 1; background: #1a4b8c; color: #fff; border: none; border-radius: 5px; padding: 11px; font-size: 14px; font-weight: bold; cursor: pointer; }
.sdats-modal-add:hover { background: #0d3369; }
.sdats-modal-cancel { flex: 1; background: #fff; color: #333; border: 1.5px solid #ccc; border-radius: 5px; padding: 11px; font-size: 14px; cursor: pointer; }

/* ── SPINNER ─────────────────────────────────────── */
.sdats-spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: sdats-spin 0.7s linear infinite; vertical-align: middle; margin-right: 8px; }
@keyframes sdats-spin { to { transform: rotate(360deg); } }


/* ── AMOUNT INPUTS — two separate boxes with spinner arrows, dot between ─ */
.sdats-amount-inner {
    display: flex;
    align-items: center;
    gap: 6px;     /* gap between $ sign, dollars box, dot, cents box */
    width: 100%;
}
.sdats-dollar {
    font-size: 15px;
    font-weight: bold;
    color: #333;
    flex-shrink: 0;
}
/* Dollars box — standalone box, spinner arrows kept */
.sdats-dollars-box {
    flex: 1;
    min-width: 0;
    border: 1.5px solid #ccc;
    border-radius: 5px;      /* fully rounded — own box */
    background: #fff;
    text-align: right;
    font-family: inherit;
    font-size: 15px;
    padding: 7px 8px;
    outline: none;
    color: #111;
    box-sizing: border-box;
}
.sdats-dollars-box:focus { border-color: #1a4b8c; }
.sdats-dollars-box[readonly] { background: #f5f5f5; color: #666; cursor: default; border-color: #ddd; }
/* Dot separator — plain text, not part of any box */
.sdats-dot {
    font-size: 15px;
    font-weight: bold;
    color: #555;
    flex-shrink: 0;
    user-select: none;
    padding: 0 1px;
}
.sdats-dot-readonly { color: #aaa; }
/* Cents box — standalone fixed-width box, spinner arrows kept */
.sdats-cents-box {
    width: 62px;
    flex-shrink: 0;
    border: 1.5px solid #ccc;
    border-radius: 5px;      /* fully rounded — own box */
    background: #fff;
    text-align: center;
    font-family: inherit;
    font-size: 15px;
    padding: 7px 4px;
    outline: none;
    color: #333;
    box-sizing: border-box;
}
.sdats-cents-box:focus { border-color: #1a4b8c; }
.sdats-cents-box[readonly] { background: #f5f5f5; color: #666; cursor: default; border-color: #ddd; }

/* ══════════════════════════════════════════════════
   RESPONSIVE — Mobile First
   Breakpoints: 480px (phone), 640px (large phone/tablet)
══════════════════════════════════════════════════ */

/* ── Base mobile styles (all screens) ── */
.sdats-wrap {
    /* Prevent horizontal overflow on any screen */
    overflow-x: hidden;
    /* Safe area for notched phones (iPhone X+) */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Ensure inputs don't cause zoom on iOS (must be >= 16px) */
.sdats-field input,
.sdats-modal label input[type="text"] {
    font-size: 16px !important;
}
/* Keep number inputs at 15px — spinners need natural rendering */
.sdats-dollars-box,
.sdats-cents-box,
.sdats-modal-amount input[type="number"] {
    font-size: 15px;
}

/* Touch-friendly minimum tap target (44px) on buttons */
.sdats-submit-btn,
.sdats-add-gift,
.sdats-modal-add,
.sdats-modal-cancel,
.sdats-download-btn,
.sdats-pdf-btn,
.sdats-new-btn {
    min-height: 44px;
}

/* ── Small phones (up to 480px) ── */
@media (max-width: 480px) {

    /* Wrapper — flush to screen edges */
    .sdats-wrap {
        margin: 0;
        border-left: none;
        border-right: none;
        border-radius: 0;
    }

    /* Header — stack logo above title */
    .sdats-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
        padding: 14px 16px 12px;
    }
    .sdats-logo-img { height: 48px; }
    .sdats-church-name { font-size: 15px; }
    .sdats-slip-title  { font-size: 10px; }

    /* Scripture */
    .sdats-scripture { font-size: 12px; padding: 8px 14px; }

    /* Info grid — single column */
    .sdats-info-grid { grid-template-columns: 1fr; }
    .sdats-field { padding: 12px 14px 10px; }
    .sdats-field-pray { grid-column: 1; }
    .sdats-field input { font-size: 16px !important; }

    /* PCG heading */
    .sdats-pcg-heading span { font-size: 17px; }
    .sdats-pcg-heading { padding: 8px 14px 6px; }

    /* Giving table — compress label, keep amount readable */
    table.sdats-giving-table col.col-section { width: 22px; }
    table.sdats-giving-table col.col-amount  { width: 130px; }

    .sdats-section-inner { font-size: 6.5px; letter-spacing: 2px; }

    .sdats-label-cell,
    .sdats-other-label-cell { padding: 9px 10px 9px 12px; }
    .sdats-label-cell strong,
    .sdats-other-label-cell strong { font-size: 10.5px; }
    .sdats-label-cell small { font-size: 7.5px; }

    /* Amount cell — make it fit on small screens */
    .sdats-amount-cell,
    .sdats-other-amount-cell,
    .sdats-total-amount-cell { padding: 8px 8px; }

    .sdats-dollar { font-size: 13px; }
    .sdats-amount-inner { gap: 4px; }
    .sdats-dollars-box { font-size: 14px; padding: 6px 6px; }
    .sdats-dot { font-size: 13px; }
    .sdats-cents-box { width: 52px; font-size: 14px; padding: 6px 3px; }

    /* Total row */
    .sdats-total-label-cell { padding: 10px 10px 10px 12px; }
    .sdats-total-label-cell span { font-size: 12px; }

    /* Add Gift button — full width */
    .sdats-add-gift {
        display: block;
        width: 100%;
        text-align: center;
        padding: 8px 10px;
        font-size: 12px;
        margin-bottom: 6px;
    }

    /* Gift list */
    .sdats-gift-list { font-size: 10px; }

    /* Thank you */
    .sdats-thankyou-line { font-size: 13px; padding: 8px 14px; }

    /* Upload area */
    .sdats-upload-area { padding: 12px 14px; }
    .sdats-upload-box  { padding: 14px 10px; }

    /* Submit */
    .sdats-submit-area { padding: 14px 14px 18px; }
    .sdats-submit-btn  { width: 100%; padding: 14px 20px; font-size: 15px; }

    /* Messages */
    .sdats-messages { margin: 0 14px 14px; }

    /* Success panel */
    .sdats-success-panel { padding: 14px; }
    .sdats-receipt-preview { padding: 16px 16px; }
    .sdats-receipt-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .sdats-receipt-logo { height: 32px; }
    .sdats-receipt-scripture { font-size: 11px; }
    .sdats-receipt-amounts td { padding: 8px 8px; font-size: 11px; }
    .sdats-receipt-amounts td:last-child { padding-right: 8px; }
    .sdats-receipt-footer { font-size: 13px; }

    /* Action buttons — stack vertically */
    .sdats-success-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .sdats-download-btn,
    .sdats-pdf-btn,
    .sdats-new-btn {
        width: 100%;
        text-align: center;
        padding: 13px 16px;
    }

    /* Modal */
    .sdats-modal {
        width: calc(100vw - 24px);
        padding: 20px 18px;
    }
    .sdats-modal-amount input[type="number"]:first-of-type { min-width: 0; }
}

/* ── Medium phones / large phones (481px–640px) ── */
@media (min-width: 481px) and (max-width: 640px) {

    .sdats-wrap { margin: 8px; border-radius: 0; }

    .sdats-header {
        padding: 14px 18px 12px;
        gap: 12px;
    }
    .sdats-logo-img { height: 50px; }
    .sdats-church-name { font-size: 16px; }

    /* Info grid — single column on medium phones too */
    .sdats-info-grid { grid-template-columns: 1fr; }
    .sdats-field { padding: 12px 16px 10px; }
    .sdats-field-pray { grid-column: 1; }

    table.sdats-giving-table col.col-amount { width: 145px; }

    .sdats-label-cell strong { font-size: 11px; }

    .sdats-submit-btn { width: 100%; }

    .sdats-success-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .sdats-download-btn,
    .sdats-pdf-btn,
    .sdats-new-btn { width: 100%; text-align: center; }
}

/* ── Tablet and up (641px+) ── */
@media (min-width: 641px) {
    /* Two-column info grid restored */
    .sdats-info-grid { grid-template-columns: 1fr 1fr; }
    .sdats-field-pray { grid-column: 1 / span 2; }
    /* Buttons side by side */
    .sdats-success-actions { flex-direction: row; flex-wrap: wrap; justify-content: center; }
}

/* ── TOOLTIPS ────────────────────────────────────────────────────── */
.sdats-tooltip-wrap {
    position: relative;
    display: inline-block;
}
.sdats-tip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #1a4b8c;
    color: #fff;
    font-size: 10px;
    font-family: Arial, sans-serif;
    font-weight: bold;
    cursor: pointer;
    margin-left: 5px;
    vertical-align: middle;
    flex-shrink: 0;
    line-height: 1;
    user-select: none;
}
.sdats-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a3a5c;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 12px;
    line-height: 1.5;
    padding: 8px 12px;
    border-radius: 6px;
    white-space: normal;
    width: 220px;
    z-index: 9999;
    pointer-events: none;
    transition: opacity 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.sdats-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1a3a5c;
}
.sdats-tooltip-wrap:hover .sdats-tooltip,
.sdats-tooltip-wrap.sdats-tip-active .sdats-tooltip {
    visibility: visible;
    opacity: 1;
}

/* ── TUTORIAL TOGGLE ─────────────────────────────────────────────── */
.sdats-tutorial-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: #eef3fb;
    border-bottom: 1px solid #c5d5e8;
    font-family: Arial, sans-serif;
    font-size: 13px;
    color: #1a4b8c;
}
.sdats-tutorial-bar span { font-weight: 600; }
.sdats-tutorial-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #1a4b8c;
    font-weight: 600;
    user-select: none;
}
/* Toggle switch */
.sdats-switch {
    position: relative;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}
.sdats-switch input { opacity: 0; width: 0; height: 0; }
.sdats-switch-slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 22px;
    transition: background 0.2s;
    cursor: pointer;
}
.sdats-switch-slider:before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}
.sdats-switch input:checked + .sdats-switch-slider { background: #1a4b8c; }
.sdats-switch input:checked + .sdats-switch-slider:before { transform: translateX(18px); }

/* ── TUTORIAL HIGHLIGHT ──────────────────────────────────────────── */
.sdats-tutorial-active .sdats-field,
.sdats-tutorial-active .sdats-row-label-cell,
.sdats-tutorial-active .sdats-other-label-cell,
.sdats-tutorial-active .sdats-total-label-cell {
    transition: box-shadow 0.3s;
}
.sdats-tutorial-active .sdats-field.sdats-highlight,
.sdats-tutorial-active .sdats-row-label-cell.sdats-highlight {
    box-shadow: inset 0 0 0 2px #1a4b8c;
    border-radius: 2px;
}

/* Tutorial tooltip — larger, positioned differently */
.sdats-tutorial-tip {
    display: none;
    position: absolute;
    background: #1a3a5c;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 13px;
    line-height: 1.6;
    padding: 12px 16px;
    border-radius: 8px;
    width: 260px;
    z-index: 9999;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    pointer-events: none;
}
.sdats-tutorial-tip.visible { display: block; }
.sdats-tutorial-tip .tip-step { font-size: 10px; opacity: 0.7; margin-bottom: 4px; }
.sdats-tutorial-tip .tip-nav {
    margin-top: 10px;
    display: flex;
    gap: 6px;
    pointer-events: all;
}
.sdats-tutorial-tip .tip-nav button {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
}
.sdats-tutorial-tip .tip-nav button:hover { background: rgba(255,255,255,0.35); }
.sdats-tutorial-tip .tip-nav .tip-close { margin-left: auto; }
