@import url('https://fonts.googleapis.com/css2?family=Inter:wght@600;700;800;900&family=Poppins:wght@700;800;900&display=swap');

/*
 * Daily Routine Tracker Pro v4.1.0 — Fixed & Refactored Stylesheet
 *
 * Fixes applied:
 *   1. THEME INTEGRATION: Blue color palette (#0F4CFF family) replaces teal.
 *      CSS variables updated globally — all components inherit automatically.
 *   2. EDGE-TO-EDGE CANVAS: #rtp-app-root fills full viewport with zero
 *      accidental white gaps between theme header/footer.
 *   3. ACTIVE TAB TEXT: Forced white (color: #ffffff !important) on active
 *      tab button text so it's always legible over the sliding indicator.
 *   4. TIME BADGE: Vibrant green gradient matching success palette.
 *   5. HERO TITLE: Changed from 3-line forced breaks to 2-line natural flow,
 *      reducing excess vertical space before the % counter.
 *   6. FLUID RESPONSIVENESS: Cleaned up breakpoints for mobile/tablet/desktop.
 */

:root {
    /* ── Blue palette from brand swatch (image reference) ── */
    --primary:        #2159E5;   /* #2159E5  mid-blue — primary interactive */
    --primary-dark:   #0F4CFF;   /* #0F4CFF  vivid blue — gradients / hero   */
    --primary-mid:    #4277E0;   /* #4277E0  medium blue — hover states       */
    --primary-light:  #7CA2FF;   /* #7CA2FF  soft blue — borders / tints      */
    --primary-pale:   #BCCFFF;   /* #BCCFFF  very light blue — backgrounds    */
    --primary-ghost:  #F0F4FF;   /* #F0F4FF  near-white blue — card bg        */

    /* Kept for semantic meaning — now mapped to blue-compatible greens */
    --green-success:  #10b981;
    --yellow-warning: #f59e0b;
    --red-danger:     #ef4444;
    --orange-accent:  #f59e0b;

    /* Text */
    --text-dark:      #0f2057;   /* deep navy — replaces dark-teal            */
    --text-muted:     #64748b;

    /* Glass / Surfaces */
    --glass-bg:       rgba(240, 244, 255, 0.5);
    --glass-border:   rgba(188, 207, 255, 0.6);

    /* Shadows (blue-tinted) */
    --shadow-sm:  0 2px 8px rgba(33, 89, 229, 0.08);
    --shadow-md:  0 4px 16px rgba(33, 89, 229, 0.14);
    --shadow-lg:  0 8px 32px rgba(33, 89, 229, 0.20);

    /* Page gradient */
    --bg-gradient-start: #dde6ff;
    --bg-gradient-mid:   #f0f4ff;
    --bg-gradient-end:   #ffffff;

    /* Aliases kept for backward-compat with JS-referenced values */
    --primary-teal: var(--primary);
    --dark-teal:    var(--primary-dark);
    --light-teal:   var(--primary-light);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ========================================
   THEME BLEED-OUT OVERRIDES
   Strips horizontal padding/margin from every common WP theme
   content wrapper so the plugin background fills edge-to-edge
   and feels native rather than embedded in a content box.
======================================== */
.entry-content:has(#rtp-app-root),
.page-content:has(#rtp-app-root),
.post-content:has(#rtp-app-root),
.site-main:has(#rtp-app-root),
.wp-block-post-content:has(#rtp-app-root),
.elementor-widget-container:has(#rtp-app-root),
.fl-module-content:has(#rtp-app-root),
article:has(#rtp-app-root),
main:has(#rtp-app-root) {
    padding-left:  0   !important;
    padding-right: 0   !important;
    margin-left:   0   !important;
    margin-right:  0   !important;
    max-width:     none !important;
    width:         100% !important;
}

/* ========================================
   ROOT & CONTAINER
======================================== */

/*
 * SCOPED THEME MARGIN OVERRIDE
 * Targets only the .site-content that wraps our plugin.
 * Uses :has() so NO other .site-content on the site is affected.
 */
.site-content:has(#rtp-app-root) {
    margin-top:    0 !important;
    margin-bottom: 0 !important;
    padding-top:   0 !important;
    padding-bottom:0 !important;
}

#rtp-app-root {
    background: transparent;
    min-height: 100vh;
    padding: 0 0 56px;
    /* Negative margin trick: break out of any padded ancestor */
    margin-left:  calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    width:  100vw !important;
    max-width: 100vw !important;
    position: relative;
    left: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-dark);
}

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

/* ========================================
   HEADER / HERO — Redesigned
   Clean two-column: title+meta left, big % right
   All badges transparent — no pill backgrounds
======================================== */
.rtp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 0;
    margin-bottom: 20px;
    padding-top: 16px;
    gap: 12px;
}

.rtp-header-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.rtp-title {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(26px, 6vw, 38px);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -1.5px;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.rtp-date-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 12px;
    width: fit-content;
}

.rtp-date-badge .rtp-icon {
    width: 13px;
    height: 13px;
    color: var(--primary);
    flex-shrink: 0;
}

.rtp-next-reset {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    color: var(--orange-accent);
    background: transparent;
    padding: 0;
    border: none;
    width: fit-content;
}

.rtp-icon-sm {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.rtp-streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 800;
    color: #ea580c;
    background: transparent;
    padding: 0;
    border: none;
    width: fit-content;
    animation: none;
}

@keyframes streakGlow {
    from { opacity: 0.8; }
    to   { opacity: 1; }
}

.rtp-header-right {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
}

.rtp-hero-pct {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(38px, 10vw, 56px);
    font-weight: 900;
    color: var(--primary-dark);
    line-height: 1;
    letter-spacing: -3px;
    text-shadow: 0 2px 12px rgba(15, 76, 255, 0.18);
}

.rtp-hero-ratio {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 12px;
    margin-top: 3px;
    white-space: nowrap;
    text-align: right;
}

/* ========================================
   STATS CARDS
======================================== */
.rtp-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

.rtp-stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    padding: 20px 12px;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.rtp-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.rtp-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
}

.rtp-stat-card:hover .rtp-stat-icon {
    transform: scale(1.1) rotate(5deg);
}

.rtp-stat-icon svg {
    width: 18px;
    height: 18px;
    z-index: 2;
}

.rtp-card-done .rtp-stat-icon  { background: linear-gradient(135deg, #10b981, #059669); color: white; }
.rtp-card-total .rtp-stat-icon { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: white; }
.rtp-card-time .rtp-stat-icon  { background: linear-gradient(135deg, var(--primary-pale), var(--primary-light)); color: var(--primary-dark); }

.rtp-card-done  { color: var(--green-success); }
.rtp-card-total { color: var(--yellow-warning); }
.rtp-card-time  { color: var(--primary); }

.rtp-stat-val {
    font-family: 'Poppins', sans-serif;
    font-size: 26px;
    font-weight: 900;
    margin-bottom: 4px;
    color: var(--text-dark);
}

.rtp-stat-lbl {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
   TABS
   FIX: Active tab text forced white (#ffffff) so it reads against the
   white sliding indicator underneath it.
======================================== */
.rtp-tabs {
    background: rgba(33, 89, 229, 0.07);
    border-radius: 50px;
    display: flex;
    padding: 5px;
    position: relative;
    margin-bottom: 28px;
    box-shadow: inset 0 2px 4px rgba(33, 89, 229, 0.08);
}

.rtp-tab-btn {
    flex: 1;
    border: none;
    background: none;
    padding: 12px 16px;
    font-weight: 800;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    z-index: 2;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    font-family: inherit;
    border-radius: 40px;
}

.rtp-tab-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.rtp-tab-btn:hover { color: var(--primary-dark); }

/* FIX: Active tab text must be white regardless of inherited theme styles */
.rtp-tab-btn.active,
.rtp-tab-btn.active svg {
    color: #ffffff !important;
}

.rtp-tab-indicator {
    position: absolute;
    top: 5px;
    left: 5px;
    width: calc(33.33% - 10px);
    height: calc(100% - 10px);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 40px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1;
    box-shadow: 0 2px 10px rgba(33, 89, 229, 0.35);
}

/* ========================================
   TODAY — CATEGORY HEADERS
======================================== */
.rtp-category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0 8px;
    padding: 0 4px;
}

.rtp-category-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.rtp-category-label {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    flex: 1;
}

.rtp-category-count {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 8px;
    border-radius: 20px;
}

/* ========================================
   TODAY — TASK ROWS
======================================== */
.rtp-task {
    background: rgba(240, 244, 255, 0.85);
    backdrop-filter: blur(8px);
    border: 2px solid rgba(188, 207, 255, 0.5);
    border-radius: 22px;
    padding: 14px 18px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
    cursor: pointer;
    will-change: transform, box-shadow;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.25s ease,
                border-color 0.25s ease,
                background 0.25s ease;
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.rtp-task:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(33, 89, 229, 0.14);
    border-color: rgba(124, 162, 255, 0.8);
}

.rtp-task:active {
    transform: scale(0.98);
    box-shadow: none;
}

.rtp-task.done {
    background: rgba(243, 244, 246, 0.6);
    border-color: rgba(209, 213, 219, 0.5);
}

/* Check ring */
.rtp-check-ring {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2.5px solid #cbd5e1;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    will-change: transform, background, border-color;
    transition: background 0.2s ease,
                border-color 0.2s ease,
                transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rtp-task:active .rtp-check-ring { transform: scale(0.9); }

.rtp-task.done .rtp-check-ring {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #10b981;
    transform: scale(1.08);
}

.rtp-check-ring svg {
    width: 15px;
    height: 15px;
    color: white;
    opacity: 0;
    transform: scale(0) rotate(-30deg);
    will-change: transform, opacity;
    transition: opacity 0.18s ease,
                transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
}

.rtp-task.done .rtp-check-ring svg {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* Task content layout */
.rtp-task-content {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.rtp-task-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    min-width: 0;
}

.rtp-task-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
    text-align: left;
    word-break: break-word;
    transition: opacity 0.25s ease, text-decoration 0.25s ease;
}

.rtp-task.done .rtp-task-name {
    text-decoration: line-through;
    opacity: 0.4;
}

.rtp-task-note {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    font-style: italic;
    text-align: left;
    transition: opacity 0.25s ease;
}

.rtp-task.done .rtp-task-note {
    opacity: 0.3;
    text-decoration: line-through;
}

/*
 * TIME PILL / TIME BADGE
 * FIX: Vibrant green gradient for polished, distinct appearance
 * that harmonises with success colours and stands apart from blue.
 */
.rtp-time-pill {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    flex-shrink: 0;
    align-self: center;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.30);
    transition: background 0.25s ease;
}

.rtp-task.done .rtp-time-pill {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
    box-shadow: none;
}

/* ========================================
   EMPTY STATE
======================================== */
.rtp-empty-state {
    text-align: center;
    padding: 60px 20px;
    opacity: 0.4;
}

.rtp-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    color: var(--text-muted);
}

.rtp-empty-text {
    font-weight: 800;
    font-size: 15px;
    color: var(--text-muted);
}

/* ========================================
   PANELS
======================================== */
.rtp-panel {
    background: white;
    border-radius: 24px;
    padding: 24px;
    border: 2px solid var(--primary-pale);
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s;
}

.rtp-panel:hover {
    box-shadow: var(--shadow-md);
}

.rtp-panel-header {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.rtp-panel-icon {
    width: 24px;
    height: 24px;
    color: var(--primary);
    flex-shrink: 0;
}

/* ========================================
   FORMS
======================================== */
.rtp-form-group {
    margin-bottom: 18px;
}

.rtp-form-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 8px;
    text-align: left;
}

input,
textarea {
    width: 100%;
    padding: 13px 16px;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-dark);
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(33, 89, 229, 0.12);
}

input::placeholder,
textarea::placeholder { color: #cbd5e1; }

input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }

textarea {
    resize: vertical;
    min-height: 64px;
}

/* Category chips */
.rtp-category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.rtp-chip {
    padding: 5px 12px;
    border-radius: 20px;
    border: 1.5px solid #e5e7eb;
    background: white;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.15s;
}

.rtp-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(33, 89, 229, 0.05);
    transform: translateY(-1px);
}

/* ========================================
   BUTTONS
======================================== */
.rtp-btn-main {
    width: 100%;
    padding: 15px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff !important;
    font-family: inherit;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(33, 89, 229, 0.25);
    transition: transform 0.2s, box-shadow 0.2s;
}

.rtp-btn-main svg { width: 18px; height: 18px; flex-shrink: 0; }

.rtp-btn-main:hover  { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(33, 89, 229, 0.35); }
.rtp-btn-main:active { transform: translateY(0); box-shadow: none; }

.rtp-btn-reset {
    width: 100%;
    padding: 13px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #64748b, #475569);
    color: #ffffff !important;
    font-family: inherit;
    font-weight: 800;
    font-size: 14px;
    margin-top: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.rtp-btn-reset:hover  { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(100, 116, 139, 0.3); }
.rtp-btn-reset:active { transform: translateY(0); box-shadow: none; }

/* ========================================
   MANAGE — TASK LIST
======================================== */
.rtp-task-list-manage {
    margin-bottom: 20px;
}

.rtp-drag-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding: 0 4px;
    opacity: 0.6;
}

.rtp-task-item {
    background: rgba(248, 250, 252, 0.9);
    padding: 12px 14px;
    margin-bottom: 10px;
    border-radius: 18px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    border: 1px solid #e2e8f0;
    transition: background 0.2s, box-shadow 0.2s;
}

.rtp-task-item:hover {
    background: white;
    box-shadow: var(--shadow-sm);
}

.rtp-drag-handle {
    color: #cbd5e1;
    cursor: grab;
    padding: 4px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: color 0.2s;
    touch-action: none;
}

.rtp-drag-handle:active { cursor: grabbing; }
.rtp-drag-handle svg { width: 18px; height: 18px; }
.rtp-drag-handle:hover { color: var(--primary); }

.rtp-task-item-info {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.rtp-task-item-name {
    font-weight: 800;
    font-size: 14px;
    color: var(--text-dark);
    text-align: left;
    word-break: break-word;
    margin-bottom: 4px;
}

.rtp-task-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rtp-tag {
    font-size: 10px;
    font-weight: 700;
    color: var(--primary);
    background: rgba(33, 89, 229, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.rtp-note-indicator {
    font-size: 12px;
    cursor: help;
}

.rtp-task-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    align-items: center;
}

.rtp-btn-edit {
    background: rgba(33, 89, 229, 0.1);
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, transform 0.15s;
}

.rtp-btn-edit svg { width: 16px; height: 16px; }

.rtp-btn-edit:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
}

.rtp-btn-remove {
    background: rgba(239, 68, 68, 0.1);
    border: none;
    color: var(--red-danger);
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, transform 0.15s;
}

.rtp-btn-remove svg { width: 16px; height: 16px; }

.rtp-btn-remove:hover {
    background: var(--red-danger);
    color: white;
    transform: translateY(-1px);
}

/* Drag states */
.rtp-drag-ghost {
    opacity: 0.35;
    background: rgba(33, 89, 229, 0.05) !important;
    border: 2px dashed var(--primary) !important;
}

.rtp-drag-chosen {
    box-shadow: 0 8px 24px rgba(33, 89, 229, 0.20) !important;
    transform: rotate(0.8deg);
}

/* ========================================
   HISTORY
======================================== */
.rtp-section-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin: 20px 0 12px 4px;
}

.rtp-history-item {
    background: white;
    padding: 16px 20px;
    margin-bottom: 12px;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.rtp-history-item:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--primary-light);
}

.rtp-history-date {
    font-weight: 800;
    font-size: 14px;
    color: var(--primary-dark);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rtp-history-date svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.rtp-perfect-badge {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 20px;
}

.rtp-history-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.rtp-history-stat {
    text-align: center;
}

.rtp-history-stat-val {
    font-weight: 900;
    font-size: 17px;
    color: var(--text-dark);
}

.rtp-history-stat-lbl {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 2px;
}

.rtp-completion-bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 4px;
}

.rtp-completion-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green-success), var(--primary-light));
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Streak card */
.rtp-streak-card {
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.05), rgba(245, 158, 11, 0.08)) !important;
    border-color: rgba(234, 88, 12, 0.2) !important;
}

/* Per-task stats */
.rtp-task-stats-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rtp-task-stat-row {
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.rtp-task-stat-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.rtp-task-stat-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.rtp-task-stat-name {
    font-weight: 800;
    font-size: 14px;
    color: var(--text-dark);
    word-break: break-word;
    flex: 1;
    text-align: left;
}

/* ========================================
   EDIT MODAL
======================================== */
.rtp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    opacity: 0;
    transition: opacity 0.25s;
}

.rtp-modal-overlay.open { opacity: 1; }

.rtp-modal {
    background: white;
    border-radius: 28px 28px 0 0;
    padding: 28px 24px 40px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 -4px 40px rgba(0, 0, 0, 0.15);
}

.rtp-modal-overlay.open .rtp-modal { transform: translateY(0); }

.rtp-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.rtp-modal-header h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-dark);
}

.rtp-modal-close {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: background 0.2s, color 0.2s;
    font-family: inherit;
}

.rtp-modal-close:hover {
    background: #e2e8f0;
    color: var(--text-dark);
}

/* ========================================
   RESET NOTIFICATION
======================================== */
.rtp-reset-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-120px);
    background: white;
    padding: 14px 24px;
    border-radius: 50px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: 2px solid var(--primary);
    z-index: 9999;
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
}

.rtp-reset-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.rtp-reset-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 14px;
    color: var(--primary-dark);
    white-space: nowrap;
}

.rtp-reset-content svg {
    width: 22px;
    height: 22px;
    color: var(--green-success);
    animation: spinOnce 0.7s ease-in-out;
    flex-shrink: 0;
}

@keyframes spinOnce {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ========================================
   ANIMATIONS
======================================== */
.rtp-fade-in {
    animation: fadeIn 0.4s ease both;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ========================================
   UTILITY
======================================== */
.rtp-text-center { text-align: center; }

/* ========================================
   KILL THEME BOTTOM GAP
   Themes frequently add margin-bottom or padding-bottom to
   .entry-content, .post, article, etc. below the shortcode.
   These rules zero those out when our root is present.
======================================== */
.entry-content:has(#rtp-app-root),
.post:has(#rtp-app-root),
.page:has(#rtp-app-root),
article:has(#rtp-app-root) {
    margin-bottom:  0 !important;
    padding-bottom: 0 !important;
}

/* Also target direct parent of our root (handles any wrapper) */
#rtp-app-root + * { margin-top: 0 !important; }
* > #rtp-app-root { display: block; }

/* ========================================
   RESPONSIVE — Fluid scaling across all viewports
======================================== */

/* Tablet and below */
@media (max-width: 600px) {
    #rtp-app-root { padding: 0 0 32px; }
    .rtp-container { padding: 0 16px; }
    .rtp-stats { gap: 10px; }
    .rtp-stat-card { padding: 16px 10px; }
    .rtp-stat-val { font-size: 22px; }
}

/* Mobile */
@media (max-width: 520px) {
    .rtp-header { gap: 12px; }
    .rtp-tab-btn { padding: 10px 8px; font-size: 12px; }
    .rtp-tab-btn svg { display: none; }
    .rtp-panel { padding: 20px; }
    .rtp-history-stats { grid-template-columns: repeat(4, 1fr); gap: 6px; }
    .rtp-history-stat-val { font-size: 15px; }
    .rtp-task-item-actions { gap: 4px; }
}

/* Small mobile — avoid text overlap in hero */
@media (max-width: 380px) {
    .rtp-stat-val { font-size: 20px; }
    .rtp-stat-lbl { font-size: 9px; }
    .rtp-date-badge { font-size: 11px; padding: 6px 10px; }
    .rtp-history-stats { grid-template-columns: repeat(2, 1fr); }
    .rtp-header { flex-direction: column; align-items: flex-start; }
    .rtp-header-right { align-self: flex-end; }
}
