/* --- Unified Root Variables --- */
      :root {
        /* New Reference Colors */
        --primary: #29ad10;
        --primary-hover: #228b0d;
        --accent: #0f172a;
        --accent-light: #1e293b;
        --bg-light: #ffffff;
        --bg-alt: #f8fafc;
        --card-bg: #ffffff;
        --text-main: #0f172a;
        --text-muted: #64748b;
        --border-color: #e2e8f0;

        /* Legacy mappings mapped to new colors (keeps JS inline styles working) */
        --brand-green: var(--primary);
        --brand-green-light: #eaf7e8;
        --brand-blue: var(--accent); /* Remapped blue to deep slate accent */
        --brand-red: #ef4444;
        --brand-yellow: #f59e0b;
        --brand-orange: #f97316;
        --bg-page: var(--bg-alt);

        /* Modernized Radii and Shadows */
        --radius-lg: 24px;
        --radius-md: 16px;
        --radius-sm: 12px;
        --shadow-card: 0 10px 30px rgba(15, 23, 42, 0.04);
        --shadow-hover: 0 20px 40px rgba(15, 23, 42, 0.08);
        --shadow-modal: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
      }

      * {
        box-sizing: border-box;
      }

      body {
        margin: 0;
        padding: 24px;
        font-family: "Plus Jakarta Sans", sans-serif;
        color: var(--text-main);
        background-color: var(--bg-page);
        /* Subtle grid background to match the modern tech feel */
        background-image: radial-gradient(
          var(--border-color) 1px,
          transparent 1px
        );
        background-size: 32px 32px;
        display: flex;
        flex-direction: column;
        align-items: center;
        min-height: 100vh;
        line-height: 1.6;
      }

      body::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: radial-gradient(
          circle at 50% 0%,
          rgba(248, 250, 252, 0.5) 0%,
          rgba(248, 250, 252, 1) 80%
        );
        z-index: -1;
      }

      body.modal-open {
        overflow: hidden;
      }

      /* Animations */
      @keyframes spin {
        100% {
          transform: rotate(360deg);
        }
      }
      @keyframes fadeIn {
        from {
          opacity: 0;
          transform: translateY(-10px);
        }
        to {
          opacity: 1;
          transform: translateY(0);
        }
      }
      @keyframes fadeInOverlay {
        from {
          opacity: 0;
        }
        to {
          opacity: 1;
        }
      }
      @keyframes slideUp {
        from {
          opacity: 0;
          transform: translateY(30px) scale(0.98);
        }
        to {
          opacity: 1;
          transform: translateY(0) scale(1);
        }
      }

      .fade-in {
        animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
      }

      .loading-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(8px);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 50;
        border-radius: inherit;
      }

      .loader-spinner {
        border: 4px solid var(--border-color);
        border-top: 4px solid var(--primary);
        border-radius: 50%;
        width: 40px;
        height: 40px;
        animation: spin 1s linear infinite;
      }

      .btn-spinner {
        width: 18px;
        height: 18px;
        margin-right: 8px;
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-top: 2px solid #ffffff;
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
        display: none;
      }

      .error-banner {
        padding: 12px 24px;
        font-size: 13px;
        font-weight: 600;
        display: none;
        align-items: flex-start;
        background-color: #fef2f2;
        color: var(--brand-red);
        border-bottom: 1px solid #fecaca;
        width: 100%;
        position: absolute;
        top: 0;
        left: 0;
        z-index: 60;
      }
      .error-banner svg {
        width: 16px;
        height: 16px;
        fill: currentColor;
        margin-right: 8px;
        flex-shrink: 0;
        margin-top: 2px;
      }

      /* Main Wrapper */
      .checkout-wrapper {
        background: var(--card-bg);
        width: 100%;
        max-width: 1080px;
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-card);
        border: 1px solid var(--border-color);
        overflow: hidden;
        position: relative;
        z-index: 10;
        transition: box-shadow 0.3s ease;
      }
      .checkout-wrapper:hover {
        box-shadow: var(--shadow-hover);
      }

      .split-layout {
        display: grid;
        grid-template-columns: 320px 1fr;
        gap: 40px;
        padding: 32px 40px;
        align-items: start;
        transition: opacity 0.3s;
      }

      @media (max-width: 820px) {
        .split-layout {
          grid-template-columns: 1fr;
          gap: 24px;
          padding: 24px;
        }
        .sidebar-column {
          position: relative !important;
          top: 0 !important;
        }
      }

      .header {
        padding: 32px 40px 24px;
        text-align: center;
        border-bottom: 1px solid var(--border-color);
        background: var(--bg-light);
      }
      .header-logo {
        height: 36px;
        width: auto;
        margin-bottom: 16px;
      }
      .header h1 {
        margin: 0;
        font-size: 24px;
        font-weight: 800;
        color: var(--accent);
        letter-spacing: -0.5px;
      }
      .header p {
        margin: 12px 0 0;
        font-size: 14px;
        color: var(--text-muted);
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
      }

      .tech-badge {
        display: inline-flex;
        align-items: center;
        background-color: var(--bg-alt);
        padding: 6px 14px;
        border-radius: 999px;
        font-size: 12px;
        font-weight: 700;
        color: var(--accent);
        border: 1px solid var(--border-color);
      }
      .price-badge {
        display: inline-flex;
        align-items: center;
        background-color: rgba(41, 173, 16, 0.1);
        padding: 4px 10px;
        border-radius: 999px;
        font-size: 12px;
        font-weight: 700;
        color: var(--primary);
        border: 1px solid rgba(41, 173, 16, 0.2);
        letter-spacing: 0.5px;
      }

      .ticket-badge {
        display: inline-flex;
        align-items: center;
        background-color: #fefce8;
        padding: 6px 14px;
        border-radius: 999px;
        font-size: 12px;
        font-weight: 700;
        color: #b45309;
        border: 1px solid #fde047;
      }
      .ticket-badge svg {
        width: 14px;
        height: 14px;
        margin-right: 6px;
        fill: currentColor;
      }

      /* Sidebar Elements */
      .sidebar-column {
        position: sticky;
        top: 32px;
        align-self: start;
      }

      .summary-box {
        background-color: var(--bg-alt);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        padding: 24px;
        margin-bottom: 20px;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
      }
      .summary-row {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 14px;
        font-size: 14px;
        color: var(--text-muted);
        font-weight: 500;
      }
      .summary-row:last-of-type {
        margin-bottom: 0;
      }
      .summary-row span.value {
        font-weight: 700;
        color: var(--text-main);
        text-align: right;
      }

      .prorated-tag {
        font-size: 11px;
        background: #e2e8f0;
        padding: 2px 8px;
        border-radius: 6px;
        display: block;
        margin-top: 6px;
        width: fit-content;
        font-weight: 600;
      }

      .summary-row.total-row {
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px dashed var(--border-color);
        font-size: 18px;
        font-weight: 800;
        color: var(--accent);
        align-items: center;
      }
      .summary-row.recurring-row {
        font-size: 14px;
        color: var(--primary);
        font-weight: 700;
        margin-top: 12px;
        align-items: center;
      }
      .recurring-date {
        font-size: 11px;
        font-weight: 600;
        color: var(--text-muted);
        display: block;
        margin-top: 4px;
      }

      .info-card {
        background-color: var(--card-bg);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        padding: 20px;
        margin-bottom: 20px;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
      }
      .info-card h4 {
        margin: 0 0 10px 0;
        font-size: 13px;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        font-weight: 800;
      }
      .info-card p {
        margin: 0 0 4px 0;
        font-size: 15px;
        color: var(--text-main);
        font-weight: 700;
      }
      .info-card p.sub-text {
        font-size: 13px;
        color: var(--text-muted);
        font-weight: 500;
      }

      /* Main Forms */
      .form-group {
        margin-bottom: 32px;
      }
      .section-title {
        font-size: 18px;
        font-weight: 800;
        margin: 0 0 16px 0;
        color: var(--accent);
        display: flex;
        justify-content: space-between;
        align-items: center;
        letter-spacing: -0.5px;
      }
      .section-desc {
        font-size: 14px;
        color: var(--text-muted);
        margin: -8px 0 20px 0;
        font-weight: 500;
        line-height: 1.5;
      }

      /* Main Navigation Wizard */
      .main-wizard-header {
        margin-bottom: 32px;
        padding-bottom: 24px;
        border-bottom: 1px solid var(--border-color);
      }
      .main-step {
        display: none;
        animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
      }
      .main-step.active {
        display: block;
      }
      .nav-buttons {
        display: flex;
        justify-content: space-between;
        gap: 16px;
        margin-top: 40px;
        padding-top: 24px;
        border-top: 1px solid var(--border-color);
      }
      .nav-buttons .primary-btn {
        margin-top: 0;
        flex: 1;
      }
      .nav-buttons .secondary-btn {
        flex: 1;
      }

      .primary-btn.terminal-waiting:disabled {
        background-color: var(--brand-orange) !important;
        color: #ffffff !important;
        opacity: 1 !important;
        box-shadow: 0 10px 25px rgba(249, 115, 22, 0.3) !important;
      }

      /* Shared Wizard Progress Bars */
      .wizard-progress {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
      }
      .wizard-step {
        flex: 1;
        height: 8px;
        background: var(--border-color);
        border-radius: 999px;
        transition: 0.4s ease;
        cursor: pointer;
      }
      .wizard-step:hover {
        background: #cbd5e1;
      }
      .wizard-step.active {
        background: var(--primary);
        box-shadow: 0 0 10px rgba(41, 173, 16, 0.3);
      }
      .wizard-step.completed {
        background: var(--primary);
        opacity: 0.4;
      }
      .wizard-step.completed:hover {
        opacity: 0.7;
      }

      .wizard-labels {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
        width: 100%;
        margin-top: 10px;
        font-size: 11px;
        font-weight: 800;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.5px;
      }
      .wizard-labels span {
        cursor: pointer;
        transition: 0.2s;
      }
      .wizard-labels span:hover {
        color: var(--accent) !important;
      }
      .wizard-labels span:nth-child(1) {
        text-align: left;
      }
      .wizard-labels span:nth-child(2) {
        text-align: center;
      }
      .wizard-labels span:nth-child(3) {
        text-align: center;
      }
      .wizard-labels span:nth-child(4) {
        text-align: center;
      }
      .wizard-labels span:nth-child(5) {
        text-align: right;
      }

      /* Billing Toggle */
      .toggle-container {
        display: flex;
        background: var(--bg-alt);
        border-radius: 999px;
        padding: 6px;
        margin-bottom: 24px;
        border: 1px solid var(--border-color);
      }
      .toggle-btn {
        flex: 1;
        padding: 12px;
        text-align: center;
        border: none;
        background: transparent;
        font-size: 14px;
        font-weight: 700;
        color: var(--text-muted);
        cursor: pointer;
        border-radius: 999px;
        transition: all 0.3s ease;
        font-family: inherit;
      }
      .toggle-btn.active {
        background: var(--card-bg);
        color: var(--accent);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
      }
      .save-badge {
        background: rgba(41, 173, 16, 0.1);
        color: var(--primary);
        font-size: 11px;
        padding: 4px 10px;
        border-radius: 999px;
        margin-left: 6px;
        font-weight: 800;
        text-transform: uppercase;
      }

      /* Tier Cards */
      .tier-card {
        display: flex;
        align-items: flex-start;
        padding: 24px;
        border: 2px solid var(--border-color);
        border-radius: var(--radius-md);
        background-color: var(--card-bg);
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        margin-bottom: 16px;
        position: relative;
      }
      .tier-card:hover {
        border-color: #cbd5e1;
        transform: translateY(-4px);
        box-shadow: 0 10px 20px rgba(15, 23, 42, 0.04);
      }
      .tier-card.selected {
        border-color: var(--primary);
        background-color: rgba(41, 173, 16, 0.03);
        box-shadow: 0 10px 30px rgba(41, 173, 16, 0.1);
      }
      .tier-card input[type="radio"] {
        margin: 6px 20px 0 0;
        width: 20px;
        height: 20px;
        cursor: pointer;
        flex-shrink: 0;
        accent-color: var(--primary);
        pointer-events: none;
      }

      .tier-content {
        width: 100%;
        pointer-events: none;
      }
      .tier-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 6px;
      }
      .tier-title {
        font-size: 18px;
        font-weight: 800;
        color: var(--accent);
        margin: 0;
      }
      .tier-price {
        font-size: 18px;
        font-weight: 800;
        color: var(--accent);
      }
      .tier-desc {
        font-size: 14px;
        color: var(--text-muted);
        font-weight: 500;
        margin: 0;
      }

      .tier-expand-toggle {
        font-size: 13px;
        color: var(--primary);
        font-weight: 700;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        margin-top: 12px;
        pointer-events: auto;
        transition: color 0.2s;
      }
      .tier-expand-toggle:hover {
        color: var(--primary-hover);
      }
      .tier-expand-toggle svg {
        width: 14px;
        height: 14px;
        fill: currentColor;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
      }
      .tier-expand-toggle.open svg {
        transform: rotate(180deg);
      }

      .tier-features-container {
        display: none;
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px dashed var(--border-color);
        animation: fadeIn 0.3s ease;
      }
      .tier-features-container.open {
        display: block;
      }
      .tier-features {
        margin: 0;
        padding-left: 20px;
        font-size: 14px;
        color: var(--text-muted);
        font-weight: 500;
        line-height: 1.6;
      }
      .tier-features li {
        margin-bottom: 6px;
      }

      /* ===== Compare-plans trigger + modal ===== */
      .compare-plans-btn {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        flex-shrink: 0;
        padding: 8px 14px;
        font-size: 13px;
        font-weight: 700;
        color: var(--accent);
        background: var(--card-bg);
        border: 1px solid var(--border-color);
        border-radius: 999px;
        cursor: pointer;
        transition: all 0.2s ease;
      }
      .compare-plans-btn:hover {
        border-color: var(--primary);
        color: var(--primary);
        box-shadow: 0 4px 12px rgba(41, 173, 16, 0.1);
      }
      .compare-plans-btn svg {
        width: 15px;
        height: 15px;
        fill: currentColor;
      }

      .compare-modal {
        max-width: 980px;
        height: auto;
        min-height: unset;
        max-height: 92vh;
      }
      .compare-subhead {
        margin: 0;
        font-size: 14px;
        font-weight: 500;
        color: var(--text-muted);
        line-height: 1.5;
      }
      .compare-close {
        background: none;
        border: none;
        color: var(--text-muted);
        cursor: pointer;
        font-size: 32px;
        line-height: 1;
        transition: color 0.2s;
      }
      .compare-close:hover {
        color: var(--accent);
      }
      .compare-body {
        flex: 1;
        overflow-y: auto;
        padding: 24px 40px 32px;
      }
      .compare-table-wrap {
        overflow-x: auto;
      }
      .compare-table {
        width: 100%;
        border-collapse: collapse;
        min-width: 620px;
      }
      .compare-table th,
      .compare-table td {
        padding: 14px 16px;
        text-align: center;
        border-bottom: 1px solid var(--border-color);
        font-size: 15px;
        color: var(--accent);
        vertical-align: middle;
      }
      .compare-table tbody th[scope="row"],
      .compare-table .compare-feature-col {
        text-align: left;
        font-size: 14px;
        font-weight: 600;
        color: var(--text-muted);
      }
      .compare-table tbody th[scope="row"] sup {
        font-weight: 700;
        color: var(--primary);
        margin-left: 2px;
      }
      .compare-table thead th {
        border-bottom: 2px solid var(--border-color);
        position: relative;
        padding-top: 22px;
      }
      .compare-tier-name {
        font-size: 15px;
        font-weight: 800;
        color: var(--accent);
      }
      .compare-tier-price {
        font-size: 26px;
        font-weight: 800;
        color: var(--accent);
        letter-spacing: -0.5px;
        margin-top: 2px;
      }
      .compare-tier-price span {
        font-size: 13px;
        font-weight: 600;
        color: var(--text-muted);
      }
      .compare-tier-sub {
        font-size: 12px;
        font-weight: 500;
        color: var(--text-muted);
        margin-top: 2px;
      }
      .compare-best-badge {
        display: inline-block;
        margin-bottom: 6px;
        padding: 3px 12px;
        font-size: 10px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: white;
        background: var(--primary);
        border-radius: 999px;
      }
      .compare-table .cmp-yes::before {
        content: "✓";
        color: var(--primary);
        font-size: 18px;
        font-weight: 800;
      }
      .compare-table .cmp-no::before {
        content: "—";
        color: #cbd5e1;
        font-weight: 700;
      }
      /* Highlight the tier the tech already has selected */
      .compare-table.highlight-basic th:nth-child(2),
      .compare-table.highlight-basic td:nth-child(2),
      .compare-table.highlight-premium th:nth-child(3),
      .compare-table.highlight-premium td:nth-child(3),
      .compare-table.highlight-plus th:nth-child(4),
      .compare-table.highlight-plus td:nth-child(4) {
        background: rgba(41, 173, 16, 0.05);
      }
      .compare-select-btn {
        width: 100%;
        padding: 10px 12px;
        font-size: 13px;
        font-weight: 700;
        color: var(--accent);
        background: var(--card-bg);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-sm);
        cursor: pointer;
        transition: all 0.2s ease;
      }
      .compare-select-btn:hover {
        border-color: var(--primary);
        color: var(--primary);
      }
      .compare-select-btn.primary {
        background: var(--primary);
        color: white;
        border-color: var(--primary);
      }
      .compare-select-btn.primary:hover {
        background: var(--primary-hover);
        color: white;
      }
      .compare-footnotes {
        margin-top: 24px;
        padding-top: 20px;
        border-top: 1px dashed var(--border-color);
        font-size: 12px;
        line-height: 1.6;
        color: var(--text-muted);
      }
      .compare-footnotes p {
        margin: 0 0 8px;
      }
      .compare-footnotes p:last-child {
        margin-bottom: 0;
      }
      .compare-footnotes strong {
        color: var(--primary);
        margin-right: 2px;
      }

      .status-tag {
        position: absolute;
        top: -12px;
        right: 24px;
        color: white;
        font-size: 11px;
        font-weight: 800;
        padding: 4px 12px;
        border-radius: 999px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        box-shadow: 0 4px 10px rgba(41, 173, 16, 0.3);
      }
      .tag-popular {
        background: var(--accent);
        box-shadow: 0 4px 10px rgba(15, 23, 42, 0.3);
      }

      /* Add-ons & Toggles */
      .addon-box {
        background: var(--card-bg);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-sm);
        padding: 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 12px;
        transition: all 0.3s ease;
      }
      .addon-box.clickable {
        cursor: pointer;
      }
      .addon-box.clickable:hover {
        border-color: var(--primary);
        box-shadow: 0 8px 20px rgba(41, 173, 16, 0.08);
        transform: translateY(-2px);
      }

      .addon-info h5 {
        margin: 0 0 6px 0;
        font-size: 16px;
        font-weight: 800;
        color: var(--accent);
        display: flex;
        align-items: center;
        gap: 8px;
      }
      .addon-info p {
        margin: 0;
        font-size: 13px;
        color: var(--text-muted);
        font-weight: 500;
        max-width: 350px;
        line-height: 1.5;
      }

      .qty-selector {
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--border-color);
        border-radius: 999px;
        overflow: hidden;
        height: 40px;
        background: var(--bg-light);
      }
      .qty-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--bg-alt);
        border: none;
        padding: 0 16px;
        cursor: pointer;
        font-size: 18px;
        font-weight: 700;
        color: var(--text-muted);
        transition: 0.2s;
        height: 100%;
      }
      .qty-btn:hover:not(:disabled) {
        background: #e2e8f0;
        color: var(--accent);
      }
      .qty-input {
        width: 48px;
        height: 100%;
        text-align: center;
        border: none;
        border-radius: 0;
        border-left: 1px solid var(--border-color);
        border-right: 1px solid var(--border-color);
        font-family: inherit;
        font-size: 16px;
        font-weight: 700;
        outline: none;
        margin: 0;
        padding: 0;
        -moz-appearance: textfield;
        color: var(--accent);
        background: transparent;
      }
      .qty-input::-webkit-outer-spin-button,
      .qty-input::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
      }

      /* Time Entries Section */
      .time-entry-card {
        display: flex;
        align-items: center;
        padding: 16px;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-sm);
        background: var(--card-bg);
        cursor: pointer;
        transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        margin-bottom: 12px;
      }
      .time-entry-card:hover {
        border-color: var(--primary);
        box-shadow: 0 6px 16px rgba(41, 173, 16, 0.08);
        transform: translateY(-2px);
      }
      .time-entry-card.disabled {
        cursor: not-allowed;
        opacity: 0.6;
      }
      .time-entry-card.disabled:hover {
        border-color: var(--border-color);
        box-shadow: none;
        transform: none;
      }

      .te-details {
        flex: 1;
        display: flex;
        justify-content: space-between;
        align-items: center;
        pointer-events: none;
      }
      .te-text {
        font-size: 14px;
        color: var(--accent);
        font-weight: 700;
      }
      .te-text span {
        color: var(--text-muted);
        font-size: 13px;
        display: block;
        font-weight: 500;
        margin-top: 4px;
      }
      .te-price {
        font-size: 15px;
        font-weight: 800;
        color: var(--accent);
      }

      /* Switch Toggle */
      .switch {
        position: relative;
        display: inline-block;
        width: 48px;
        height: 26px;
        flex-shrink: 0;
      }
      .switch input {
        opacity: 0;
        width: 0;
        height: 0;
        pointer-events: none;
      }
      .slider {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: var(--border-color);
        transition: 0.4s;
        border-radius: 999px;
        pointer-events: none;
      }
      .slider:before {
        position: absolute;
        content: "";
        height: 20px;
        width: 20px;
        left: 3px;
        bottom: 3px;
        background-color: white;
        transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        border-radius: 50%;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
      }
      input:checked + .slider {
        background-color: var(--primary);
      }
      input:checked + .slider:before {
        transform: translateX(22px);
      }

      .select-input {
        width: 100%;
        padding: 14px 16px;
        font-family: inherit;
        font-size: 15px;
        font-weight: 500;
        color: var(--text-main);
        border: 2px solid var(--border-color);
        border-radius: 12px;
        background-color: var(--bg-alt);
        outline: none;
        transition: all 0.3s ease;
        cursor: pointer;
      }
      .select-input:focus {
        border-color: var(--primary);
        background-color: var(--bg-light);
        box-shadow: 0 0 0 4px rgba(41, 173, 16, 0.1);
      }

      .secondary-btn {
        padding: 14px 28px;
        background-color: transparent;
        color: var(--accent);
        border: 2px solid var(--border-color);
        border-radius: 999px;
        font-size: 15px;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        display: flex;
        align-items: center;
        justify-content: center;
      }
      .secondary-btn:hover {
        border-color: var(--accent);
        background-color: var(--accent);
        color: white;
        transform: translateY(-2px);
      }

      .primary-btn {
        width: 100%;
        padding: 16px 28px;
        background-color: var(--primary);
        color: #ffffff;
        border: 2px solid transparent;
        border-radius: 999px;
        font-size: 16px;
        font-weight: 700;
        cursor: pointer;
        display: flex;
        justify-content: center;
        align-items: center;
        transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 0 4px 14px rgba(41, 173, 16, 0.25);
      }
      .primary-btn.blue-btn {
        background-color: var(--accent);
        box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25);
      }
      .primary-btn.blue-btn:hover {
        background-color: var(--accent-light);
        box-shadow: 0 6px 20px rgba(15, 23, 42, 0.35);
        transform: translateY(-2px);
      }
      .primary-btn:hover {
        background-color: var(--primary-hover);
        box-shadow: 0 6px 20px rgba(41, 173, 16, 0.35);
        transform: translateY(-2px);
      }

      .primary-btn:disabled,
      .secondary-btn:disabled {
        background-color: var(--border-color) !important;
        color: var(--text-muted) !important;
        cursor: not-allowed !important;
        box-shadow: none !important;
        border-color: transparent !important;
        transform: none !important;
      }

      /* Tax Gatekeeper */
      #tax-calculation-container {
        text-align: center;
        padding: 40px 24px;
        background: var(--bg-alt);
        border: 2px dashed var(--border-color);
        border-radius: var(--radius-md);
        margin-bottom: 32px;
      }

      #secure-checkout-section {
        opacity: 0.4;
        pointer-events: none;
        transition: opacity 0.4s ease;
      }
      #secure-checkout-section.unlocked {
        opacity: 1;
        pointer-events: auto;
      }

      /* Modals */
      .ceremony-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.85);
        z-index: 1000;
        justify-content: center;
        align-items: center;
        backdrop-filter: blur(8px);
        animation: fadeInOverlay 0.3s ease;
      }

      /* The signature ceremony is the only overlay that opens ON TOP of another
         one — modify / cancel / resume all launch it for in-person consent and
         stay open behind it. It sits earlier in the DOM than those modals, so
         at a shared z-index they painted over it. Keep it above the stack. */
      #ceremony-modal {
        z-index: 1100;
      }

      #warning-modal .ceremony-modal,
      #monthly-modal .ceremony-modal,
      #delete-card-modal .ceremony-modal {
        max-width: 460px;
        height: auto;
        min-height: unset;
        animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
      }

      .ceremony-modal {
        background: var(--card-bg);
        width: 95%;
        max-width: 900px;
        height: 90vh;
        max-height: 800px;
        border-radius: var(--radius-lg);
        display: flex;
        flex-direction: column;
        overflow: hidden;
        box-shadow: var(--shadow-modal);
        animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        border: 1px solid var(--border-color);
      }

      .ceremony-header {
        padding: 32px 40px 24px;
        background: var(--bg-light);
        border-bottom: 1px solid var(--border-color);
        display: flex;
        flex-direction: column;
        gap: 20px;
        flex-shrink: 0;
      }
      .ceremony-header-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
      }
      .ceremony-header-top h2 {
        margin: 0;
        font-size: 22px;
        font-weight: 800;
        color: var(--accent);
        display: flex;
        align-items: center;
        gap: 12px;
      }
      .ceremony-header-top svg {
        width: 28px;
        height: 28px;
        fill: var(--primary);
      }

      .ceremony-progress {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        max-width: 500px;
      }
      .ceremony-labels {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        width: 100%;
        max-width: 500px;
        margin-top: 10px;
        font-size: 12px;
        font-weight: 800;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.5px;
      }
      .ceremony-labels span:nth-child(1) {
        text-align: left;
      }
      .ceremony-labels span:nth-child(2) {
        text-align: center;
      }
      .ceremony-labels span:nth-child(3) {
        text-align: right;
      }

      .ceremony-step-container {
        flex: 1;
        display: none;
        flex-direction: column;
        min-height: 0;
      }
      .ceremony-step-container.active {
        display: flex;
      }

      .ceremony-body-scroll {
        flex: 1;
        overflow-y: auto;
        padding: 40px;
        background: var(--bg-alt);
      }
      .ceremony-footer {
        padding: 24px 40px;
        background: var(--bg-light);
        border-top: 1px solid var(--border-color);
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-shrink: 0;
      }

      .ceremony-details-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 24px;
        background: var(--card-bg);
        padding: 32px;
        border: 1px solid var(--border-color);
        margin-bottom: 32px;
        border-radius: var(--radius-md);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
      }
      .ceremony-details-grid small {
        font-size: 12px;
        color: var(--text-muted);
        font-weight: 700;
        letter-spacing: 0.5px;
        text-transform: uppercase;
        display: block;
        margin-bottom: 6px;
      }
      .ceremony-details-grid strong {
        display: block;
        font-size: 16px;
        font-weight: 800;
        color: var(--accent);
      }
      .ceremony-details-grid p {
        font-size: 14px;
        color: var(--text-muted);
        font-weight: 500;
        margin: 4px 0 0 0;
      }

      .legal-scroll-box {
        height: 350px;
        overflow-y: auto;
        border: 1px solid var(--border-color);
        background: var(--card-bg);
        padding: 32px;
        font-size: 14px;
        font-weight: 500;
        line-height: 1.7;
        color: var(--text-main);
        border-radius: var(--radius-md);
        margin-bottom: 24px;
        box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.02);
      }

      .consent-label {
        display: flex;
        align-items: flex-start;
        gap: 16px;
        cursor: pointer;
        background: var(--card-bg);
        padding: 24px;
        border: 2px solid var(--border-color);
        border-radius: var(--radius-md);
        transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
      }
      .consent-label:hover {
        border-color: var(--primary);
        box-shadow: 0 8px 20px rgba(41, 173, 16, 0.08);
        transform: translateY(-2px);
      }
      .consent-label input {
        margin-top: 2px;
        width: 22px;
        height: 22px;
        accent-color: var(--primary);
        flex-shrink: 0;
        cursor: pointer;
      }
      .consent-label span {
        font-size: 15px;
        font-weight: 600;
        color: var(--accent);
        line-height: 1.5;
      }

      .ceremony-canvas-wrapper {
        flex: 1;
        border: 2px dashed var(--border-color);
        border-radius: var(--radius-md);
        position: relative;
        background: var(--card-bg);
        box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.02);
        overflow: hidden;
        display: flex;
        flex-direction: column;
        min-height: 350px;
        transition:
          border-color 0.3s,
          background-color 0.3s;
      }
      .ceremony-canvas-wrapper.active {
        border-color: var(--primary);
        border-style: solid;
        box-shadow: 0 0 0 4px rgba(41, 173, 16, 0.1);
      }
      .ceremony-canvas-wrapper.locked {
        border-color: var(--border-color);
        background: var(--bg-alt);
        cursor: not-allowed;
      }

      canvas#ceremony-canvas {
        width: 100%;
        height: 100%;
        cursor: crosshair;
        touch-action: none;
        display: block;
      }

      .signature-line {
        position: absolute;
        bottom: 25%;
        left: 5%;
        right: 5%;
        height: 2px;
        background-color: var(--border-color);
        pointer-events: none;
      }
      .signature-hint {
        position: absolute;
        bottom: calc(25% - 28px);
        left: 5%;
        color: var(--text-muted);
        font-size: 14px;
        font-weight: 600;
        pointer-events: none;
      }
      .signature-x {
        position: absolute;
        bottom: calc(25% + 8px);
        left: 5%;
        color: #cbd5e1;
        font-size: 32px;
        font-weight: 800;
        pointer-events: none;
        line-height: 1;
      }

      /* Success Screen Restyling */
      #success-view {
        display: none;
        position: relative;
        padding: 32px 40px 80px;
        text-align: center;
        flex-direction: column;
        align-items: center;
        background: var(--bg-light);
        border-radius: inherit;
      }
      #success-confetti {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        pointer-events: none;
        z-index: 1;
      }
      .success-shell {
        position: relative;
        z-index: 2;
        width: 100%;
        max-width: 820px;
        margin: 0 auto;
        text-align: center;
      }
      .success-kicker {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 8px 16px;
        border-radius: 999px;
        background: var(--bg-alt);
        border: 1px solid var(--border-color);
        color: var(--text-muted);
        font-size: 12px;
        font-weight: 800;
        letter-spacing: 1px;
        text-transform: uppercase;
        margin-bottom: 24px;
      }
      .success-mark {
        width: 80px;
        height: 80px;
        margin: 0 auto 24px;
        border-radius: 24px;
        display: grid;
        place-items: center;
        background: var(--primary);
        box-shadow: 0 20px 40px rgba(41, 173, 16, 0.25);
      }
      .success-mark svg {
        width: 40px;
        height: 40px;
        fill: #ffffff;
      }
      .success-headline {
        margin: 0 auto;
        max-width: 760px;
        font-size: clamp(36px, 5vw, 48px);
        font-weight: 800;
        line-height: 1.1;
        letter-spacing: -1px;
        color: var(--accent);
      }
      .success-subcopy {
        margin: 20px auto 0;
        max-width: 660px;
        font-size: 18px;
        line-height: 1.6;
        color: var(--text-muted);
        font-weight: 500;
      }

      .success-pill-row {
        margin-top: 32px;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
      }
      .success-pill {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        padding: 12px 20px;
        border-radius: 999px;
        background: var(--bg-alt);
        border: 1px solid var(--border-color);
        color: var(--accent);
        font-size: 14px;
        font-weight: 700;
      }
      .success-pill .dot {
        width: 10px;
        height: 10px;
        border-radius: 999px;
        background: var(--primary);
      }

      .success-stats {
        margin-top: 48px;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 20px;
      }
      .success-stat {
        padding: 24px;
        border-radius: var(--radius-md);
        background: var(--bg-alt);
        border: 1px solid var(--border-color);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
      }
      .success-stat-label {
        font-size: 12px;
        font-weight: 800;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 12px;
      }
      .success-stat-value {
        font-size: 26px;
        line-height: 1.2;
        font-weight: 800;
        color: var(--accent);
        letter-spacing: -0.5px;
      }
      .success-stat-sub {
        margin-top: 10px;
        font-size: 13px;
        line-height: 1.5;
        color: var(--text-muted);
        font-weight: 500;
      }

      .success-divider {
        height: 1px;
        background: var(--border-color);
        margin: 48px 0;
        width: 100%;
      }
      .success-checklist {
        background: transparent;
        border: none;
        padding: 0;
        text-align: left;
        width: 100%;
      }
      .check-item {
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 16px;
        align-items: start;
        margin-bottom: 24px;
      }
      .check-item:last-child {
        margin-bottom: 0;
      }
      .check-icon {
        width: 32px;
        height: 32px;
        border-radius: 999px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: rgba(41, 173, 16, 0.1);
        color: var(--primary);
        margin-top: 2px;
      }
      .check-icon svg {
        width: 16px;
        height: 16px;
        fill: currentColor;
      }
      .check-title {
        font-size: 16px;
        font-weight: 800;
        line-height: 1.4;
        color: var(--accent);
      }
      .check-meta {
        margin-top: 6px;
        font-size: 14px;
        line-height: 1.5;
        color: var(--text-muted);
        font-weight: 500;
      }

      .premium-close-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 16px 32px;
        border: none;
        border-radius: 999px;
        background: var(--accent);
        color: #ffffff;
        cursor: pointer;
        font-size: 16px;
        font-weight: 700;
        box-shadow: 0 10px 25px rgba(15, 23, 42, 0.2);
        transition: all 0.3s ease;
      }
      .premium-close-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 15px 35px rgba(15, 23, 42, 0.3);
        background: var(--accent-light);
      }

      /* Toasts */
      .toast-stack {
        position: fixed;
        top: 24px;
        right: 24px;
        display: flex;
        flex-direction: column;
        gap: 16px;
        z-index: 3000;
        width: min(420px, calc(100vw - 48px));
        pointer-events: none;
      }
      .toast {
        pointer-events: auto;
        display: grid;
        grid-template-columns: auto 1fr auto;
        gap: 16px;
        align-items: start;
        padding: 20px;
        border-radius: var(--radius-md);
        color: #ffffff;
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
        animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
      }
      .toast.error {
        background: #ef4444;
      }
      .toast.success {
        background: var(--primary);
      }
      .toast.warn {
        background: #f59e0b;
        color: #fffbeb;
      }
      .toast-icon {
        width: 32px;
        height: 32px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.2);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
      }
      .toast-icon svg {
        width: 16px;
        height: 16px;
        fill: currentColor;
      }
      .toast-title {
        font-size: 15px;
        font-weight: 800;
        line-height: 1.3;
        margin-bottom: 6px;
      }
      .toast-message {
        font-size: 14px;
        line-height: 1.5;
        font-weight: 500;
        color: rgba(255, 255, 255, 0.9);
      }
      .toast-close {
        border: none;
        background: transparent;
        color: rgba(255, 255, 255, 0.7);
        cursor: pointer;
        font-size: 24px;
        padding: 0;
        transition: color 0.2s;
      }
      .toast-close:hover {
        color: #ffffff;
      }

      /* Custom Checkbox */
      input[type="checkbox"].custom-cb {
        appearance: none;
        -webkit-appearance: none;
        width: 22px;
        height: 22px;
        border: 2px solid var(--border-color);
        border-radius: 6px;
        background-color: var(--card-bg);
        cursor: pointer;
        position: relative;
        transition: all 0.2s;
        margin: 0;
        flex-shrink: 0;
      }
      input[type="checkbox"].custom-cb:checked {
        background-color: var(--primary);
        border-color: var(--primary);
      }
      input[type="checkbox"].custom-cb:checked::after {
        content: "";
        position: absolute;
        left: 6px;
        top: 3px;
        width: 5px;
        height: 10px;
        border: solid white;
        border-width: 0 2px 2px 0;
        transform: rotate(45deg);
      }
      input[type="checkbox"].custom-cb:disabled {
        background-color: var(--bg-alt);
        cursor: not-allowed;
        opacity: 0.6;
      }

      .visually-hidden {
        position: absolute !important;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
      }
      .footer-copyright {
        margin-top: 48px;
        font-size: 13px;
        color: var(--text-muted);
        font-weight: 600;
        text-align: center;
        padding-bottom: 24px;
      }

      /* =================================================================
         REVIEW-ENROLLMENT MODE
         ================================================================= */
      .review-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px 24px;
      }
      .review-grid > div {
        display: flex;
        flex-direction: column;
        gap: 4px;
        min-width: 0;
      }
      .review-label {
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.6px;
        font-weight: 800;
        color: var(--text-muted);
      }
      .review-value {
        font-size: 15px;
        font-weight: 700;
        color: var(--accent);
        line-height: 1.4;
        word-break: break-word;
      }
      .review-sig-name {
        font-family: "Brush Script MT", "Lucida Handwriting", cursive;
        font-size: 26px;
        font-weight: 400;
        line-height: 1.2;
        color: var(--accent);
      }
      .review-flag-card {
        display: flex;
        gap: 14px;
        align-items: flex-start;
        padding: 16px 18px;
        border-radius: var(--radius-md);
        background: #fffbeb;
        border: 1px solid #fde047;
        color: #78350f;
      }
      .review-flag-card svg {
        width: 22px;
        height: 22px;
        fill: #b45309;
        flex-shrink: 0;
        margin-top: 1px;
      }
      .review-flag-card .review-flag-code {
        font-size: 11px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.6px;
        color: #92400e;
        margin-bottom: 4px;
      }
      .review-flag-card .review-flag-message {
        font-size: 14px;
        line-height: 1.5;
        color: #78350f;
        font-weight: 600;
      }
      .review-flag-empty {
        padding: 16px 18px;
        border-radius: var(--radius-md);
        background: rgba(41, 173, 16, 0.08);
        border: 1px solid rgba(41, 173, 16, 0.25);
        color: var(--primary);
        font-size: 14px;
        font-weight: 700;
      }
      #review-status-banner.is-pending {
        background: #fefce8;
        border: 1px solid #fde047;
        color: #854d0e;
      }
      #review-status-banner.is-approved {
        background: rgba(41, 173, 16, 0.08);
        border: 1px solid rgba(41, 173, 16, 0.25);
        color: var(--primary);
      }
      #review-status-banner.is-rejected {
        background: #fef2f2;
        border: 1px solid #fecaca;
        color: var(--brand-red);
      }
      #review-status-banner svg {
        width: 22px;
        height: 22px;
        fill: currentColor;
        flex-shrink: 0;
      }

      /* ---- Why-this-is-in-review explainer ---- */
      .review-why {
        margin-bottom: 24px;
        padding: 18px 22px;
        border-radius: var(--radius-md);
        background: #eff6ff;
        border: 1px solid #bfdbfe;
        color: #1e3a8a;
      }
      .review-why-title {
        margin: 0 0 8px;
        font-size: 15px;
        font-weight: 800;
        color: #1e3a8a;
        letter-spacing: -0.2px;
      }
      .review-why-body {
        margin: 0 0 10px;
        font-size: 14px;
        line-height: 1.6;
      }
      .review-why-list {
        margin: 0;
        padding-left: 20px;
        font-size: 14px;
        line-height: 1.6;
      }
      .review-why-list li { margin-bottom: 2px; }

      /* ---- Section title row (title + action button) ---- */
      .section-title-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 8px;
      }
      .review-sublabel {
        font-size: 12px;
        font-weight: 500;
        color: var(--text-muted);
        margin-top: 2px;
      }

      /* ---- Friendly flag card (title + advice) ---- */
      .review-flag-card .review-flag-title {
        font-size: 14px;
        font-weight: 800;
        color: #78350f;
        margin-bottom: 4px;
      }
      .review-flag-card .review-flag-advice {
        font-size: 13px;
        line-height: 1.5;
        color: #78350f;
        margin-top: 6px;
        font-style: italic;
      }

      /* ---- Confidence pill ---- */
      .confidence-pill {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 4px 12px;
        border-radius: 999px;
        font-size: 12px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        border: 1px solid currentColor;
      }
      .confidence-pill.is-green {
        background: rgba(41, 173, 16, 0.1);
        color: var(--primary);
        border-color: rgba(41, 173, 16, 0.4);
      }
      .confidence-pill.is-yellow {
        background: #fffbeb;
        color: #b45309;
        border-color: #fde68a;
      }
      .confidence-pill.is-red {
        background: #fef2f2;
        color: var(--brand-red);
        border-color: #fecaca;
      }

      /* ---- Linkage actions + inline panels ---- */
      .linkage-actions {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px dashed var(--border-color);
      }
      .link-action-btn {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 8px 14px;
        border-radius: var(--radius-md);
        background: white;
        border: 1px solid var(--border-color);
        color: var(--accent);
        font-family: inherit;
        font-size: 13px;
        font-weight: 700;
        cursor: pointer;
        transition: border-color 0.15s, background 0.15s;
      }
      .link-action-btn:hover { border-color: var(--primary); background: var(--bg-alt); }

      .linkage-panel {
        margin-top: 14px;
        padding: 16px;
        background: var(--bg-alt);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
      }
      .linkage-panel[hidden] { display: none; }
      .linkage-status {
        font-size: 12px;
        color: var(--text-muted);
        margin: 8px 0;
        min-height: 1em;
      }
      .linkage-status.is-err { color: var(--brand-red); font-weight: 600; }
      .linkage-results {
        list-style: none;
        padding: 0;
        margin: 0;
        max-height: 240px;
        overflow-y: auto;
      }
      .linkage-results li {
        padding: 10px 12px;
        border-radius: var(--radius-md);
        cursor: pointer;
        font-size: 13px;
        color: var(--text-main);
        line-height: 1.4;
        border: 1px solid transparent;
      }
      .linkage-results li:hover,
      .linkage-results li.is-selected {
        background: #effded;
        border-color: rgba(41, 173, 16, 0.25);
      }
      .linkage-results li .linkage-result-name {
        font-weight: 700;
        color: var(--accent);
      }
      .linkage-results li .linkage-result-meta {
        font-size: 12px;
        color: var(--text-muted);
        margin-top: 2px;
      }
      .linkage-help {
        font-size: 12px;
        color: var(--text-muted);
        margin: 10px 0 0;
      }
      .text-link {
        background: none;
        border: none;
        padding: 0;
        color: var(--primary);
        font: inherit;
        font-weight: 700;
        text-decoration: underline;
        cursor: pointer;
      }

      /* ---- Inline edit toggle + inputs ---- */
      .edit-toggle-btn {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 6px 12px;
        border-radius: var(--radius-md);
        background: white;
        border: 1px solid var(--border-color);
        color: var(--accent);
        font-family: inherit;
        font-size: 12px;
        font-weight: 700;
        cursor: pointer;
        transition: border-color 0.15s, background 0.15s;
      }
      .edit-toggle-btn:hover { border-color: var(--primary); background: var(--bg-alt); }
      .edit-toggle-btn.is-editing {
        background: var(--primary);
        color: white;
        border-color: var(--primary);
      }
      .edit-input {
        width: 100%;
        padding: 10px 12px;
        border: 1px solid var(--border-color);
        background: white;
        border-radius: var(--radius-md);
        font-family: inherit;
        font-size: 14px;
        color: var(--accent);
        font-weight: 600;
        transition: border-color 0.15s, box-shadow 0.15s;
      }
      .edit-input:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(41, 173, 16, 0.15);
      }
      .edit-actions {
        display: flex;
        gap: 10px;
        justify-content: flex-end;
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px dashed var(--border-color);
      }
      .edit-actions[hidden] { display: none; }
      .edit-actions .secondary-btn,
      .edit-actions .primary-btn {
        padding: 8px 16px;
        font-size: 13px;
        margin: 0;
        min-width: 120px;
      }
      .info-card.is-edited::after {
        content: "✓ Edited";
        display: inline-block;
        margin-top: 12px;
        padding: 3px 10px;
        background: rgba(41, 173, 16, 0.1);
        color: var(--primary);
        border-radius: 999px;
        font-size: 11px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.5px;
      }

      .pending-edits-note {
        margin: 0 0 16px;
        padding: 12px 16px;
        border-radius: var(--radius-md);
        background: #fef3c7;
        border: 1px solid #fde68a;
        color: #92400e;
        font-size: 13px;
      }

      /* ---- Linkage active-membership warning ---- */
      .linkage-am-warn {
        margin-top: 14px;
        padding: 12px 14px;
        border-radius: var(--radius-md);
        font-size: 13px;
        line-height: 1.5;
        display: flex;
        gap: 10px;
        align-items: flex-start;
      }
      .linkage-am-warn[hidden] { display: none; }
      .linkage-am-warn.is-warning {
        background: #fef3c7;
        border: 1px solid #fde68a;
        color: #92400e;
      }
      .linkage-am-warn.is-ok {
        background: rgba(41, 173, 16, 0.08);
        border: 1px solid rgba(41, 173, 16, 0.25);
        color: var(--primary);
      }
      .linkage-am-warn.is-loading,
      .linkage-am-warn.is-error {
        background: var(--bg-alt);
        border: 1px solid var(--border-color);
        color: var(--text-muted);
        font-style: italic;
      }
      .linkage-am-warn svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
        margin-top: 1px;
      }

      /* ---- Address re-validate row inside edit panel ---- */
      .addr-revalidate-row {
        display: flex;
        align-items: center;
        gap: 12px;
        flex-wrap: wrap;
        margin-top: 14px;
        padding-top: 14px;
        border-top: 1px dashed var(--border-color);
      }
      .addr-revalidate-row[hidden] { display: none; }
      .addr-revalidate-result {
        font-size: 13px;
        line-height: 1.5;
        color: var(--text-muted);
        flex: 1;
        min-width: 240px;
      }
      .addr-revalidate-result.is-ok {
        color: var(--primary);
        font-weight: 700;
      }
      .addr-revalidate-result.is-warn {
        color: #b45309;
        font-weight: 600;
      }
      .addr-revalidate-result.is-err {
        color: var(--brand-red);
        font-weight: 600;
      }
      .addr-revalidate-result.is-loading {
        color: var(--text-muted);
        font-style: italic;
      }
      .addr-revalidate-result .addr-revalidate-suggest {
        margin-top: 4px;
        font-size: 12px;
        font-weight: 500;
        color: var(--text-muted);
        font-style: normal;
      }
      .addr-revalidate-result .addr-revalidate-suggest button {
        background: none;
        border: none;
        padding: 0;
        margin-left: 4px;
        color: var(--primary);
        font: inherit;
        font-weight: 700;
        text-decoration: underline;
        cursor: pointer;
      }

      @media (max-width: 720px) {
        .review-grid {
          grid-template-columns: 1fr;
        }
        #review-wrapper .header,
        #review-wrapper > div {
          padding-left: 20px !important;
          padding-right: 20px !important;
        }
        .section-title-row { flex-wrap: wrap; }
      }

      /* =========================================================
         TICKET COVERAGE PICKER (company-only links)
         ========================================================= */
      .open-tickets-list {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-bottom: 8px;
      }
      .open-ticket-card {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 16px 18px;
        background: var(--card-bg);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        cursor: pointer;
        transition:
          border-color 0.15s ease,
          box-shadow 0.15s ease,
          transform 0.05s ease;
      }
      .open-ticket-card:hover {
        border-color: var(--primary);
        box-shadow: 0 4px 14px rgba(41, 173, 16, 0.12);
      }
      .open-ticket-card:active {
        transform: translateY(1px);
      }
      .open-ticket-main {
        min-width: 0;
      }
      .open-ticket-row {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 4px;
      }
      .open-ticket-id {
        font-weight: 800;
        color: var(--accent);
        font-size: 15px;
      }
      .open-ticket-status {
        font-size: 10px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: var(--text-muted);
        background: var(--bg-alt);
        border: 1px solid var(--border-color);
        padding: 2px 8px;
        border-radius: 6px;
      }
      .open-ticket-summary {
        font-size: 14px;
        font-weight: 600;
        color: var(--accent);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 360px;
      }
      .open-ticket-meta {
        font-size: 12px;
        color: var(--text-muted);
        margin-top: 2px;
      }
      .open-ticket-aside {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 4px;
        flex-shrink: 0;
      }
      .open-ticket-amount {
        font-size: 15px;
        font-weight: 800;
        color: var(--primary);
      }
      .open-ticket-amount.muted {
        color: var(--text-muted);
      }
      .open-ticket-cta {
        font-size: 11px;
        font-weight: 700;
        color: var(--text-muted);
      }
      .open-tickets-empty {
        padding: 24px;
        text-align: center;
        background: var(--bg-alt);
        border: 1px dashed var(--border-color);
        border-radius: var(--radius-md);
        color: var(--text-muted);
        font-size: 14px;
        font-weight: 500;
      }
      .ticket-picker-divider {
        display: flex;
        align-items: center;
        text-align: center;
        margin: 18px 0;
        color: var(--text-muted);
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.04em;
      }
      .ticket-picker-divider::before,
      .ticket-picker-divider::after {
        content: "";
        flex: 1;
        height: 1px;
        background: var(--border-color);
      }
      .ticket-picker-divider span {
        padding: 0 12px;
      }
      .ticket-picker-manual {
        display: flex;
        gap: 12px;
      }
      .manual-ticket-input {
        flex: 1;
        padding: 12px 14px;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        font-size: 15px;
        font-weight: 600;
        color: var(--accent);
        background: var(--card-bg);
      }
      .manual-ticket-input:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(41, 173, 16, 0.12);
      }
      .referral-code-input {
        width: 100%;
        padding: 12px 14px;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        font-size: 15px;
        font-weight: 600;
        color: var(--accent);
        background: var(--card-bg);
        text-transform: uppercase;
        letter-spacing: 2px;
      }
      .referral-code-input:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(41, 173, 16, 0.12);
      }
      .btn-load-ticket {
        padding: 12px 18px;
        border: none;
        border-radius: var(--radius-md);
        background: var(--primary);
        color: #fff;
        font-size: 14px;
        font-weight: 800;
        cursor: pointer;
        white-space: nowrap;
        transition: filter 0.15s ease;
      }
      .btn-load-ticket:hover {
        filter: brightness(0.95);
      }
      @media (max-width: 600px) {
        .open-ticket-summary {
          max-width: 200px;
        }
        .ticket-picker-manual {
          flex-direction: column;
        }
      }
